Repository navigation
feat: navigate to sessions by ID from the command palette - #67779
Conversation
There was a problem hiding this comment.
Looks good to me. In the TUI, typing a session ID into the command palette showed 'No results found' on the base; with this PR it lists the session and Enter opens it (screenshots below). The util and TUI tests you added or changed pass, and typecheck:tsc is clean for packages/app and packages/tui. I didn't run the Desktop/Web side, only read it and type-checked it:
- The removed
filesOnly,onOpenFile,rootFileEntriesandcreateCommandPaletteFileOpenerhave no remaining callers. - The shell-level
command.paletteregistration still covers Home after Home's own registration is removed. - File search still appears inside sessions, because the dialog renders under the opener's context, where
FileContextis available.
Public API: unchanged. parseSessionID and the newly exported TUI/app contexts are internal.
One behaviour change worth a maintainer's nod: inside a session, the Desktop palette used to search only the current server's sessions. It now searches every online visible server, like Search sessions. With several servers connected, each search goes to all of them, and the recent-sessions list mixes servers. This seems intended by the description, so it isn't blocking.
No other concerns. The new tests wait on the rendered frame and route instead of sleeping, so they don't look flaky.
There was a problem hiding this comment.
The new commit looks right. Rows from another server now keep their server name whenever registry.tag() returns one, which also covers the case where the local server is offline and filtered out. Rows with no project text now show just the server name instead of · Remote. tag() already handles the single-server and current-server cases, so dropping the servers.length < 2 check doesn't add a label anywhere it shouldn't. I type-checked packages/app (clean) but didn't run Desktop or the e2e test. Public API: unchanged. No new concerns.


Issue for this PR
N/A
Type of change
What does this PR do?
Makes navigating to a session by its ID (e.g.
ses_dc99b02a4ffewLjRLvd2CpSsmror@session:ses_...) work consistently from the command palette in both Desktop/Web and the TUI, while removing duplicated palette and session-search plumbing:packages/app):createAllServerSessionEntriesinpackages/app/src/shell/commands/palette.tssoDialogCommandPaletteandDialogSessionSearchshare the same multi-server session search across all online visible servers (matching Inbox, Recent sessions, and Projects).HomeCommandPalette(packages/app/src/home/start/command-palette.tsx) and Home's duplicate palette registration inpackages/app/src/home/sessions/controller.tsx:DialogCommandPalettenow readsFileContextoptionally, including file search when mounted inside a session/draft and omitting it on Home/Settings.filesOnly,onOpenFile,rootFileEntries, andcreateCommandPaletteFileOpenercode frompalette.ts.session.idsynchronously against known sessions, skipped the 150ms search debounce for exact session IDs, and allowed exact archived session ID matches to surface dimmed.packages/tui):session.location) toCommandPaletteDialog(packages/tui/src/component/command-palette.tsx) andDialogSessionList(packages/tui/src/component/dialog-session-list.tsx).packages/util):parseSessionIDinpackages/util/src/session-mention.tsand reused it across Desktop/Web and TUI session pickers.No feature flag is needed: this aligns the command palette with existing Search sessions / Quick Open behavior and simplifies internal wiring.
How did you verify your code works?
packages/util:bun test ./src/session-mention.test.ts(9 pass) andbun run typecheck:tscpackages/app:bun run typecheck:tsc, browser unit tests (command-palette.test.ts,command-palette-search.test.ts,search-machine.test.ts— 15 pass), and built Playwright e2e (command-palette.spec.tscross-server ID test, 10/10 passes with--repeat-each=10 --workers=5 --retries=0)packages/tui:bun test --timeout 30000 ./test/cli/tui/command-palette.test.tsx ./test/cli/tui/dialog-session-list.test.tsx ./test/cli/tui/dialog-open.test.tsx(27 pass) andbun run typecheck:tscbun run lintandbun run lint:changed HEAD^1(0 problems)Screenshots / recordings
N/A
Checklist