Skip to content

feat(tui): delete current session - #39750

Merged
kitlangton merged 1 commit into
v2from
delete-current-session
Jul 30, 2026
Merged

feat(tui): delete current session#39750
kitlangton merged 1 commit into
v2from
delete-current-session

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Add a Delete session command for the active V2 TUI session. It is available from the command palette and as /delete; the existing session_delete binding also makes Ctrl-D open the confirmation while viewing a session.

The confirmation starts on Confirm, so the full keyboard flow is Ctrl-D, then Enter. Escape cancels without deleting anything.

Before / After

Before: Deleting the active session required opening the session list, finding the current session, and pressing Ctrl-D twice.

After: The active session can be deleted in place. The TUI asks for confirmation, removes the session on the second keypress, and returns home through the existing session.deleted event flow.

How

  • Register session.delete with the session route in packages/tui/src/routes/session/index.tsx.
  • Reuse DialogConfirm for the destructive confirmation instead of introducing another dialog.
  • Call the existing session removal API after confirmation and surface failures as an error toast.
  • Leave successful navigation and notification handling to the existing session.deleted listener.

Testing

  • bun typecheck in packages/tui
  • bun run test in packages/tui (573 passed, 5 skipped)
  • Push hook: workspace typecheck across 33 packages
  • OpenCode Drive v1.4.1 against this worktree with required protocol negotiation: created one simulated session, pressed Ctrl-D, asserted the confirmation, pressed Enter, asserted the deleted-session toast, and verified the session API returned zero sessions

Demo

OpenCode Drive recording with a simulated model and isolated project. It shows Ctrl-D opening the confirmation and Enter deleting the session and returning home.

recording-0b03cce4-7519-4254-a2a5-0d4dd27d5319.mp4

Delete session confirmation

Flow

flowchart LR
  A[Active session] -->|Ctrl-D, palette, or /delete| B[Delete confirmation]
  B -->|Escape or Cancel| A
  B -->|Enter on Confirm| C[Remove session]
  C -->|session.deleted| D[Home]
  C -->|API error| E[Error toast]
Loading

@kitlangton
kitlangton merged commit 7814568 into v2 Jul 30, 2026
9 checks passed
@kitlangton
kitlangton deleted the delete-current-session branch July 30, 2026 21:06
kitlangton added a commit that referenced this pull request Jul 31, 2026
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