Repository navigation
feat(app): add setting to keep the side panel across sessions - #64950
Conversation
There was a problem hiding this comment.
The change looks sound. All side-region reads and writes go through the four tabs accessors, so the shared entry applies to the session screen, the plugin host and the close-tab guard alike. The bottom pane and split ratio stay per tab, and with the setting off nothing changes. I couldn't run the app here (no browser in this environment), so I checked by reading every caller and running type checks (tsc -b passes) and the src/shell/tabs and src/settings unit tests (255 pass). A throwaway round-trip test also confirmed the shared entry is still saved with side as review.
Public API: unchanged. The PR adds only a local app setting (general.sharedSidePanel) and a new window storage key (tabs.panes.shared).
One behaviour to confirm is intended: the plugin host closes the side region when the last panel tab in a session is closed (host-apis.tsx, the closeAt close and the panel.closed effect of transitionSideRegion). With the setting on, closing the last panel tab in one session hides the side panel in every other session too, including sessions that still have panel tabs open.
Since I couldn't run the UI, could you attach before/after screenshots or a short recording of the setting in Settings > General and of the side panel staying open when you switch sessions?
Related: #62876
Issue for this PR
No issue.
Type of change
What does this PR do?
Adds a "Keep side panel open across sessions" setting under Settings > Preferences > General. It's off by default.
Today each session tab remembers whether its own side panel is open, and a tab with nothing saved opens with the panel closed. So when you switch to another session, the panel often closes. With the setting on, all session tabs share one open/closed state: opening or closing the panel in one session does the same in every other session. The panel width and the bottom pane stay per tab.
The change is in
tabs.region/setRegioninshell/tabs/tabs.tsx. Every reader and writer of the side region goes through these: the session screen, the plugin host's side APIs and the close-tab guard. With the setting on, thesideregion reads and writes one shared flag, persisted undertabs.panes.shared, instead of the tab's own entry. With the setting off, nothing changes.No feature flag: the setting itself is opt-in and off by default.
How did you verify your code works?
bun typecheckandbun run test:unitinpackages/apppass.Screenshots / recordings
The new setting:
With the setting on, open the side panel in one session:
Switch to another session and the panel is still open:
Checklist
Added by the opencode bot (AI-generated).
Related: #62876