opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: Add sessions sidebar view

Open hashcacher opened this issue 1 month ago • 0 comments

Summary

Adds a new sessions sidebar mode that displays all sessions in a persistent sidebar, allowing users to quickly navigate between sessions without opening a modal.

Changes

  • New Component: SessionsSidebar - Displays all sessions grouped by date
  • Configuration: Added sidebar_mode option to toggle between:
    • context (default): Shows current session's context, MCP, LSP, todos, diffs
    • sessions: Shows list of all sessions
  • Keybind: Added sidebar_mode_toggle (default: none) to switch between modes
  • UI Features:
    • Sessions grouped by date (Today, Yesterday, etc.)
    • Current session highlighted
    • Visual indicators for active/working sessions
    • Click to switch sessions
    • Displays up to 50 most recent sessions for performance

Usage

  1. Toggle sidebar: Ctrl+X then B (or configured keybind)
  2. Switch sidebar mode: Configure sidebar_mode_toggle keybind in config, or use command palette
  3. In sessions sidebar, click on any session to switch to it

Configuration Example

{
  "keybinds": {
    "sidebar_mode_toggle": "<leader>v"
  }
}

Motivation

Closes common user request for persistent sessions list in sidebar instead of modal popup. Makes it easier to navigate between many active sessions.

Screenshots/Demo

(Would be added before final merge with actual screenshots)

Testing

  • Tested sidebar toggle between context and sessions modes
  • Verified session grouping by date
  • Confirmed click navigation works
  • Checked visual indicators for active sessions

Checklist

  • [x] Code follows project style guidelines
  • [x] Added configuration documentation in code
  • [x] Feature is backward compatible (defaults to existing behavior)
  • [ ] Screenshots/demo added (pending)
  • [ ] Tested in actual OpenCode TUI environment (requires build)

hashcacher avatar Dec 15 '25 17:12 hashcacher