opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Persist desktop/web steps panel collapse state across sessions

Open anntnzrb opened this issue 1 week ago • 1 comments

Describe the enhancement you want to request

Current Behavior

In the desktop (and web) version of Open Code, the steps panel (showing thinking, tool use, and other details) has a collapse/expand button that users can toggle. However, this preference is not persisted across sessions. Every time a new session is started, the expanded state resets, requiring users to manually collapse the panel again.

The panel also auto-expands when the session is actively working and auto-collapses when the session completes (as seen in packages/app/src/pages/session.tsx:337-341).

Requested Enhancement

Add persistence for the steps panel collapse/expand state in desktop/web

  1. Persist user's collapse preference across sessions
  2. Add configuration option (optional) to set default behavior (e.g., always collapsed by default)
  3. Respect user preference when sessions are created

Benefits

  • Improved UX: Users who prefer a cleaner view without the steps panel don't need to manually collapse it in every session
  • Consistency: The TUI version already has this functionality (implemented in issue #4582, completed 2025-11-28)
  • Better workflow: Maintains user preferences across the application, similar to how layout, file views, and terminal state are persisted

Technical Context

Desktop/Web Implementation Location:

  • State management: packages/app/src/pages/session.tsx:247-255 (in-memory store, not persisted)
  • Collapse button: packages/ui/src/components/session-turn.tsx:475-511
  • Auto-expansion logic: packages/app/src/pages/session.tsx:337-341

Comparison with TUI:

  • TUI has persistent settings using kv store (packages/opencode/src/cli/cmd/tui/context/kv.tsx)
  • TUI stores preferences like thinking_visibility and tool_details_visibility
  • Desktop app uses persisted() utility for other settings (layout, file views, terminal state) but not for collapse state

Potential Implementation Approach:

  • Wrap the expanded state with the persisted() utility (similar to how other contexts work)
  • Add a user preference for "collapse all by default"
  • Initialize new sessions based on this saved preference

Additional Notes

  • Keyboard shortcut exists to toggle steps: Cmd+E (Mac) / Ctrl+E (Windows/Linux)
  • This request is specifically about desktop/web persistence, not about the model's thinking behavior
  • The TUI version already has similar functionality (issue #4582), but desktop/web does not

anntnzrb avatar Jan 07 '26 06:01 anntnzrb