|
| 1 | +# Search return context |
| 2 | + |
| 3 | +Proposed cross-surface constraint: Back from a nested search picker restores the |
| 4 | +parent query and navigation context. Each nested scope owns its input. Clearing a |
| 5 | +child query must not silently clear its parent. This proposal is informed by |
| 6 | +Apple’s [Searching](https://developer.apple.com/design/human-interface-guidelines/searching) |
| 7 | +and [Navigation and search](https://developer.apple.com/design/human-interface-guidelines/navigation-and-search) |
| 8 | +guidance; it is not a claim of Apple certification or prior maintainer approval. |
| 9 | + |
| 10 | +For example, filter commands with `>new thread`, enter **New thread in…**, and |
| 11 | +filter the project picker. Back should restore `>new thread`, not an unfiltered |
| 12 | +command list. Further nested pickers restore one level at a time. Visible Back |
| 13 | +and Backspace on an empty child input have the same meaning. Removing a picker’s |
| 14 | +initial path prefix remains an existing way to leave that picker; it also |
| 15 | +restores the parent input. |
| 16 | + |
| 17 | +Return must leave a predictable keyboard target. Preserve the prior highlighted |
| 18 | +item where the component’s public API supports it; otherwise select the first |
| 19 | +enabled matching result. The web palette uses this fallback because its Base UI |
| 20 | +Autocomplete has no public API to restore a highlighted item. Do not reorder |
| 21 | +results or simulate keyboard events to recreate a highlight. Verify that Enter |
| 22 | +executes the visible highlighted result after returning. |
| 23 | + |
| 24 | +Closing and reopening is a fresh invocation. Direct requests to search linked |
| 25 | +threads, add a project, choose a project for a new thread, or change theme also |
| 26 | +start fresh and must not retain unrelated parent queries. Explicitly clearing |
| 27 | +input at the root is a reset, not Back. Network result completeness is a separate |
| 28 | +constraint. |
| 29 | + |
| 30 | +Web and Electron share the nested command picker. React Native’s palette closes |
| 31 | +before presenting its destination sheet, so it has no in-palette return path; |
| 32 | +reopening starts fresh there. Opening file or content search from a palette action creates a bounded parent |
| 33 | +context: Escape returns to that command query. Launching a mode directly by its |
| 34 | +shortcut starts fresh. Selecting a file or otherwise closing the overlay discards |
| 35 | +that return context and must not reopen the palette. Child input never replaces |
| 36 | +the parent query. |
| 37 | + |
| 38 | +Acceptance covers distinct parent and child queries, multiple levels of Back, |
| 39 | +path-prefix removal, an explicitly cleared root, fresh open, and direct-open |
| 40 | +replacement while already in a picker. Runtime verification must check both Back |
| 41 | +entry points, input focus, and the highlighted-result/Enter fallback with a |
| 42 | +nonempty result list. State-transition tests alone do not prove that keyboard |
| 43 | +behavior. |
0 commit comments