Merge commit 'e3deb84dadad65339c17bfa8b78a2b3c97927d46' into pipelines/run-20261112-0140-run-details-open-with-output-expanded-81b3
This commit is contained in:
@@ -5,6 +5,7 @@ import '../chat/workspace/chat_float_shortcut.dart';
|
||||
import '../terminal/terminal_shortcuts.dart';
|
||||
import '../../shell/windows/window_shortcuts.dart';
|
||||
import '../../shell/shell_chat_shortcut.dart';
|
||||
import '../../shell/shell_runs_pipelines_shortcut.dart';
|
||||
import '../../shell/shell_search_shortcut_labels.dart';
|
||||
|
||||
/// A shortcut entry shown in the in-app help. Keeping these entries together
|
||||
@@ -61,6 +62,12 @@ class KeyboardShortcutRegistry {
|
||||
? 'Shows the open chat and focuses its message input. The browser may reserve Ctrl+K.'
|
||||
: 'Shows the open chat and focuses its message input. In the terminal Ctrl+K stays kill-line; Alt+K still opens Chat.',
|
||||
),
|
||||
const KeyboardShortcutEntry(
|
||||
action: 'Switch between Runs and Pipelines',
|
||||
keys: shellRunsPipelinesShortcutLabel,
|
||||
caveat:
|
||||
'Goes to Runs from other destinations and to Pipelines from Runs. In a text field or the terminal Ctrl+A keeps its own meaning.',
|
||||
),
|
||||
KeyboardShortcutEntry(
|
||||
action: 'Toggle Center Stage',
|
||||
keys:
|
||||
|
||||
@@ -17,7 +17,7 @@ const _terminalContent = 'terminal';
|
||||
///
|
||||
/// [TerminalLayout] stays the terminal's own state (shown, panel or float):
|
||||
/// showing it in float mode opens or shows the window, hiding minimises it,
|
||||
/// and the window's Minimise and Close hide the terminal.
|
||||
/// and the window's X (minimise) hides the terminal.
|
||||
class TerminalWindows {
|
||||
TerminalWindows({
|
||||
required this.manager,
|
||||
@@ -110,7 +110,7 @@ class TerminalWindows {
|
||||
if (legacy && layout.maximized) manager.setMaximized(entry.id, true);
|
||||
}
|
||||
|
||||
/// The window's Minimise or Close (or the windows' own show and hide)
|
||||
/// The window's X or Minimise (or the windows' own show and hide)
|
||||
/// hides the terminal.
|
||||
void _windowsChanged() {
|
||||
if (!_started || !_ready || _syncing || !_wanted) return;
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'list_pane_widths.dart';
|
||||
import 'shell_bar.dart';
|
||||
import 'shell_chat_shortcut.dart';
|
||||
import 'shell_list_shortcuts.dart';
|
||||
import 'shell_runs_pipelines_shortcut.dart';
|
||||
import 'shell_search_shortcut_labels.dart';
|
||||
import 'tab_history.dart';
|
||||
import '../ui/input/keyboard_owner.dart';
|
||||
@@ -274,8 +275,9 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
}
|
||||
|
||||
/// App-wide search and conversation-list selection are handled before text
|
||||
/// fields. Split-pane navigation belongs to the chat workspace; tab changes
|
||||
/// have no global keyboard chord.
|
||||
/// fields. Split-pane navigation belongs to the chat workspace. Ctrl+A
|
||||
/// bounces between Runs and Pipelines, but leaves text fields and the
|
||||
/// terminal their own Ctrl+A (select all, line start).
|
||||
bool _handleDestinationKeyEvent(KeyEvent event) {
|
||||
final keyboard = HardwareKeyboard.instance;
|
||||
// Ctrl+K is the terminal's kill-line while the terminal has the keyboard;
|
||||
@@ -285,6 +287,13 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
if (event is KeyDownEvent) _openChat();
|
||||
return true;
|
||||
}
|
||||
if (shellRunsPipelinesShortcut(event, keyboard)) {
|
||||
if (primaryFocusTakesTyping()) return false;
|
||||
if (event is KeyDownEvent) {
|
||||
_select(shellRunsPipelinesTarget(_selected));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// A terminal keeps its keys (Escape, Ctrl+/, Ctrl+digits).
|
||||
if (primaryFocusIsTypingSurface()) return false;
|
||||
if (_selected == AppDestination.search &&
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'destination.dart';
|
||||
|
||||
/// The chord that bounces between Runs and Pipelines, as the help page reads
|
||||
/// it. It is the same on every platform.
|
||||
const shellRunsPipelinesShortcutLabel = 'Ctrl+A';
|
||||
|
||||
/// Whether [event] is Ctrl+A. Only Ctrl counts: Alt, Shift, Cmd and chords
|
||||
/// with both Ctrl and Alt are not the shortcut. Repeats of a held chord match
|
||||
/// as well, so the caller can swallow them; only its first press acts.
|
||||
bool shellRunsPipelinesShortcut(KeyEvent event, HardwareKeyboard keyboard) {
|
||||
if (event is KeyUpEvent ||
|
||||
keyboard.isAltPressed ||
|
||||
keyboard.isShiftPressed ||
|
||||
keyboard.isMetaPressed ||
|
||||
!keyboard.isControlPressed) {
|
||||
return false;
|
||||
}
|
||||
return event.logicalKey == LogicalKeyboardKey.keyA;
|
||||
}
|
||||
|
||||
/// The destination Ctrl+A goes to from [current]: Pipelines from Runs, and
|
||||
/// Runs from every other destination (Pipelines included).
|
||||
AppDestination shellRunsPipelinesTarget(AppDestination current) =>
|
||||
current == AppDestination.runs
|
||||
? AppDestination.pipelines
|
||||
: AppDestination.runs;
|
||||
@@ -37,7 +37,7 @@ class WindowEntry {
|
||||
/// The saved frame; it is drawn fitted inside the window area.
|
||||
final Rect frame;
|
||||
|
||||
/// Hidden by its minimise button; still listed and shown again with its
|
||||
/// Hidden by the title bar's X; still listed and shown again with its
|
||||
/// group.
|
||||
final bool minimized;
|
||||
final bool maximized;
|
||||
|
||||
@@ -11,8 +11,9 @@ double windowTitleBarHeight(BuildContext context) =>
|
||||
MediaQuery.textScalerOf(context).scale(40).clamp(40.0, 64.0);
|
||||
|
||||
/// A floating window's card and title bar: the title (drag to move, double
|
||||
/// click to maximise), the kind's actions, then Minimise, Maximise and
|
||||
/// Close. The content is drawn over the card's body by the window's
|
||||
/// click to maximise), the kind's actions, then Maximise and the X. The X
|
||||
/// minimises: it hides the window and keeps its state, like the chord does
|
||||
/// in reverse. The content is drawn over the card's body by the window's
|
||||
/// navigator.
|
||||
class WindowFrame extends StatelessWidget {
|
||||
const WindowFrame({
|
||||
@@ -25,7 +26,6 @@ class WindowFrame extends StatelessWidget {
|
||||
required this.onMoveEnd,
|
||||
required this.onMinimize,
|
||||
required this.onToggleMaximized,
|
||||
required this.onClose,
|
||||
});
|
||||
|
||||
final String title;
|
||||
@@ -36,9 +36,10 @@ class WindowFrame extends StatelessWidget {
|
||||
/// The drag's delta and the pointer's global position.
|
||||
final void Function(Offset delta, Offset globalPosition) onMove;
|
||||
final VoidCallback onMoveEnd;
|
||||
|
||||
/// The X: hides the window, keeping it listed and its state.
|
||||
final VoidCallback onMinimize;
|
||||
final VoidCallback onToggleMaximized;
|
||||
final VoidCallback onClose;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -69,11 +70,6 @@ class WindowFrame extends StatelessWidget {
|
||||
onPressed: action.onPressed,
|
||||
icon: Icon(action.icon),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: 'Minimise',
|
||||
onPressed: onMinimize,
|
||||
icon: const Icon(Icons.minimize),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: maximized ? 'Restore size' : 'Maximise',
|
||||
onPressed: onToggleMaximized,
|
||||
@@ -82,8 +78,8 @@ class WindowFrame extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: 'Close',
|
||||
onPressed: onClose,
|
||||
tooltip: 'Minimise',
|
||||
onPressed: onMinimize,
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'window_entry.dart';
|
||||
|
||||
/// One action in a window's title bar, before Minimise and Close (Dock on a
|
||||
/// One action in a window's title bar, before Maximise and the X (Dock on a
|
||||
/// chat, a kind's own menu).
|
||||
class WindowAction {
|
||||
const WindowAction({
|
||||
@@ -42,7 +42,7 @@ abstract class WindowKind {
|
||||
/// The window's content, below the title bar.
|
||||
Widget build(BuildContext context, WindowEntry entry);
|
||||
|
||||
/// Title-bar actions before Minimise and Close.
|
||||
/// Title-bar actions before Maximise and the X.
|
||||
List<WindowAction> actions(BuildContext context, WindowEntry entry) =>
|
||||
const [];
|
||||
|
||||
@@ -57,7 +57,7 @@ abstract class WindowKind {
|
||||
/// as its window takes focus. The default leaves it on the window.
|
||||
void focusContent(WindowEntry entry) {}
|
||||
|
||||
/// Called after the user closes the window (the X).
|
||||
/// Called after the window is closed (Dock, Close all, a chat's /close).
|
||||
void closed(WindowEntry entry) {}
|
||||
|
||||
/// Validates a saved window's [WindowEntry.data]; null drops the window.
|
||||
|
||||
@@ -259,7 +259,6 @@ class _WindowLayerState extends State<WindowLayer>
|
||||
onMinimize: () => manager.setMinimized(_id, true),
|
||||
onToggleMaximized: () =>
|
||||
manager.setMaximized(_id, !entry.maximized),
|
||||
onClose: () => manager.close(_id),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -229,11 +229,14 @@ class _Frame {
|
||||
required bool tracking,
|
||||
}) {
|
||||
const curve = Curves.fastOutSlowIn;
|
||||
// Played backwards in time, the same easing reads as the item settling.
|
||||
// Closing reads `t` from 1 to 0, so easeIn of `t` is a shrink that
|
||||
// decelerates in time and starts on the first frame. The time-reversed
|
||||
// fastOutSlowIn barely moved for its first ~60 ms, which read as Back
|
||||
// doing nothing.
|
||||
final grown = tracking
|
||||
? t
|
||||
: closing
|
||||
? curve.flipped.transform(t)
|
||||
? Curves.easeInCubic.transform(t)
|
||||
: curve.transform(t);
|
||||
// Opening covers the item first and shows the page late; closing hides
|
||||
// the page first and uncovers the item late.
|
||||
|
||||
Reference in New Issue
Block a user