Skip to content

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

@anntnzrb

Description

@anntnzrb

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 [FEATURE]: Persist TUI thinking block visibility toggle or add config option #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

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions