Skip to content

feat: sidebar sessions panel with auto-resume and session history browsing #2934

@cy2311

Description

@cy2311

Problem

Currently there is no way to see all conversation sessions in a persistent sidebar panel. The only way to switch between sessions is Ctrl+R (session picker popup) or codewhale run --continue at startup.

This creates friction:

  • Users have to remember to use Ctrl+R to find old conversations
  • There is no visual overview of all sessions (titles, timestamps, last message preview)
  • Starting CodeWhale fresh loses the previous session context unless the user explicitly remembers --continue
  • No intuitive way to browse, search, or manage past conversations

Proposed Solution

Add a Sessions panel to the sidebar (alongside existing Work / Tasks / Agents / Context panels), similar to how VS Code / Cursor / Codex show a chat history list on the left side.

Design

  1. Sidebar panel: A new SidebarFocus::Sessions variant that renders a scrollable list of all past sessions, each showing:

    • Session title or first prompt
    • Timestamp (relative: "2h ago", "yesterday", "Jun 5")
    • Last message preview (truncated to one line)
    • Status indicator (active / archived)
  2. Interaction:

    • Click/Enter on a session → switches to that session (loads history into the transcript)
    • Delete key → option to archive/remove a session
    • Right-click / context menu → rename, export, delete
  3. Auto-resume:

    • On startup, default to the most recent session instead of a blank state
    • Or show the Sessions panel by default with the latest session pre-selected

Keybindings (suggested)

  • Alt+S or similar to focus the Sessions sidebar panel
  • Ctrl+R stays as an alternative quick-switch

Alternatives Considered

  1. Keep Ctrl+R as the only session switching mechanism — current state, confusing for new users
  2. Show sessions only at startup in a picker — one-time choice, doesn't help during a session
  3. Auto-save and auto-restore the last session without showing history — solves persistence but not browsing

Additional Context

  • Current SidebarFocus enum has: Auto, Work, Tasks, Agents, Context, Hidden — no Sessions variant
  • Session data is already persisted to disk (SQLite store in crates/tui/src/session_manager.rs)
  • Ctrl+R already opens a session picker popup, suggesting the session listing infrastructure exists
  • Main gap is a persistent sidebar panel + startup auto-resume

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions