Skip to content

sessions: respect hidden secondary side bar on session switch#320075

Merged
sandy081 merged 2 commits into
mainfrom
sandy081/sessions-respect-hidden-auxbar-on-switch
Jun 5, 2026
Merged

sessions: respect hidden secondary side bar on session switch#320075
sandy081 merged 2 commits into
mainfrom
sandy081/sessions-respect-hidden-auxbar-on-switch

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Jun 5, 2026

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

LayoutController enforces 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
    • Keep the "editor implies auxiliary bar" invariant for genuine editor reveals (e.g. file opened from chat).
    • Add _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.
  • Docs
    • New LAYOUT_CONTROLLER.md spec describing per-session layout state (auxiliary bar, panel, editor working sets, switch flow, persistence, invariants).
    • Linked it from LAYOUT.md §10, README.md, and the sessions skill's Specification Documents table; updated LAYOUT.md §5 to describe the working-set exception.

Resulting behavior

  • Open a file from chat → editor + secondary side bar both shown. ✓
  • Hide the side bar for a session, switch away and back → side bar stays hidden. ✓

Notes for reviewers

  • Scope is limited to src/vs/sessions/ (+ the sessions skill doc).
  • The suppression is a synchronous re-entrancy guard, not a stashed-then-later-read side channel — the visibility event is delivered synchronously within setPartHidden.

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>
Copilot AI review requested due to automatic review settings June 5, 2026 10:54
alexdima
alexdima previously approved these changes Jun 5, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented Jun 5, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@benibenj

Matched files:

  • src/vs/sessions/contrib/layout/browser/sessionLayoutController.ts
  • src/vs/sessions/contrib/layout/test/browser/sessionLayoutController.test.ts

@sandy081 sandy081 enabled auto-merge (squash) June 5, 2026 10:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/vs/sessions/LAYOUT_CONTROLLER.md
Comment thread .github/skills/sessions/SKILL.md
Comment thread src/vs/sessions/contrib/layout/browser/sessionLayoutController.ts
- 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>
@sandy081 sandy081 merged commit 231a1f0 into main Jun 5, 2026
25 checks passed
@sandy081 sandy081 deleted the sandy081/sessions-respect-hidden-auxbar-on-switch branch June 5, 2026 11:30
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants