Skip to content

feat(tui): add temporary new session tab - #39735

Merged
kitlangton merged 2 commits into
v2from
new-session-tab
Jul 30, 2026
Merged

feat(tui): add temporary new session tab#39735
kitlangton merged 2 commits into
v2from
new-session-tab

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Represent the unsaved /new screen as a selected, temporary New session tab.

Closing that tab now restores the previously active session from selection history. If the user submits a prompt instead, the temporary tab disappears as the created session takes its place in the strip.

Before / After

Before

  1. Start on First task with Second task also open.
  2. Run leader+n; the TUI moves to Home, but no tab represents that screen.
  3. Run leader+w; because Home has no active tab, Close selects the last tab in strip order (Second task) rather than the previously active tab (First task).

After

1 First task  2 Second task
                          leader+n
1 First task  2 Second task  3 New session
                          leader+w
1 First task  2 Second task
^ restored

How

  • Derive a non-persisted New session display tab whenever the active route is Home.
  • Keep the placeholder outside the persisted session-tab collection and plugin tab API.
  • Render the placeholder as selected and inert except for Close.
  • Resolve Home-close through session selection history, falling back to strip order only when no open history entry remains.
  • Let the existing session-route effect replace the placeholder with the real session tab after creation.

Scope

This changes only the TUI session tab strip. It does not create a durable session before prompt submission or expose a synthetic session ID through the plugin API.

Testing

  • bun run test test/context/session-tabs.test.tsx test/context/session-tabs-model.test.ts in packages/tui: 26 passed
  • bun typecheck in packages/tui
  • Full repository typecheck through the pre-push hook: 33 tasks passed
  • Terminal Control end-to-end run against a hermetic V2 server with synthetic First task and Second task sessions

Demo

The recording shows leader+n opening the temporary tab and leader+w closing it back to the previously active tab.

new-session-tab.mp4

@kitlangton
kitlangton enabled auto-merge (squash) July 30, 2026 18:44
@kitlangton
kitlangton disabled auto-merge July 30, 2026 19:05
@kitlangton
kitlangton merged commit e1c04dc into v2 Jul 30, 2026
6 of 7 checks passed
@kitlangton
kitlangton deleted the new-session-tab branch July 30, 2026 19:05
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