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.

Make New swarm ready to type without covering its choices

dee72355d91e709
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index 271786762..b139fa372 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -75,7 +75,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
OverlayEntry? _searchOverlay;
FocusNode? _searchReturnFocus;
double _nativeSearchWidth = 600;
- String? _searchFieldState;
+ ({String query, String hint})? _nativeSearchFieldState;
bool _nativeQueryChange = false;
bool _spokenPaletteOpen = false;
bool _dialogOpen = false;
@@ -668,21 +668,25 @@ class _SwarmScreenState extends State<SwarmScreen> {
void _syncSearch() {
final search = _search;
if (search == null) return;
- if (_searchText.text != search.query) {
+ if (!_native && _searchText.text != search.query) {
_searchText.value = TextEditingValue(
text: search.query,
selection: TextSelection.collapsed(offset: search.query.length),
);
}
- final state = {'query': search.query, 'hint': search.hint};
- final encoded = jsonEncode(state);
- if (_searchFieldState != encoded) {
- _searchFieldState = encoded;
- if (_native) {
+ if (_native) {
+ final state = (query: search.query, hint: search.hint);
+ final updateQuery =
+ !_nativeQueryChange && state.query != _nativeSearchFieldState?.query;
+ final updateHint = state.hint != _nativeSearchFieldState?.hint;
+ // Remember native edits even when no message is needed. A later catalog
+ // refresh must not echo this query over a newer edit or marked text.
+ _nativeSearchFieldState = state;
+ if (updateQuery || updateHint) {
unawaited(
_channel.invokeMethod<void>('searchState', {
- if (!_nativeQueryChange) 'query': search.query,
- 'hint': search.hint,
+ if (updateQuery) 'query': state.query,
+ 'hint': state.hint,
}),
);
}
@@ -705,7 +709,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
_search!.removeListener(_syncSearch);
_search!.dispose();
_search = null;
- _searchFieldState = null;
+ _nativeSearchFieldState = null;
_searchText.clear();
_searchFocus.unfocus();
if (_native) unawaited(_channel.invokeMethod<void>('closeSearch'));
@@ -1088,7 +1092,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
onPending: (keys) => setState(() => _pendingKeys = keys),
child: Focus(
focusNode: _shellFocus,
- autofocus: true,
+ autofocus: app.panes.isNotEmpty,
child: Scaffold(
backgroundColor: grid.AppPalette.swarmField,
body: Column(
diff --git a/desktop/lib/state/swarm_navigation.dart b/desktop/lib/state/swarm_navigation.dart
index 7b9eb3b77..5808bb369 100644
--- a/desktop/lib/state/swarm_navigation.dart
+++ b/desktop/lib/state/swarm_navigation.dart
@@ -228,7 +228,7 @@ class SwarmSearchCatalog {
title: machine.machine.displayName,
detail: [
'Machine',
- '${members.length} agents',
+ _agentCountLabel(members),
if (machine.needsLink)
'Link required'
else if (machine.nodeOnline == false)
@@ -254,7 +254,7 @@ class SwarmSearchCatalog {
id: 'project:${group.id}',
projectId: group.id,
title: group.name,
- detail: 'Project · ${members.length} agents',
+ detail: 'Project · ${_agentCountLabel(members)}',
swarmId: null,
current: false,
members: Set.unmodifiable(members),
diff --git a/desktop/lib/widgets/swarm_inline_search.dart b/desktop/lib/widgets/swarm_inline_search.dart
index dcf5151e1..e7d2da53b 100644
--- a/desktop/lib/widgets/swarm_inline_search.dart
+++ b/desktop/lib/widgets/swarm_inline_search.dart
@@ -48,11 +48,9 @@ class _SwarmInlineSearchState extends State<SwarmInlineSearch> {
}
void _focusChanged() {
- if (_focus.hasFocus) {
- _begin();
- } else {
- _close();
- }
+ // New swarm gives the field its caret immediately, but the welcome
+ // choices stay visible until a click, edit or result-navigation key.
+ if (!_focus.hasFocus) _close();
}
@override
@@ -88,7 +86,6 @@ class _SwarmInlineSearchState extends State<SwarmInlineSearch> {
_search!.removeListener(_changed);
_search!.dispose();
_search = null;
- _focus.unfocus();
setState(() {});
}
@@ -172,6 +169,7 @@ class _SwarmInlineSearchState extends State<SwarmInlineSearch> {
editing: _text,
onChoose: _choose,
onClose: _close,
+ onOpen: _begin,
child: TextField(
key: const ValueKey('swarm-welcome-search-input'),
groupId: _tapGroup,
diff --git a/desktop/lib/widgets/swarm_switcher.dart b/desktop/lib/widgets/swarm_switcher.dart
index 2b159fda9..abd8ddeda 100644
--- a/desktop/lib/widgets/swarm_switcher.dart
+++ b/desktop/lib/widgets/swarm_switcher.dart
@@ -113,12 +113,17 @@ class SwarmSearchKeys extends StatelessWidget {
required this.editing,
required this.onChoose,
required this.onClose,
+ this.onOpen,
required this.child,
});
final SwarmSearchController? search;
final TextEditingController editing;
final ValueChanged<SwarmSearchSelection> onChoose;
final VoidCallback onClose;
+
+ /// A focused field may be ready for typing while its suggestions are closed.
+ /// The first navigation/accept key reveals them without choosing unseen work.
+ final VoidCallback? onOpen;
final Widget child;
@override
@@ -131,28 +136,43 @@ class SwarmSearchKeys extends StatelessWidget {
}
void choose(bool add) => run(() {
- final choice = add ? search?.addHere() : search?.submit();
+ if (search == null) {
+ onOpen?.call();
+ return;
+ }
+ final choice = add ? search.addHere() : search.submit();
if (choice != null) onChoose(choice);
});
+ void move(int delta) => run(() {
+ if (search == null) {
+ onOpen?.call();
+ } else {
+ search.move(delta);
+ }
+ });
if (KeymapTheme.of(context) != null) {
return KeymapRegion(
contextKind: KeymapContext.picker,
composing: composing,
actions: {
- if (search != null) ...{
+ if (search != null || onOpen != null) ...{
'picker.accept': () => choose(false),
'picker.add_here': () => choose(true),
- 'picker.next': () => search.move(1),
- 'picker.previous': () => search.move(-1),
- 'picker.preview': search.togglePreview,
+ 'picker.next': () => move(1),
+ 'picker.previous': () => move(-1),
+ if (search != null) 'picker.preview': search.togglePreview,
'picker.cancel': onClose,
- if (search.history == null)
+ if (search?.history == null)
'navigation.commands': () {
editing.value = const TextEditingValue(
text: '> ',
selection: TextSelection.collapsed(offset: 2),
);
- search.setQuery('> ');
+ if (search == null) {
+ onOpen?.call();
+ } else {
+ search.setQuery('> ');
+ }
},
},
},
@@ -160,7 +180,7 @@ class SwarmSearchKeys extends StatelessWidget {
);
}
return CallbackShortcuts(
- bindings: search == null
+ bindings: search == null && onOpen == null
? {}
: {
const SingleActivator(
@@ -186,35 +206,35 @@ class SwarmSearchKeys extends StatelessWidget {
): () =>
choose(true),
const SingleActivator(LogicalKeyboardKey.arrowDown): () =>
- run(() => search.move(1)),
- const SingleActivator(LogicalKeyboardKey.arrowUp): () =>
- run(() => search.move(-1)),
- const SingleActivator(
- LogicalKeyboardKey.keyI,
- meta: true,
- includeRepeats: false,
- ): () =>
- run(search.togglePreview),
+ move(1),
+ const SingleActivator(LogicalKeyboardKey.arrowUp): () => move(-1),
+ if (search != null)
+ const SingleActivator(
+ LogicalKeyboardKey.keyI,
+ meta: true,
+ includeRepeats: false,
+ ): () =>
+ run(search.togglePreview),
const SingleActivator(
LogicalKeyboardKey.keyN,
control: true,
): () =>
- run(() => search.move(1)),
+ move(1),
const SingleActivator(
LogicalKeyboardKey.keyP,
control: true,
): () =>
- run(() => search.move(-1)),
+ move(-1),
const SingleActivator(
LogicalKeyboardKey.keyJ,
control: true,
): () =>
- run(() => search.move(1)),
+ move(1),
const SingleActivator(
LogicalKeyboardKey.keyK,
control: true,
): () =>
- run(() => search.move(-1)),
+ move(-1),
const SingleActivator(LogicalKeyboardKey.escape): () =>
run(onClose),
const SingleActivator(
diff --git a/desktop/test/first_workspace_test.dart b/desktop/test/first_workspace_test.dart
index fd7752a07..591daca43 100644
--- a/desktop/test/first_workspace_test.dart
+++ b/desktop/test/first_workspace_test.dart
@@ -254,7 +254,22 @@ void main() {
expect(find.text('Machines'), findsNothing);
expect(find.text('Projects'), findsNothing);
expect(app.launches, isEmpty);
- await tester.tap(find.text('Choose folder…'));
+ expect(
+ tester
+ .widget<TextField>(
+ find.byKey(const ValueKey('swarm-welcome-search-input')),
+ )
+ .focusNode!
+ .hasPrimaryFocus,
+ isTrue,
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(
+ Focus.of(tester.element(find.text('Choose folder…'))).hasPrimaryFocus,
+ isTrue,
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pump();
final engine = tester.widget<AppSelectField<String>>(
find.byKey(const Key('new-agent-engine-field')),
diff --git a/desktop/test/keymap_runtime_test.dart b/desktop/test/keymap_runtime_test.dart
index 2f5606701..9682f4bfb 100644
--- a/desktop/test/keymap_runtime_test.dart
+++ b/desktop/test/keymap_runtime_test.dart
@@ -179,6 +179,149 @@ void main() {
);
}
+ testWidgets(
+ 'closed New swarm search honors remapped opening keys and command mode',
+ (tester) async {
+ final map = MemoryKeymap()
+ ..apply('''{"bindings":[
+ {"keys":"down","command":null,"when":"picker"},
+ {"keys":"enter","command":null,"when":"picker"},
+ {"keys":"ctrl+g","command":"picker.next","when":"picker"},
+ {"keys":"alt+enter","command":"picker.accept","when":"picker"},
+ {"keys":"cmd+d","command":"navigation.commands","when":"picker"}
+ ]}''');
+ final app = createApp();
+ await mount(tester, app, map);
+ final initialId = app.activeSwarmId;
+ final field = find.byKey(const ValueKey('swarm-welcome-search-input'));
+ expect(
+ tester.widget<TextField>(field).focusNode!.hasPrimaryFocus,
+ isTrue,
+ );
+ expect(find.byType(SwarmSearchResults), findsNothing);
+ await key(tester, LogicalKeyboardKey.arrowDown);
+ await key(tester, LogicalKeyboardKey.enter);
+ expect(find.byType(SwarmSearchResults), findsNothing);
+ await key(tester, LogicalKeyboardKey.keyG, ctrl: true);
+ expect(
+ tester
+ .widget<SwarmSearchResults>(find.byType(SwarmSearchResults))
+ .search
+ .cursor,
+ 0,
+ );
+ expect(app.activeSwarmId, initialId);
+ await key(tester, LogicalKeyboardKey.escape);
+ await key(tester, LogicalKeyboardKey.enter, alt: true);
+ expect(find.byType(SwarmSearchResults), findsOneWidget);
+ expect(app.activeSwarmId, initialId);
+ await key(tester, LogicalKeyboardKey.escape);
+ await key(tester, LogicalKeyboardKey.keyD, cmd: true);
+ final search = tester
+ .widget<SwarmSearchResults>(find.byType(SwarmSearchResults))
+ .search;
+ expect(search.isCommandMode, isTrue);
+ expect(tester.widget<TextField>(field).controller!.text, '> ');
+ expect(
+ tester
+ .widget<TextField>(find.byKey(const ValueKey('swarm-search-input')))
+ .controller!
+ .text,
+ isEmpty,
+ );
+ expect(app.panes, isEmpty);
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ map.dispose();
+ },
+ );
+
+ testWidgets(
+ 'native typing sends only changed hints and never echoes a query during refresh',
+ (tester) async {
+ final calls = <MethodCall>[];
+ tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
+ nativeChannel,
+ (call) async {
+ calls.add(call);
+ return null;
+ },
+ );
+ addTearDown(
+ () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
+ nativeChannel,
+ null,
+ ),
+ );
+ final map = MemoryKeymap();
+ final app = createApp();
+ await mount(tester, app, map, native: true);
+ await native(tester, 'keymapCommand', {
+ 'command': 'navigation.quick_open',
+ });
+ await tester.pump();
+ calls.clear();
+ for (final query in ['w', 'wo', 'wor', 'work', 'work 木']) {
+ await native(tester, 'searchChanged', {'query': query});
+ app.renameSwarm(app.activeSwarmId, 'Background $query');
+ }
+ await tester.pump();
+ expect(
+ calls.where((c) => c.method == 'searchState'),
+ isEmpty,
+ reason:
+ 'Typing and discovery do not need a reverse-channel field update',
+ );
+ for (final query in ['>', '> s', '> se', '> set']) {
+ await native(tester, 'searchChanged', {'query': query});
+ app.renameSwarm(app.activeSwarmId, 'Background $query');
+ }
+ map.apply(
+ '{"bindings":[{"keys":"down","command":null,"when":"picker"}]}',
+ );
+ await tester.pump();
+ expect(
+ calls
+ .where((c) => c.method == 'searchState')
+ .map((c) => c.arguments)
+ .toList(),
+ [
+ {'hint': 'Search commands…'},
+ ],
+ );
+ await native(tester, 'searchChanged', {'query': 'Agent'});
+ await tester.pump();
+ calls.clear();
+ await native(tester, 'keymapCommand', {'command': 'navigation.commands'});
+ await tester.pump();
+ expect(
+ calls
+ .where((c) => c.method == 'searchState')
+ .map((c) => c.arguments)
+ .toList(),
+ [
+ {'query': '> ', 'hint': 'Search commands…'},
+ ],
+ reason: 'Deliberate commands still update the native query and hint',
+ );
+ await native(tester, 'keymapCommand', {'command': 'picker.cancel'});
+ await tester.pump();
+ expect(find.byType(SwarmSearchResults), findsNothing);
+ expect(
+ tester
+ .widget<TextField>(
+ find.byKey(const ValueKey('swarm-welcome-search-input')),
+ )
+ .focusNode!
+ .hasPrimaryFocus,
+ isTrue,
+ );
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ map.dispose();
+ },
+ );
+
testWidgets(
'terminal IME composition keeps its keys before workspace dispatch',
(tester) async {
diff --git a/desktop/test/swarm_inline_search_test.dart b/desktop/test/swarm_inline_search_test.dart
index 7da6c6f8f..934c34509 100644
--- a/desktop/test/swarm_inline_search_test.dart
+++ b/desktop/test/swarm_inline_search_test.dart
@@ -15,6 +15,132 @@ final _input = find.byKey(const ValueKey('swarm-welcome-search-input'));
final _results = find.byKey(const ValueKey('swarm-welcome-search-results'));
void main() {
+ for (final native in [false, true]) {
+ testWidgets(
+ 'New swarm arrives ready to type without opening results (native=$native)',
+ (tester) async {
+ const channel = MethodChannel('harness/swarm_tabs');
+ final messages = <MethodCall>[];
+ tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
+ channel,
+ (call) async {
+ messages.add(call);
+ return true;
+ },
+ );
+ addTearDown(
+ () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
+ channel,
+ null,
+ ),
+ );
+ tester.view.devicePixelRatio = 1;
+ tester.view.physicalSize = const Size(1280, 800);
+ addTearDown(tester.view.resetPhysicalSize);
+ addTearDown(tester.view.resetDevicePixelRatio);
+ final app = createApp();
+ app.machineStates['m']!.nodeOnline = true;
+ final frames = <TerminalBinaryFrame>[];
+ final projects = SwarmProjectStore();
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: SwarmScreen(
+ notifier: app,
+ nativeTabs: native,
+ projectStore: projects,
+ ),
+ ),
+ );
+ await tester.pump();
+ void ready() {
+ expect(
+ _results,
+ findsNothing,
+ reason: 'Arriving must leave the welcome choices visible',
+ );
+ expect(
+ tester.widget<TextField>(_input).focusNode!.hasPrimaryFocus,
+ isTrue,
+ );
+ }
+
+ ready();
+ messages.clear();
+ tester.testTextInput.enterText('Agent 12');
+ await tester.pump();
+ expect(_results, findsOneWidget);
+ expect(find.widgetWithText(ListTile, 'Agent 12'), findsOneWidget);
+ final text = tester.widget<TextField>(_input).controller!;
+ final composing = text.value.copyWith(
+ selection: const TextSelection.collapsed(offset: 7),
+ composing: const TextRange(start: 6, end: 8),
+ );
+ text.value = composing;
+ app.renameSwarm(app.activeSwarmId, 'Updated in the background');
+ await tester.pump();
+ expect(text.value, composing);
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
+ expect(_results, findsOneWidget, reason: 'Composition owns Escape');
+ text.clearComposing();
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
+ ready();
+ expect(text.text, 'Agent 12');
+ tester.testTextInput.enterText('Agent 3');
+ await tester.pump();
+ expect(_results, findsOneWidget);
+ expect(find.widgetWithText(ListTile, 'Agent 3'), findsOneWidget);
+ expect(
+ messages.where(
+ (c) => c.method == 'searchState' || c.method == 'focusSearch',
+ ),
+ isEmpty,
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
+
+ app.adoptSessionForTest(terminal('a0', frames));
+ app.selectSwarm(app.activeSwarmId);
+ await tester.pump();
+ await tester.pump();
+ app.newSwarm();
+ await tester.pump();
+ await tester.pump();
+ ready();
+ final newId = app.activeSwarmId;
+ await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
+ await tester.pump();
+ expect(_results, findsOneWidget);
+ expect(
+ app.activeSwarmId,
+ newId,
+ reason: 'Opening suggestions cannot activate an unseen result',
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
+ ready();
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
+ await tester.pump();
+ expect(_results, findsOneWidget);
+ expect(app.activeSwarmId, newId);
+ await app.closeSwarm(app.activeSwarmId);
+ await tester.pump();
+ await app.closeSwarm(app.activeSwarmId);
+ await tester.pump();
+ await tester.pump();
+ ready();
+ expect(app.swarms, hasLength(1));
+ expect(frames, isEmpty);
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ projects.dispose();
+ expect(tester.takeException(), isNull);
+ },
+ );
+ }
+
testWidgets(
'New swarm keeps editing and results at the field that was clicked',
(tester) async {
diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swift
index 52dbd6a6d..238d9efdb 100644
--- a/desktop/tool/swarm_titlebar_checks.swift
+++ b/desktop/tool/swarm_titlebar_checks.swift
@@ -185,6 +185,21 @@ private extension SwarmTabStrip {
focusSearch(selectAll: true)
try checkTitlebar((searchField.currentEditor() as? NSTextView)?.selectedRange().length == ("feature/木" as NSString).length,
"Command-P selects the current query for replacement")
+ let fieldEditor = searchField.currentEditor() as! NSTextView
+ fieldEditor.setMarkedText("も", selectedRange: NSRange(location: 1, length: 0),
+ replacementRange: NSRange(location: 3, length: 0))
+ let draft = fieldEditor.string, marked = fieldEditor.markedRange(), caret = fieldEditor.selectedRange()
+ update(["enabled": true, "activeId": activeId,
+ "tabs": tabs.map { ["id": $0.swarmId, "name": $0.name, "attention": 1] as [String: Any] },
+ "palette": ["workspace": Int64(0xff252d43), "search": Int64(0xff262f46)]])
+ setSearchState(["hint": "Search agents…"])
+ focusSearch(selectAll: true)
+ try checkTitlebar(window.firstResponder === fieldEditor && fieldEditor.string == draft,
+ "Background attention and palette changes preserve the current search editor and draft")
+ try checkTitlebar(fieldEditor.markedRange() == marked && fieldEditor.selectedRange() == caret,
+ "Background updates and refocusing preserve marked text and its caret")
+ fieldEditor.unmarkText()
+ setSearchState(["query": "feature/木", "hint": "Search agents…"])
var cancelled = false
let originalEmit = emit
emit = { method, args in
diff --git a/docs/harness-v2-appearance-onboarding.md b/docs/harness-v2-appearance-onboarding.md
index 5a4c8b32a..5e68fb894 100644
--- a/docs/harness-v2-appearance-onboarding.md
+++ b/docs/harness-v2-appearance-onboarding.md
@@ -56,3 +56,11 @@ Validation: the new pending-launch regression failed before the fix and passed a
The next pass removes one intermediate click for a known empty local workspace. **Choose folder…** opens the native directory chooser directly. The ordinary form then shows that folder and prefers an installed coding agent. Availability probing runs while the user chooses, and the form reuses the same probe. Cmd-N and the returning-user New agent action keep their existing behavior. This is our adaptation of the folder-first flow, not a measured claim about user activation.
The chooser is opened only by deliberate activation. Duplicate activation, cancellation, changed target identity and offline/unlinked state are checked before showing its result. Sixty-five focused onboarding/profile/engine/split/search checks pass, including completion with no automatic agent input, keyboard-only ordinary creation, late availability, cancellation and stale-target cases. Isolated 880×560 welcome/form renders were reviewed. The native OS chooser itself was stubbed; live first-install and provider sign-in remain separate validation.
+
+## Arriving at New swarm
+
+A later full-screen probe found that first launch focused the shell, while arriving from a populated swarm automatically covered the welcome choices with suggestions. The inline field now receives focus on arrival with its popup closed. The user can type immediately, click for suggestions, or reveal them with the configured picker keys. Tab reaches the primary folder action in the first-workspace path. The first opening key reveals the choices without activating an unseen agent or swarm. Escape closes suggestions while preserving text and the caret; typing again reopens them in place.
+
+The [W3C combobox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) documents a collapsed default and several possible expansion triggers, including Down Arrow, focus and typing. Our choice is to keep the welcome useful while making search immediately available. This is a Harness interaction decision, not a claim of complete ARIA or native accessibility conformance. Keymap overrides, composition ownership, explicit command mode and both search locations retain their existing behavior.
+
+The full Flutter screen was rendered at 880×560 for fresh welcome, prefilled creation, New swarm after work and inline results. Regression checks cover first arrival, close-last-swarm, keyboard opening, retained query/selection/composition, native-search cancellation and the first folder action. The render uses Flutter's fallback titlebar; native field behavior is checked separately in a hidden AppKit window. Live first-install observation and native input-to-display timing remain unmeasured.
diff --git a/docs/harness-v2-performance.md b/docs/harness-v2-performance.md
index aadcd38b7..4e59fd825 100644
--- a/docs/harness-v2-performance.md
+++ b/docs/harness-v2-performance.md
@@ -10,6 +10,14 @@ flutter test --no-pub --reporter expanded test/benchmarks/swarm_benchmark.dart
It prints `SWARM_BENCH` JSON records. Its filename deliberately does not end in `_test.dart`, so ordinary correctness runs do not include timing measurements.
+## Native search field updates (2026-09-13)
+
+The production bridge was sending the same placeholder hint back to AppKit for every native query edit. A regression observed five reverse-channel `searchState` messages for the five-query burst `w`, `wo`, `wor`, `work`, `work 木`, including interleaved catalog updates. The revised bridge sends zero for that burst and one changed hint when entering command mode. It still sends an intentional query replacement when the user invokes Search commands.
+
+The bridge remembers the latest native query even when it sends nothing, so a later catalog refresh cannot echo that older query over a newer native edit or composition. A typed query/hint snapshot replaces JSON encoding on each edit. Native search also stops maintaining the unmounted Flutter text controller. Result filtering and rendering still occur as needed; this does not establish a measured latency reduction or eliminate the cost of opening the search catalog.
+
+The redundant-message check failed before the change (`/private/tmp/harness-v2-search-echo-before.log`). Final focused behavior/render checks passed (`/private/tmp/harness-v2-search-arrival-final-tests.log`); the hidden AppKit field separately preserved its editor, marked text and caret through attention/palette updates (`/private/tmp/harness-v2-search-arrival-native.log`). Real native input-to-display calibration remains paused as described below.
+
## Local Git context recovery (2026-09-13)
[Dart's filesystem watch documentation](https://api.dart.dev/dart-io/FileSystemEntity/watch.html) warns that events can coalesce or arrive out of order, and that watches end when their target disappears or the watcher stops. [Git's repository layout](https://git-scm.com/docs/gitrepository-layout) distinguishes the working tree's `.git` pointer, worktree-specific HEAD and shared configuration through `commondir`. The compatibility reader now observes those relationships and treats a subscription as fallible.
diff --git a/docs/harness-v2-progress.md b/docs/harness-v2-progress.md
index 580e119e4..5cd348259 100644
--- a/docs/harness-v2-progress.md
+++ b/docs/harness-v2-progress.md
@@ -2,6 +2,15 @@
Updated 2026-09-13 with coordinated palettes, Models, combined closed-work History and faster unified search. This is a working preview, not a release.
+## Search arrival and typing checkpoint
+
+- An isolated full-screen probe reproduced inconsistent arrival: initial launch focused the shell, while New swarm after work and close-last-swarm immediately opened suggestions over the welcome choices. All three now focus the inline field with results closed. Clicking, typing or a configured picker navigation/accept key opens results in place. The opening key never activates an unseen result. Escape keeps the query and caret; returning from the native search or a dialog does not reopen inline suggestions automatically.
+- The first-workspace path now verifies Tab from the focused field to **Choose folder…**, then Enter to open the existing folder flow. Closed-field navigation honors keymap overrides and command mode. Background changes preserve inline composition and selection. Native-field checks preserve its editor, marked range and caret during attention/palette changes and refocusing.
+- A reproduced native bridge regression sent five unchanged placeholder messages for five query edits. The same burst now sends none. A mode change sends its new hint; deliberate command navigation still changes the query. A small typed snapshot replaces per-edit JSON encoding, and native search no longer updates its unmounted Flutter text controller. This removes work, not a measured amount of input/display latency.
+- Visual review at 880×560 covered fresh welcome, the prefilled New agent form, New swarm after work and inline results. It also caught singular machine/project labels; they now reuse the swarm agent-count formatter. These images use the Flutter fallback titlebar, not a live native capture.
+- Validation: both arrival regressions and the redundant-message regression failed before their fixes. **48 focused Flutter tests plus the isolated render passed**; the final count-label reuse then passed nine search checks plus the rerender. **51 native decoder and 363 AppKit checks passed**. Analyzer has zero errors/warnings and the existing 12 vendored infos. Artifacts: `/private/tmp/harness-v2-search-arrival-{before,tests,final-tests,native,analyze,copy-render}.log`, `/private/tmp/harness-v2-search-echo-before.log`, and `/private/tmp/harness-v2-search-arrival-{welcome,form,new-swarm,search}.png`.
+- No real agent input, provider installation or foreground latency measurement was used. Release rebuild follows this checkpoint; public-origin push approval is still pending.
+
## Native tab interaction checkpoint
- A reproduced overflow regression let background name/status/palette updates snap the strip back to the active tab. The strip now preserves manual scrolling during those updates, reveals a newly selected tab, and keeps a previously visible active tab in view when the strip's geometry or order changes.