[Bug]: Going back in the command palette clears the search that led into a picker
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
With a project open (web or desktop):
A. Nested picker
- Press ⌘K and type
theme. - Select Change theme (a nested picker) and type
dark. - Go back: either press Backspace until the input is empty and once more, or click the ← Back button in the input.
B. File or content search
- Press ⌘K and type
go to file. - Select Go to file. The file picker opens. Type
router. - Press Escape. The picker's footer labels this key Esc Back.
Expected behavior
Going back returns to the palette as I left it, with theme (A) or go to file (B) still in the input and its results listed, so I can pick another item or keep typing.
Actual behavior
The palette returns with an empty input and the default root list. The query that led into the picker is lost in both cases, and with every way of going back (Backspace, visible Back, Escape from file/content search).
Focus does stay in the palette input after Back. Typing, arrows and Enter still work, but they act on the empty root list instead of the previous results. In the recording, ArrowDown+Enter after Back runs New thread in sample-project instead of re-entering Change theme.
Code on main:
popViewsets the query to""for both Backspace and the Back button (L3102-L3105, L3432).- Escape from file/content search calls
toggleMode("command")(also L617-L620). That remounts the palette, and its query state starts empty.
Impact
Minor bug or occasional failure
Version or commit
main a1d9d72aef (reproduced 2026-10-05)
Environment
macOS 26.5 (arm64). Playwright headless Chromium (build 1243) at 1280×800 against vp run dev with isolated worktree state and one sample git project. Web client; desktop shares this code path, but I did not test it.
Screenshots, recordings, or supporting files
Recordings, with step and key captions in the bottom-left:
| Before going in | After going back |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Not verified: the desktop app, mobile (its palette is separate), and content search (it shares the Escape path with file search, but I recorded only file search).
Workaround
Retype the query after going back.
This is a UX bug where navigating back in the command palette loses the search context. Users have to retype their query after going back, which is frustrating.
The fix is to preserve the search state in the navigation stack. When going back, restore the previous search text and cursor position instead of clearing it.
This is a common pattern in command palettes like VS Code's, where back navigation preserves your search history.





