mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
On a narrow Agents window, auto-hide the sessions sidebar while both the editor and the side panel (auxiliary bar) are open, and show it again once either closes or the window grows wide. A manual close suppresses auto-show until the user opens it again; suspended while the editor is maximized or multiple sessions are visible. Gated by the experimental setting `sessions.layout.autoCollapseSessionsSidebar` (default on in non-stable builds). Session navigation never auto-hides the sidebar: a base-controller restore epoch (`_withSessionLayoutRestore` / `_isRestoringSessionLayout`) wraps both the aux-bar restore and the editor working-set apply (`_applyWorkingSet`, which reveals the editor part after an await). The D7 autorun re-baselines instead of reacting while a restore is in flight. The epoch is a depth counter so the guard stays up across overlapping/independently-settling restores, and it decrements synchronously for void work so it never leaks for no-op restores. Layout-controller registration moves to a new `sessions.layout.contribution.ts` that picks the desktop or mobile controller per platform and registers the experimental setting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>