Files
pipelines/app/notes/ctrl-a-runs-pipelines.md
T
alan 2bbc737604 Add Ctrl+A Runs and Pipelines shortcut
Provide a platform-independent destination shortcut that preserves Ctrl+A for text fields and the terminal. Document the shortcut in help and cover navigation and focus exceptions with regression tests.
2026-11-12 01:57:44 +00:00

38 lines
3.1 KiB
Markdown

# Ctrl+A toggles Runs and Pipelines
Stage 01-implement (artifact 401). Not committed.
## Behaviour
- Ctrl+A (the same chord on every platform) moves the shell between destinations:
- from Runs, to Pipelines;
- from Pipelines, to Runs;
- from any other destination (Chat, Search, Settings), to Runs.
- It is matched like Ctrl+K in `shell/adaptive_shell.dart`: logical key A with Ctrl alone. Alt, Shift, Cmd, Ctrl+Alt, and key-up events do not match. Repeats of a held chord are swallowed; only the first key-down acts.
- It does not act while a text field (`primaryFocusTakesTyping`) or a `TypingSurface` such as the terminal has focus. The handler returns false, so the field or terminal keeps Ctrl+A (select all, line start).
- The switch goes through the shell's normal `_select`, so a controlled shell (`onDestinationSelected`) receives the destination.
## Changed paths
- `app/lib/shell/shell_runs_pipelines_shortcut.dart` (new): `shellRunsPipelinesShortcut` (matcher), `shellRunsPipelinesTarget` (destination rule), `shellRunsPipelinesShortcutLabel` (`'Ctrl+A'`).
- `app/lib/shell/adaptive_shell.dart`: one branch in `_handleDestinationKeyEvent`, after the Ctrl+K branch and before the typing-surface check; updated doc comment.
- `app/lib/features/settings/keyboard_shortcuts_registry.dart`: "Switch between Runs and Pipelines" help entry, `Ctrl+A` on every platform, with a caveat about text fields and the terminal.
- `app/test/shell/runs_pipelines_shortcut_test.dart` (new): matcher, destination rule, Chat→Runs→Pipelines→Runs sequence, text-field exception, terminal exception.
- `app/test/features/settings/keyboard_shortcuts_help_test.dart`: help entry test over every `TargetPlatform` value.
## Focused results
- `tool/memwatch/full.sh 'test/shell/runs_pipelines_shortcut_test.dart test/features/settings/keyboard_shortcuts_help_test.dart test/shell/shell_chat_shortcut_test.dart test/shell/destination_shortcuts_test.dart'`: PASS, 19 passed, 0 failed, peak 1151 MB, 13s, exit 0.
- Mutation check: with the `primaryFocusTakesTyping()` guard removed, `runs_pipelines_shortcut_test.dart` fails (2 failed, including the text-field case). The guard was restored; the file matches the pre-mutation backup.
- `tool/analyze.sh` on the changed files: clean, exit 0. Run after the focused tests, sequentially.
- No existing test sends Ctrl+A. The `keyA` uses in `chat_shell_terminal_test.dart` and `chat_transcript_selection_test.dart` are plain or Cmd+A, so they are unaffected.
## Affected states
- Shell tabs: Pipelines, Runs, Chat, Search, and Settings (a page of Pipelines).
- Text field focused: Ctrl+A goes to the field.
- Terminal focused: Ctrl+A goes to the terminal.
- Help page: new "Switch between Runs and Pipelines" row.
## Not covered
- No UI capture or device run (ui-review owns that).
- The text-field test pins the platform to Android so that Ctrl+A means select all. On Apple platforms Ctrl+A is line start in the field; the field still keeps it, but that case is not tested.
- The chat composer is not tested directly; it is a text field, so the same guard applies.
- On web, the browser may keep Ctrl+A; the registry caveat does not mention this.