Keep Cupertino web search editable across clear and revisit

This commit is contained in:
2026-11-06 18:36:53 +00:00
parent c1e0de352a
commit f398376e38
5 changed files with 265 additions and 1 deletions
@@ -5,3 +5,11 @@ Ctrl+/ opens the persistent Search tab and focuses its existing field. On the ac
Ctrl+1…9 and macOS Command+1…9 still choose conversation rows, in the visible list order. Pipelines and Runs no longer receive digit shortcuts. Ctrl+Tab and Ctrl+Shift+Tab no longer switch destinations; workspace pane navigation is handled separately. Extra Shift/Alt or combined Ctrl+Command modifiers pass through for both Search and digit selection. No socket or backend changes.
Checks: bounded analysis clean. 188 shell/Search tests passed through the memory watchdog (peak1713MB,14s). Tests cover exact modifiers on macOS/Windows, actual SearchScreen focus from a composer, repeat/revisit retaining query, Android-theme/macOS-host mismatch, chat-only digits, unchanged destination/history for removed chords, and normal Tab traversal. Browser interaction for the full split workspace is recorded by the parent integration task; this lane has no visual layout change.
## Cupertino web focus recovery
Real Mac Chrome raw-key captures found that the original native Cupertino search field accepted only the first character with accessibility semantics enabled: when its nested clear action appeared, the generated editable DOM node changed into a disabled child. The EditableText widget and FocusNode identities remained stable, so a widget-focus assertion alone missed the browser input failure. Generic outer semantics boundaries and an always-visible nested native suffix did not solve it.
The web Cupertino path now composes the native CupertinoSearchTextField without an inner suffix and a native sibling CupertinoButton for Clear, inside the same TextFieldTapRegion. Editable semantics stay enabled and keep their identity while the independent clear action appears. A standard Cupertino minimum interactive height keeps out-of-bar geometry constant across empty/text/clear. The helper owns a FocusNode only when the caller supplies none; native non-web Cupertino and Material paths are unchanged. Clear explicitly hands focus back after its button disappears. The Search shortcut likewise ends an old native edit after the bar is laid out, then focuses the mounted field on the following frame, guarded by active destination, mount, focus ownership and canRequestFocus. These handoffs happen only for explicit user actions; query updates never refocus or restart editing.
Final checks:191 shell/Search/shared-input tests passed (peak1512MB,18s), including stable enabled editable semantics, unchanged empty/text/clear geometry, externally supplied/internal FocusNode clear handling, and Cupertino shortcut focus/query retention. Bounded analysis is clean. Fresh full-app fixture build and real Chrome captures with no diagnostic probe code passed individual raw letter presses for `release`, Clear then raw `x`, revisit Chat then Command+/ preserving `x`, and raw `y`,`z` editing to `yz`. Native single-line select-all-on-focus behavior intentionally replaces the retained query when typing begins. All three final PNGs were inspected; kit-owned processes exited. Evidence: `/private/tmp/search-focus-native-final/{01-typed,02-clear-retyped,03-revisited}.png`, report.json. No capture `type` fallback/insertText was used for these acceptance assertions.