sessions: respect hidden secondary side bar on session switch#320075
Merged
Conversation
Restore the invariant that revealing the editor part also reveals the auxiliary bar (e.g. opening a file from chat shows the secondary side bar), but suppress that enforcement while restoring a session's editor working set on session switch. The working-set reveal is programmatic, so the session's saved auxiliary bar visibility now wins and a side bar the user hid for a session stays hidden when returning to it. Adds the LAYOUT_CONTROLLER.md spec documenting per-session layout state and links it from LAYOUT.md, README.md, and the sessions skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
alexdima
previously approved these changes
Jun 5, 2026
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 adjusts the Agents window (src/vs/sessions/) layout restoration flow so that a session’s saved auxiliary bar visibility is respected when returning to that session, while preserving the existing “revealing the editor also reveals the auxiliary bar” invariant for user-driven editor reveals (e.g. opening a file from chat). It also adds/links new documentation describing the LayoutController per-session layout state and invariants.
Changes:
- Add a synchronous suppression guard around the editor reveal performed during working-set restoration so the aux bar isn’t forced visible during session switches.
- Document the per-session layout state model and invariants in a new
LAYOUT_CONTROLLER.md, and link it from existing sessions docs and skill documentation.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/README.md | Links the new layout-controller specification document from the sessions docs index. |
| src/vs/sessions/LAYOUT.md | Clarifies the auxiliary-bar invariant and the working-set restoration exception; links to the detailed spec. |
| src/vs/sessions/LAYOUT_CONTROLLER.md | New detailed spec for LayoutController behavior (aux bar, panel, working sets, persistence, invariants). |
| src/vs/sessions/contrib/layout/browser/sessionLayoutController.ts | Implements suppression of aux-bar enforcement during programmatic editor reveals for working-set restore. |
| .github/skills/sessions/SKILL.md | Adds the new spec to the sessions skill doc and expands “Common Pitfalls”. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Fix relative markdown link in LAYOUT_CONTROLLER.md so it resolves on GitHub - Add blank line before the Capturing Feedback heading in the sessions skill - Add LayoutController regression tests covering the editor->auxiliary bar invariant and its suppression during working-set restore; the layout service stub now fires onDidChangePartVisibility synchronously Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lszomoru
approved these changes
Jun 5, 2026
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
Fixes the Agents window so that a secondary side bar (auxiliary bar) the user hid for a session stays hidden when switching back to that session, while keeping the behavior that opening a file from chat reveals the side bar.
Why
LayoutControllerenforces an invariant: when the editor part becomes visible, the auxiliary bar is revealed (so e.g. opening a file from chat shows the secondary side bar alongside the editor).On a session switch, restoring the session's editor working set reveals the editor part programmatically. That re-triggered the invariant and forced the auxiliary bar visible, overriding the session's saved "hidden" state. As a result, a side bar the user had hidden for a session reappeared when returning to it.
Changes
contrib/layout/browser/sessionLayoutController.ts_suppressAuxiliaryBarEnforcement+_revealEditorPartForWorkingSet()and use it in_applyWorkingSet, so the working-set restoration reveal does not force the aux bar visible. The part-visibility event fires synchronously, so the transient guard reliably scopes the suppression to exactly that reveal. The session's saved aux-bar visibility (_syncAuxiliaryBarVisibility) then wins.LAYOUT_CONTROLLER.mdspec describing per-session layout state (auxiliary bar, panel, editor working sets, switch flow, persistence, invariants).LAYOUT.md§10,README.md, and thesessionsskill's Specification Documents table; updatedLAYOUT.md§5 to describe the working-set exception.Resulting behavior
Notes for reviewers
src/vs/sessions/(+ the sessions skill doc).setPartHidden.