Skip to content

[Feature] Cancel button for untitled sessions with confirmation popup #147

@realproject7

Description

@realproject7

Problem

Users can't cancel an untitled (new story) session. If they started a session but don't want to continue, there's no way to discard it cleanly.

Solution

Two ways to cancel an untitled session:

1. Close tab with confirmation popup

When user clicks the × on an "Untitled" tab and structure.md doesn't exist yet, show a confirmation popup:

┌────────────────────────────────────────────┐
│  Discard this session?                     │
│                                            │
│  This session will be lost — your AI       │
│  hasn't created a story structure yet.     │
│                                            │
│           [Cancel]    [Discard]             │
└────────────────────────────────────────────┘

2. Cancel button on top-right of terminal

Display a cancel/discard button on the top-right corner of the terminal session area (next to the tab bar). Only visible for untitled sessions.

┌─────────────────────────────────────────────┐
│ ● Untitled ×                    [Cancel ×]  │
│─────────────────────────────────────────────│
│  Claude Code v2.1.92                        │
│  ...                                        │

Clicking triggers the same confirmation popup.

On discard:

  1. Send exit command to the Claude terminal session (graceful shutdown)
  2. Remove the terminal session (kill PTY)
  3. Remove the "Untitled" entry from the sidebar
  4. Clean up any session data (IndexedDB scrollback, etc.)

Files

  • app/web/components/TerminalPanel.tsx — cancel button, close tab handler
  • app/web/components/StoriesPage.tsx — remove untitled session state
  • app/routes/terminal.ts — may need endpoint to kill a specific session

Acceptance Criteria

  • Closing untitled tab shows confirmation popup
  • Cancel button visible on top-right for untitled sessions only
  • Both trigger the same confirmation dialog
  • On discard: exits Claude session, kills PTY, removes sidebar entry
  • Confirmed stories (with structure.md) close without popup

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions