sessions: reveal the side pane when opening Changes after collapsing it#323345
Merged
Conversation
In the Agents window, collapsing the whole side pane (editor + auxiliary bar) via the toggle hides the aux bar as a side effect, not as an explicit aux-bar choice. The live capture skips it, but the save-time capture (switch-away / shutdown) re-read the now-hidden aux bar and persisted auxiliaryBarVisible:false. After a reload, opening the Changes editor then revealed only the editor part, not the aux bar. Track a per-session auxiliaryBarHiddenByCollapse bit so a collapse-driven hide is distinguished from an explicit aux-bar hide: the side pane is still restored closed on reload, but opening a Changes editor re-reveals the aux bar. An explicit aux-bar-only hide stays remembered and is not re-revealed. Also gate the reveal on the editor part being visible: a Changes editor restored on reload becomes the active editor while the editor part is still hidden, which must not auto-reveal the side pane; a user-opened Changes editor reveals the part first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @benibenjMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Agents window per-session layout persistence so that collapsing the whole side pane (editor + auxiliary bar) is distinguished from an explicit auxiliary-bar hide, allowing Changes to re-reveal the auxiliary bar after reload when appropriate, while avoiding auto-reveal during restore when the editor part is still hidden.
Changes:
- Persist a per-session
auxiliaryBarHiddenByCollapsemarker to distinguish collapse-driven aux-bar hides from explicit hides. - Gate the “reveal Changes view on first open” behavior on the editor part being visible to avoid auto-reveals during working set restore on reload.
- Add unit tests covering the reload/restore vs user-open distinction and update the design spec.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.ts | Tracks whether the whole side pane is currently collapsed via toggleSidePane(). |
| src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.ts | Persists/consumes auxiliaryBarHiddenByCollapse and gates Changes-view reveal on editor-part visibility. |
| src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.md | Updates D8/D9 spec to describe collapse-vs-explicit-hide behavior (including across reload). |
| src/vs/sessions/contrib/layout/test/browser/desktopSessionLayoutController.test.ts | Adds focused regression tests for reload restore vs user-open behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Low
lszomoru
approved these changes
Jun 28, 2026
sandy081
added a commit
that referenced
this pull request
Jun 28, 2026
#323360) * sessions: scope the side-pane collapse marker to the collapsed session Address Copilot code review on #323345: deriving auxiliaryBarHiddenByCollapse from a controller-global _sidePaneToggledClosed flag read at arbitrary capture times was leaky. It required resetting the flag on session switch (breaking the documented invariant) and could still clobber an explicit aux-bar hide on a different session, turning it into a collapse. Record the collapse marker for the active session directly in _onSidePaneToggled (where the collapse actually happens), and have _captureViewState only preserve an existing marker while the aux bar stays hidden — never fabricate one. The global flag is no longer read anywhere, so remove it along with the session-switch and aux-bar-change resets. Add a regression test asserting an explicit aux-bar hide is not turned into a collapse when another session is collapsed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * sessions: only mark a collapse when it hides a previously-visible aux bar Address Copilot code review on #323360: _onSidePaneToggled set the collapse marker whenever the aux bar ended up hidden after a toggle. But re-opening the side pane can restore an editor-only state (aux bar explicitly hidden before the collapse), which wrongly stamped that explicit hide as collapse-driven and made opening Changes re-reveal the aux bar. Pass collapsed + previousAuxiliaryBarVisible to the hook and only mark the collapse when the toggle fully collapsed a previously-visible aux bar; any other outcome captures the resulting state without fabricating a marker, preserving an explicit aux-bar hide. Add a regression test for the collapse + editor-only re-open case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In the Agents window, the per-session layout controller did not re-reveal the auxiliary bar when opening a Changes editor after the whole side pane had been collapsed and the window reloaded.
This tracks a new per-session
auxiliaryBarHiddenByCollapsebit so a collapse-driven aux-bar hide is distinguished from an explicit aux-bar hide:It also gates the reveal on the editor part being visible, so a Changes editor restored on reload (which becomes the active editor while the editor part is still hidden) does not auto-reveal the side pane; only a user-opened Changes editor (which reveals the editor part first) does.
Why
Repro (Agents window):
Root cause: the live aux-bar capture correctly skips a whole-pane toggle, but the save-time capture (switch-away / shutdown) re-read the now-hidden aux bar and persisted
auxiliaryBarVisible: false. After reload,_revealChangesViewOnFirstOpentreated that as an explicit hide and never revealed.Notes for reviewers
auxiliaryBarHiddenByCollapseflag is only written whentrue(omitted otherwise) to keep stored state minimal and existing entries unchanged.desktopSessionLayoutController.test.ts:[D9] does not auto-reveal the side pane when the Changes editor is restored on reload(editor part hidden → no reveal).[D9] reveals the Changes view when opening Changes after reloading a session whose side pane was toggled closed(editor part visible → reveal).desktopSessionLayoutController.md(D8/D9) updated.Depends conceptually on the editor-part restore fix in #323342 (which is what makes the editor part open at all after reload), but is independent in code.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com