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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Use single-line rows for every resource in Cmd-P (#335)
Dee40a3fccf49e4
diff --git a/desktop/design/images/terminal-open-models.png b/desktop/design/images/terminal-open-models.pngnew file mode 100644index 000000000..a1c11b89bBinary files /dev/null and b/desktop/design/images/terminal-open-models.png differdiff --git a/desktop/design/terminal-dialogs.md b/desktop/design/terminal-dialogs.mdindex 696d821cf..a17d2b180 100644--- a/desktop/design/terminal-dialogs.md+++ b/desktop/design/terminal-dialogs.md@@ -63,8 +63,10 @@ when using custom row widgets.- Keep Cmd-O and Cmd-P search prefixes editable: Cmd-P opens an empty field andCmd-O inserts `#`. Deleting a prefix returns to harness search.Do not draw a separate prompt character beside these inputs.- Cmd-P session results occupy one row: title- on the left and activity age on the right. The preview puts the compact+- All Cmd-P results occupy one row: title+ on the left and activity age, when available, on the right. Machine, project,+ model, API connection, and Store details live in the preview. For sessions,+ the preview puts the compactStandard context `machine:project (branch)` directly below the session title,followed by status and harness type. Omit missing fields and preserveimportant state such as Offline.@@ -85,12 +87,15 @@ For example, Cmd-P session results are consecutive single lines:Search experience 1h```-The highlight covers the selected row. Machine, project, and branch metadata-remain searchable and available to screen readers. Resource choices with-descriptions keep two text lines followed by one blank row.+The highlight covers the selected row. All result types, including resource+creation entries, use consecutive single lines. Details remain searchable and+available to screen readers. Machine and project previews retain their name+and harness count even when they contain just one session.++## Inherit the real terminal's appearanceUse `terminalContentStyle()` for all dialog text: input, labels, values,diff --git a/desktop/lib/widgets/swarm_search_preview.dart b/desktop/lib/widgets/swarm_search_preview.dartindex 3ee6d79df..1c7dc86e9 100644--- a/desktop/lib/widgets/swarm_search_preview.dart+++ b/desktop/lib/widgets/swarm_search_preview.dart@@ -152,7 +152,7 @@ class _SwarmSearchPreviewState extends State<SwarmSearchPreview> {label: 'Agent preview',child: Scrollbar(controller: _scroll,- child: agents.length != 1+ child: row.isGroup || agents.length != 1? ListView.builder(key: ValueKey('preview-content:${row.id}'),controller: _scroll,diff --git a/desktop/lib/widgets/swarm_switcher.dart b/desktop/lib/widgets/swarm_switcher.dartindex 9720c64ec..89cb8b480 100644--- a/desktop/lib/widgets/swarm_switcher.dart+++ b/desktop/lib/widgets/swarm_switcher.dart@@ -665,9 +665,7 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {700 *scale.scale(grid.AppType.monoSize) /grid.AppType.monoSize;- final singleLine =- search.isCommandMode ||- (search.setupLayout && search.scopePrefix.isEmpty);+ final singleLine = search.isCommandMode || search.setupLayout;_rowHeight = swarmSearchRowHeight(scale,commands: search.isCommandMode,@@ -675,8 +673,8 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {stacked: stacked,);if (widget.bios) {- // Session context lives in the preview. Resource choices retain- // their description and one blank terminal row.+ // All Cmd-P types put context in the preview and use one row per+ // result. Other pickers retain their descriptions and spacing._rowHeight = cell.height * (singleLine ? 1 : 3);}final height = widget.fitRowsdiff --git a/desktop/test/resource_picker_test.dart b/desktop/test/resource_picker_test.dartindex ae375e6ad..e57045ff2 100644--- a/desktop/test/resource_picker_test.dart+++ b/desktop/test/resource_picker_test.dart@@ -20,6 +20,7 @@ import 'package:harness/terminal/terminal_theme.dart';import 'package:harness/terminal/terminal_theme_store.dart';import 'package:harness/widgets/swarm_resource_preview.dart';import 'package:harness/widgets/swarm_switcher.dart';+import 'package:harness/widgets/search_result_text.dart';import 'package:xterm/xterm.dart' show TerminalStyle;import 'keymap_host_test.dart' show MemoryKeymap, key;@@ -865,31 +866,99 @@ void main() {testWidgets('live store inventory updates and every resource renders', (tester,) async {+ final originalFont = terminalFontStore.value;+ final originalTheme = terminalThemeStore.value;+ addTearDown(() {+ terminalFontStore.value = originalFont;+ terminalThemeStore.value = originalTheme;+ });final app = await fixture();await mount(tester, app);await openHarnessPicker(tester);- for (final (query, kind) in [- ('Checkout', 'harnesses'),- ('@', 'machines'),- ('#', 'projects'),- (':', 'models'),- ('*', 'store'),- ]) {- await tester.enterText(field, query);- await tester.pump();- final controller = search(tester);- final index = controller.rows.indexWhere(- (row) => switch (kind) {- 'machines' => row.id == 'machine:m',- 'models' => row.modelId == 'model:local:qwen',- _ => !row.isCreate,- },- );- controller.move(index - controller.cursor);- await tester.pump(const Duration(milliseconds: 200));- expect(find.byType(SwarmResourcePreview), findsOneWidget);- expect(tester.takeException(), isNull);- await capture(tester, kind);+ for (final narrow in [false, true]) {+ if (narrow) {+ tester.view.physicalSize = const Size(480, 600);+ terminalFontStore.value = const TerminalStyle(+ fontSize: 18,+ fontFamily: 'Menlo',+ height: 1.4,+ );+ terminalThemeStore.value = TerminalThemeChoice.tango;+ }+ for (final (query, kind) in [+ ('Checkout', 'harnesses'),+ ('@', 'machines'),+ ('#', 'projects'),+ (':', 'models'),+ (':deepseek', 'api'),+ ('*', 'store'),+ ]) {+ await tester.enterText(field, query);+ await tester.pump();+ final controller = search(tester);+ final index = controller.rows.indexWhere(+ (row) => switch (kind) {+ 'machines' => row.id == 'machine:m',+ 'models' => row.modelId == 'model:local:qwen',+ _ => !row.isCreate,+ },+ );+ controller.move(index - controller.cursor);+ await tester.pump(const Duration(milliseconds: 200));+ final preview = find.byType(SwarmResourcePreview);+ expect(preview, findsOneWidget);+ expect(+ find.descendant(+ of: preview,+ matching: find.text(controller.selected!.title),+ ),+ findsWidgets,+ );+ final cell = terminalCellSizeOf(tester.element(field));+ final visibleRows = [+ for (final row in controller.rows)+ if (find.byKey(ValueKey(row.id)).evaluate().isNotEmpty) row,+ ];+ for (final row in visibleRows) {+ final result = find.byKey(ValueKey(row.id));+ expect(tester.getSize(result).height, closeTo(cell.height, .01));+ expect(+ tester+ .widgetList<SearchResultText>(+ find.descendant(+ of: result,+ matching: find.byType(SearchResultText),+ ),+ )+ .map((text) => text.text),+ row.isCreate ? isEmpty : [row.title],+ );+ }+ for (var i = 1; i < visibleRows.length; i++) {+ expect(+ tester.getTopLeft(find.byKey(ValueKey(visibleRows[i].id))).dy -+ tester+ .getTopLeft(find.byKey(ValueKey(visibleRows[i - 1].id)))+ .dy,+ closeTo(cell.height, .01),+ );+ }+ expect(tester.widget<TextField>(field).focusNode!.hasFocus, isTrue);+ expect(tester.takeException(), isNull);+ await capture(tester, '$kind-single-line${narrow ? '-narrow' : ''}');+ final createIndex = controller.rows.indexWhere((row) => row.isCreate);+ if (createIndex >= 0) {+ controller.move(createIndex - controller.cursor);+ await tester.pump();+ expect(+ find.descendant(+ of: preview,+ matching: find.text(controller.createDescription),+ ),+ findsOneWidget,+ );+ }+ }}app.machineStates['m']!.dsh.replace(const [DshEntry(id: 'excalidraw', name: 'Excalidraw', engine: 'codex'),@@ -909,4 +978,45 @@ void main() {await tester.pumpWidget(const SizedBox());app.dispose();});++ testWidgets(+ 'a single-session group keeps its name and count in the preview',+ (tester) async {+ final app = await fixture();+ final machine = app.machineStates['other']!;+ machine.agents = [app.machineStates['m']!.agents.first];+ await mount(tester, app);+ await openHarnessPicker(tester);+ for (final (query, name) in [+ ('@Other computer', 'Other computer'),+ ('#storefront', 'storefront'),+ ]) {+ // The project is only present on one machine in this case.+ if (query.startsWith('#')) {+ machine.agents = [];+ app.notifyListeners();+ }+ await tester.enterText(field, query);+ await tester.pumpAndSettle();+ final selected = search(tester).selected!;+ expect(selected.members, hasLength(1));+ final preview = find.byType(SwarmResourcePreview);+ expect(+ find.descendant(of: preview, matching: find.text(name)),+ findsOneWidget,+ );+ expect(+ find.descendant(of: preview, matching: find.text(selected.detail)),+ findsOneWidget,+ );+ expect(+ find.descendant(of: preview, matching: find.text('Checkout retries')),+ findsOneWidget,+ );+ expect(tester.takeException(), isNull);+ }+ await tester.pumpWidget(const SizedBox());+ app.dispose();+ },+ );}diff --git a/docs/keyboard.md b/docs/keyboard.mdindex da010450a..277afb279 100644--- a/docs/keyboard.md+++ b/docs/keyboard.md@@ -48,7 +48,7 @@ When a split needs more room, the workspace expands and scrolls to keep both panIn a picker: ↓ ⌃N ⌃J and ↑ ⌃P ⌃K move, and ⏎ opens. In the unified picker, Return opens the highlighted harness; a paused harness resumes and opens. Machines and projects open their session lists inside the picker. Model management opens the existing Model Manager terminal; API connections open the existing edit dialog. Cmd-Shift-P (Ctrl-Shift-P on Linux) searches named actions for the selected item. Commands name their target, and cancelling or completing an action returns to the same search. Filters and sorting are explicit commands. The preview has no action strip or keyboard footer. Existing remappable Ctrl-S lifecycle shortcuts remain available. Escape returns from a scoped list or closes the picker. ⌘⏎ accepts into the same requested destination. ⌃/ toggles the preview. Page Up/Down pages the result list; Shift-↑/↓ scrolls the preview by one line without leaving the search input. Cmd-P starts without a selected row and shows the resource type hints in the preview area. Typing selects the first match; arrows or Tab can select a row without typing. Enter does nothing until a row is selected.Cmd-P has no New Harness row; use Cmd-N to create a harness, including when no sessions match.-Session results use one line each, with the name and activity age. The preview shows the machine, project, and branch directly beneath the session name; these fields remain searchable.+All Cmd-P results use one line each, with the name and activity age when available. Machine, project, model, API connection, and Store details appear in the preview. For sessions, the preview shows the machine, project, and branch directly beneath the name; these fields remain searchable.The terminal keeps ⌘C, ⌘V, ⌘A, Esc, ⌥⏎ and ⌃C for itself. `pane.pin`, `pane.focus_1…9`,`pane.resize`, `pane.reset_sizes`, `machine.link` and a few others ship unbound and are in the palette.