Skip to content

feat(tui): add open menu for sessions and projects - #39752

Merged
kitlangton merged 4 commits into
v2from
v2-open-menu
Jul 31, 2026
Merged

feat(tui): add open menu for sessions and projects#39752
kitlangton merged 4 commits into
v2from
v2-open-menu

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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-only DialogProject. 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.

Open
> 

Sessions
  merman flowchart bug      merman · 3h
  effect atom docs          effect · 1d

Projects
  life-hub    ~/code/open-source/life-hub
  dotfiles    ~/.dotfiles

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 DialogProject had).

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 toggledialog-session-list.tsx swaps the createSignal(false) for a useStorage() store (session-list.json), so ctrl+a state survives reopen and restart.
  • feat(tui): add open menu for sessions and projects
    • New packages/tui/src/component/dialog-open.tsx: renders instantly from the local store; one background session.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: new open_menu binding, default ctrl+o, mapped to command open.menu; open.menu added to appGlobalBindingCommands so the binding registers (palette commands are bind: false by default).
    • app.tsx: open.menu command (slash /open, aliases /projects, /project) replaces project.switch; dialog-project.tsx is deleted — the projects tier is a strict superset of it.
  • feat(tui): free ctrl+o for the open menu by removing tab history navigation
    • Removes the session.tab.history.back/forward commands and the session_tab_history_back (ctrl+o) / session_tab_history_forward (ctrl+i) keybinds, plus the now-unused public history() on the tabs context.
    • The internal tab history stays: closing a tab still returns to the previously viewed one.
    • Note: configs that override the two removed keybind names will now fail keybind validation ("Unrecognized keybind"), and ctrl+i is freed.

Scope

  • No tabs tier in the empty state by design: tabs are visible in the strip already; the menu shows what you can't see.
  • Session management (delete/rename/pin) stays in the session list; Enter is the only verb here.

Testing

  • bun typecheck in packages/tui — clean.
  • bun run test in packages/tui — 573 pass, 5 skip, 0 fail (tab-history keybind assertions removed with the feature).
  • End-to-end via opencode-drive against this branch: ctrl+o opens 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).

@kitlangton
kitlangton marked this pull request as ready for review July 30, 2026 23:57
@kitlangton
kitlangton merged commit 146fdb9 into v2 Jul 31, 2026
8 of 9 checks passed
@kitlangton
kitlangton deleted the v2-open-menu branch July 31, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant