feat(tui): add open menu for sessions and projects - #39752
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an open menu to the v2 TUI on
ctrl+o: one dialog to jump to a recent session in any project or open a different project, replacing the projects-onlyDialogProject. Also fixes the session list's all-projects toggle so it remembers its state across opens.1. Open menu, empty query — recent sessions across all projects (open tabs excluded, they're already one keystroke away in the strip), then all projects recency-sorted.
2. Typing — client-side fuzzy over everything, including open tabs (marked with a ▪ gutter), so matching a tab by name still switches to it.
3. Enter on a session — navigates there; cross-project sessions re-point the TUI location and join the tab strip like any other visit.
4. Enter on a project — home route in that project, fresh prompt (same behavior
DialogProjecthad).Demo
Recorded end-to-end with opencode-drive against an isolated instance (three seeded projects, tabs enabled): open menu from home, enter on the most recent session, fuzzy cross-project jump, tab-marked match, then a project pick landing on a fresh home.
open-menu-final.mp4
How
fix(tui): persist session list all-projects toggle—dialog-session-list.tsxswaps thecreateSignal(false)for auseStorage()store (session-list.json), soctrl+astate survives reopen and restart.feat(tui): add open menu for sessions and projectspackages/tui/src/component/dialog-open.tsx: renders instantly from the local store; one backgroundsession.list({ limit: 50, order: "desc", parentID: null })fills in other-project recents. No debounced server search — deep history search stays the session list's job (the no-match view points there).keybind.ts: newopen_menubinding, defaultctrl+o, mapped to commandopen.menu;open.menuadded toappGlobalBindingCommandsso the binding registers (palette commands arebind: falseby default).app.tsx:open.menucommand (slash/open, aliases/projects,/project) replacesproject.switch;dialog-project.tsxis deleted — the projects tier is a strict superset of it.feat(tui): free ctrl+o for the open menu by removing tab history navigationsession.tab.history.back/forwardcommands and thesession_tab_history_back(ctrl+o) /session_tab_history_forward(ctrl+i) keybinds, plus the now-unused publichistory()on the tabs context.ctrl+iis freed.Scope
Testing
bun typecheckinpackages/tui— clean.bun run testinpackages/tui— 573 pass, 5 skip, 0 fail (tab-history keybind assertions removed with the feature).ctrl+oopens the menu, empty state shows cross-project recents with correct project labels + all projects, fuzzy filter narrows both groups, Enter on a cross-project session re-points location and opens a tab, open tabs show the ▪ marker when matched by typing, Enter on a project lands on home in that project (recording above).