Skip to content

Commit f45fb53

Browse files
sandy081Copilot
andauthored
sessions: stabilize single pane lifecycle behavior (#330573)
* sessions: simplify single pane lifecycle strategies Consolidate single-pane behavior into New, Existing, and Quick Chat strategies while keeping shared tab and detail mechanics in coordinators. Preserve New Session editor visibility through isolated entry, toggle, and close transitions. Co-authored-by: Copilot <[email protected]> * sessions: stabilize single pane lifecycle behavior Separate lifecycle visibility policy from shared detail content mechanics, preserve Existing session layouts, and avoid close/open and sizing flicker during session navigation. Co-authored-by: Copilot <[email protected]> * sessions: preserve managed tabs across session switches Replace session-specific Changes inputs in place while retaining generation safety and restoring default Files tabs for the incoming session. Co-authored-by: Copilot <[email protected]> * sessions: address single pane review feedback Handle detail sync failures, gate Changes tab actions to created sessions, and align Quick Chat documentation with its entry policy. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 3686629 commit f45fb53

34 files changed

Lines changed: 2242 additions & 1703 deletions

‎.github/skills/sessions/SKILL.md‎

Lines changed: 24 additions & 9 deletions
Large diffs are not rendered by default.

‎src/vs/sessions/LAYOUT.md‎

Lines changed: 16 additions & 11 deletions
Large diffs are not rendered by default.

‎src/vs/sessions/LAYOUT_CONTROLLER.md‎

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ It is the detailed companion to [LAYOUT.md §10 Per-Session Layout State](LAYOUT
2525

2626
The Agents window keeps a single **active session** but lets the user move between many.
2727
Each session owns its editor working set and bottom-panel visibility. The classic layout also keeps
28-
auxiliary-bar and editor-part visibility per session. The single-pane layout keeps shared
29-
editor/detail profiles for New Sessions and Existing Sessions.
28+
auxiliary-bar and editor-part visibility per session. The single-pane layout keeps a shared
29+
Editor/Details profile for Existing Sessions; New Sessions use a one-time Editor opening rule.
3030

3131
`LayoutController` owns three independent pieces of per-session state, all keyed by session
3232
resource (`URI`) and persisted to workspace storage:
@@ -71,21 +71,27 @@ Skipped entirely on mobile web (`isWeb && isMobile`) to avoid disruptive auto-ex
7171

7272
> **Docked detail panel (experimental).** With `sessions.layout.singlePaneDetailPanel` enabled, the auxiliary
7373
> bar is docked inside the editor part rather than being a grid column (see [LAYOUT.md](../LAYOUT.md) §5).
74-
> `SinglePaneSidePaneVisibilityStrategy` persists New Sessions and Existing Sessions
75-
> `{ editorVisible, auxiliaryBarVisible }` profiles under `sessions.singlePane.sidePaneVisibility`.
76-
> Switching types applies the matching profile; submitting preserves the current composition and seeds
77-
> the Existing profile from it. Quick chats
78-
> temporarily suppress the side pane without changing either profile. The per-session rules below apply
74+
> `SinglePaneExistingSessionStrategy` persists one shared Existing Session Editor/Details profile
75+
> (via `SinglePaneVisibilityProfileStore`) under `sessions.singlePane.sidePaneVisibility`.
76+
> New Sessions do not apply or capture an Editor
77+
> profile; submitting preserves Editor visibility and seeds the Existing profile. `SinglePaneQuickChatStrategy`
78+
> hides the whole side pane once when Quick Chat becomes active without changing either profile.
79+
> The per-session rules below apply
7980
> to the classic layout only.
8081
> The docked detail panel opens at a 300px preferred width unless the user explicitly resized it; cached editor
8182
> node sizes and temporary sidebar-collapse growth are not allowed to widen the first/opened detail-only pane.
8283
> Docked sash collapse is also expressed through the same visibility API: the left grid sash hides editor content
8384
> when the editor node reaches the detail width, and the middle docked sash hides the auxiliary bar when the raw
8485
> dragged detail width reaches ~0.
85-
> Single-pane also keeps new-session views Files-first: when an uncreated workspace session is entered,
86-
> `SinglePaneLayoutController` hides the editor content once under editor-auto-visibility
87-
> suppression so the editor tab bar and Files detail panel remain visible. Later user reveals are respected.
88-
> The shared new-session hide memory (`sessions.newSessionViewState`) remains unchanged.
86+
> Single-pane also keeps new-session views Files-first without owning side-pane visibility: when an
87+
> uncreated workspace session is entered and its restored editor set contains only Empty Files,
88+
> `SinglePaneNewSessionStrategy` hides Editor once under editor-auto-visibility suppression. Auxiliary
89+
> Bar visibility is unchanged. A completed Toggle Side Panel reopen is a separate transition: after
90+
> managed tabs settle, a sole Empty Files input produces dock-only Files. Closing the last non-Empty
91+
> input is a third, authoritative transition that restores Empty Files and the exact pre-close visibility.
92+
> New, Existing, and Quick Chat share one `SinglePaneDetailPanelCoordinator` for Changes/Files
93+
> content selection and context publication. Auxiliary Bar visibility is not shared: each lifecycle
94+
> strategy applies its own visibility rules before publishing its content target.
8995
9096
### 3.1 Switching away — capture
9197

@@ -315,8 +321,8 @@ does, causing the aux bar to fall back to the default-visible logic (§3.2) on t
315321
- `_loadState` reads `sessions.newSessionViewState` and `sessions.layoutState`; if the latter is
316322
absent it performs a one-time migration from the legacy `sessions.workingSets` key and then removes
317323
it. Corrupted data is dropped defensively.
318-
- Single-pane editor working sets use `sessions.singlePane.layoutState`; its New/Existing editor/detail
319-
profiles are written immediately to `sessions.singlePane.sidePaneVisibility`.
324+
- Single-pane editor working sets use `sessions.singlePane.layoutState`; the Existing Session
325+
editor/detail profile is written immediately to `sessions.singlePane.sidePaneVisibility`.
320326

321327
---
322328

@@ -329,11 +335,15 @@ does, causing the aux bar to fall back to the default-visible logic (§3.2) on t
329335
the new-session default (§3.2 step 2) and stays visible when an already-visible new session is
330336
submitted (§3.3). A created session with no explicit "visible" choice stays closed until the user
331337
opens it.
332-
- **In single-pane, editor/detail visibility is shared by lifecycle type** — New Sessions and Existing
333-
Sessions restore independent profiles; quick chats only suppress the pane temporarily while a single
334-
session is visible. With multiple visible sessions, the focused session may reveal parts from its
335-
matching profile, but it never automatically hides parts it does not use. This restores an existing
336-
session's open side pane without letting a quick chat hide a pane used by another session.
338+
- **In single-pane, Existing Sessions restore a shared Editor/Details profile** while New Sessions apply their
339+
entry rules. Quick Chat hides the whole side pane once on single-session entry; later explicit
340+
editor opens follow normal workbench behavior. With multiple visible sessions, the focused session may reveal parts from its
341+
matching profile, but it never automatically hides parts used by another session.
342+
- Existing→Existing detail content selection ignores the outgoing active editor. It selects content
343+
only when a concrete different incoming editor activates or the incoming session-layout restore ends,
344+
avoiding a Files→Changes flash.
345+
- Classic-layout D10 empty-Aux cleanup is disabled in single-pane mode; Quick Chat strategy is the
346+
sole owner of Quick visibility and waits for entry editor restoration to settle before applying it.
337347
- **In the classic desktop layout, the sessions sidebar is auto-managed on a small window ([D7])** — when the main container is
338348
1800px wide or narrower and both the editor and auxiliary bar are open, the sidebar is hidden; it is shown
339349
again once either closes or the window widens, unless the user closed it themselves. Suspended while
@@ -358,8 +368,7 @@ does, causing the aux bar to fall back to the default-visible logic (§3.2) on t
358368
(`IsQuickChatSessionContext.negate()`). Invariant: `partVisibility.auxiliaryBar`
359369
(⇒ `AuxiliaryBarVisibleContext` ⇒ the detail toggle) is true iff the docked detail panel is rendered with
360370
an active view container.
361-
- **Single-pane new-session views are Files-first (desktop, [D11])** — when an uncreated workspace
362-
session is entered in single-pane mode (single session visible, not maximized, not a quick chat), the
363-
editor content is hidden once under `suppressEditorPartAutoVisibility()`. D3b keeps the Files detail
364-
panel active unless the shared new-session side pane state says it is hidden; later user editor reveals
365-
are respected until the controller exits and re-enters a new-session resource.
371+
- **Single-pane new-session views hide only redundant Editor content (desktop, [D11])** — when an
372+
uncreated workspace session is entered in single-pane mode and the restored editor set contains only
373+
Empty Files, Editor is hidden once under `suppressEditorPartAutoVisibility()`. Auxiliary Bar visibility
374+
is not changed or persisted by the New strategy, and later user editor reveals are respected.

0 commit comments

Comments
 (0)