Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Refine welcome wallpapers, keyboard shortcuts, and workspace spacing (#207)

Deed870afdf3f37
diff --git a/desktop/CLAUDE.md b/desktop/CLAUDE.md
index 272eae16b..6b786f110 100644
--- a/desktop/CLAUDE.md
+++ b/desktop/CLAUDE.md
@@ -517,14 +517,13 @@ its headless debug timings do not establish native display or network latency.
usually is, since a skeleton that shrinks jumps the page upward. **"Loading" and "answered with
nothing" must not render the same** — hence `AppNotifier.machinesLoading`, which is set on the
first fetch only so a refresh keeps the rows already on screen.
-- `lib/shortcuts/app_shortcuts.dart` is the one list that feeds both the live bindings and the ⌘/
- sheet. `shortcutRows()` there is that list as the UI prints it — one row per action, so the two
- activators on "focus the next pane" (`⌘]`, `⌃⇥`) fold into one line, and `⌘1`–`⌘9` join as one.
- `shortcuts/shortcuts_list.dart` renders those rows in the two shapes the app needs and nothing
- else: `ShortcutsList` (the ⌘/ sheet's column, inside a 420px dialog) and `ShortcutsDeck` (Settings
- ▸ Keyboard shortcuts, group cards reflowed across the pane, plus the recessed "the terminal keeps"
- card built from `kTerminalOwnedKeys`). Same rows behind both, so they cannot disagree; keycaps come
- from `shortcuts/key_cap.dart`. Every shortcut is ⌘-based — Ctrl belongs to the shell/tmux, ⌥ is a
+- `lib/shortcuts/app_shortcuts.dart` and `keymap_commands.dart` supply the live shortcut catalog.
+ `shortcuts/shortcuts_browser.dart` shares searchable, grouped rows between the ⌘/ dialog and
+ Settings ▸ Keyboard shortcuts. It reads resolved bindings through `keyboardLessons()`, so remaps
+ appear immediately; clicking a row or pressing Enter opens keyboard practice without dispatching
+ that action. Labels and keycaps use the selected terminal font and size. ⌘P opens commands with
+ the query `>`; ⌘O opens harnesses. `shortcuts/key_cap.dart` uses the app type scale elsewhere.
+ Every shortcut is ⌘-based — Ctrl belongs to the shell/tmux, ⌥ is a
Meta prefix for the pty (⌥⏎ and ⌥⌫ only — `AltAsMetaInputHandler` in
`lib/terminal/terminal_input.dart` turns them into `ESC` + Return and `ESC` + `\x7f`, so the
engine's prompt breaks the line instead of submitting and kills the word behind the cursor
diff --git a/desktop/assets/swarm-wallpapers/atlas-of-connections.png b/desktop/assets/swarm-wallpapers/atlas-of-connections.png
new file mode 100644
index 000000000..08562ba0a
Binary files /dev/null and b/desktop/assets/swarm-wallpapers/atlas-of-connections.png differ
diff --git a/desktop/assets/swarm-wallpapers/renaissance-notebook.png b/desktop/assets/swarm-wallpapers/renaissance-notebook.png
new file mode 100644
index 000000000..125f34327
Binary files /dev/null and b/desktop/assets/swarm-wallpapers/renaissance-notebook.png differ
diff --git a/desktop/assets/swarm-wallpapers/terminal-star-atlas.png b/desktop/assets/swarm-wallpapers/terminal-star-atlas.png
new file mode 100644
index 000000000..a0175e8c0
Binary files /dev/null and b/desktop/assets/swarm-wallpapers/terminal-star-atlas.png differ
diff --git a/desktop/assets/swarm-wallpapers/terminal-workshop.png b/desktop/assets/swarm-wallpapers/terminal-workshop.png
new file mode 100644
index 000000000..3dd79c3ee
Binary files /dev/null and b/desktop/assets/swarm-wallpapers/terminal-workshop.png differ
diff --git a/desktop/design/review/keyboard-shortcuts-browser.png b/desktop/design/review/keyboard-shortcuts-browser.png
new file mode 100644
index 000000000..45ed9524a
Binary files /dev/null and b/desktop/design/review/keyboard-shortcuts-browser.png differ
diff --git a/desktop/design/review/welcome-terminal-wallpaper.png b/desktop/design/review/welcome-terminal-wallpaper.png
new file mode 100644
index 000000000..abc946b97
Binary files /dev/null and b/desktop/design/review/welcome-terminal-wallpaper.png differ
diff --git a/desktop/design/wallpapers.md b/desktop/design/wallpapers.md
new file mode 100644
index 000000000..b913e029f
--- /dev/null
+++ b/desktop/design/wallpapers.md
@@ -0,0 +1,51 @@
+# New-tab wallpapers
+
+Blank remains the default and uses the selected tab's workspace color. The optional artwork appears only on empty welcome/new-tab pages. The welcome text and wallpaper stay mounted at their original position while the New Harness and Open Harness panels overlay the page.
+
+The four images below were created with the built-in image generation tool. The PNG outputs were copied into the app without retouching. They are bundled locally; changing wallpaper does not make a network request. The center is deliberately quiet so the terminal-font welcome message remains readable.
+
+| Choice | Bundled asset | Direction |
+| --- | --- | --- |
+| Renaissance notebook | [PNG](../assets/swarm-wallpapers/renaissance-notebook.png) | Flight, mechanisms, nature and geometry on charcoal parchment |
+| Atlas of connections | [PNG](../assets/swarm-wallpapers/atlas-of-connections.png) | Connections between astronomy, biology, music and engineering |
+| Terminal workshop | [PNG](../assets/swarm-wallpapers/terminal-workshop.png) | Sparse green ASCII-style inventions at the edges |
+| Terminal star atlas | [PNG](../assets/swarm-wallpapers/terminal-star-atlas.png) | ASCII-style space and geometry on a clear midnight field |
+
+## Generation prompts
+
+### Renaissance notebook
+
+```text
+Use case: stylized-concept. Asset type: a premium desktop wallpaper for Harness, a creative engineering tool for curious polymaths. Generate one finished landscape image, 16:9, ideally 2048x1152. A Leonardo da Vinci inspired inventor's notebook redrawn on deep charcoal parchment: exquisite delicate warm chalk and sepia ink studies of a bird's wing and flight machine, interlocking gears, geometric constructions, water vortices and a botanical spiral. Intellectual, humane, quietly optimistic. Museum-quality drawing, tactile paper grain, restrained amber and ivory accents, detailed yet spacious. Distribute the beautiful studies around the outer thirds and corners, with a broad very dark calm central region suitable for small light monospace welcome text. The images should gently emerge from darkness; no framed panels, no UI, no borders, no actual words, no branding, no letters or watermarks. The wallpaper celebrates following curiosity and building across disciplines.
+```
+
+### Atlas of connections
+
+```text
+Use case: stylized-concept. Asset type: a premium 16:9 landscape desktop wallpaper for Harness, ideally 2048x1152. Create an enchanting visual atlas of connections across disciplines, drawn like an exceptionally beautiful modern Renaissance scientific notebook on midnight blue paper. Fine cyan, desaturated gold and muted coral ink drawings flow from orbital geometry to a shell spiral, a sine-wave musical string, an elegant robotic hand, delicate botanical forms and tiny circuit traces. Precise hand-drafted construction lines, radiant restrained points of connection. The sketches are elegant and sparse, concentrated near the edges, not an all-over busy pattern. Keep the broad central half dark, quiet and unmarked so that small light welcome text can be read there. Rich subtle tactile paper, soft atmospheric depth; a sophisticated collectible print celebrating learning, discovery and making across disciplines. No text, no logos, no watermarks, no UI, no rectangular panels. One finished wallpaper, not a montage of wallpaper options.
+```
+
+### Terminal workshop
+
+```text
+Use case: stylized-concept. Asset type: minimalist 16:9 desktop wallpaper, ideally 2048x1152, for a terminal-inspired creative engineering app. Beautiful ASCII and block-character artwork on flat dark graphite gray. Sparse pale green phosphor characters form small Leonardo-like inventions in the extreme corners: a wireframe flying machine upper left, a mechanical gear lower left, a geometric hand upper right, an orbital diagram lower right. Precise monospaced character grid using + - | / backslash dots colons and light block glyphs, like a gorgeous old engineering terminal, restrained and minimal. No interface, no words. CRITICAL: the central rectangle from 25% to 75% width and 18% to 82% height remains solid empty charcoal with absolutely no marks, stars, texture, glow, text or art. Only sparse peripheral details outside that region. No neon haze, no gradients, no borders, no watermark. One finished wallpaper celebrating the polymath workshop.
+```
+
+### Terminal star atlas
+
+```text
+Use case: stylized-concept. Asset type: minimal full-bleed 16:9 desktop wallpaper, ideally 2048x1152. Dark terminal star atlas made entirely from delicate monospaced ASCII characters and tasteful chunky block glyphs: a small ringed planet upper left, orbital compass upper right, tiny satellite and stepped Fibonacci spiral in opposite bottom corners. Subdued ice blue, warm ivory and desaturated amber characters on solid deep midnight charcoal. Lovingly handcrafted generative terminal art: elegant, sparse, exploratory. No readable language, UI, code, logos or watermark. Essential composition: central 55 percent of width and central 70 percent of height completely empty uniform solid dark background; no stars, dots or artwork there. All art restricted to outermost corners and ends before the clear center. No borders, vignette or lighting effects. One finished wallpaper.
+```
+
+## Review
+
+Rendered app previews: [welcome with terminal wallpaper](review/welcome-terminal-wallpaper.png) and [keyboard shortcut popup](review/keyboard-shortcuts-browser.png).
+
+`test/welcome_wallpaper_shortcuts_test.dart` loads the actual bundled images and renders the welcome content with the terminal font. It checks selection persistence, the blank default, font changes and compact layouts. `test/workspace_start_guide_test.dart` checks that opening and closing both command panels preserves the welcome text and wallpaper bounds, and that Customize Harness opens the wallpaper picker.
+
+To capture review images outside the repository:
+
+```sh
+HARNESS_REFINEMENT_CAPTURE_DIR=/private/tmp/harness-refinement-review \
+ flutter test --no-pub --update-goldens test/welcome_wallpaper_shortcuts_test.dart
+```
diff --git a/desktop/integration_test/native_resume_e2e_test.dart b/desktop/integration_test/native_resume_e2e_test.dart
index 071c38ef1..c872536c6 100644
--- a/desktop/integration_test/native_resume_e2e_test.dart
+++ b/desktop/integration_test/native_resume_e2e_test.dart
@@ -138,8 +138,8 @@ void main() {
return verified;
}
- var previous = await open(LogicalKeyboardKey.keyP);
- for (final key in [LogicalKeyboardKey.keyP, LogicalKeyboardKey.keyT]) {
+ var previous = await open(LogicalKeyboardKey.keyO);
+ for (final key in [LogicalKeyboardKey.keyO, LogicalKeyboardKey.keyT]) {
expect(await app.deleteAgent('m', id), isNull);
await until(
() =>
@@ -153,7 +153,7 @@ void main() {
previous = resumed;
}
// Opening an already-running harness must preserve its native process.
- final attached = await open(LogicalKeyboardKey.keyP);
+ final attached = await open(LogicalKeyboardKey.keyO);
expect(attached['pid'], previous['pid']);
expect(attached['pane'], previous['pane']);
expect(await app.deleteAgent('m', id), isNull);
diff --git a/desktop/integration_test/native_workspace_e2e_test.dart b/desktop/integration_test/native_workspace_e2e_test.dart
index 21d0aaf2a..2d713a0df 100644
--- a/desktop/integration_test/native_workspace_e2e_test.dart
+++ b/desktop/integration_test/native_workspace_e2e_test.dart
@@ -45,7 +45,6 @@ import 'package:harness/state/workspace_learning.dart';
import 'package:harness/store/store_screen.dart';
import 'package:harness/widgets/workspace_welcome.dart';
import 'package:harness/shortcuts/keyboard_practice.dart';
-import 'package:harness/shortcuts/keymap.dart';
import 'package:harness/terminal/terminal_binary.dart';
import 'package:harness/terminal/terminal_session.dart';
import 'package:harness/widgets/new_harness_box.dart';
@@ -816,12 +815,17 @@ void main() {
tester.widget<SettingsNav>(find.byType(SettingsNav)).section,
SettingsSection.shortcuts,
);
- await key(tester, LogicalKeyboardKey.tab);
- await key(tester, LogicalKeyboardKey.tab);
+ final shortcutSearch = find.byKey(const ValueKey('shortcuts-search'));
+ for (
+ var i = 0;
+ i < 4 && !tester.widget<TextField>(shortcutSearch).focusNode!.hasFocus;
+ i++
+ ) {
+ await key(tester, LogicalKeyboardKey.tab);
+ }
expect(
- FocusManager.instance.primaryFocus?.context
- ?.findAncestorWidgetOfExactType<AppSelectField<KeymapContext>>(),
- isNotNull,
+ tester.widget<TextField>(shortcutSearch).focusNode!.hasFocus,
+ isTrue,
);
final scroll = tester.state<ScrollableState>(
find
@@ -829,21 +833,24 @@ void main() {
of: find.byType(ShortcutsSection),
matching: find.byType(Scrollable),
)
- .first,
+ .last,
);
await key(tester, LogicalKeyboardKey.pageDown);
await tester.pump(const Duration(milliseconds: 300));
expect(scroll.position.pixels, greaterThan(0));
- await key(tester, LogicalKeyboardKey.pageUp);
- await tester.pump(const Duration(milliseconds: 300));
- await key(tester, LogicalKeyboardKey.arrowDown);
- await tester.pump(const Duration(milliseconds: 100));
- await key(tester, LogicalKeyboardKey.escape);
- await tester.pump(const Duration(milliseconds: 100));
- expect(find.byType(SettingsScreen), findsOneWidget);
+ await tester.enterText(shortcutSearch, 'Clone');
+ await tester.pump();
+ expect(find.text('Clone Harness'), findsOneWidget);
+ await tester.enterText(shortcutSearch, '');
+ await tester.pump();
expect(input, isEmpty);
- await key(tester, LogicalKeyboardKey.tab, shift: true);
- await key(tester, LogicalKeyboardKey.tab, shift: true);
+ for (
+ var i = 0;
+ i < 4 && !tester.widget<TextField>(search).focusNode!.hasPrimaryFocus;
+ i++
+ ) {
+ await key(tester, LogicalKeyboardKey.tab, shift: true);
+ }
expect(
tester.widget<TextField>(search).focusNode!.hasPrimaryFocus,
isTrue,
@@ -918,7 +925,7 @@ void main() {
expect(box.projectLabel, startsWith('~/harnesses/codex-'));
final proposedFolder = box.projectFolderRequest!.folderName;
expect(connection.creates, isEmpty);
- expect(find.byType(WorkspaceWelcome).hitTestable(), findsOneWidget);
+ expect(find.byType(WorkspaceWelcome), findsOneWidget);
await key(tester, LogicalKeyboardKey.enter);
await tester.pump(const Duration(milliseconds: 200));
expect(connection.creates, hasLength(1));
@@ -989,12 +996,16 @@ void main() {
await tester.pumpAndSettle();
final chooser = find.byKey(const ValueKey('swarm-search-input'));
expect(command, findsNothing);
- expect(chooser, findsOneWidget);
- expect(tester.widget<TextField>(chooser).focusNode!.hasFocus, isTrue);
- expect(app.activeSwarmId, original.id);
- await key(tester, LogicalKeyboardKey.escape);
- await tester.pump(const Duration(milliseconds: 100));
expect(chooser, findsNothing);
+ expect(find.byType(WorkspaceWelcome), findsOneWidget);
+ expect(app.activeSwarm.isNewTabPage, isTrue);
+ expect(app.activeSwarmId, isNot(original.id));
+ await key(tester, LogicalKeyboardKey.keyW, cmd: true);
+ await tester.pump(const Duration(milliseconds: 100));
+ expect(app.activeSwarmId, target.id);
+ await key(tester, LogicalKeyboardKey.digit1, cmd: true);
+ await tester.pump(const Duration(milliseconds: 100));
+ expect(app.activeSwarmId, original.id);
await key(tester, LogicalKeyboardKey.arrowRight);
await tester.pump(const Duration(milliseconds: 100));
expect(input.last.bytes, [27, 91, 67]);
@@ -1031,7 +1042,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 200));
Future<void> command(String name) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> $name',
@@ -1227,7 +1238,7 @@ void main() {
final search = find.byKey(const ValueKey('swarm-search-input'));
Future<void> command(String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(search, '> $query');
await tester.pump();
await key(tester, LogicalKeyboardKey.enter);
@@ -1296,7 +1307,7 @@ void main() {
for (final (label, shortcut) in [
('New Tab', LogicalKeyboardKey.keyT),
- ('New Pane', LogicalKeyboardKey.keyP),
+ ('Open Harness', LogicalKeyboardKey.keyO),
]) {
testWidgets('native created $label gets terminal input without a click', (
tester,
@@ -1328,7 +1339,7 @@ void main() {
await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final search = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(search, 'Check retargeted keyboard input');
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final destination = app.activeSwarm;
expect(find.text('Check retargeted keyboard input'), findsWidgets);
@@ -1530,9 +1541,8 @@ void main() {
expect(prompt().engine, 'codex');
expect(prompt().machineId, 'm');
expect(prompt().project.folder, '/work/openharness');
- expect(app.swarms, hasLength(2));
- expect(app.swarms.first, same(source));
- expect(app.activeSwarm.isBlankNewTab, true);
+ expect(app.swarms, [source]);
+ expect(app.activeSwarm, same(source));
expect(prompt().field, NewHarnessField.launch);
await key(tester, LogicalKeyboardKey.arrowDown);
await key(tester, LogicalKeyboardKey.arrowDown);
@@ -1610,9 +1620,9 @@ void main() {
);
expect(connection.creates, isEmpty);
- // Reopen from the same source, this time choosing a pane. Escape kept
- // both the task and edited defaults after removing the temporary tab.
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ // Reopen from the same source. Escape kept the task and edited defaults
+ // without creating a temporary tab.
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
await key(tester, LogicalKeyboardKey.enter);
await tester.pump(const Duration(milliseconds: 80));
expect(prompt().engine, 'claude');
@@ -1715,7 +1725,7 @@ void main() {
input.clear();
// Use the real command and machine chooser to revisit the pending link.
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> link machine',
@@ -1792,7 +1802,7 @@ void main() {
),
);
await tester.pumpAndSettle();
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> link machine',
@@ -1870,7 +1880,7 @@ void main() {
),
);
await tester.pumpAndSettle();
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> machines manager',
@@ -1963,7 +1973,7 @@ void main() {
);
await tester.pumpAndSettle();
Future<void> command(String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> $query',
@@ -2054,7 +2064,7 @@ void main() {
);
await tester.pumpAndSettle();
Future<void> openStop() async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> stop',
@@ -2127,7 +2137,7 @@ void main() {
);
await tester.pumpAndSettle();
Future<void> openFork() async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> fork',
@@ -2213,7 +2223,7 @@ void main() {
);
await tester.pumpAndSettle();
Future<void> openRestart() async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> restart',
diff --git a/desktop/lib/orchestrator/orchestrator_workspace.dart b/desktop/lib/orchestrator/orchestrator_workspace.dart
index 34d787ee4..fd4e05414 100644
--- a/desktop/lib/orchestrator/orchestrator_workspace.dart
+++ b/desktop/lib/orchestrator/orchestrator_workspace.dart
@@ -146,7 +146,7 @@ class _OrchestratorWorkspaceState extends State<OrchestratorWorkspace> {
),
AppIconButton(
icon: LucideIcons.plus,
- tooltip: 'New project (⌘P)',
+ tooltip: 'New project',
onPressed: () =>
showOrchestratorLauncher(context, widget.notifier),
),
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index cc6a735fc..7b33d90ed 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -200,12 +200,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
String? _commandCatalogMachine;
final _newTabSources = <String, TerminalPane>{};
- bool get _showsStartGuide =>
- newHarnessOpensInBox &&
- app.panes.isEmpty &&
- !app.activeSwarm.isStore &&
- !app.activeSwarm.isOrchestrator;
-
Widget _startGuide() => WorkspaceWelcome(onCommand: _runShortcut);
void _showKeyboardShortcuts() {
@@ -688,7 +682,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
'engine': agent.identityEngine,
'iconAsset': agentIdentity(agent).asset,
// A stopped harness opens too: choosing it resumes its
- // conversation, the road ⌘P takes (`activateSwarmDestination`).
+ // conversation, the road ⌘O takes (`activateSwarmDestination`).
// `stopped` lets the row say so first, since that takes a
// moment and may ask the engine to sign in, unlike an attach.
'canOpen':
@@ -1543,7 +1537,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
);
},
);
- final onWelcome = _showsStartGuide;
_newHarnessOverlay = OverlayEntry(
builder: (context) => KeymapProvider(
keymap: _keymap,
@@ -1551,32 +1544,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
listenable: box,
builder: (context, child) => LayoutBuilder(
builder: (context, constraints) {
- if (onWelcome) {
- return Padding(
- padding: EdgeInsets.only(top: _native ? 0 : _tabBarHeight),
- child: FocusScope(
- child: BlockSemantics(
- child: Material(
- color: grid.AppPalette.swarmField,
- child: Column(
- children: [
- Expanded(child: _startGuide()),
- ConstrainedBox(
- constraints: BoxConstraints(
- maxHeight:
- (constraints.maxHeight -
- (_native ? 0 : _tabBarHeight)) *
- .65,
- ),
- child: content,
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
return Stack(
children: [
Positioned.fill(
@@ -1919,8 +1886,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
app.openStore();
}
- bool _searchOnWelcome = false;
-
void _openSearch({
bool adding = false,
PaneSplitRequest? split,
@@ -1950,7 +1915,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
// Search is an overlay, so late pane attachment needs an explicit focus
// boundary to keep its programmatic focus request out of the picker.
_canvasFocus.descendantsAreFocusable = false;
- _searchOnWelcome = _showsStartGuide;
_search = SwarmSearchController(
app,
_navigation.recent,
@@ -1991,8 +1955,8 @@ class _SwarmScreenState extends State<SwarmScreen> {
}
void _showSearchCommands() {
- if (_search == null) _openSearch(adding: true, query: '> ');
- _search?.setQuery('> ');
+ if (_search == null) _openSearch(adding: true, query: '>');
+ _search?.setQuery('>');
_focusSearch();
if (_search != null) _learning.commandSearchOpened();
}
@@ -2217,33 +2181,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
onRefocus: _focusSearch,
child: scoped,
);
- if (_searchOnWelcome) {
- return Padding(
- padding: EdgeInsets.only(top: _native ? 0 : _tabBarHeight),
- child: BlockSemantics(
- child: Material(
- color: grid.AppPalette.swarmField,
- child: Column(
- children: [
- Expanded(child: _startGuide()),
- ConstrainedBox(
- constraints: BoxConstraints(
- maxHeight:
- (constraints.maxHeight -
- (_native ? 0 : _tabBarHeight)) *
- (.65 * grid.appTextScaleOf(context)).clamp(
- .65,
- 1.0,
- ),
- ),
- child: contents,
- ),
- ],
- ),
- ),
- ),
- );
- }
return Stack(
children: [
// A click outside still closes it; it just no longer dims. To a
@@ -2470,7 +2407,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
'navigation.commands': _showSearchCommands,
'app.customize': () => unawaited(_customize()),
'app.store': _openStore,
- 'agent.open': _addAgent,
+ 'agent.add': _addAgent,
if (kDebugSurfaceEnabled) 'app.onboarding_review': _newTab,
'agent.rename': () => _editAgent(),
'agent.stop': () => _editAgent(stop: true),
@@ -2583,7 +2520,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
detail: 'Run anything by name',
swarmId: null,
current: false,
- pickerQuery: '> ',
+ pickerQuery: '>',
shortcut: _keymap.hint('navigation.commands'),
),
SwarmDestination(
@@ -2908,7 +2845,9 @@ class _SwarmScreenState extends State<SwarmScreen> {
child: Stack(
fit: StackFit.expand,
children: [
- if (app.panes.isEmpty)
+ if (app.panes.isEmpty &&
+ !newHarnessOpensInBox &&
+ !app.activeSwarm.isNewTabPage)
const RepaintBoundary(
key: ValueKey('harness-start-background'),
child: SwarmWallpaper(),
@@ -2925,18 +2864,9 @@ class _SwarmScreenState extends State<SwarmScreen> {
app.activeSwarm.isStore ||
app.activeSwarm.isOrchestrator,
child: Padding(
- // Under the native tab strip the canvas starts
- // 10 lower, so the pane titles do not crowd the
- // tabs (owner, 2026-09-21; the strip lifts its
- // chips 5 to match).
padding: app.panes.isEmpty
? EdgeInsets.zero
- : EdgeInsets.fromLTRB(
- kWorkspaceInset,
- kWorkspaceInset + (_native ? 10 : 0),
- kWorkspaceInset,
- kWorkspaceInset,
- ),
+ : const EdgeInsets.all(kWorkspaceInset),
child: Focus.withExternalFocusNode(
focusNode: _canvasFocus,
includeSemantics: false,
diff --git a/desktop/lib/settings/appearance/wallpaper_section.dart b/desktop/lib/settings/appearance/wallpaper_section.dart
new file mode 100644
index 000000000..0dccb4f33
--- /dev/null
+++ b/desktop/lib/settings/appearance/wallpaper_section.dart
@@ -0,0 +1,120 @@
+import 'dart:math' as math;
+
+import 'package:flutter/material.dart';
+
+import '../../shared/theme/app_theme.dart' as grid;
+import '../../shared/theme/appearance_prefs_store.dart';
+import '../../shared/theme/harness_background.dart';
+import '../../widgets/swarm_wallpaper.dart';
+
+class WallpaperSection extends StatelessWidget {
+ const WallpaperSection({super.key, this.store});
+ final AppearancePrefsStore? store;
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ final prefs = store ?? appearancePrefsStore;
+ return ValueListenableBuilder<AppearancePrefs>(
+ valueListenable: prefs,
+ builder: (context, value, _) => Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ 'Wallpaper',
+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),
+ ),
+ const SizedBox(height: 8),
+ Text(
+ 'A little curiosity for your new tabs.',
+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),
+ ),
+ const SizedBox(height: 16),
+ LayoutBuilder(
+ builder: (context, constraints) {
+ final columns =
+ constraints.maxWidth >=
+ 300 * math.max(1, grid.appTextScaleOf(context))
+ ? 2
+ : 1;
+ final width =
+ (constraints.maxWidth - (columns - 1) * 12) / columns;
+ return Wrap(
+ spacing: 12,
+ runSpacing: 16,
+ children: [
+ for (final choice in HarnessBackground.gallery)
+ SizedBox(
+ width: width,
+ child: Semantics(
+ button: true,
+ selected: value.background == choice,
+ label: '${choice.label} wallpaper',
+ child: Material(
+ color: Colors.transparent,
+ child: InkWell(
+ key: ValueKey('wallpaper-${choice.name}'),
+ onTap: () => prefs.setBackground(choice),
+ borderRadius: BorderRadius.circular(8),
+ child: Padding(
+ padding: const EdgeInsets.all(3),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ clipBehavior: Clip.antiAlias,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(
+ color: value.background == choice
+ ? grid.AppPalette.swarmAccent
+ : grid.AppPalette.divider,
+ width: 2,
+ ),
+ ),
+ child: AspectRatio(
+ aspectRatio: 16 / 9,
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ SwarmWallpaper(
+ background: choice,
+ thumbnail: true,
+ ),
+ if (value.background == choice)
+ const Positioned(
+ right: 8,
+ bottom: 8,
+ child: Icon(
+ Icons.check_circle,
+ color: Colors.white,
+ size: 20,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ const SizedBox(height: 8),
+ Text(
+ choice.label,
+ style: grid.AppType.label(
+ color: grid.AppPalette.textPrimary,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+ },
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/desktop/lib/settings/sections/appearance_section.dart b/desktop/lib/settings/sections/appearance_section.dart
index f0f49bc9c..47482247c 100644
--- a/desktop/lib/settings/sections/appearance_section.dart
+++ b/desktop/lib/settings/sections/appearance_section.dart
@@ -2,13 +2,16 @@ import 'package:flutter/material.dart';
import '../../shared/theme/app_theme.dart' as grid;
import '../appearance/palette_section.dart';
+import '../appearance/wallpaper_section.dart';
+import '../../shared/theme/appearance_prefs_store.dart';
/// Customize Harness ▸ Appearance: how the app looks on this Mac.
///
/// Palettes coordinate the workspace and terminal defaults. The shared font
/// and size are configured once in Customize Harness ▸ Terminal.
class AppearanceSection extends StatelessWidget {
- const AppearanceSection({super.key});
+ const AppearanceSection({super.key, this.store});
+ final AppearancePrefsStore? store;
@override
Widget build(BuildContext context) {
@@ -17,11 +20,13 @@ class AppearanceSection extends StatelessWidget {
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
- children: const [
- PaletteSection(),
+ children: [
+ const PaletteSection(),
+ const SizedBox(height: 24),
+ WallpaperSection(store: store),
// Room under the last card so a scrolled-to-bottom pane does not end
// flush against the window edge.
- SizedBox(height: 8),
+ const SizedBox(height: 8),
],
),
);
diff --git a/desktop/lib/settings/sections/shortcuts_section.dart b/desktop/lib/settings/sections/shortcuts_section.dart
index 7659ef840..e9fd5027b 100644
--- a/desktop/lib/settings/sections/shortcuts_section.dart
+++ b/desktop/lib/settings/sections/shortcuts_section.dart
@@ -1,58 +1,14 @@
import 'package:flutter/material.dart';
-import '../../shared/widgets/section_scaffold.dart';
-import '../../shortcuts/shortcuts_list.dart';
-import '../../shortcuts/app_keymap.dart';
-import '../../shortcuts/keymap.dart';
-import '../../shortcuts/keymap_settings.dart';
+import '../../shortcuts/shortcuts_browser.dart';
-/// Settings ▸ Keyboard shortcuts — the same rows the ⌘/ sheet shows, in the
-/// place someone looks when they don't yet know the sheet exists.
-///
-/// The sheet's own column used to be dropped in here whole, clamped to the
-/// 460px it was drawn for; in a settings window that is a third of the width,
-/// and the pane read as a dialog someone had pasted into a screen. It gets
-/// [ShortcutsDeck] instead — the same rows, laid out across the room this
-/// screen has.
-class ShortcutsSection extends StatefulWidget {
+/// The same searchable shortcut reference as the workspace's shortcut dialog.
+class ShortcutsSection extends StatelessWidget {
const ShortcutsSection({super.key});
@override
- State<ShortcutsSection> createState() => _ShortcutsSectionState();
-}
-
-class _ShortcutsSectionState extends State<ShortcutsSection> {
- KeymapContext _contextKind = KeymapContext.workspace;
-
- @override
- Widget build(BuildContext context) {
- final hint = effectiveCommandHint(context, 'keyboard.help');
- return SectionScaffold(
- title: 'Keyboard shortcuts',
- subtitle: hint == null
- ? 'Your current shortcuts.'
- : 'Your current shortcuts. Press $hint to see them in your workspace.',
- // A SingleChildScrollView, never a ListView — same reason as Appearance
- // and Terminal: a lazy list keeps children across a rebuild and strands
- // them on the palette they first mounted with.
- child: SingleChildScrollView(
- child: Padding(
- // Room under the last card so a scrolled-to-bottom pane does not end
- // flush against the window edge.
- padding: const EdgeInsets.only(bottom: 8),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- KeymapSettings(
- contextKind: _contextKind,
- onContextChanged: (value) =>
- setState(() => _contextKind = value),
- ),
- ShortcutsDeck(contextKind: _contextKind),
- ],
- ),
- ),
- ),
- );
- }
+ Widget build(BuildContext context) => FocusTraversalGroup(
+ policy: WidgetOrderTraversalPolicy(),
+ child: const ShortcutsBrowser(),
+ );
}
diff --git a/desktop/lib/shared/theme/app_theme.dart b/desktop/lib/shared/theme/app_theme.dart
index d37d11d8c..2859d37b9 100644
--- a/desktop/lib/shared/theme/app_theme.dart
+++ b/desktop/lib/shared/theme/app_theme.dart
@@ -155,8 +155,8 @@ class _PaletteScope extends InheritedNotifier<ValueNotifier<HarnessPalette>> {
abstract final class AppPalette {
// Approved Swarms canvas and native tab-strip palette.
static Color get swarmField => AppTheme.palette.value.workspace;
- // The welcome illustration recedes behind the working command dock.
- static Color get swarmWelcome => const Color(0xff171717);
+ // Empty tabs join the selected native tab as one continuous surface.
+ static Color get swarmWelcome => AppTheme.palette.value.workspace;
static Color get swarmTabBar => AppTheme.palette.value.tabBar;
static Color get swarmAccent => AppTheme.palette.value.accent;
// Shared with the native search field for a continuous input/results surface.
diff --git a/desktop/lib/shared/theme/harness_background.dart b/desktop/lib/shared/theme/harness_background.dart
index f21e1e059..a784aeaa1 100644
--- a/desktop/lib/shared/theme/harness_background.dart
+++ b/desktop/lib/shared/theme/harness_background.dart
@@ -1,6 +1,10 @@
/// Built-in backgrounds for empty Harness pages. Wallpaper never covers agents.
enum HarnessBackground {
- plain('Default'),
+ plain('Blank'),
+ renaissance('Renaissance notebook', 'renaissance-notebook.png'),
+ connections('Atlas of connections', 'atlas-of-connections.png'),
+ terminalWorkshop('Terminal workshop', 'terminal-workshop.png'),
+ terminalStars('Terminal star atlas', 'terminal-star-atlas.png'),
aurora('Aurora'),
lake('Lake', 'swarm-welcome-dusk.jpg'),
silk('Silk', 'swarm-welcome-abstract.jpg'),
@@ -13,6 +17,16 @@ enum HarnessBackground {
String? get asset =>
fileName == null ? null : 'assets/swarm-wallpapers/$fileName';
+ /// Curated wallpapers leave the welcome text's center clear. Older choices
+ /// remain readable so existing preferences still restore without migration.
+ static const gallery = [
+ plain,
+ renaissance,
+ connections,
+ terminalWorkshop,
+ terminalStars,
+ ];
+
static HarnessBackground fromId(String? id) =>
values.where((value) => value.name == id).firstOrNull ?? plain;
}
diff --git a/desktop/lib/shortcuts/app_shortcuts.dart b/desktop/lib/shortcuts/app_shortcuts.dart
index 1989d4c01..a817e0510 100644
--- a/desktop/lib/shortcuts/app_shortcuts.dart
+++ b/desktop/lib/shortcuts/app_shortcuts.dart
@@ -5,7 +5,7 @@ import 'package:flutter/widgets.dart';
import '../logging/debug_surface.dart';
/// Harness uses Command as a direct prefix for frequent workspace actions.
-/// T opens a tab, O opens a harness (also P), N creates a harness, S opens the Store,
+/// T opens a tab, O opens a harness, P opens commands, N creates a harness, S opens the Store,
/// Shift-L chooses a layout. H/J/K/L and arrows focus panes; B routes a task.
/// The same definitions feed live keys, help and search.
///
@@ -355,8 +355,8 @@ List<AppShortcut> appShortcuts({bool swarmMode = true}) => [
const kSwarmShortcuts = [
AppShortcut(
action: ShortcutAction.addAgent,
- activator: SingleActivator(LogicalKeyboardKey.keyP, meta: true),
- label: 'New Pane',
+ activator: SingleActivator(LogicalKeyboardKey.keyO, meta: true),
+ label: 'Open Harness',
group: ShortcutGroup.actions,
),
AppShortcut(
@@ -372,7 +372,7 @@ const kSwarmShortcuts = [
group: ShortcutGroup.navigate,
),
// ⌘⇧T is New Terminal, as it is in a terminal app. "Reopen last closed
- // harness" used to sit on it; it lives on in the History menu, the ⌘⇧P
+ // harness" used to sit on it; it lives on in the History menu, the ⌘P
// command palette and `keybindings.jsonc`, without a default chord.
AppShortcut(
action: ShortcutAction.newTerminal,
@@ -393,7 +393,7 @@ const kSwarmShortcuts = [
meta: true,
shift: true,
),
- label: 'Clone Agent',
+ label: 'Clone Harness',
group: ShortcutGroup.actions,
),
AppShortcut(
diff --git a/desktop/lib/shortcuts/key_cap.dart b/desktop/lib/shortcuts/key_cap.dart
index bcbb4d528..81485622d 100644
--- a/desktop/lib/shortcuts/key_cap.dart
+++ b/desktop/lib/shortcuts/key_cap.dart
@@ -16,9 +16,10 @@ import 'app_shortcuts.dart';
/// [grid.AppSurface.wellFill] is an overlay, so a cap keeps its edge on a
/// raised card and on a recessed one without being picked for either.
class KeyCap extends StatelessWidget {
- const KeyCap(this.label, {super.key});
+ const KeyCap(this.label, {super.key, this.textStyle});
final String label;
+ final TextStyle? textStyle;
/// Square at a single glyph, so ⌘ and W sit in caps of the same size and the
/// column stays a column. A longer label ("esc", "1 – 9") grows past it.
@@ -28,7 +29,8 @@ class KeyCap extends StatelessWidget {
@override
Widget build(BuildContext context) {
grid.AppTheme.watch(context);
- final iconSize = MediaQuery.textScalerOf(context).scale(14);
+ final style = textStyle ?? grid.AppType.monoMeta();
+ final iconSize = MediaQuery.textScalerOf(context).scale(style.fontSize!);
final minEdge = math.max(height, iconSize + 8);
return Container(
// A minimum, not a fixed height: large text and a multi-stroke custom
@@ -62,7 +64,7 @@ class KeyCap extends StatelessWidget {
)
: Text(
label,
- style: grid.AppType.monoMeta(
+ style: style.copyWith(
color: grid.AppPalette.textPrimary,
height: 1,
// Tabular so ⌘1 – ⌘9 and ⌘W keep the same cap width.
@@ -81,10 +83,13 @@ class KeyCap extends StatelessWidget {
/// arrive already knowing, and a screen that only lists `⌘]` teaches them the
/// app doesn't have the key they are about to press.
class KeyChordView extends StatelessWidget {
- const KeyChordView({super.key, required this.chords});
+ const KeyChordView({super.key, required this.chords, this.textStyle});
final List<KeyChord> chords;
+ /// Shortcut help can follow the terminal while other app hints keep their scale.
+ final TextStyle? textStyle;
+
@override
Widget build(BuildContext context) {
grid.AppTheme.watch(context);
@@ -99,10 +104,12 @@ class KeyChordView extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 2),
child: Text(
'or',
- style: grid.AppType.caption(color: grid.AppPalette.textFaint),
+ style: (textStyle ?? grid.AppType.caption()).copyWith(
+ color: grid.AppPalette.textFaint,
+ ),
),
),
- for (final key in chords[i]) KeyCap(key),
+ for (final key in chords[i]) KeyCap(key, textStyle: textStyle),
],
],
);
diff --git a/desktop/lib/shortcuts/keyboard_practice.dart b/desktop/lib/shortcuts/keyboard_practice.dart
index 8dfa16eb2..bf9d7c022 100644
--- a/desktop/lib/shortcuts/keyboard_practice.dart
+++ b/desktop/lib/shortcuts/keyboard_practice.dart
@@ -36,6 +36,7 @@ class KeyboardLesson {
.join(' / ');
String get result => switch (command) {
'swarm.new' => '[work] [new tab]\nFind a harness, or create one',
+ 'agent.open' ||
'agent.add' => '[agent 1] │ [agent 2]\nBoth agents share this tab.',
'agent.new' => 'agent Claude Code\nmachine dev\nproject ~/work/payments\ntask (optional)\nCreate is selected. Up/Down + Enter edits an argument. Permissions and profiles are inside Agent.',
'pane.zoom' => '[agent 2 — full workspace]\nPress the same key to restore the other panes.',
@@ -43,7 +44,7 @@ class KeyboardLesson {
'[agent 1]\nThe second view closes. Its agent keeps running.',
'swarm.close' =>
'[previous tab]\nThe view closes. Its agents keep running.',
- 'navigation.commands' => '> rename\nRename Harness\nRename Tab',
+ 'navigation.commands' => '>rename\nRename Harness\nRename Tab',
'terminal.find' => 'find > timeout\n1/3 matches in this terminal’s output',
'picker.complete' => 'project ~/work/payments\nTab completes the current argument; Enter accepts it.',
'picker.complete_back' =>
@@ -104,7 +105,7 @@ class KeyboardLesson {
List<KeyboardLesson> keyboardLessons(AppKeymap keymap) {
const essentials = [
'swarm.new',
- 'agent.add',
+ 'agent.open',
'agent.new',
'pane.zoom',
'navigation.commands',
@@ -191,18 +192,28 @@ List<KeyboardLesson> keyboardLessons(AppKeymap keymap) {
];
}
-Future<void> showKeyboardPractice(BuildContext context, {AppKeymap? keymap}) =>
- showTerminalPrompt<void>(
- context,
- keymap: keymap,
- builder: (context) => KeyboardPractice(
- keymap: keymap ?? KeymapTheme.of(context, listen: false),
- storage: kUnderTest ? null : HarnessFileStore.shared,
- ),
- );
+Future<void> showKeyboardPractice(
+ BuildContext context, {
+ AppKeymap? keymap,
+ KeyboardLesson? initialLesson,
+}) => showTerminalPrompt<void>(
+ context,
+ keymap: keymap,
+ builder: (context) => KeyboardPractice(
+ keymap: keymap ?? KeymapTheme.of(context, listen: false),
+ initialLesson: initialLesson,
+ storage: kUnderTest ? null : HarnessFileStore.shared,
+ ),
+);
class KeyboardPractice extends StatefulWidget {
- const KeyboardPractice({super.key, this.keymap, this.storage});
+ const KeyboardPractice({
+ super.key,
+ this.keymap,
+ this.storage,
+ this.initialLesson,
+ });
+ final KeyboardLesson? initialLesson;
final AppKeymap? keymap;
final LocalKeyValueStore? storage;
@override
@@ -243,6 +254,8 @@ class _KeyboardPracticeState extends State<KeyboardPractice> {
void initState() {
super.initState();
map.addListener(_keysChanged);
+ _lesson = widget.initialLesson;
+ if (_lesson != null) _requestFocus();
unawaited(_load());
}
diff --git a/desktop/lib/shortcuts/keymap_commands.dart b/desktop/lib/shortcuts/keymap_commands.dart
index 9292ec513..fa25d234b 100644
--- a/desktop/lib/shortcuts/keymap_commands.dart
+++ b/desktop/lib/shortcuts/keymap_commands.dart
@@ -63,7 +63,7 @@ final harnessCommands = <HarnessCommand>[
'navigation.commands',
'Search commands',
ShortcutGroup.actions,
- extraKeys: ['cmd+shift+p'],
+ extraKeys: ['cmd+p'],
nativeAction: 'commands',
),
const HarnessCommand(
@@ -289,15 +289,14 @@ final harnessCommands = <HarnessCommand>[
'agent.open',
'Open Harness',
ShortcutGroup.actions,
- extraKeys: ['cmd+o'],
+ action: ShortcutAction.addAgent,
+ nativeAction: 'addAgent',
keywords: ['resume', 'existing', 'pane'],
),
const HarnessCommand(
'agent.add',
'New Pane',
ShortcutGroup.actions,
- action: ShortcutAction.addAgent,
- nativeAction: 'addAgent',
),
const HarnessCommand(
'agent.new',
diff --git a/desktop/lib/shortcuts/shortcuts_browser.dart b/desktop/lib/shortcuts/shortcuts_browser.dart
new file mode 100644
index 000000000..e447dc3cb
--- /dev/null
+++ b/desktop/lib/shortcuts/shortcuts_browser.dart
@@ -0,0 +1,388 @@
+import 'dart:math' as math;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+
+import '../shared/theme/app_theme.dart' as grid;
+import '../terminal/terminal_text.dart';
+import 'app_keymap.dart';
+import 'key_cap.dart';
+import 'keymap_commands.dart';
+import 'keymap_settings.dart';
+import 'keyboard_practice.dart';
+
+/// Searchable help built from the same resolved bindings that handle input.
+/// Shared by the shortcut dialog and Settings; no separate shortcut catalog.
+class ShortcutsBrowser extends StatefulWidget {
+ const ShortcutsBrowser({super.key, this.onClose, this.autofocus = false});
+ final VoidCallback? onClose;
+ final bool autofocus;
+
+ @override
+ State<ShortcutsBrowser> createState() => _ShortcutsBrowserState();
+}
+
+class _ShortcutsBrowserState extends State<ShortcutsBrowser> {
+ final _fallback = AppKeymap();
+ final _query = TextEditingController();
+ final _scroll = ScrollController();
+ late final _input = FocusNode(
+ debugLabel: 'Search keyboard shortcuts',
+ onKeyEvent: _onKey,
+ );
+ final _rowKeys = <String, GlobalKey>{};
+ List<KeyboardLesson> _visible = [];
+ int _cursor = -1;
+
+ AppKeymap get _keymap => KeymapTheme.of(context, listen: false) ?? _fallback;
+
+ @override
+ void dispose() {
+ _fallback.dispose();
+ _query.dispose();
+ _input.dispose();
+ _scroll.dispose();
+ super.dispose();
+ }
+
+ KeyEventResult _onKey(FocusNode node, KeyEvent event) {
+ if (event is KeyUpEvent ||
+ HardwareKeyboard.instance.isMetaPressed ||
+ HardwareKeyboard.instance.isControlPressed ||
+ HardwareKeyboard.instance.isAltPressed ||
+ !_query.value.composing.isCollapsed) {
+ return KeyEventResult.ignored;
+ }
+ final delta = switch (event.logicalKey) {
+ LogicalKeyboardKey.arrowDown => 1,
+ LogicalKeyboardKey.arrowUp => -1,
+ LogicalKeyboardKey.pageDown => 10,
+ LogicalKeyboardKey.pageUp => -10,
+ _ => null,
+ };
+ if (delta != null) {
+ if (_visible.isNotEmpty) {
+ setState(
+ () => _cursor = (_cursor + delta).clamp(0, _visible.length - 1),
+ );
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (!mounted || _cursor < 0 || _cursor >= _visible.length) return;
+ final target = _rowKeys[_visible[_cursor].id]?.currentContext;
+ if (target != null) Scrollable.ensureVisible(target, alignment: .5);
+ });
+ }
+ return KeyEventResult.handled;
+ }
+ if (event.logicalKey == LogicalKeyboardKey.enter &&
+ event is KeyDownEvent &&
+ _visible.isNotEmpty) {
+ _practice(_visible[_cursor.clamp(0, _visible.length - 1)]);
+ return KeyEventResult.handled;
+ }
+ return KeyEventResult.ignored;
+ }
+
+ Future<void> _practice(KeyboardLesson lesson) async {
+ await showKeyboardPractice(context, keymap: _keymap, initialLesson: lesson);
+ if (mounted) _input.requestFocus();
+ }
+
+ void _filterChanged(String _) {
+ setState(() => _cursor = -1);
+ if (_scroll.hasClients) _scroll.jumpTo(0);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ TerminalFontScope.watch(context);
+ final keymap = KeymapTheme.of(context) ?? _fallback;
+ return ListenableBuilder(
+ listenable: Listenable.merge([keymap, terminalFontStore]),
+ builder: (context, _) {
+ final query = _query.text.trim().toLowerCase();
+ final groups = <String, List<KeyboardLesson>>{};
+ for (final lesson in keyboardLessons(keymap)) {
+ if (lesson.bindings.isEmpty) continue;
+ final searchable =
+ '${lesson.label} ${lesson.group} ${lesson.keys} ${lesson.bindings.map((b) => b.sequence).join(' ')}'
+ .toLowerCase();
+ if (!query.split(RegExp(r'\s+')).every(searchable.contains)) continue;
+ groups.putIfAbsent(lesson.group, () => []).add(lesson);
+ }
+ final names = groups.keys.toList()
+ ..sort((a, b) {
+ const order = [
+ 'Essentials',
+ 'Workspace',
+ 'Panes',
+ 'Actions',
+ 'Search & creation',
+ 'Agent input overrides',
+ ];
+ int rank(String name) =>
+ order.contains(name) ? order.indexOf(name) : order.length;
+ return rank(a).compareTo(rank(b));
+ });
+ for (final rows in groups.values) {
+ rows.sort((a, b) => a.label.compareTo(b.label));
+ }
+ _visible = [for (final name in names) ...groups[name]!];
+ if (_cursor >= _visible.length) _cursor = _visible.length - 1;
+ final scale = terminalTextScaleOf(context);
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 12, 12, 12),
+ child: Row(
+ children: [
+ if (widget.onClose != null)
+ IconButton(
+ onPressed: widget.onClose,
+ tooltip: 'Close keyboard shortcuts',
+ icon: Icon(Icons.arrow_back, size: 20 * scale),
+ )
+ else
+ Padding(
+ padding: const EdgeInsets.only(right: 12),
+ child: Icon(
+ Icons.search,
+ size: 20 * scale,
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ Expanded(
+ child: TextField(
+ key: const ValueKey('shortcuts-search'),
+ controller: _query,
+ focusNode: _input,
+ autofocus: widget.autofocus,
+ style: terminalTextStyle(
+ color: grid.AppPalette.textPrimary,
+ ),
+ onChanged: _filterChanged,
+ decoration: InputDecoration(
+ hintText: 'Search keyboard shortcuts…',
+ hintStyle: terminalTextStyle(
+ color: grid.AppPalette.textFaint,
+ ),
+ border: InputBorder.none,
+ enabledBorder: InputBorder.none,
+ focusedBorder: InputBorder.none,
+ filled: false,
+ isDense: true,
+ contentPadding: const EdgeInsets.symmetric(
+ vertical: 12,
+ ),
+ ),
+ ),
+ ),
+ if (_query.text.isNotEmpty)
+ IconButton(
+ tooltip: 'Clear search',
+ icon: Icon(Icons.close, size: 18 * scale),
+ onPressed: () {
+ _query.clear();
+ _filterChanged('');
+ _input.requestFocus();
+ },
+ ),
+ if (keymap.store != null)
+ IconButton(
+ tooltip: 'Edit keyboard shortcuts',
+ icon: Icon(Icons.tune, size: 20 * scale),
+ onPressed: () => openKeyboardConfig(context),
+ ),
+ ],
+ ),
+ ),
+ Divider(height: 1, color: grid.AppGlass.hair),
+ if (keymap.error != null)
+ Padding(
+ padding: const EdgeInsets.all(16),
+ child: Text(
+ keymap.error!,
+ style: terminalTextStyle(
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ),
+ Expanded(
+ child: _visible.isEmpty
+ ? Center(
+ child: Padding(
+ padding: const EdgeInsets.all(24),
+ child: Text(
+ 'No shortcuts found. Try an action or a key.',
+ style: terminalTextStyle(
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ),
+ )
+ : LayoutBuilder(
+ builder: (context, constraints) {
+ final columns =
+ constraints.maxWidth >= 760 * math.max(1, scale)
+ ? 2
+ : 1;
+ final width =
+ (constraints.maxWidth - 32 - (columns - 1) * 20) /
+ columns;
+ return Scrollbar(
+ controller: _scroll,
+ child: SingleChildScrollView(
+ controller: _scroll,
+ padding: const EdgeInsets.fromLTRB(16, 8, 16, 24),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ for (final name in names) ...[
+ Padding(
+ padding: const EdgeInsets.fromLTRB(
+ 12,
+ 20,
+ 12,
+ 10,
+ ),
+ child: Text(
+ name == 'Essentials' ? 'General' : name,
+ style: terminalTextStyle(
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ),
+ Wrap(
+ spacing: 20,
+ runSpacing: 4,
+ children: [
+ for (final lesson in groups[name]!)
+ SizedBox(
+ width: width,
+ child: _ShortcutBrowserRow(
+ key: _rowKeys.putIfAbsent(
+ lesson.id,
+ GlobalKey.new,
+ ),
+ lesson: lesson,
+ selected:
+ _cursor >= 0 &&
+ _visible[_cursor].id ==
+ lesson.id,
+ onTap: () => _practice(lesson),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ],
+ ),
+ ),
+ );
+ },
+ ),
+ ),
+ Divider(height: 1, color: grid.AppGlass.hair),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
+ child: Wrap(
+ spacing: 24,
+ runSpacing: 8,
+ children: [
+ Text(
+ '↑↓ select',
+ style: terminalTextStyle(
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ Text(
+ '↵ practice',
+ style: terminalTextStyle(
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ if (widget.onClose != null)
+ Text(
+ 'esc close',
+ style: terminalTextStyle(
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ );
+ },
+ );
+ }
+}
+
+class _ShortcutBrowserRow extends StatelessWidget {
+ const _ShortcutBrowserRow({
+ super.key,
+ required this.lesson,
+ required this.selected,
+ required this.onTap,
+ });
+ final KeyboardLesson lesson;
+ final bool selected;
+ final VoidCallback onTap;
+
+ @override
+ Widget build(BuildContext context) {
+ final chords = [
+ for (final binding in lesson.bindings)
+ binding.keys.length == 1
+ ? describeKeyStrokeKeys(binding.keys.single)
+ : [describeKeyBinding(binding)],
+ ];
+ return Semantics(
+ button: true,
+ selected: selected,
+ label: '${lesson.label}, ${lesson.keys}. Practice shortcut',
+ child: Material(
+ color: selected ? grid.AppSurface.selectedFill : Colors.transparent,
+ borderRadius: BorderRadius.circular(6),
+ child: InkWell(
+ onTap: onTap,
+ borderRadius: BorderRadius.circular(6),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
+ child: LayoutBuilder(
+ builder: (context, constraints) {
+ final keys = KeyChordView(
+ chords: chords,
+ textStyle: terminalTextStyle(),
+ );
+ final label = Text(
+ lesson.label,
+ style: terminalTextStyle(color: grid.AppPalette.textPrimary),
+ );
+ if (constraints.maxWidth < 330 * terminalTextScaleOf(context)) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [label, const SizedBox(height: 8), keys],
+ );
+ }
+ return Row(
+ children: [
+ Expanded(child: label),
+ const SizedBox(width: 16),
+ ConstrainedBox(
+ constraints: BoxConstraints(
+ maxWidth: constraints.maxWidth * .48,
+ ),
+ child: keys,
+ ),
+ ],
+ );
+ },
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dart
index 462cc7785..617623a30 100644
--- a/desktop/lib/state/app_state.dart
+++ b/desktop/lib/state/app_state.dart
@@ -6458,7 +6458,7 @@ class AppNotifier extends ChangeNotifier {
failure.code == 'UNSUPPORTED_ON_REMOTE' ||
failure.code == 'E2EE_REQUIRED') {
return '$machineName cannot check this creation. '
- 'Use New Pane (⌘P) to look for it before starting another.';
+ 'Use Open Harness (⌘O) to look for it before starting another.';
}
return unconfirmed;
}
@@ -6513,7 +6513,7 @@ class AppNotifier extends ChangeNotifier {
// receipt-aware version. Missing is not proof that nothing started.
// Check status stays read-only, even across upgrades and reconnects.
return '$machineName has no record of this request. '
- 'Use New Pane (⌘P) to look for it before starting another.';
+ 'Use Open Harness (⌘O) to look for it before starting another.';
case 'pending':
return '$machineName is still starting your harness. Check again in a moment.';
case 'unconfirmed':
diff --git a/desktop/lib/terminal/terminal_text.dart b/desktop/lib/terminal/terminal_text.dart
index 72803b65b..d33266b5d 100644
--- a/desktop/lib/terminal/terminal_text.dart
+++ b/desktop/lib/terminal/terminal_text.dart
@@ -5,8 +5,8 @@ import 'terminal_typography.dart';
export 'terminal_font_store.dart';
export 'terminal_typography.dart' show terminalFontSize;
-/// One face and size for terminal output and every app control. Color, weight,
-/// and spacing can distinguish roles without introducing a second type scale.
+/// The selected terminal face and size, also used by the welcome page and
+/// shortcut browser. Other app controls use the roles in AppType.
TextStyle terminalTextStyle({
Color? color,
FontWeight? fontWeight,
diff --git a/desktop/lib/widgets/box_chrome.dart b/desktop/lib/widgets/box_chrome.dart
index 8ae81b81c..b25817674 100644
--- a/desktop/lib/widgets/box_chrome.dart
+++ b/desktop/lib/widgets/box_chrome.dart
@@ -6,7 +6,9 @@ import '../shared/theme/app_theme.dart' as grid;
import '../terminal/terminal_text.dart';
const double kTerminalCornerRadius = 3;
-const double kWorkspaceInset = 6;
+
+/// One gutter around the workspace, between panes, and beside command docks.
+const double kWorkspaceInset = 9.5;
/// The selected tab joins the workspace with the same small radius used at
/// its top corners. The bottom curves turn outward, like a browser tab.
diff --git a/desktop/lib/widgets/harness_customize_pane.dart b/desktop/lib/widgets/harness_customize_pane.dart
index 37caf7fa9..863f4a90d 100644
--- a/desktop/lib/widgets/harness_customize_pane.dart
+++ b/desktop/lib/widgets/harness_customize_pane.dart
@@ -93,7 +93,7 @@ class HarnessCustomizePane extends StatelessWidget {
child: TabBarView(
children: [
PromptCustomize(store: store ?? appearancePrefsStore),
- const AppearanceSection(),
+ AppearanceSection(store: store),
const TerminalSection(),
],
),
diff --git a/desktop/lib/widgets/harness_start_page.dart b/desktop/lib/widgets/harness_start_page.dart
index 39ab87881..8687b013a 100644
--- a/desktop/lib/widgets/harness_start_page.dart
+++ b/desktop/lib/widgets/harness_start_page.dart
@@ -182,7 +182,7 @@ class _HarnessStartPageState extends State<HarnessStartPage> {
onRefocus: _focus.requestFocus,
),
),
- // The same bottom line ⌘P has: this is the first box a
+ // The same bottom line ⌘O has: this is the first box a
// new person sees, and the one that most needs to say
// what the keys are. On a window too short for both,
// the results keep the room.
diff --git a/desktop/lib/widgets/pane_grid.dart b/desktop/lib/widgets/pane_grid.dart
index 0d10b708e..634747da9 100644
--- a/desktop/lib/widgets/pane_grid.dart
+++ b/desktop/lib/widgets/pane_grid.dart
@@ -1051,25 +1051,8 @@ class _MinTile {
}
}
-/// The space between two tiles.
-///
-/// Wide enough to read as a deliberate separation rather than a rendering seam,
-/// narrow enough that four tiles do not lose a tile's worth of room to the
-/// space between them.
-///
-/// Was 10, taken in 30% on the owner's call once the separation was actually
-/// visible: the gap only had to be that wide while it was doing the work of
-/// showing itself, and with the field behind it reading properly, less space
-/// says the same thing and gives it back to the terminals.
-///
-/// Public because `test/pane_preset_test.dart` measures the lattice against it.
-/// A test carrying its own copy of this number is a second place the design
-/// lives, and the one that goes stale — which is exactly what happened when the
-/// grid stopped separating its tiles with a 1px line.
-/// Nudged 9 → 9.5 on the owner's call. Five percent of nine is under half a
-/// pixel, so it rounds to either no change at all or to ten; a half point is the
-/// honest reading of the ask and lands on a whole device pixel at 2x.
-const double kPaneGap = 9.5;
+/// Pane gaps share the outer workspace inset in both directions.
+const double kPaneGap = kWorkspaceInset;
/// What shows through the gaps.
///
diff --git a/desktop/lib/widgets/shortcuts_sheet.dart b/desktop/lib/widgets/shortcuts_sheet.dart
index 9e2dcdfb8..cd0b0c693 100644
--- a/desktop/lib/widgets/shortcuts_sheet.dart
+++ b/desktop/lib/widgets/shortcuts_sheet.dart
@@ -1,94 +1,31 @@
+import 'dart:math' as math;
+
import 'package:flutter/material.dart';
-import '../shared/theme/app_theme.dart' as grid;
import '../shared/widgets/app_dialog.dart';
-import '../shortcuts/shortcuts_list.dart';
-import '../shortcuts/keymap.dart';
-import '../shortcuts/keymap_settings.dart';
-import '../shortcuts/keyboard_practice.dart';
+import '../shortcuts/app_keymap.dart';
+import '../shortcuts/shortcuts_browser.dart';
-/// The ⌘/ sheet — [ShortcutsList] in a dialog.
-///
-/// The list itself is shared with Settings ▸ Keyboard shortcuts, so the two can
-/// never disagree about what a key does.
Future<void> showShortcutsSheet(BuildContext context) {
+ final keymap = KeymapTheme.of(context, listen: false);
return showAppDialog<void>(
context: context,
- builder: (context) => const _ShortcutsSheet(),
- );
-}
-
-class _ShortcutsSheet extends StatefulWidget {
- const _ShortcutsSheet();
-
- @override
- State<_ShortcutsSheet> createState() => _ShortcutsSheetState();
-}
-
-class _ShortcutsSheetState extends State<_ShortcutsSheet> {
- KeymapContext _contextKind = KeymapContext.workspace;
-
- @override
- Widget build(BuildContext context) {
- grid.AppTheme.watch(context);
- return Dialog(
- // No backgroundColor, no shape: `dialogTheme` supplies both, at
- // AppGlass.surfaceFill and AppCard.radius (12). The rim this used to
- // carry is gone with them — §1 allows exactly one border in the app and
- // it belongs to the menu panel, not to a dialog.
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 420),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: const EdgeInsets.fromLTRB(18, 17, 18, 4),
- child: Text(
- 'Keyboard shortcuts',
- style: grid.AppType.heading(color: grid.AppPalette.textPrimary),
- ),
- ),
- Flexible(
- child: SingleChildScrollView(
- padding: const EdgeInsets.fromLTRB(18, 8, 18, 16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- KeymapSettings(
- contextKind: _contextKind,
- onContextChanged: (value) =>
- setState(() => _contextKind = value),
- ),
- TextButton(
- onPressed: () => showKeyboardPractice(context),
- child: const Text('Practice these shortcuts'),
- ),
- ShortcutsList(contextKind: _contextKind),
- ],
- ),
- ),
- ),
- Container(
- width: double.infinity,
- padding: const EdgeInsets.fromLTRB(18, 12, 18, 12),
- decoration: BoxDecoration(
- border: Border(top: BorderSide(color: grid.AppGlass.hair)),
- ),
- child: Align(
- alignment: Alignment.centerRight,
- child: TextButton(
- onPressed: () => Navigator.of(context).pop(),
- style: TextButton.styleFrom(
- foregroundColor: grid.AppPalette.textSecondary,
- ),
- child: const Text('Close'),
- ),
- ),
- ),
- ],
+ builder: (context) {
+ final sheet = Dialog(
+ insetPadding: const EdgeInsets.all(24),
+ clipBehavior: Clip.antiAlias,
+ child: SizedBox(
+ width: 1040,
+ height: math.min(800, MediaQuery.sizeOf(context).height - 48),
+ child: ShortcutsBrowser(
+ autofocus: true,
+ onClose: () => Navigator.of(context).pop(),
+ ),
),
- ),
- );
- }
+ );
+ return keymap == null
+ ? sheet
+ : KeymapProvider(keymap: keymap, child: sheet);
+ },
+ );
}
diff --git a/desktop/lib/widgets/swarm_switcher.dart b/desktop/lib/widgets/swarm_switcher.dart
index 0ba1910f3..e9888487a 100644
--- a/desktop/lib/widgets/swarm_switcher.dart
+++ b/desktop/lib/widgets/swarm_switcher.dart
@@ -214,13 +214,13 @@ class SwarmSearchKeys extends StatelessWidget {
else if (search == null || search.allowsCommands)
'navigation.commands': () {
editing.value = const TextEditingValue(
- text: '> ',
- selection: TextSelection.collapsed(offset: 2),
+ text: '>',
+ selection: TextSelection.collapsed(offset: 1),
);
if (search == null) {
onOpen?.call();
} else {
- search.setQuery('> ');
+ search.setQuery('>');
onRefocus?.call();
}
},
@@ -1184,7 +1184,7 @@ class SwarmSearchHints extends StatelessWidget {
BoxHint(
'>',
'commands',
- onTap: onQuery == null ? null : () => onQuery!('> '),
+ onTap: onQuery == null ? null : () => onQuery!('>'),
),
BoxHint(
'@',
diff --git a/desktop/lib/widgets/workspace_quick_start.dart b/desktop/lib/widgets/workspace_quick_start.dart
index 6f5127393..b3d37de26 100644
--- a/desktop/lib/widgets/workspace_quick_start.dart
+++ b/desktop/lib/widgets/workspace_quick_start.dart
@@ -23,7 +23,7 @@ class WorkspaceQuickStart extends StatelessWidget {
final next = learning.next;
final (command, label) = switch (next) {
WorkspaceLesson.agent => ('swarm.new', 'Open your first agent'),
- WorkspaceLesson.pane => ('agent.add', 'Add a second agent to this tab'),
+ WorkspaceLesson.pane => ('agent.open', 'Add a second agent to this tab'),
WorkspaceLesson.zoom => ('pane.zoom', 'Zoom the focused pane'),
WorkspaceLesson.commands => (
'navigation.commands',
diff --git a/desktop/lib/widgets/workspace_start_guide.dart b/desktop/lib/widgets/workspace_start_guide.dart
index ab6725f2e..9209b8d33 100644
--- a/desktop/lib/widgets/workspace_start_guide.dart
+++ b/desktop/lib/widgets/workspace_start_guide.dart
@@ -234,7 +234,7 @@ class WorkspaceStartGuide extends StatelessWidget {
child: Align(
alignment: Alignment.center,
child: callout(
- 'agent.add',
+ 'agent.open',
'New Pane',
'Add a harness beside your work.',
),
diff --git a/desktop/lib/widgets/workspace_welcome.dart b/desktop/lib/widgets/workspace_welcome.dart
index 837091b65..16645a94c 100644
--- a/desktop/lib/widgets/workspace_welcome.dart
+++ b/desktop/lib/widgets/workspace_welcome.dart
@@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
import '../core/app_version.dart';
import '../shared/theme/app_theme.dart' as grid;
+import '../shared/theme/appearance_prefs_store.dart';
+import '../shared/theme/harness_background.dart';
+import 'swarm_wallpaper.dart';
import '../shortcuts/app_keymap.dart';
import '../shortcuts/keymap.dart';
import '../shortcuts/keymap_commands.dart';
@@ -31,7 +34,7 @@ class _WorkspaceWelcomeState extends State<WorkspaceWelcome> {
Widget build(BuildContext context) {
TerminalFontScope.watch(context);
return ListenableBuilder(
- listenable: terminalFontStore,
+ listenable: Listenable.merge([terminalFontStore, appearancePrefsStore]),
builder: (context, _) => _buildWelcome(context),
);
}
@@ -39,8 +42,12 @@ class _WorkspaceWelcomeState extends State<WorkspaceWelcome> {
Widget _buildWelcome(BuildContext context) {
grid.AppTheme.watch(context);
final palette = grid.AppTheme.palette.value;
- final ink = palette.foreground.withValues(alpha: .75);
- final accent = Theme.of(context).brightness == Brightness.dark
+ final background = appearancePrefsStore.value.background;
+ final hasArtwork = background != HarnessBackground.plain;
+ final ink = hasArtwork
+ ? const Color(0xffdededb)
+ : palette.foreground.withValues(alpha: .75);
+ final accent = hasArtwork || Theme.of(context).brightness == Brightness.dark
? const Color(0xffa5d786)
: const Color(0xff356522);
// The page stands where a terminal will, so it is set like one: the
@@ -84,79 +91,115 @@ class _WorkspaceWelcomeState extends State<WorkspaceWelcome> {
return Material(
key: const ValueKey('workspace-welcome'),
color: grid.AppPalette.swarmWelcome,
- child: LayoutBuilder(
- builder: (context, constraints) => SingleChildScrollView(
- padding: const EdgeInsets.all(24),
- child: ConstrainedBox(
- constraints: BoxConstraints(
- minHeight: (constraints.maxHeight - 48).clamp(0, double.infinity),
- ),
- child: Center(
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ RepaintBoundary(
+ key: const ValueKey('welcome-wallpaper'),
+ child: SwarmWallpaper(background: background),
+ ),
+ LayoutBuilder(
+ builder: (context, constraints) => SingleChildScrollView(
+ padding: const EdgeInsets.all(24),
child: ConstrainedBox(
constraints: BoxConstraints(
- maxWidth: prefixWidth + keyWidth + descriptionWidth,
+ minHeight: (constraints.maxHeight - 48).clamp(
+ 0,
+ double.infinity,
+ ),
),
- child: DefaultTextStyle(
- style: style,
- textAlign: TextAlign.center,
- child: Column(
- key: const ValueKey('workspace-welcome-text'),
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text('HARNESS'),
- SizedBox(height: line),
- FutureBuilder<String>(
- future: _version,
- builder: (context, snapshot) =>
- Text('version ${snapshot.data ?? '…'}'),
- ),
- const Text('Open source software and hardware'),
- SizedBox(height: line * 2),
- for (final row in rows)
- TextButton(
- key: ValueKey('welcome-${row.command}'),
- onPressed: () => widget.onCommand(row.command),
- style: TextButton.styleFrom(
- foregroundColor: ink,
- textStyle: style,
- padding: const EdgeInsets.symmetric(vertical: 2),
- minimumSize: Size.zero,
- tapTargetSize: MaterialTapTargetSize.shrinkWrap,
- shape: const RoundedRectangleBorder(),
+ child: Center(
+ child: ConstrainedBox(
+ constraints: BoxConstraints(
+ maxWidth: prefixWidth + keyWidth + descriptionWidth,
+ ),
+ child: DefaultTextStyle(
+ style: style,
+ textAlign: TextAlign.center,
+ child: Column(
+ key: const ValueKey('workspace-welcome-text'),
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const Text('HARNESS'),
+ SizedBox(height: line),
+ FutureBuilder<String>(
+ future: _version,
+ builder: (context, snapshot) =>
+ Text('version ${snapshot.data ?? '…'}'),
),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SizedBox(
- width: prefixWidth,
- child: Text(
- row.hint == null ? 'click' : 'press',
+ const Text('Open source software and hardware'),
+ SizedBox(height: line * 2),
+ for (final row in rows)
+ TextButton(
+ key: ValueKey('welcome-${row.command}'),
+ onPressed: () => widget.onCommand(row.command),
+ style: TextButton.styleFrom(
+ foregroundColor: ink,
+ textStyle: style,
+ padding: const EdgeInsets.symmetric(
+ vertical: 2,
),
+ minimumSize: Size.zero,
+ tapTargetSize: MaterialTapTargetSize.shrinkWrap,
+ shape: const RoundedRectangleBorder(),
),
- SizedBox(
- width: keyWidth,
- child: Text(
- row.hint ?? row.label,
- style: TextStyle(color: accent),
- textAlign: TextAlign.left,
- ),
- ),
- Expanded(
- child: Text(
- row.description,
- textAlign: TextAlign.left,
- ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SizedBox(
+ width: prefixWidth,
+ child: Text(
+ row.hint == null ? 'click' : 'press',
+ ),
+ ),
+ SizedBox(
+ width: keyWidth,
+ child: Text(
+ row.hint ?? row.label,
+ style: TextStyle(color: accent),
+ textAlign: TextAlign.left,
+ ),
+ ),
+ Expanded(
+ child: Text(
+ row.description,
+ textAlign: TextAlign.left,
+ ),
+ ),
+ ],
),
- ],
- ),
- ),
- ],
+ ),
+ ],
+ ),
+ ),
),
),
),
),
),
- ),
+ Positioned(
+ right: 20,
+ bottom: 16,
+ child: TextButton.icon(
+ key: const ValueKey('welcome-customize'),
+ onPressed: () => widget.onCommand('app.customize'),
+ icon: const Icon(Icons.edit_outlined, size: 18),
+ label: const Text('Customize Harness'),
+ style: TextButton.styleFrom(
+ foregroundColor: ink,
+ backgroundColor: hasArtwork
+ ? const Color(0xcc242424)
+ : grid.AppPalette.swarmTabBar,
+ textStyle: terminalTextStyle(),
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16,
+ vertical: 12,
+ ),
+ shape: const StadiumBorder(),
+ ),
+ ),
+ ),
+ ],
),
);
}
diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swift
index 0d4d16680..f1ed1684f 100644
--- a/desktop/macos/Runner/SwarmTitlebar.swift
+++ b/desktop/macos/Runner/SwarmTitlebar.swift
@@ -290,13 +290,13 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {
if let file = main.item(withTitle: "File") { main.removeItem(file) }
let file = NSMenu(title: "File")
add(file, "New Tab", "t", "new")
- add(file, "New Pane…", "p", "addAgent")
+ add(file, "Open Harness…", "o", "addAgent")
// ⌘⇧T, as in a terminal app. It used to be Reopen Last Closed (History menu), which keeps its
// row and loses its default chord — the Dart keymap (`swarm.reopen`) is where both are decided,
// and applyMenuKeys rewrites every equivalent here from it.
add(file, "New Terminal", "t", "newTerminal", [.command, .shift])
// ⌘⇧N: another agent like the focused pane's, fresh conversation (Dart: `agent.clone`).
- add(file, "Clone Agent", "n", "cloneAgent", [.command, .shift])
+ add(file, "Clone Harness", "n", "cloneAgent", [.command, .shift])
add(file, "Rename Tab…", "r", "renameActive", [.command, .shift])
add(file, "Close Tab", "w", "closeActive")
file.addItem(.separator())
@@ -313,7 +313,7 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {
// Native menu hints mirror Flutter; the shared picker owns all editing.
if let edit = main.item(withTitle: "Edit")?.submenu {
edit.addItem(.separator())
- add(edit, "Search Commands…", "p", "commands", [.command, .shift])
+ add(edit, "Search Commands…", "p", "commands")
}
if let view = main.item(withTitle: "View")?.submenu {
view.addItem(.separator())
diff --git a/desktop/test/agent_creation_recovery_test.dart b/desktop/test/agent_creation_recovery_test.dart
index bbeecfe80..7314c4461 100644
--- a/desktop/test/agent_creation_recovery_test.dart
+++ b/desktop/test/agent_creation_recovery_test.dart
@@ -105,7 +105,7 @@ void main() {
await runtime.mount(tester, app, keymap);
switch (entry) {
case 'new pane':
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
case 'new tab':
@@ -113,7 +113,7 @@ void main() {
await chord(tester, LogicalKeyboardKey.keyO);
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
case 'search shortcut':
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'Agent 12',
@@ -222,9 +222,9 @@ void main() {
await mount(tester, app);
final field = find.byKey(const ValueKey('swarm-search-input'));
if (entry == 'Open') {
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
} else {
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(field, '> $entry');
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
@@ -282,7 +282,7 @@ void main() {
final original = app.activeSwarm;
await mount(tester, app);
if (change == 'stale split') {
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> split right',
@@ -366,7 +366,7 @@ void main() {
final input = <TerminalBinaryFrame>[];
final pane = app.adoptSessionForTest(terminal('a0', input));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await chord(tester, LogicalKeyboardKey.keyN);
await tester.pumpAndSettle();
await browseNewAgentProject(tester);
@@ -392,7 +392,7 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
await tester.pump();
expect(input.single.bytes, [27, 91, 66]);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
expect(find.byType(SwarmSearchResults), findsOneWidget);
expect(find.byKey(const ValueKey('create-agent-submit')), findsNothing);
expect(connection.calls, hasLength(1));
diff --git a/desktop/test/benchmarks/swarm_benchmark.dart b/desktop/test/benchmarks/swarm_benchmark.dart
index 42ca44121..c0ec5c85b 100644
--- a/desktop/test/benchmarks/swarm_benchmark.dart
+++ b/desktop/test/benchmarks/swarm_benchmark.dart
@@ -145,7 +145,7 @@ void main() {
await tester.pump();
});
final retarget = await timed(() async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
await tester.pump();
await key(tester, LogicalKeyboardKey.keyO, cmd: true);
await tester.pump();
diff --git a/desktop/test/boot_flow_widget_test.dart b/desktop/test/boot_flow_widget_test.dart
index e9e6a6921..302b2fd85 100644
--- a/desktop/test/boot_flow_widget_test.dart
+++ b/desktop/test/boot_flow_widget_test.dart
@@ -1111,7 +1111,7 @@ void main() {
await tester.pump();
expect(find.text('Link this machine'), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('harness-start-search')),
'> link machine',
@@ -1194,7 +1194,7 @@ void main() {
await tester.pump();
expect(find.text('Link this machine'), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('harness-start-search')),
'> link machine',
diff --git a/desktop/test/box_polish_test.dart b/desktop/test/box_polish_test.dart
index 284886891..60d50d6a4 100644
--- a/desktop/test/box_polish_test.dart
+++ b/desktop/test/box_polish_test.dart
@@ -63,7 +63,7 @@ void main() {
tester.view.physicalSize = size;
await tester.pump();
final before = tester.getRect(find.byKey(pane.cellKey));
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
void aligned(Finder panel) {
final rect = tester.getRect(panel);
expect(rect.left, before.left);
@@ -109,7 +109,7 @@ void main() {
tester.platformDispatcher.textScaleFactorTestValue = 1.7;
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
void checkGuide() {
final guide = find.byType(BoxHintStrip);
@@ -161,7 +161,7 @@ void main() {
final frames = <TerminalBinaryFrame>[];
app.adoptSessionForTest(terminal('a69', frames));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
final preview = find.byKey(const ValueKey('swarm-search-preview'));
await tester.enterText(field, 'Agent 1');
@@ -358,7 +358,7 @@ void main() {
tester.platformDispatcher.textScaleFactorTestValue = scale;
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final list = find.byKey(const ValueKey('swarm-search-result-list'));
final row = find
.descendant(of: list, matching: find.byType(ListTile))
diff --git a/desktop/test/box_render_preview_test.dart b/desktop/test/box_render_preview_test.dart
index 8d548b39c..835724f1e 100644
--- a/desktop/test/box_render_preview_test.dart
+++ b/desktop/test/box_render_preview_test.dart
@@ -206,7 +206,7 @@ void main() {
}
final search = find.byKey(const ValueKey('swarm-search-input'));
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await shot('01-new-pane-empty');
await type(search, 'age');
await tester.sendKeyEvent(LogicalKeyboardKey.arrowUp);
@@ -371,7 +371,7 @@ void main() {
await tester.pump();
expect(find.byKey(const ValueKey('new-harness-box')), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await shot('13-command-open');
await type(search, '> spl');
await shot('13-command-palette');
@@ -381,7 +381,7 @@ void main() {
await seedPreviews(app);
final previousAppearance = appearancePrefsStore.value;
addTearDown(() => appearancePrefsStore.value = previousAppearance);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
for (final style in PromptStyle.values) {
appearancePrefsStore.value = previousAppearance.copyWith(
prompt: PromptPrefs(style: style),
@@ -396,7 +396,7 @@ void main() {
appearancePrefsStore.value = previousAppearance;
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await type(search, 'Checkout');
await shot('14-search-preview');
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
@@ -492,7 +492,7 @@ void main() {
seedMixedAgents(catalogApp);
catalogApp.adoptSessionForTest(terminal('a0', []));
await mount(tester, catalogApp);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await key(tester, LogicalKeyboardKey.slash, ctrl: true);
await shot('25-mixed-catalog');
await type(search, '?');
@@ -542,7 +542,7 @@ void main() {
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pump();
tester.view.physicalSize = const Size(600, 800);
@@ -569,7 +569,7 @@ void main() {
session.terminal.write('\x1b[36m❯\x1b[0m ');
}
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await type(search, '> resize panes');
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pump();
@@ -697,7 +697,7 @@ void main() {
tester.view.physicalSize = const Size(1280, 800);
tester.platformDispatcher.clearTextScaleFactorTestValue();
linkApp.machineStates['m']!.localOnly = true;
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> link machine',
@@ -731,7 +731,7 @@ void main() {
await tester.pumpAndSettle();
tester.view.physicalSize = const Size(1280, 800);
tester.platformDispatcher.clearTextScaleFactorTestValue();
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> link machine',
@@ -805,7 +805,7 @@ void main() {
..nodeOnline = true;
managerApp.machines.add(shared);
await mount(tester, managerApp);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> machines manager',
@@ -884,7 +884,7 @@ void main() {
renameApp.adoptSessionForTest(terminal('a0', []));
await mount(tester, renameApp);
Future<void> renameCommand(String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> $query',
diff --git a/desktop/test/clone_agent_test.dart b/desktop/test/clone_agent_test.dart
index d66d7aaa9..36d0906b5 100644
--- a/desktop/test/clone_agent_test.dart
+++ b/desktop/test/clone_agent_test.dart
@@ -1,4 +1,4 @@
-// Clone Agent (⌘⇧N): another agent of the focused pane's kind with a fresh
+// Clone Harness (⌘⇧N): another agent of the focused pane's kind with a fresh
// conversation — fork minus the context. Everything a dialog would ask is read
// off the source agent's frame, so the chord goes straight to `agent_create`
// on the source's machine; a relayed machine takes the same road as this one.
@@ -116,7 +116,7 @@ void main() {
Map<String, dynamic> withoutId(Map<String, dynamic> payload) =>
{...payload}..remove('creationId');
- test('⌘⇧N is Clone Agent in the live table and reaches the native menu', () {
+ test('⌘⇧N is Clone Harness in the live table and reaches the native menu', () {
final shiftN = kSwarmShortcuts.where(
(s) =>
s.activator.trigger == LogicalKeyboardKey.keyN &&
diff --git a/desktop/test/command_dock_interaction_test.dart b/desktop/test/command_dock_interaction_test.dart
index 44e9df2eb..e1da73229 100644
--- a/desktop/test/command_dock_interaction_test.dart
+++ b/desktop/test/command_dock_interaction_test.dart
@@ -489,7 +489,7 @@ void main() {
await configured.mount(tester, app, map);
tester.view.physicalSize = size;
await tester.pump();
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final results = tester.widget<SwarmSearchResults>(
find.byType(SwarmSearchResults),
);
@@ -542,7 +542,7 @@ void main() {
tester.view.physicalSize = size;
await tester.pump();
final paneBounds = tester.getRect(find.byKey(pane.cellKey));
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final input = find.byKey(const ValueKey('swarm-search-input'));
final preview = find.byKey(const ValueKey('swarm-search-preview'));
expect(find.text('· Feature work'), findsNothing);
@@ -561,7 +561,7 @@ void main() {
final createRow = find.byKey(const ValueKey('create:harness'));
final createBounds = tester.getRect(createRow);
expect(queryBounds.top - createBounds.bottom, inInclusiveRange(0, 12));
- expect(matchBounds.bottom, lessThanOrEqualTo(createBounds.top));
+ expect(matchBounds.bottom, lessThanOrEqualTo(createBounds.top + .001));
expect(search.rows.first.isCreate, isTrue);
expect(search.rows.first.task, 'Agent 1');
expect(preview, findsOneWidget);
diff --git a/desktop/test/entry_surfaces_render_test.dart b/desktop/test/entry_surfaces_render_test.dart
index 94e5a0ee5..4b6450d0f 100644
--- a/desktop/test/entry_surfaces_render_test.dart
+++ b/desktop/test/entry_surfaces_render_test.dart
@@ -197,7 +197,7 @@ void main() {
}
}
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pumpAndSettle();
await capture('open');
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
diff --git a/desktop/test/fork_keyboard_test.dart b/desktop/test/fork_keyboard_test.dart
index 707d8c353..54c2efbf9 100644
--- a/desktop/test/fork_keyboard_test.dart
+++ b/desktop/test/fork_keyboard_test.dart
@@ -77,7 +77,7 @@ void main() {
WidgetTester tester, {
LogicalKeyboardKey accept = LogicalKeyboardKey.enter,
}) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> fork',
@@ -313,7 +313,7 @@ void main() {
];
}
await mount(tester);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> fork',
diff --git a/desktop/test/harness_customize_test.dart b/desktop/test/harness_customize_test.dart
index e347ac0a7..007b45f9d 100644
--- a/desktop/test/harness_customize_test.dart
+++ b/desktop/test/harness_customize_test.dart
@@ -202,7 +202,7 @@ void main() {
expect(find.byType(SettingsScreen), findsOneWidget);
await tester.tap(find.text('Customize'));
} else {
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> customize',
@@ -289,7 +289,7 @@ void main() {
final lineHeights = [
for (final state in states) state.renderTerminal.lineHeight,
];
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> customize',
diff --git a/desktop/test/harness_picker_entry_test.dart b/desktop/test/harness_picker_entry_test.dart
index 92166e35a..5d9e9582b 100644
--- a/desktop/test/harness_picker_entry_test.dart
+++ b/desktop/test/harness_picker_entry_test.dart
@@ -71,7 +71,7 @@ void main() {
);
await tester.pump(const Duration(milliseconds: 100));
final field = find.byKey(const ValueKey('swarm-search-input'));
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
expect(field, findsOneWidget);
expect(find.byType(SwarmSearchResults), findsOneWidget);
expect(
diff --git a/desktop/test/harness_placement_test.dart b/desktop/test/harness_placement_test.dart
index 8efce3c86..9e82a6610 100644
--- a/desktop/test/harness_placement_test.dart
+++ b/desktop/test/harness_placement_test.dart
@@ -275,7 +275,7 @@ void main() {
final inPane = dismiss == 'outside';
await chord(
tester,
- inPane ? LogicalKeyboardKey.keyP : LogicalKeyboardKey.keyT,
+ inPane ? LogicalKeyboardKey.keyO : LogicalKeyboardKey.keyT,
);
if (!inPane) await chord(tester, LogicalKeyboardKey.keyO);
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
@@ -800,7 +800,7 @@ void main() {
await tester.pump();
expect(box.task, task);
for (final key in [
- LogicalKeyboardKey.keyP,
+ LogicalKeyboardKey.keyO,
LogicalKeyboardKey.keyT,
LogicalKeyboardKey.period,
]) {
@@ -883,7 +883,7 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pump();
expect(find.byType(NewHarnessBox), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pump();
final box = tester
@@ -901,7 +901,7 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pump();
expect(find.byType(NewHarnessBox), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
@@ -944,7 +944,7 @@ void main() {
await mount(tester, app);
final key = placement == HarnessPlacement.newTab
? LogicalKeyboardKey.keyT
- : LogicalKeyboardKey.keyP;
+ : LogicalKeyboardKey.keyO;
await chord(tester, key);
if (placement == HarnessPlacement.newTab) {
await chord(tester, LogicalKeyboardKey.keyO);
@@ -982,7 +982,7 @@ void main() {
expect(app.swarms, contains(original));
// The creation box was opened from a search editor that is now gone.
// Returning focus to that detached editor would disable shortcuts.
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
expect(
find.byKey(const ValueKey('swarm-search-input')),
findsOneWidget,
diff --git a/desktop/test/harness_store_entry_test.dart b/desktop/test/harness_store_entry_test.dart
index e354ad480..f41f4f725 100644
--- a/desktop/test/harness_store_entry_test.dart
+++ b/desktop/test/harness_store_entry_test.dart
@@ -84,7 +84,7 @@ void main() {
'browse harnesses',
'extensions',
]) {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> $query',
diff --git a/desktop/test/keyboard_practice_test.dart b/desktop/test/keyboard_practice_test.dart
index 286b5b848..1d281449f 100644
--- a/desktop/test/keyboard_practice_test.dart
+++ b/desktop/test/keyboard_practice_test.dart
@@ -35,7 +35,7 @@ void main() {
}
Future<void> command(WidgetTester tester, String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> $query',
@@ -290,7 +290,7 @@ void main() {
expect(learning.next, WorkspaceLesson.zoom);
await key(tester, LogicalKeyboardKey.enter, cmd: true);
expect(learning.next, WorkspaceLesson.commands);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
expect(learning.finished, isTrue);
expect(
tester
diff --git a/desktop/test/keymap_host_test.dart b/desktop/test/keymap_host_test.dart
index 01c266971..4175e9414 100644
--- a/desktop/test/keymap_host_test.dart
+++ b/desktop/test/keymap_host_test.dart
@@ -59,7 +59,7 @@ void main() {
('cmd+9', 'swarm.select_9'),
('cmd+t', 'swarm.new'),
('cmd+n', 'agent.new'),
- ('cmd+p', 'agent.add'),
+ ('cmd+o', 'agent.open'),
('cmd+r', 'pane.split_right'),
('cmd+d', 'pane.split_down'),
('cmd+shift+n', 'agent.clone'),
@@ -72,7 +72,7 @@ void main() {
('cmd+right', 'pane.focus_right'),
('cmd+left', 'pane.focus_left'),
('cmd+enter', 'pane.zoom'),
- ('cmd+shift+p', 'navigation.commands'),
+ ('cmd+p', 'navigation.commands'),
('cmd+shift+j', 'navigation.command_bar'),
('cmd+s', 'app.store'),
('cmd+shift+l', 'pane.layout'),
diff --git a/desktop/test/keymap_runtime_test.dart b/desktop/test/keymap_runtime_test.dart
index 97e7356c9..3c0a1d0ad 100644
--- a/desktop/test/keymap_runtime_test.dart
+++ b/desktop/test/keymap_runtime_test.dart
@@ -8,7 +8,7 @@ import 'package:harness/settings/sections/shortcuts_section.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/shortcuts/app_keymap.dart';
import 'package:harness/shortcuts/keymap.dart';
-import 'package:harness/shortcuts/shortcuts_list.dart';
+import 'package:harness/shortcuts/shortcuts_browser.dart';
import 'package:harness/state/app_state.dart';
import 'package:harness/state/pane_preset.dart';
import 'package:harness/state/swarm_catalog.dart';
@@ -390,7 +390,7 @@ void main() {
if (inline) {
await tester.tap(input);
} else {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
}
await tester.enterText(input, 'Agent');
await tester.pump();
@@ -471,13 +471,13 @@ void main() {
.widget<TextField>(find.byKey(const ValueKey('swarm-search-input')))
.controller!
.text,
- '> ',
+ '>',
);
await key(tester, LogicalKeyboardKey.escape);
expect(field, findsOneWidget);
expect(find.byType(SwarmSearchResults), findsNothing);
expect(tester.widget<TextField>(field).controller!.text, isEmpty);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final modal = find.byKey(const ValueKey('swarm-search-input'));
expect(tester.widget<TextField>(modal).focusNode!.hasFocus, isTrue);
expect(tester.widget<TextField>(modal).controller!.text, isEmpty);
@@ -572,7 +572,7 @@ void main() {
);
final commandField = find.byKey(const ValueKey('swarm-search-input'));
expect(commandField, findsOneWidget);
- expect(tester.widget<TextField>(commandField).controller!.text, '> ');
+ expect(tester.widget<TextField>(commandField).controller!.text, '>');
expect(
tester.widget<TextField>(commandField).focusNode!.hasPrimaryFocus,
isTrue,
@@ -682,7 +682,7 @@ void main() {
if (inline) {
await tester.tap(field);
} else {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
}
await tester.enterText(field, 'Agent');
await tester.pump();
@@ -863,7 +863,7 @@ void main() {
KeymapContext.terminal,
);
expect(terminalRows.where((r) => r.chords.isEmpty), isNotEmpty);
- expect(find.byType(ShortcutsDeck), findsOneWidget);
+ expect(find.byType(ShortcutsBrowser), findsOneWidget);
expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox());
map.dispose();
diff --git a/desktop/test/models_menu_test.dart b/desktop/test/models_menu_test.dart
index a7a5df2cc..514a34966 100644
--- a/desktop/test/models_menu_test.dart
+++ b/desktop/test/models_menu_test.dart
@@ -419,7 +419,7 @@ void main() {
expect(find.byType(NewHarnessBox), findsNothing);
expect(app.swarms, [source]);
if (command == 'manageMachines') {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> machine monitor',
diff --git a/desktop/test/new_harness_entry_rules_test.dart b/desktop/test/new_harness_entry_rules_test.dart
index 1c97c832a..74ead6f6a 100644
--- a/desktop/test/new_harness_entry_rules_test.dart
+++ b/desktop/test/new_harness_entry_rules_test.dart
@@ -167,11 +167,7 @@ void main() {
await key(tester, LogicalKeyboardKey.enter);
}
- for (final shortcut in [
- LogicalKeyboardKey.keyN,
- LogicalKeyboardKey.keyP,
- LogicalKeyboardKey.keyO,
- ]) {
+ for (final shortcut in [LogicalKeyboardKey.keyN, LogicalKeyboardKey.keyO]) {
testWidgets(
'${shortcut.keyLabel} starts a pane with no extra launch controls',
(tester) async {
@@ -384,196 +380,165 @@ void main() {
},
);
- for (final newTab in [true, false]) {
- testWidgets(
- 'switching to Cmd-${newTab ? 'O' : 'P'} keeps the highlighted existing harness',
- (tester) async {
- await mount(tester, store: false);
- final origin = app.activeSwarm;
- await key(
- tester,
- newTab ? LogicalKeyboardKey.keyP : LogicalKeyboardKey.keyO,
- cmd: true,
- );
- final search = find.byKey(const ValueKey('swarm-search-input'));
- await tester.enterText(search, 'login');
- final picker = tester
- .widget<SwarmSearchInput>(find.byType(SwarmSearchInput))
- .search!;
- for (
- var i = 0;
- i < picker.rows.length && picker.selected?.agentId != 'a1';
- i++
- ) {
- await key(tester, LogicalKeyboardKey.arrowUp);
- }
- expect(picker.selected?.agentId, 'a1');
- await key(
- tester,
- newTab ? LogicalKeyboardKey.keyO : LogicalKeyboardKey.keyP,
- cmd: true,
- );
- final updated = tester
- .widget<SwarmSearchInput>(find.byType(SwarmSearchInput))
- .search!;
- expect(updated.query, 'login');
- expect(updated.selected?.agentId, 'a1');
- await key(tester, LogicalKeyboardKey.enter);
- expect(app.focusedPane?.agentId, 'a1');
- expect(app.activeSwarm, same(origin));
- expect(app.swarms.length, 1);
- expect(connections.values.expand((c) => c.starts), isEmpty);
- await tester.pumpWidget(const SizedBox());
- },
- );
-
- for (final switchDestination in [false, true]) {
- testWidgets(
- 'Cmd-${newTab ? 'O' : 'P'} ${switchDestination ? 'switches shortcut' : 'repeats'} without losing the search task',
- (tester) async {
- await mount(tester, store: false);
- final origin = app.activeSwarm;
- final shortcut = newTab
- ? LogicalKeyboardKey.keyO
- : LogicalKeyboardKey.keyP;
- final nextTab = switchDestination ? !newTab : newTab;
- await key(tester, shortcut, cmd: true);
- final search = find.byKey(const ValueKey('swarm-search-input'));
- await tester.enterText(search, 'Check the keyboard workflow');
- final editor = tester.widget<SwarmSearchInput>(
- find.byType(SwarmSearchInput),
- );
- editor.controller.selection = const TextSelection(
- baseOffset: 6,
- extentOffset: 18,
- );
- await key(
- tester,
- nextTab ? LogicalKeyboardKey.keyO : LogicalKeyboardKey.keyP,
- cmd: true,
- );
- final updated = tester.widget<SwarmSearchInput>(
- find.byType(SwarmSearchInput),
- );
- expect(updated.controller.text, 'Check the keyboard workflow');
- expect(
- updated.controller.selection,
- const TextSelection(baseOffset: 6, extentOffset: 18),
- );
- expect(updated.focusNode.hasFocus, isTrue);
- expect(find.text(nextTab ? 'New Tab' : 'New Pane'), findsNothing);
- expect(app.swarms.first, same(origin));
- expect(app.swarms.length, 1);
- await key(tester, LogicalKeyboardKey.enter);
- expect(box(tester).task, 'Check the keyboard workflow');
- expect(box(tester).placement, HarnessPlacement.currentTab);
- await key(tester, LogicalKeyboardKey.enter);
- expect(
- connections['m']!.starts.single['prompt'],
- 'Check the keyboard workflow',
- );
- connections['m']!.created();
- await tester.pump();
- await tester.pump(const Duration(milliseconds: 200));
- expect(app.swarms.length, 1);
- expect(app.focusedPane?.agentId, 'created-1');
- await tester.pumpWidget(const SizedBox());
- },
- );
+ testWidgets('repeating Cmd-O keeps the highlighted existing harness', (
+ tester,
+ ) async {
+ await mount(tester, store: false);
+ final origin = app.activeSwarm;
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
+ final search = find.byKey(const ValueKey('swarm-search-input'));
+ await tester.enterText(search, 'login');
+ final picker = tester
+ .widget<SwarmSearchInput>(find.byType(SwarmSearchInput))
+ .search!;
+ for (
+ var i = 0;
+ i < picker.rows.length && picker.selected?.agentId != 'a1';
+ i++
+ ) {
+ await key(tester, LogicalKeyboardKey.arrowUp);
}
+ expect(picker.selected?.agentId, 'a1');
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
+ final updated = tester
+ .widget<SwarmSearchInput>(find.byType(SwarmSearchInput))
+ .search!;
+ expect(updated.query, 'login');
+ expect(updated.selected?.agentId, 'a1');
+ await key(tester, LogicalKeyboardKey.enter);
+ expect(app.focusedPane?.agentId, 'a1');
+ expect(app.activeSwarm, same(origin));
+ expect(app.swarms.length, 1);
+ expect(connections.values.expand((c) => c.starts), isEmpty);
+ await tester.pumpWidget(const SizedBox());
+ });
- testWidgets(
- 'Cmd-${newTab ? 'O' : 'P'} keeps drafts separate when the focused source pane changes',
- (tester) async {
- await mount(tester, store: false);
- final first = app.focusedPane!;
- final other = app.adoptSessionForTest(terminal('a2', []));
- app.focusPane(first.id);
- await tester.pump();
- final shortcut = newTab
- ? LogicalKeyboardKey.keyO
- : LogicalKeyboardKey.keyP;
- await key(tester, shortcut, cmd: true);
- await key(tester, LogicalKeyboardKey.enter);
- await nameProject(tester, 'keyboard-review');
- box(tester).focusField(NewHarnessField.task);
- await tester.pump();
- await tester.enterText(input, 'Review this project');
- await dismiss(tester);
- app.focusPane(other.id);
- await tester.pump();
- await key(tester, shortcut, cmd: true);
- await key(tester, LogicalKeyboardKey.enter);
- expect(box(tester).engine, 'autonomous/typst');
- expect(box(tester).project.folder, '/work/release-notes');
- expect(box(tester).task, isEmpty);
- await dismiss(tester);
- app.focusPane(first.id);
- await tester.pump();
- await key(tester, shortcut, cmd: true);
- await key(tester, LogicalKeyboardKey.enter);
- expect(box(tester).engine, 'codex');
- expect(box(tester).project.name, 'keyboard-review');
- expect(box(tester).task, 'Review this project');
- expect(connections.values.expand((c) => c.starts), isEmpty);
- await dismiss(tester);
- await tester.pumpWidget(const SizedBox());
- await tester.pump(const Duration(milliseconds: 60));
- },
- );
+ testWidgets('Cmd-O repeats without losing the search task', (tester) async {
+ await mount(tester, store: false);
+ final origin = app.activeSwarm;
+ final shortcut = LogicalKeyboardKey.keyO;
- testWidgets(
- 'Cmd-${newTab ? 'O' : 'P'} inherits its source and resumes edits via either open shortcut',
- (tester) async {
- await mount(tester, store: false);
- final origin = app.activeSwarm;
- final shortcut = newTab
- ? LogicalKeyboardKey.keyO
- : LogicalKeyboardKey.keyP;
- await key(tester, shortcut, cmd: true);
- await key(tester, LogicalKeyboardKey.enter);
- var draft = box(tester);
- expect(draft.engine, 'codex');
- expect(draft.machineId, 'm');
- expect(draft.project.folder, '/work/openharness');
- expect(app.swarms.first, same(origin));
- expect(app.swarms.length, 1);
- draft.focusField(NewHarnessField.task);
- await tester.pump();
- await tester.enterText(input, 'Check keyboard focus');
- await key(tester, LogicalKeyboardKey.escape);
- await nameProject(tester, 'keyboard-review');
- await dismiss(tester);
- expect(app.swarms, [origin]);
- expect(app.activeSwarm, same(origin));
- await key(
- tester,
- newTab ? LogicalKeyboardKey.keyP : LogicalKeyboardKey.keyO,
- cmd: true,
- );
- await key(tester, LogicalKeyboardKey.enter);
- draft = box(tester);
- expect(draft.task, 'Check keyboard focus');
- expect(draft.project.name, 'keyboard-review');
- expect(draft.placement, HarnessPlacement.currentTab);
- await key(tester, LogicalKeyboardKey.enter);
- final connection = connections['m']!;
- expect(connection.starts, hasLength(1));
- expect(connection.starts.single['engine'], 'codex');
- expect(connection.starts.single['projectName'], 'keyboard-review');
- expect(connection.starts.single['prompt'], 'Check keyboard focus');
- expect(connection.starts.single['dsh'], isNull);
- connection.created();
- await tester.pump();
- await tester.pump(const Duration(milliseconds: 200));
- expect(find.byType(NewHarnessBox), findsNothing);
- expect(app.swarms.length, 1);
- expect(app.activeSwarm.panes.last.agentId, 'created-1');
- expect(app.focusedPane?.agentId, 'created-1');
- await tester.pumpWidget(const SizedBox());
- },
+ await key(tester, shortcut, cmd: true);
+ final search = find.byKey(const ValueKey('swarm-search-input'));
+ await tester.enterText(search, 'Check the keyboard workflow');
+ final editor = tester.widget<SwarmSearchInput>(
+ find.byType(SwarmSearchInput),
);
- }
+ editor.controller.selection = const TextSelection(
+ baseOffset: 6,
+ extentOffset: 18,
+ );
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
+ final updated = tester.widget<SwarmSearchInput>(
+ find.byType(SwarmSearchInput),
+ );
+ expect(updated.controller.text, 'Check the keyboard workflow');
+ expect(
+ updated.controller.selection,
+ const TextSelection(baseOffset: 6, extentOffset: 18),
+ );
+ expect(updated.focusNode.hasFocus, isTrue);
+ expect(find.text('New Pane'), findsNothing);
+ expect(app.swarms.first, same(origin));
+ expect(app.swarms.length, 1);
+ await key(tester, LogicalKeyboardKey.enter);
+ expect(box(tester).task, 'Check the keyboard workflow');
+ expect(box(tester).placement, HarnessPlacement.currentTab);
+ await key(tester, LogicalKeyboardKey.enter);
+ expect(
+ connections['m']!.starts.single['prompt'],
+ 'Check the keyboard workflow',
+ );
+ connections['m']!.created();
+ await tester.pump();
+ await tester.pump(const Duration(milliseconds: 200));
+ expect(app.swarms.length, 1);
+ expect(app.focusedPane?.agentId, 'created-1');
+ await tester.pumpWidget(const SizedBox());
+ });
+
+ testWidgets(
+ 'Cmd-O keeps drafts separate when the focused source pane changes',
+ (tester) async {
+ await mount(tester, store: false);
+ final first = app.focusedPane!;
+ final other = app.adoptSessionForTest(terminal('a2', []));
+ app.focusPane(first.id);
+ await tester.pump();
+ final shortcut = LogicalKeyboardKey.keyO;
+ await key(tester, shortcut, cmd: true);
+ await key(tester, LogicalKeyboardKey.enter);
+ await nameProject(tester, 'keyboard-review');
+ box(tester).focusField(NewHarnessField.task);
+ await tester.pump();
+ await tester.enterText(input, 'Review this project');
+ await dismiss(tester);
+ app.focusPane(other.id);
+ await tester.pump();
+ await key(tester, shortcut, cmd: true);
+ await key(tester, LogicalKeyboardKey.enter);
+ expect(box(tester).engine, 'autonomous/typst');
+ expect(box(tester).project.folder, '/work/release-notes');
+ expect(box(tester).task, isEmpty);
+ await dismiss(tester);
+ app.focusPane(first.id);
+ await tester.pump();
+ await key(tester, shortcut, cmd: true);
+ await key(tester, LogicalKeyboardKey.enter);
+ expect(box(tester).engine, 'codex');
+ expect(box(tester).project.name, 'keyboard-review');
+ expect(box(tester).task, 'Review this project');
+ expect(connections.values.expand((c) => c.starts), isEmpty);
+ await dismiss(tester);
+ await tester.pumpWidget(const SizedBox());
+ await tester.pump(const Duration(milliseconds: 60));
+ },
+ );
+
+ testWidgets('Cmd-O inherits its source and resumes edits via Open Harness', (
+ tester,
+ ) async {
+ await mount(tester, store: false);
+ final origin = app.activeSwarm;
+ final shortcut = LogicalKeyboardKey.keyO;
+ await key(tester, shortcut, cmd: true);
+ await key(tester, LogicalKeyboardKey.enter);
+ var draft = box(tester);
+ expect(draft.engine, 'codex');
+ expect(draft.machineId, 'm');
+ expect(draft.project.folder, '/work/openharness');
+ expect(app.swarms.first, same(origin));
+ expect(app.swarms.length, 1);
+ draft.focusField(NewHarnessField.task);
+ await tester.pump();
+ await tester.enterText(input, 'Check keyboard focus');
+ await key(tester, LogicalKeyboardKey.escape);
+ await nameProject(tester, 'keyboard-review');
+ await dismiss(tester);
+ expect(app.swarms, [origin]);
+ expect(app.activeSwarm, same(origin));
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
+ await key(tester, LogicalKeyboardKey.enter);
+ draft = box(tester);
+ expect(draft.task, 'Check keyboard focus');
+ expect(draft.project.name, 'keyboard-review');
+ expect(draft.placement, HarnessPlacement.currentTab);
+ await key(tester, LogicalKeyboardKey.enter);
+ final connection = connections['m']!;
+ expect(connection.starts, hasLength(1));
+ expect(connection.starts.single['engine'], 'codex');
+ expect(connection.starts.single['projectName'], 'keyboard-review');
+ expect(connection.starts.single['prompt'], 'Check keyboard focus');
+ expect(connection.starts.single['dsh'], isNull);
+ connection.created();
+ await tester.pump();
+ await tester.pump(const Duration(milliseconds: 200));
+ expect(find.byType(NewHarnessBox), findsNothing);
+ expect(app.swarms.length, 1);
+ expect(app.activeSwarm.panes.last.agentId, 'created-1');
+ expect(app.focusedPane?.agentId, 'created-1');
+ await tester.pumpWidget(const SizedBox());
+ });
testWidgets(
'switching the picker keeps its project scope and Escape goes back',
@@ -590,7 +555,7 @@ void main() {
expect(before.canGoBack, isTrue);
final selected = before.selected?.id;
final results = before.rows.map((row) => row.id).toList();
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final picker = tester
.widget<SwarmSearchInput>(find.byType(SwarmSearchInput))
.search!;
diff --git a/desktop/test/orchestrator_test.dart b/desktop/test/orchestrator_test.dart
index ba0521c6a..d0d5bfb9e 100644
--- a/desktop/test/orchestrator_test.dart
+++ b/desktop/test/orchestrator_test.dart
@@ -123,7 +123,7 @@ void main() {
final shortcut = appShortcuts()
.singleWhere((s) => s.action == ShortcutAction.addAgent)
.activator;
- expect(shortcut.trigger, LogicalKeyboardKey.keyP);
+ expect(shortcut.trigger, LogicalKeyboardKey.keyO);
expect(shortcut.meta, isTrue);
expect(shortcut.shift, isFalse);
expect(
diff --git a/desktop/test/quick_access_test.dart b/desktop/test/quick_access_test.dart
index e03561fce..cdde02a55 100644
--- a/desktop/test/quick_access_test.dart
+++ b/desktop/test/quick_access_test.dart
@@ -113,7 +113,7 @@ void main() {
expect(search.rows.any((row) => row.agentId == 'a0'), isTrue);
});
- for (final entry in [LogicalKeyboardKey.keyP, LogicalKeyboardKey.keyT]) {
+ for (final entry in [LogicalKeyboardKey.keyO, LogicalKeyboardKey.keyT]) {
testWidgets(
'Quick Access stays in the same picker from ${entry.keyLabel}',
(tester) async {
@@ -170,8 +170,8 @@ void main() {
expect(field.focusNode!.hasFocus, isTrue);
await key(tester, LogicalKeyboardKey.escape);
expect(field.controller!.text, '@ Office');
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
- expect(field.controller!.text, '> ');
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ expect(field.controller!.text, '>');
expect(search.isCommandMode, isTrue);
expect(search.canGoBack, isFalse);
// Backspace leaves command mode without closing/reopening the dock.
diff --git a/desktop/test/rename_keyboard_test.dart b/desktop/test/rename_keyboard_test.dart
index 0aafca1f4..8cb2dc491 100644
--- a/desktop/test/rename_keyboard_test.dart
+++ b/desktop/test/rename_keyboard_test.dart
@@ -23,7 +23,7 @@ TextField field(WidgetTester tester, Finder finder) =>
tester.widget<TextField>(finder);
Future<void> command(WidgetTester tester, String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(_search, '> $query');
await key(tester, LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
@@ -198,7 +198,7 @@ void main() {
tester,
) async {
await mount(tester);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(_search, '> rename agent');
expect(find.byKey(const ValueKey('command:agent.rename')), findsNothing);
await key(tester, LogicalKeyboardKey.escape);
@@ -211,7 +211,7 @@ void main() {
);
app.notifyListeners();
await tester.pump();
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(_search, '> rename agent');
expect(find.byKey(const ValueKey('command:agent.rename')), findsNothing);
expect(connection.renames, isEmpty);
diff --git a/desktop/test/restart_keyboard_test.dart b/desktop/test/restart_keyboard_test.dart
index ed3d180b5..eb4472cf9 100644
--- a/desktop/test/restart_keyboard_test.dart
+++ b/desktop/test/restart_keyboard_test.dart
@@ -68,7 +68,7 @@ void main() {
WidgetTester tester, {
LogicalKeyboardKey accept = LogicalKeyboardKey.enter,
}) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> restart',
diff --git a/desktop/test/search_workspace_test.dart b/desktop/test/search_workspace_test.dart
index 2e3e4738f..74594ad73 100644
--- a/desktop/test/search_workspace_test.dart
+++ b/desktop/test/search_workspace_test.dart
@@ -37,7 +37,7 @@ void main() {
);
await mount(tester, app, map, native: native);
final field = find.byKey(const ValueKey('swarm-search-input'));
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
final controller = tester.widget<TextField>(field).controller!;
final focus = tester.widget<TextField>(field).focusNode!;
final selected = find.byWidgetPredicate(
@@ -68,7 +68,7 @@ void main() {
);
await key(tester, LogicalKeyboardKey.escape);
expect(field, findsNothing);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
await tester.enterText(field, 'Agent 0');
await tester.pump();
expect(
diff --git a/desktop/test/settings_review_render_test.dart b/desktop/test/settings_review_render_test.dart
index 694b35a85..ae8f8d55c 100644
--- a/desktop/test/settings_review_render_test.dart
+++ b/desktop/test/settings_review_render_test.dart
@@ -150,18 +150,25 @@ void main() {
);
await tester.enterText(search, '');
await tester.pumpAndSettle();
- final scaffold = find.byType(SectionScaffold);
- final heading = find.descendant(
- of: scaffold,
- matching: find.text(
- tester.widget<SectionScaffold>(scaffold).title,
- ),
- );
- expect(
- tester.getCenter(find.text('Back to app')).dy,
- closeTo(tester.getCenter(heading).dy, 1),
- reason: 'Back and the section title share a header at every text size.',
- );
+ if (section == SettingsSection.shortcuts) {
+ expect(
+ find.byKey(const ValueKey('shortcuts-search')),
+ findsOneWidget,
+ );
+ } else {
+ final scaffold = find.byType(SectionScaffold);
+ final heading = find.descendant(
+ of: scaffold,
+ matching: find.text(
+ tester.widget<SectionScaffold>(scaffold).title,
+ ),
+ );
+ expect(
+ tester.getCenter(find.text('Back to app')).dy,
+ closeTo(tester.getCenter(heading).dy, 1),
+ reason: 'Back and the section title share a header at every text size.',
+ );
+ }
if (section == SettingsSection.about) {
await tester.runAsync(() async {
await precacheImage(
@@ -243,8 +250,7 @@ void main() {
expect(
label.getMaxIntrinsicWidth(double.infinity),
lessThanOrEqualTo(label.size.width + 0.1),
- reason:
- 'The shortcut context must be readable without opening it.',
+ reason: 'Shortcut group headings remain readable at every text size.',
);
unawaited(
showShortcutsSheet(tester.element(find.byType(SettingsScreen))),
diff --git a/desktop/test/settings_screen_test.dart b/desktop/test/settings_screen_test.dart
index 400498a75..26fdb3b20 100644
--- a/desktop/test/settings_screen_test.dart
+++ b/desktop/test/settings_screen_test.dart
@@ -19,9 +19,8 @@ import 'package:harness/settings/settings_screen.dart';
import 'package:harness/settings/settings_nav.dart';
import 'package:harness/settings/settings_section.dart';
import 'package:harness/settings/sections/shortcuts_section.dart';
-import 'package:harness/shared/widgets/app_select_field.dart';
import 'package:harness/shared/theme/app_theme.dart';
-import 'package:harness/shortcuts/keymap.dart';
+import 'package:harness/shortcuts/keyboard_practice.dart';
import 'package:harness/state/app_state.dart';
import 'package:harness/widgets/harness_customize_pane.dart';
@@ -249,7 +248,7 @@ void main() {
});
testWidgets(
- 'shortcut help can be paged and its context changed by keyboard',
+ 'shortcut help can be searched, paged and practiced by keyboard',
(tester) async {
await openSettings(tester);
await tester.enterText(
@@ -258,49 +257,42 @@ void main() {
);
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
- // Search -> matching section -> shortcut context. No pointer is needed
- // to leave the search and reach the section's first control.
- await tester.sendKeyEvent(LogicalKeyboardKey.tab);
- await tester.pump();
- await tester.sendKeyEvent(LogicalKeyboardKey.tab);
- await tester.pump();
- expect(
- FocusManager.instance.primaryFocus?.context
- ?.findAncestorWidgetOfExactType<AppSelectField<KeymapContext>>(),
- isNotNull,
- );
+ final search = find.byKey(const ValueKey('shortcuts-search'));
+ for (
+ var i = 0;
+ i < 4 && !tester.widget<TextField>(search).focusNode!.hasFocus;
+ i++
+ ) {
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ }
+ expect(tester.widget<TextField>(search).focusNode!.hasFocus, isTrue);
final scroll = tester.state<ScrollableState>(
find
.descendant(
of: find.byType(ShortcutsSection),
matching: find.byType(Scrollable),
)
- .first,
+ .last,
);
await tester.sendKeyEvent(LogicalKeyboardKey.pageDown);
await tester.pumpAndSettle();
expect(scroll.position.pixels, greaterThan(0));
await tester.sendKeyEvent(LogicalKeyboardKey.pageUp);
await tester.pumpAndSettle();
+ await tester.enterText(search, 'Clone');
+ await tester.pump();
+ expect(find.text('Clone Harness'), findsOneWidget);
await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
+ expect(find.byType(KeyboardPractice), findsOneWidget);
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pumpAndSettle();
expect(find.byType(SettingsScreen), findsOneWidget);
- await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
- await tester.pumpAndSettle();
- await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
- await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
- await tester.sendKeyEvent(LogicalKeyboardKey.enter);
- await tester.pumpAndSettle();
- expect(
- tester
- .widget<AppSelectField<KeymapContext>>(
- find.byType(AppSelectField<KeymapContext>),
- )
- .value,
- KeymapContext.picker,
- );
+ expect(tester.widget<TextField>(search).focusNode!.hasFocus, isTrue);
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
await tester.pumpAndSettle();
expect(find.byType(SettingsScreen), findsNothing);
diff --git a/desktop/test/shortcuts_test.dart b/desktop/test/shortcuts_test.dart
index 3c1b7e749..d4abb6266 100644
--- a/desktop/test/shortcuts_test.dart
+++ b/desktop/test/shortcuts_test.dart
@@ -265,7 +265,7 @@ void main() {
expect(chordsFor(ShortcutAction.showLayout), ['⇧⌘L']);
expect(chordsFor(ShortcutAction.orchestrate), isEmpty);
expect(chordsFor(ShortcutAction.routeTask), ['⌘B']);
- expect(chordsFor(ShortcutAction.addAgent), ['⌘P']);
+ expect(chordsFor(ShortcutAction.addAgent), ['⌘O']);
expect(chordsFor(ShortcutAction.newAgent), ['⌘N']);
expect(chordsFor(ShortcutAction.showAttention), ['⇧⌘I']);
expect(chordsFor(ShortcutAction.findTerminal), ['⌘F']);
diff --git a/desktop/test/stop_keyboard_test.dart b/desktop/test/stop_keyboard_test.dart
index 4cabad5af..351241b85 100644
--- a/desktop/test/stop_keyboard_test.dart
+++ b/desktop/test/stop_keyboard_test.dart
@@ -65,7 +65,7 @@ void main() {
WidgetTester tester, {
LogicalKeyboardKey accept = LogicalKeyboardKey.enter,
}) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> stop',
@@ -237,7 +237,7 @@ void main() {
isShared: true,
);
await mount(tester);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> stop',
diff --git a/desktop/test/stopped_harness_test.dart b/desktop/test/stopped_harness_test.dart
index 18a549ca8..bde84e443 100644
--- a/desktop/test/stopped_harness_test.dart
+++ b/desktop/test/stopped_harness_test.dart
@@ -294,7 +294,7 @@ void main() {
},
);
- for (final key in [LogicalKeyboardKey.keyP, LogicalKeyboardKey.keyT]) {
+ for (final key in [LogicalKeyboardKey.keyO, LogicalKeyboardKey.keyT]) {
testWidgets(
'${key.keyLabel} opens retained work with Enter and preserves other panes',
(tester) async {
@@ -329,7 +329,7 @@ void main() {
expect(app.allPanes.contains(existing), isTrue);
expect(
app.activeSwarmId == originalTab,
- key == LogicalKeyboardKey.keyP,
+ key == LogicalKeyboardKey.keyO,
);
expect(connection.types, ['agent_resume']);
await tester.pumpWidget(const SizedBox());
diff --git a/desktop/test/swarm_add_agent_test.dart b/desktop/test/swarm_add_agent_test.dart
index 5059317e1..44bbde3dd 100644
--- a/desktop/test/swarm_add_agent_test.dart
+++ b/desktop/test/swarm_add_agent_test.dart
@@ -27,7 +27,7 @@ void main() {
await tester.pump();
expect(find.byKey(const ValueKey('swarm-new-pane-button')), findsNothing);
expect(find.byType(FloatingActionButton), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'Agent 0',
@@ -70,7 +70,7 @@ void main() {
await tester.pump();
final neighborRect = tester.getRect(find.byKey(neighbor.cellKey));
final expected = app.preparePaneSplit(axis)!;
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
final inputField = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(
inputField,
diff --git a/desktop/test/swarm_arrange_keyboard_test.dart b/desktop/test/swarm_arrange_keyboard_test.dart
index d59ac0778..dcab3a881 100644
--- a/desktop/test/swarm_arrange_keyboard_test.dart
+++ b/desktop/test/swarm_arrange_keyboard_test.dart
@@ -212,7 +212,7 @@ void main() {
tester.view.physicalSize = const Size(2000, 1200);
await tester.pump();
Future<void> command(String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> $query',
diff --git a/desktop/test/swarm_commands_test.dart b/desktop/test/swarm_commands_test.dart
index b6787bb8e..b8b0da46c 100644
--- a/desktop/test/swarm_commands_test.dart
+++ b/desktop/test/swarm_commands_test.dart
@@ -68,7 +68,7 @@ void main() {
final pane = app.adoptSessionForTest(terminal('a0', frames));
final original = app.activeSwarm;
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
final input = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(input, '> pin');
await tester.pump();
@@ -97,9 +97,9 @@ void main() {
isTrue,
);
// The approved command shortcut opens command mode and leaves pinning alone.
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
expect(app.isPanePinned(pane), isTrue);
- expect(tester.widget<TextField>(input).controller!.text, '> ');
+ expect(tester.widget<TextField>(input).controller!.text, '>');
await tester.enterText(input, '> unpin');
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
@@ -117,7 +117,7 @@ void main() {
final app = createApp();
await mount(tester, app);
final input = find.byKey(const ValueKey('swarm-search-input'));
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(input, '> rename');
await tester.pump();
expect(
diff --git a/desktop/test/swarm_content_search_test.dart b/desktop/test/swarm_content_search_test.dart
index 31a24d78f..a0489069c 100644
--- a/desktop/test/swarm_content_search_test.dart
+++ b/desktop/test/swarm_content_search_test.dart
@@ -164,7 +164,7 @@ void main() {
app.adoptSessionForTest(terminal('a69', []));
app.newSwarm();
await mount(tester, app);
- if (!inline) await chord(tester, LogicalKeyboardKey.keyP);
+ if (!inline) await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(
ValueKey(inline ? 'harness-start-search' : 'swarm-search-input'),
);
diff --git a/desktop/test/swarm_entry_picker_test.dart b/desktop/test/swarm_entry_picker_test.dart
index a7b5af9b9..b7493fe2f 100644
--- a/desktop/test/swarm_entry_picker_test.dart
+++ b/desktop/test/swarm_entry_picker_test.dart
@@ -27,8 +27,8 @@ void main() {
tester.widget<TextField>(_startInput).focusNode!.requestFocus();
}
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
- expect(tester.widget<TextField>(_input).controller!.text, '> ');
+ await chord(tester, LogicalKeyboardKey.keyP);
+ expect(tester.widget<TextField>(_input).controller!.text, '>');
expect(
find.textContaining('run command', findRichText: true),
findsOneWidget,
@@ -226,7 +226,7 @@ void main() {
(tester) async {
final app = createApp();
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(_input, 'Agent 12');
await tester.pump();
final text = tester.widget<TextField>(_input).controller!;
@@ -247,8 +247,8 @@ void main() {
expect(_results, findsNothing);
expect(_startInput, findsOneWidget);
expect(tester.widget<TextField>(_startInput).focusNode!.hasFocus, isTrue);
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
- expect(tester.widget<TextField>(_input).controller!.text, '> ');
+ await chord(tester, LogicalKeyboardKey.keyP);
+ expect(tester.widget<TextField>(_input).controller!.text, '>');
expect(
tester.widget<TextField>(_input).decoration!.hintText,
'Search commands…',
@@ -269,7 +269,7 @@ void main() {
app.newSwarm();
final destination = app.activeSwarmId;
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(_input, 'Agent 0');
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
diff --git a/desktop/test/swarm_interactions_test.dart b/desktop/test/swarm_interactions_test.dart
index e52212555..a081d3f2c 100644
--- a/desktop/test/swarm_interactions_test.dart
+++ b/desktop/test/swarm_interactions_test.dart
@@ -118,7 +118,7 @@ void main() {
() => chord(tester, LogicalKeyboardKey.keyT),
newFromChrome,
() async {
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> New Tab',
@@ -181,7 +181,7 @@ void main() {
(tester) async {
final app = createApp();
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
expect(app.panes, isEmpty);
await tester.enterText(
diff --git a/desktop/test/swarm_picker_activation_test.dart b/desktop/test/swarm_picker_activation_test.dart
index d9e731529..fc069d3c2 100644
--- a/desktop/test/swarm_picker_activation_test.dart
+++ b/desktop/test/swarm_picker_activation_test.dart
@@ -16,7 +16,7 @@ void main() {
final input = <TerminalBinaryFrame>[];
final pane = app.adoptSessionForTest(terminal('a0', input));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
final results = find.byKey(const ValueKey('swarm-search-results'));
expect(field, findsOneWidget);
@@ -56,7 +56,7 @@ void main() {
app.newSwarm();
final target = app.activeSwarm;
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Agent 0');
await tester.pump();
diff --git a/desktop/test/swarm_resize_test.dart b/desktop/test/swarm_resize_test.dart
index ff209cf24..412cd1b1e 100644
--- a/desktop/test/swarm_resize_test.dart
+++ b/desktop/test/swarm_resize_test.dart
@@ -120,7 +120,7 @@ void main() {
app.adoptSessionForTest(terminal('a1', frames));
await mountWide(tester, app);
final before = tester.getSize(find.byKey(left.cellKey)).width;
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> resize panes',
diff --git a/desktop/test/swarm_screen_test.dart b/desktop/test/swarm_screen_test.dart
index 40f4a06b5..e37e19319 100644
--- a/desktop/test/swarm_screen_test.dart
+++ b/desktop/test/swarm_screen_test.dart
@@ -508,7 +508,7 @@ void main() {
);
await mount(tester, app);
expect(find.text('Existing project'), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
@@ -551,7 +551,7 @@ void main() {
);
expect(find.text('Models'), findsNothing);
expect(find.text('Machines'), findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
@@ -567,7 +567,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 200));
final zoom = app.zoomedPaneId;
final before = tester.getSize(find.byType(PaneGrid));
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump(const Duration(milliseconds: 300));
expect(
find.byKey(const ValueKey('swarm-search-results')),
diff --git a/desktop/test/swarm_search_identity_test.dart b/desktop/test/swarm_search_identity_test.dart
index b4d597a6e..001ec8a49 100644
--- a/desktop/test/swarm_search_identity_test.dart
+++ b/desktop/test/swarm_search_identity_test.dart
@@ -343,7 +343,7 @@ void main() {
app.newSwarm();
final target = app.activeSwarm;
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final input = find.byKey(const ValueKey('swarm-search-input'));
expect(
tester.widget<TextField>(input).decoration!.hintText,
diff --git a/desktop/test/swarm_search_preview_test.dart b/desktop/test/swarm_search_preview_test.dart
index 11b4b6417..f8d5c087f 100644
--- a/desktop/test/swarm_search_preview_test.dart
+++ b/desktop/test/swarm_search_preview_test.dart
@@ -99,7 +99,7 @@ void main() {
await seedPreviews(app);
app.adoptSessionForTest(terminal('a69', []));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Workspace sync');
await tester.pump();
@@ -173,7 +173,7 @@ void main() {
if (inline) {
await tester.tap(field);
} else {
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
}
await tester.enterText(field, 'Checkout retries');
await tester.pump();
@@ -285,7 +285,7 @@ void main() {
if (inline) {
await tester.tap(field);
} else {
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
}
await tester.enterText(field, 'Checkout retries');
await tester.pump();
@@ -382,7 +382,7 @@ void main() {
);
app.adoptSessionForTest(terminal('a69', []));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'Checkout',
@@ -421,7 +421,7 @@ void main() {
await mount(tester, app);
tester.view.physicalSize = size;
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'Checkout',
diff --git a/desktop/test/swarm_search_render_test.dart b/desktop/test/swarm_search_render_test.dart
index 6c58360c0..7a2aa2296 100644
--- a/desktop/test/swarm_search_render_test.dart
+++ b/desktop/test/swarm_search_render_test.dart
@@ -59,7 +59,7 @@ void main() {
final target = app.activeSwarm;
await mount(tester, app);
final field = find.byKey(const ValueKey('swarm-search-input'));
- Future<void> open() => chord(tester, LogicalKeyboardKey.keyP);
+ Future<void> open() => chord(tester, LogicalKeyboardKey.keyO);
SwarmSearchKeys keys() => tester.widget<SwarmSearchKeys>(
find.ancestor(of: field, matching: find.byType(SwarmSearchKeys)),
);
@@ -143,7 +143,7 @@ void main() {
SwarmSearchInput inputWidget() => tester.widget<SwarmSearchInput>(
find.ancestor(of: field, matching: find.byType(SwarmSearchInput)),
);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.enterText(field, 'Agent 0');
await tester.pump();
final first = inputWidget().search!;
@@ -158,7 +158,7 @@ void main() {
await tester.pump();
session.terminal.write('Newest useful output.\r\n');
machine.projectReads = 0;
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
expect(tester.widget<TextField>(field).controller!.text, isEmpty);
await tester.enterText(field, 'Agent 0');
await tester.pump();
@@ -197,7 +197,10 @@ void main() {
if (element.widget is SwarmScreen) canvasBuilds++;
};
try {
- await chord(tester, LogicalKeyboardKey.keyP, shift: !add);
+ await chord(
+ tester,
+ add ? LogicalKeyboardKey.keyO : LogicalKeyboardKey.keyP,
+ );
expect(
tester
.widget<TextField>(
@@ -237,7 +240,7 @@ void main() {
final input = <TerminalBinaryFrame>[];
app.adoptSessionForTest(terminal('a69', input));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Agent');
await tester.pump(const Duration(milliseconds: 200));
@@ -285,7 +288,7 @@ void main() {
final input = <TerminalBinaryFrame>[];
app.adoptSessionForTest(terminal('a69', input));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Agent');
await tester.pump(const Duration(milliseconds: 200));
@@ -345,7 +348,7 @@ void main() {
),
),
);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Agent');
await tester.pump();
@@ -380,7 +383,7 @@ void main() {
final input = <TerminalBinaryFrame>[];
app.adoptSessionForTest(terminal('a69', input));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Agent');
await tester.pump();
@@ -417,7 +420,7 @@ void main() {
app.adoptSessionForTest(terminal('a69', input));
final target = app.activeSwarm;
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
final field = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(field, 'Agent');
await tester.pump();
diff --git a/desktop/test/swarm_search_test.dart b/desktop/test/swarm_search_test.dart
index 61c629134..1d634bc47 100644
--- a/desktop/test/swarm_search_test.dart
+++ b/desktop/test/swarm_search_test.dart
@@ -27,7 +27,7 @@ void main() {
await mount(tester, app);
final input = find.byKey(const ValueKey('swarm-search-input'));
expect(input, findsNothing);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
final originalController = tester.widget<TextField>(input).controller;
await tester.enterText(input, 'a query only');
@@ -312,7 +312,7 @@ void main() {
.take(3)
.toList();
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
await tester.enterText(jumpField, 'Test host');
await tester.pump();
@@ -342,7 +342,7 @@ void main() {
app.adoptSessionForTest(terminal('a1', secondInputs));
final target = app.activeSwarm;
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
await tester.enterText(jumpField, 'Agent 0');
await tester.pump();
@@ -385,7 +385,7 @@ void main() {
ValueKey(adding ? 'swarm-search-input' : 'harness-start-search'),
);
if (adding) {
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
await tester.pump();
} else {
await tester.tap(field);
diff --git a/desktop/test/swarm_split_test.dart b/desktop/test/swarm_split_test.dart
index e5d8da226..baccfb12c 100644
--- a/desktop/test/swarm_split_test.dart
+++ b/desktop/test/swarm_split_test.dart
@@ -239,7 +239,7 @@ void main() {
: LogicalKeyboardKey.keyD,
);
case 'palette':
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> split $direction',
@@ -635,7 +635,7 @@ void main() {
await mountWide(tester, app);
tester.view.physicalSize = const Size(3000, 1800);
await tester.pump();
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
await tester.enterText(
find.byKey(const ValueKey('swarm-search-input')),
'> split right',
diff --git a/desktop/test/swarm_switcher_test.dart b/desktop/test/swarm_switcher_test.dart
index 98b84fa5a..7980a7bfa 100644
--- a/desktop/test/swarm_switcher_test.dart
+++ b/desktop/test/swarm_switcher_test.dart
@@ -41,7 +41,7 @@ void main() {
harnessCommandById.containsKey('navigation.quick_open'),
isFalse,
);
- await chord(tester, LogicalKeyboardKey.keyP);
+ await chord(tester, LogicalKeyboardKey.keyO);
expect(jumpField, findsOneWidget);
expect(app.swarms, [original]);
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
@@ -93,7 +93,7 @@ void main() {
final frames = <TerminalBinaryFrame>[];
final pane = app.adoptSessionForTest(terminal('a0', frames));
await mount(tester, app);
- await chord(tester, LogicalKeyboardKey.keyP, shift: true);
+ await chord(tester, LogicalKeyboardKey.keyP);
final field = find.byKey(const ValueKey('swarm-search-input'));
for (final query in ['> ', '> Agent 0', '>', '> new']) {
await tester.enterText(field, query);
diff --git a/desktop/test/terminal_catalog_test.dart b/desktop/test/terminal_catalog_test.dart
index a584b7a02..77d64d3d9 100644
--- a/desktop/test/terminal_catalog_test.dart
+++ b/desktop/test/terminal_catalog_test.dart
@@ -21,7 +21,7 @@ void main() {
seedMixedAgents(app);
app.adoptSessionForTest(terminal('a0', []));
await mount(tester, app);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
final input = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(input, 'login');
await tester.pump();
@@ -101,7 +101,7 @@ void main() {
final input = find.byKey(const ValueKey('swarm-search-input'));
Future<void> command(String query) async {
- await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
await tester.enterText(input, '> $query');
await tester.pump();
await key(tester, LogicalKeyboardKey.enter);
@@ -171,7 +171,7 @@ void main() {
seedMixedAgents(app);
app.adoptSessionForTest(terminal('a0', []));
await mount(tester, app);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
await key(tester, LogicalKeyboardKey.slash, ctrl: true);
final input = find.byKey(const ValueKey('swarm-search-input'));
await tester.enterText(input, 'login');
diff --git a/desktop/test/terminal_ui_typography_test.dart b/desktop/test/terminal_ui_typography_test.dart
index 7d7907ee2..068892e62 100644
--- a/desktop/test/terminal_ui_typography_test.dart
+++ b/desktop/test/terminal_ui_typography_test.dart
@@ -255,7 +255,7 @@ void main() {
await key(tester, LogicalKeyboardKey.escape);
for (final shortcut in [
LogicalKeyboardKey.keyO,
- LogicalKeyboardKey.keyP,
+ LogicalKeyboardKey.keyO,
]) {
await key(tester, shortcut, cmd: true);
final input = find.byKey(const ValueKey('swarm-search-input'));
diff --git a/desktop/test/welcome_wallpaper_shortcuts_test.dart b/desktop/test/welcome_wallpaper_shortcuts_test.dart
new file mode 100644
index 000000000..779fcb020
--- /dev/null
+++ b/desktop/test/welcome_wallpaper_shortcuts_test.dart
@@ -0,0 +1,334 @@
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/core/local_key_value_store.dart';
+import 'package:harness/settings/appearance/wallpaper_section.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/shared/theme/appearance_prefs_store.dart';
+import 'package:harness/shared/theme/harness_background.dart';
+import 'package:harness/shortcuts/app_keymap.dart';
+import 'package:harness/shortcuts/keyboard_practice.dart';
+import 'package:harness/shortcuts/shortcuts_browser.dart';
+import 'package:harness/terminal/terminal_text.dart';
+import 'package:harness/widgets/shortcuts_sheet.dart';
+import 'package:harness/widgets/workspace_welcome.dart';
+import 'package:package_info_plus/package_info_plus.dart';
+import 'package:xterm/xterm.dart';
+
+import 'keymap_host_test.dart' show MemoryKeymap, key;
+import 'support/real_fonts.dart';
+
+class _Storage implements LocalKeyValueStore {
+ final values = <String, String>{};
+ @override
+ Future<String?> read(String key) async => values[key];
+ @override
+ Future<void> write(String key, String value) async => values[key] = value;
+ @override
+ Future<void> delete(String key) async => values.remove(key);
+}
+
+void main() {
+ final boundary = GlobalKey();
+ late TerminalStyle savedFont;
+ late AppearancePrefs savedAppearance;
+ late Brightness savedBrightness;
+
+ setUp(() {
+ savedBrightness = grid.AppTheme.brightness.value;
+ savedFont = terminalFontStore.value;
+ savedAppearance = appearancePrefsStore.value;
+ appearancePrefsStore.value = const AppearancePrefs();
+ PackageInfo.setMockInitialValues(
+ appName: 'Harness',
+ packageName: 'ai.autonomous.harness',
+ version: '1.1.25',
+ buildNumber: '25',
+ buildSignature: '',
+ );
+ });
+ tearDown(() {
+ grid.AppTheme.brightness.value = savedBrightness;
+ terminalFontStore.value = savedFont;
+ appearancePrefsStore.value = savedAppearance;
+ });
+
+ void font(double size) {
+ terminalFontStore.value = TerminalStyle(
+ fontSize: size,
+ fontFamily: 'Menlo',
+ fontFamilyFallback: const ['monospace'],
+ );
+ }
+
+ Future<void> mount(
+ WidgetTester tester,
+ Widget child, {
+ Size size = const Size(1280, 800),
+ Brightness brightness = Brightness.dark,
+ }) async {
+ tester.view.devicePixelRatio = 1;
+ tester.view.physicalSize = size;
+ addTearDown(tester.view.reset);
+ grid.AppTheme.brightness.value = brightness;
+ await tester.runAsync(() async {
+ if (Platform.isMacOS) {
+ final loader = FontLoader('Menlo');
+ final bytes = await File('/System/Library/Fonts/Menlo.ttc')
+ .readAsBytes();
+ loader.addFont(Future.value(ByteData.sublistView(bytes)));
+ await loader.load();
+ } else {
+ await loadRealFonts();
+ }
+ final icons = FontLoader('MaterialIcons');
+ icons.addFont(rootBundle.load('fonts/MaterialIcons-Regular.otf'));
+ await icons.load();
+ });
+ await tester.pumpWidget(
+ ListenableBuilder(
+ listenable: terminalFontStore,
+ builder: (context, _) => MaterialApp(
+ debugShowCheckedModeBanner: false,
+ themeAnimationDuration: Duration.zero,
+ theme: grid.buildAppTheme(brightness: brightness),
+ builder: (context, child) => grid.BrightnessScope(child: child!),
+ home: RepaintBoundary(key: boundary, child: child),
+ ),
+ ),
+ );
+ await tester.pumpAndSettle();
+ }
+
+ Future<void> capture(WidgetTester tester, String name) async {
+ final output = Platform.environment['HARNESS_REFINEMENT_CAPTURE_DIR'];
+ if (output == null) return;
+ await tester.runAsync(() async {
+ final image =
+ await (boundary.currentContext!.findRenderObject()
+ as RenderRepaintBoundary)
+ .toImage();
+ final data = await image.toByteData(format: ui.ImageByteFormat.png);
+ Directory(output).createSync(recursive: true);
+ File('$output/$name.png').writeAsBytesSync(data!.buffer.asUint8List());
+ image.dispose();
+ });
+ }
+
+ void expectUniformText(WidgetTester tester) {
+ void check(InlineSpan span, TextStyle parent) {
+ final style = parent.merge(span.style);
+ if (span is TextSpan) {
+ if (span.text?.trim().isNotEmpty == true &&
+ style.fontFamily != 'MaterialIcons') {
+ expect(style.fontSize, terminalFontStore.size, reason: span.text);
+ expect(
+ style.fontFamily,
+ terminalFontStore.value.fontFamily,
+ reason: span.text,
+ );
+ }
+ for (final child in span.children ?? <InlineSpan>[]) {
+ check(child, style);
+ }
+ }
+ }
+
+ for (final rich in tester.widgetList<RichText>(find.byType(RichText))) {
+ check(rich.text, const TextStyle());
+ }
+ for (final input in tester.widgetList<EditableText>(
+ find.byType(EditableText),
+ )) {
+ expect(input.style.fontSize, terminalFontStore.size);
+ expect(input.style.fontFamily, terminalFontStore.value.fontFamily);
+ }
+ expect(tester.takeException(), isNull);
+ }
+
+ testWidgets(
+ 'wallpapers keep a centered welcome and the selected terminal type',
+ (tester) async {
+ font(14);
+ final commands = <String>[];
+ await mount(tester, WorkspaceWelcome(onCommand: commands.add));
+ final text = find.byKey(const ValueKey('workspace-welcome-text'));
+ final textRect = tester.getRect(text);
+ expect(
+ tester
+ .widget<Material>(find.byKey(const ValueKey('workspace-welcome')))
+ .color,
+ grid.AppTheme.palette.value.workspace,
+ );
+ expect(find.byType(Image), findsNothing);
+ for (final choice in HarnessBackground.gallery) {
+ if (choice.asset != null) {
+ await tester.runAsync(
+ () => precacheImage(
+ ResizeImage(AssetImage(choice.asset!), width: 1920),
+ tester.element(text),
+ ),
+ );
+ }
+ appearancePrefsStore.value = appearancePrefsStore.value.copyWith(
+ background: choice,
+ );
+ await tester.pumpAndSettle();
+ expect(tester.getRect(text), textRect);
+ expectUniformText(tester);
+ if (choice.asset != null) {
+ expect(
+ tester.widget<RawImage>(find.byType(RawImage)).image,
+ isNotNull,
+ reason: choice.asset,
+ );
+ }
+ await capture(tester, 'welcome-${choice.name}');
+ }
+ await tester.tap(find.byKey(const ValueKey('welcome-customize')));
+ expect(commands, ['app.customize']);
+ font(22);
+ tester.view.physicalSize = const Size(960, 640);
+ await tester.pumpAndSettle();
+ expectUniformText(tester);
+ expect(tester.getCenter(text), const Offset(480, 320));
+ for (final choice in HarnessBackground.gallery.skip(1)) {
+ appearancePrefsStore.value = appearancePrefsStore.value.copyWith(
+ background: choice,
+ );
+ await tester.pumpAndSettle();
+ expect(tester.getCenter(text), const Offset(480, 320));
+ expectUniformText(tester);
+ await capture(tester, 'welcome-${choice.name}-large');
+ }
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+
+ testWidgets(
+ 'wallpaper gallery persists a choice and restores the blank default',
+ (tester) async {
+ final storage = _Storage();
+ final prefs = AppearancePrefsStore(storage: storage);
+ addTearDown(prefs.dispose);
+ font(22);
+ await mount(
+ tester,
+ Material(
+ child: SingleChildScrollView(
+ padding: const EdgeInsets.all(20),
+ child: WallpaperSection(store: prefs),
+ ),
+ ),
+ size: const Size(440, 850),
+ );
+ expect(prefs.value.background, HarnessBackground.plain);
+ for (final choice in HarnessBackground.gallery) {
+ final card = find.byKey(ValueKey('wallpaper-${choice.name}'));
+ await tester.ensureVisible(card);
+ await tester.tap(card);
+ await tester.pumpAndSettle();
+ expect(prefs.value.background, choice);
+ expect(tester.takeException(), isNull);
+ }
+ final restored = AppearancePrefsStore(storage: storage);
+ addTearDown(restored.dispose);
+ await restored.load();
+ expect(restored.value.background, HarnessBackground.terminalStars);
+ final blank = find.byKey(const ValueKey('wallpaper-plain'));
+ await tester.ensureVisible(blank);
+ await tester.tap(blank);
+ await tester.pumpAndSettle();
+ await restored.load();
+ expect(restored.value.background, HarnessBackground.plain);
+ await capture(tester, 'wallpaper-gallery');
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+
+ testWidgets(
+ 'shortcut browser searches live bindings and practices the selected row',
+ (tester) async {
+ final map = MemoryKeymap();
+ addTearDown(map.dispose);
+ font(14);
+ await mount(
+ tester,
+ KeymapProvider(
+ keymap: map,
+ child: const Material(child: ShortcutsBrowser(autofocus: true)),
+ ),
+ );
+ final search = find.byKey(const ValueKey('shortcuts-search'));
+ await capture(tester, 'shortcuts-dark');
+ expectUniformText(tester);
+ await tester.enterText(search, 'clone');
+ await tester.pump();
+ expect(find.text('Clone Harness'), findsOneWidget);
+ expect(find.text('New Tab'), findsNothing);
+ await tester.enterText(search, 'unknown shortcut');
+ await tester.pump();
+ expect(find.textContaining('No shortcuts found'), findsOneWidget);
+ map.apply(
+ '{"bindings":[{"keys":"cmd+t","command":null},{"keys":"cmd+y","command":"swarm.new"}]}',
+ );
+ await tester.enterText(search, 'cmd+y');
+ await tester.pump();
+ expect(find.text('New Tab'), findsOneWidget);
+ expect(find.text('Y'), findsOneWidget);
+ await key(tester, LogicalKeyboardKey.arrowDown);
+ await key(tester, LogicalKeyboardKey.enter);
+ await tester.pumpAndSettle();
+ expect(find.byType(KeyboardPractice), findsOneWidget);
+ await key(tester, LogicalKeyboardKey.keyY, cmd: true);
+ await tester.pumpAndSettle();
+ expect(find.text('[x] New Tab'), findsOneWidget);
+ await key(tester, LogicalKeyboardKey.escape);
+ await key(tester, LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expect(find.byType(KeyboardPractice), findsNothing);
+ expect(tester.widget<TextField>(search).focusNode!.hasFocus, isTrue);
+ await tester.enterText(search, '');
+ font(22);
+ tester.view.physicalSize = const Size(420, 740);
+ await tester.pumpAndSettle();
+ expectUniformText(tester);
+ await capture(tester, 'shortcuts-narrow-large');
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+
+ testWidgets('shortcut popup fits and closes with Escape', (tester) async {
+ font(14);
+ late BuildContext host;
+ await mount(
+ tester,
+ Builder(
+ builder: (context) {
+ host = context;
+ return const Material();
+ },
+ ),
+ brightness: Brightness.light,
+ );
+ showShortcutsSheet(host);
+ await tester.pumpAndSettle();
+ expect(find.byType(ShortcutsBrowser), findsOneWidget);
+ expectUniformText(tester);
+ // Dialog lives above the page's boundary; capture it directly when requested.
+ final output = Platform.environment['HARNESS_REFINEMENT_CAPTURE_DIR'];
+ if (output != null) {
+ await expectLater(
+ find.byType(MaterialApp),
+ matchesGoldenFile(Uri.file('$output/shortcuts-popup.png')),
+ );
+ }
+ await key(tester, LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expect(find.byType(Dialog), findsNothing);
+ });
+}
diff --git a/desktop/test/workspace_start_guide_test.dart b/desktop/test/workspace_start_guide_test.dart
index 2af0d2ea1..1861904c7 100644
--- a/desktop/test/workspace_start_guide_test.dart
+++ b/desktop/test/workspace_start_guide_test.dart
@@ -19,6 +19,8 @@ import 'package:harness/state/harness_placement.dart';
import 'package:harness/state/new_harness.dart';
import 'package:harness/state/pane_arrangement.dart';
import 'package:harness/widgets/new_harness_box.dart';
+import 'package:harness/widgets/harness_customize_pane.dart';
+import 'package:harness/settings/appearance/wallpaper_section.dart';
import 'package:harness/widgets/workspace_start_guide.dart';
import 'package:harness/widgets/workspace_welcome.dart';
import 'package:package_info_plus/package_info_plus.dart';
@@ -170,36 +172,39 @@ void main() {
await tester.pumpWidget(const SizedBox());
});
- testWidgets(
- 'Command-O and Command-P explicitly open the same existing-harness picker',
- (tester) async {
- final app = _FirstApp();
- addTearDown(app.dispose);
- app.machineStates['m']!.agents = [
- Agent(
- id: 'saved',
- engine: 'codex',
- name: 'Existing work',
- terminalAvailable: true,
- ),
- ];
- await _mount(tester, app);
- expect(find.byKey(const ValueKey('swarm-search-input')), findsNothing);
- await key(tester, LogicalKeyboardKey.keyO, cmd: true);
- expect(find.byType(NewHarnessBox), findsNothing);
- expect(find.byKey(const ValueKey('swarm-search-input')), findsOneWidget);
- expect(find.text('Existing work'), findsOneWidget);
- expect(find.byType(WorkspaceWelcome).hitTestable(), findsOneWidget);
- await key(tester, LogicalKeyboardKey.escape);
- app.notifyListeners();
- await tester.pump();
- expect(find.byKey(const ValueKey('swarm-search-input')), findsNothing);
- await key(tester, LogicalKeyboardKey.keyP, cmd: true);
- expect(find.byKey(const ValueKey('swarm-search-input')), findsOneWidget);
- expect(find.text('Existing work'), findsOneWidget);
- await tester.pumpWidget(const SizedBox());
- },
- );
+ testWidgets('Command-O opens harnesses and Command-P opens commands', (
+ tester,
+ ) async {
+ final app = _FirstApp();
+ addTearDown(app.dispose);
+ app.machineStates['m']!.agents = [
+ Agent(
+ id: 'saved',
+ engine: 'codex',
+ name: 'Existing work',
+ terminalAvailable: true,
+ ),
+ ];
+ await _mount(tester, app);
+ expect(find.byKey(const ValueKey('swarm-search-input')), findsNothing);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
+ expect(find.byType(NewHarnessBox), findsNothing);
+ expect(find.byKey(const ValueKey('swarm-search-input')), findsOneWidget);
+ expect(find.text('Existing work'), findsOneWidget);
+ expect(find.byType(WorkspaceWelcome), findsOneWidget);
+ await key(tester, LogicalKeyboardKey.escape);
+ app.notifyListeners();
+ await tester.pump();
+ expect(find.byKey(const ValueKey('swarm-search-input')), findsNothing);
+ await key(tester, LogicalKeyboardKey.keyP, cmd: true);
+ final input = tester.widget<TextField>(
+ find.byKey(const ValueKey('swarm-search-input')),
+ );
+ expect(input.controller!.text, '>');
+ expect(input.controller!.selection.baseOffset, 1);
+ expect(find.text('Existing work'), findsNothing);
+ await tester.pumpWidget(const SizedBox());
+ });
testWidgets('restored work keeps its focused pane', (tester) async {
final app = _FirstApp();
@@ -293,27 +298,31 @@ void main() {
find.byKey(const ValueKey('swarm-search-input')),
findsOneWidget,
);
- void expectGuideAboveDock(Finder dock) {
+ void expectGuideFixed(Finder dock) {
final drawing = tester.getRect(
find.byKey(const ValueKey('workspace-welcome-text')).last,
);
expect(drawing.top, greaterThanOrEqualTo(0));
- expect(drawing.bottom, lessThanOrEqualTo(tester.getTopLeft(dock).dy));
+ expect(
+ drawing.center,
+ tester.getRect(find.byType(WorkspaceWelcome).last).center,
+ );
+ expect(dock, findsOneWidget);
expect(tester.takeException(), isNull);
}
final searchDock = find.byKey(const ValueKey('swarm-search-results'));
- expectGuideAboveDock(searchDock);
+ expectGuideFixed(searchDock);
tester.view.physicalSize = const Size(960, 640);
await tester.pump();
- expectGuideAboveDock(searchDock);
+ expectGuideFixed(searchDock);
expect(tester.state<TerminalViewState>(view), same(renderer));
expect(app.launches, isEmpty);
await key(tester, LogicalKeyboardKey.keyN, cmd: true);
await tester.pump(const Duration(milliseconds: 150));
expect(find.byType(NewHarnessBox), findsOneWidget);
- expectGuideAboveDock(find.byKey(const ValueKey('new-harness-box')));
+ expectGuideFixed(find.byKey(const ValueKey('new-harness-box')));
await key(tester, LogicalKeyboardKey.escape);
await tester.pump();
await key(tester, LogicalKeyboardKey.keyW, cmd: true);
@@ -421,47 +430,61 @@ void main() {
},
);
- testWidgets(
- 'compact welcome stays centered in the visible area above each dock',
- (tester) async {
- final app = _FirstApp();
- addTearDown(app.dispose);
- app.machineStates['m']!.agents = [
- Agent(id: 'saved', name: 'Robot arm', engine: 'claude'),
- ];
- await _mount(tester, app);
- await key(tester, LogicalKeyboardKey.keyT, cmd: true);
- await tester.pumpAndSettle();
- final page = find.byType(WorkspaceWelcome).last;
- final tagline = find.byKey(const ValueKey('workspace-welcome-text')).last;
- void expectCentered() {
- expect(tester.getCenter(tagline), tester.getRect(page).center);
- expect(
- find.descendant(of: page, matching: find.byType(Image)),
- findsNothing,
- );
- }
+ testWidgets('welcome text and wallpaper stay fixed when either dock opens', (
+ tester,
+ ) async {
+ final app = _FirstApp();
+ addTearDown(app.dispose);
+ app.machineStates['m']!.agents = [
+ Agent(id: 'saved', name: 'Robot arm', engine: 'claude'),
+ ];
+ await _mount(tester, app);
+ await key(tester, LogicalKeyboardKey.keyT, cmd: true);
+ await tester.pumpAndSettle();
+ final page = find.byType(WorkspaceWelcome).last;
+ final tagline = find.byKey(const ValueKey('workspace-welcome-text')).last;
+ final textRect = tester.getRect(tagline);
+ final wallpaper = find.byKey(const ValueKey('welcome-wallpaper')).last;
+ final wallpaperRect = tester.getRect(wallpaper);
+ void expectCentered() {
+ expect(tester.getRect(tagline), textRect);
+ expect(tester.getRect(wallpaper), wallpaperRect);
+ expect(tester.getCenter(tagline), tester.getRect(page).center);
+ expect(
+ find.descendant(of: page, matching: find.byType(Image)),
+ findsNothing,
+ );
+ }
- expectCentered();
+ expectCentered();
- final search = find.byKey(const ValueKey('swarm-search-input'));
- expect(search, findsNothing);
- await key(tester, LogicalKeyboardKey.keyO, cmd: true);
- await tester.enterText(search, 'nothing matches');
- await tester.pumpAndSettle();
- expectCentered();
+ final search = find.byKey(const ValueKey('swarm-search-input'));
+ expect(search, findsNothing);
+ await key(tester, LogicalKeyboardKey.keyO, cmd: true);
+ await tester.enterText(search, 'nothing matches');
+ await tester.pumpAndSettle();
+ expectCentered();
- await key(tester, LogicalKeyboardKey.keyN, cmd: true);
- await tester.pumpAndSettle();
- expect(find.byType(NewHarnessBox), findsOneWidget);
- expectCentered();
- expect(
- tester.getRect(find.byType(NewHarnessBox)).top,
- greaterThan(tester.getRect(tagline).bottom),
- );
- await tester.pumpWidget(const SizedBox());
- },
- );
+ await key(tester, LogicalKeyboardKey.keyN, cmd: true);
+ await tester.pumpAndSettle();
+ expect(find.byType(NewHarnessBox), findsOneWidget);
+ expectCentered();
+ await key(tester, LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expectCentered();
+ await tester.tap(find.byKey(const ValueKey('welcome-customize')));
+ await tester.pumpAndSettle();
+ expect(find.byType(HarnessCustomizePane), findsOneWidget);
+ await tester.tap(find.byKey(const ValueKey('customize-appearance')));
+ await tester.pumpAndSettle();
+ expect(find.byType(WallpaperSection), findsOneWidget);
+ expectCentered();
+ await key(tester, LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expect(find.byType(HarnessCustomizePane), findsNothing);
+ expectCentered();
+ await tester.pumpWidget(const SizedBox());
+ });
final output = Platform.environment['GUIDE_RENDER_DIR'];
testWidgets('render first entry guide', skip: output == null, (tester) async {
diff --git a/desktop/tool/keymap_native_checks.swift b/desktop/tool/keymap_native_checks.swift
index 95b0e2f7e..fa3c2a6ea 100644
--- a/desktop/tool/keymap_native_checks.swift
+++ b/desktop/tool/keymap_native_checks.swift
@@ -27,7 +27,7 @@ for (key, command) in [
("cmd+up", "pane.focus_above"), ("cmd+right", "pane.focus_right"),
("cmd+s", "app.store"), ("cmd+shift+l", "pane.layout"),
("cmd+b", "task.route"), ("cmd+t", "swarm.new"),
- ("cmd+p", "agent.add"),
+ ("cmd+o", "agent.open"), ("cmd+p", "navigation.commands"),
("cmd+r", "pane.split_right"), ("cmd+d", "pane.split_down"),
("cmd+n", "agent.new"),
("cmd+h", "pane.focus_left"), ("cmd+j", "pane.focus_below"),
@@ -40,11 +40,13 @@ try checkKeymap(defaults.viewerOrchestratorCommand(stroke("cmd+p")) == nil,
"The pane picker chord is not mistaken for an orchestrator command")
try checkKeymap(defaults.viewerOrchestratorCommand(stroke("cmd+b")) == nil,
"The viewer bridge does not change single-agent routing")
-try checkKeymap(defaults.viewerOrchestratorCommand(stroke("cmd+shift+p")) == nil,
+try checkKeymap(defaults.viewerOrchestratorCommand(stroke("cmd+p")) == nil,
"The viewer bridge does not take the command palette chord")
for context in HarnessNativeKeymap.contexts {
- try checkKeymap(defaults.match([stroke("cmd+shift+n")], context: context).binding == nil,
- "Shift-Command-N is unbound by default in \(context)")
+ try checkKeymap(defaults.match([stroke("cmd+shift+p")], context: context).binding == nil,
+ "The former commands shortcut is unbound")
+ try checkKeymap(defaults.match([stroke("cmd+shift+n")], context: context).binding?.command == "agent.clone",
+ "Shift-Command-N clones the harness in \(context)")
for number in 1...9 {
try checkKeymap(defaults.match([stroke("cmd+\(number)")], context: context).binding?.command == "swarm.select_\(number)",
"Command-number selects the corresponding tab from \(context)")
diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swift
index 7289c9796..b4f8af563 100644
--- a/desktop/tool/swarm_titlebar_checks.swift
+++ b/desktop/tool/swarm_titlebar_checks.swift
@@ -510,8 +510,8 @@ private extension SwarmTitlebar {
"The main-menu dispatcher retains the actual Edit submenu and its targets")
try checkTitlebar(newSwarm.keyEquivalent == "t" && newSwarm.toolTip == nil,
"Native shortcuts display in the menu without duplicate hover hints")
- try checkTitlebar(addHarness.keyEquivalent == "p" && addHarness.keyEquivalentModifierMask == [.command],
- "The exported keymap keeps New Pane on Command-P")
+ try checkTitlebar(addHarness.keyEquivalent == "o" && addHarness.keyEquivalentModifierMask == [.command],
+ "The exported keymap keeps Open Harness on Command-O")
for (action, key) in [("splitRight", "r"), ("splitDown", "d")] {
let split = agent.items.first(where: { $0.representedObject as? String == action })!
try checkTitlebar(split.keyEquivalent == key && split.keyEquivalentModifierMask == [.command],
@@ -553,8 +553,9 @@ private extension SwarmTitlebar {
try checkTitlebar(strip.newButton.accessibilityLabel() == "New Tab", "The plus announces New Tab")
try checkTitlebar(main.defersToInput(event("n", 45, .command)) && main.defersToInput(event("t", 17, .command)),
"Command-N and Command-T reach creation and New Tab")
- try checkTitlebar(main.defersToInput(event("p", 35, .command)), "Command-P reaches New Pane")
- try checkTitlebar(main.defersToInput(event("p", 35, [.command, .shift])), "Command-Shift-P reaches command search")
+ try checkTitlebar(main.defersToInput(event("p", 35, .command)), "Command-P reaches commands")
+ try checkTitlebar(!main.defersToInput(event("p", 35, [.command, .shift])), "Command-Shift-P is unbound")
+ try checkTitlebar(main.defersToInput(event("o", 31, .command)), "Command-O reaches Open Harness")
flutterKeyContext = "picker"
syncMenuKeys()
try checkTitlebar(!main.performKeyEquivalent(with: event("\u{f701}", 125)), "Result arrows are owned by the shared picker")
@@ -681,11 +682,12 @@ private extension SwarmTitlebar {
try checkTitlebar(settings.title == "Settings…" && settings.representedObject as? String == "settings", "Settings stays in the application menu")
let agent = main.item(withTitle: "File")!.submenu!
let addHarness = agent.items.first(where: { $0.representedObject as? String == "addAgent" })!
- try checkTitlebar(addHarness.title == "New Pane…" && addHarness.keyEquivalent == "p" && addHarness.keyEquivalentModifierMask == [.command],
- "New Pane advertises Command-P")
+ try checkTitlebar(addHarness.title == "Open Harness…" && addHarness.keyEquivalent == "o" && addHarness.keyEquivalentModifierMask == [.command],
+ "Open Harness advertises Command-O")
try checkTitlebar(agent.items.contains { $0.title == "New Terminal" && $0.keyEquivalent == "t" && $0.keyEquivalentModifierMask == [.command, .shift] && $0.representedObject as? String == "newTerminal" },
"New Terminal has its Command-Shift-T menu action")
let historyMenu = main.item(withTitle: "History")!.submenu!
+ try checkTitlebar(agent.items.contains { $0.title == "Clone Harness" && $0.representedObject as? String == "cloneAgent" }, "Clone Harness preserves its action")
try checkTitlebar(agent.items.map { $0.isSeparatorItem ? "separator" : ($0.representedObject as? String ?? "") } == ["new", "addAgent", "newTerminal", "cloneAgent", "renameActive", "closeActive", "separator", "splitRight", "splitDown", "zoomPane", "closePane"], "File groups tab, terminal and pane actions")
for (action, title, key) in [("splitRight", "Split Right…", "r"), ("splitDown", "Split Down…", "d")] {
let split = agent.items.first(where: { $0.representedObject as? String == action })!
@@ -704,7 +706,7 @@ private extension SwarmTitlebar {
try checkTitlebar(agent.items.contains { $0.title == "Rename Tab…" && $0.representedObject as? String == "renameActive" }, "Rename Tab preserves its command")
try checkTitlebar(agent.items.contains { $0.title == "Close Tab" && $0.representedObject as? String == "closeActive" }, "Close Tab preserves its command")
let commands = edit.submenu!.items.first(where: { $0.representedObject as? String == "commands" })!
- try checkTitlebar(commands.keyEquivalent == "p" && commands.keyEquivalentModifierMask == [.command, .shift], "Command search keeps its native menu owner")
+ try checkTitlebar(commands.keyEquivalent == "p" && commands.keyEquivalentModifierMask == [.command], "Command search keeps its native menu owner")
try checkTitlebar(edit.submenu!.items.allSatisfy { $0.representedObject as? String != "jump" }, "Edit has no Navigate action")
try checkTitlebar(agent.items.first?.title == "New Tab" && agent.items.first?.keyEquivalent == "t", "New Tab opens the chooser with Command-T")
let reopen = historyMenu.items.first(where: { $0.representedObject as? String == "reopen" })!
diff --git a/docs/keyboard.md b/docs/keyboard.md
index 078dfd344..24276107c 100644
--- a/docs/keyboard.md
+++ b/docs/keyboard.md
@@ -7,15 +7,14 @@ The defaults, in the workspace:
| Keys | Action |
|---|---|
| ⌘T | New Tab — opens the same quiet welcome page shown at startup. Use ⌘N to create a harness, ⌘O to open one, or ⌘S for the store |
-| ⌘O | Open Harness — the same picker and placement as ⌘P; opens in the current tab, or focuses its pane if already here |
-| ⌘P | New Pane — the same picker, adding to the current tab and automatically tiling its panes. Search by harness name, project, machine, or session content. Selecting a harness already here focuses its pane |
+| ⌘O | Open Harness — search by harness name, project, machine, or session content. Opens in the current tab and tiles its panes, or focuses the harness if already here |
+| ⌘P | Search commands — opens the picker with `>` ready for an action name; includes the orchestrator, directional splits, and settings |
| ⌘R / ⌘D | Split right / down — open the New Pane picker with the requested direction, then choose an existing harness or create one |
| ⌘N | New Harness directly — the box opens on the task: type what it should do and press Return, and it starts as another of the pane you were in (labeled agent, machine, project, and mode defaults stay visible above `task >`). Tab and ⇧Tab step out to those answers; each is a list you filter by typing, with a ✓ on the current one. One verb per field: in a list Return **chooses** and comes back to the task, on the task Return **makes it**, and ⌘↵ makes it from anywhere with the highlighted row. In the project field a word names a new project, `owner/repo` clones it, a path completes the way zsh's does (Tab: common prefix, then walk the candidates, ⇧Tab back; `/` goes in) and Browse… opens the folder chooser. ⌥↵ breaks the line in the task; ⌥1–⌥9 pick a row; ⌘. opens the full form. Escape keeps what you typed for the next ⌘N |
-| ⇧⌘P | Command palette — a `:` prompt with an empty input; includes the orchestrator, directional splits, and settings. Recent commands appear first; typing `usage` opens Settings ▸ Usage |
| ⌘B | Boss mode: describe a task, it picks the agent |
| ⌘W · ⇧⌘R | Close tab · rename tab |
| ⇧⌘T | New terminal in the current project |
-| ⇧⌘N | Clone Agent — another agent like the focused pane's (same machine, project, harness, Codex profile, permission mode, named agent) with a fresh conversation. No dialog; fork minus the context |
+| ⇧⌘N | Clone Harness — another harness like the focused pane's (same machine, project, harness, Codex profile, permission mode, named agent) with a fresh conversation. No dialog; fork minus the context |
| ⌘1 … ⌘9 | Select tab by position |
| ⇧⌘] · ⇧⌘[ · ⌃Tab · ⌃⇧Tab | Next · previous tab |
| ⌘] · ⌘[ · ⌘Y | Forward · back through visited agents · full history |
@@ -43,6 +42,8 @@ JSONC: `{ "version": 1, "bindings": [{ "keys": "cmd+k cmd+l", "command": "pane.f
"when": "workspace" }] }`. Sequences are one to four strokes; `"command": null` unbinds a key or a
whole prefix; `when` is `workspace`, `terminal` or `picker`. The file is watched and reloaded on save;
a bad edit keeps the last good keymap and says what was wrong. **Keyboard shortcuts (⌘/)** lists the
-effective bindings and **Open keyboard config** writes a commented template with every command id.
+effective bindings in searchable groups. Select a row and press Return to practice it without
+executing the action. The popup follows Customize Harness ▸ Terminal for its font and size.
+**Edit keyboard shortcuts** opens a commented config template with every command id.
In both modes of the box the line is a readline: ⌃A ⌃E ⌃F ⌃B and ⌥←/→ move, ⌃W kills a word (stopping at `/`), ⌃U kills to the start, ⌃H and ⌃D delete a character each way, ⌃Y puts the last kill back. ⌃N/⌃J and ⌃P/⌃K move the highlight — ⌃K is "previous", as in fzf, not kill-line — ⌃M is Return and ⌃[ or ⌃G is Escape. Every entry of the box's bottom line is also a button.