sessions: refine the single-pane detail-panel layout#324348
Conversation
Add an experimental `sessions.layout.singlePaneDetailPanel` setting (default off) that docks the detail panel (auxiliary bar) inside the editor part, so a single editor tab bar spans the editor content and the docked panel. Introduces a custom Changes (multi-diff) editor, Files/Browser tabs, and a "+" add-tab menu, with the Changes view and diff-stats split into standard vs single-pane subclasses chosen at startup. The redesign uses a mode-based architecture: all single-pane parts, editors, serializers, actions and views are registered/gated behind the setting via `IAgentWorkbenchLayoutService.isSinglePaneLayoutEnabled` (the single source of truth), so the standard Agents-window layout is unchanged when the setting is off. Core editor support: `EditorPart.setContentRightInset` (concrete class, not the public `IEditorPart` interface) insets only right-edge groups so the tab bar stays full-width; a generic `MenuId.EditorTabsBarAddTab` renders a core-owned "+" dropdown at the end of the tab strip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…redesign-single-pane # Conflicts: # src/vs/sessions/contrib/changes/browser/changesActions.ts # src/vs/sessions/contrib/layout/test/browser/layoutControllerTestUtils.ts
- empty-file editor: register a touch Gesture target and handle Tap (iOS) in addition to click, and set `touch-action: manipulation` to avoid the tap delay. - docked detail panel border: use `var(--vscode-strokeThickness)` instead of a hardcoded 1px. - drop the internal `[Option A]` design-discussion marker from comments across workbench.ts / style.css / sessionConfig.ts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The _activeEditorObs / _auxBarVisibleObs field initializers referenced the constructor-injected _editorService / _layoutService, which run before the parameter properties are assigned (TS2729, caught by tsc in CI but not by the tsgo typechecker). Move their initialization into the constructor body. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh the committed blocks-ci-screenshots.md to the current CI-rendered image hashes (CodeEditor / InlineChatZoneWidget fixtures). These are bare editor-widget fixtures not affected by this PR's editor-tab changes; the drift is from the screenshot service re-render. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…redesign-single-pane
… layout service SessionChangesService is a DI singleton also instantiated in component fixtures / unit tests, which do not register IAgentWorkbenchLayoutService. Read the single-pane setting via IConfigurationService (available everywhere) instead, so resolving ISessionChangesService no longer fails with 'depends on layoutService which is NOT registered'. The layout service remains the single source of truth for contributions that run only in the real Agents window. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the committed hashes to the current CI render (the 6 CodeEditor / InlineChatZoneWidget fixtures shifted with the merged upstream editor changes). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…redesign-single-pane # Conflicts: # src/vs/sessions/contrib/changes/browser/changesView.ts
Grid/sizing: persist the logical editor width (excluding the docked panel) so the Sessions Part no longer shrinks by the panel width on every reload; clamp the stored docked width to its minimum and yield to the editor's minimum in narrow windows; keep the editor grid leaf visible when only the docked aux bar toggles. Editor content inset: recompute on group maximize/restore so a maximized non-right group is not rendered under the docked panel, and re-layout the docked panel after the un-maximize resize. Controllers: DetailPanelController shows Changes while the editor is maximized (agreeing with the D5 rule) and classifies editor types (file/empty-file -> Files, Changes -> Changes, Browser -> hidden, other -> preserve); the LayoutController no longer auto-reveals the Changes view on editor open in single-pane, so existing sessions keep the 'never auto-open' rule. Docs: fix stale method references in LAYOUT.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge the single-pane detail/tab controllers into the layout controller, add a dedicated Toggle Details command, refine R1 (transition-triggered editor hide), default a created session to the Changes editor with the detail closed, reveal the docked editor part for created sessions, and remove the docked reveal-sync suppression mechanism. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…redesign-single-pane # Conflicts: # .github/skills/sessions/SKILL.md # src/vs/sessions/LAYOUT.md # src/vs/sessions/LAYOUT_CONTROLLER.md # src/vs/sessions/browser/dockedAuxiliaryBarController.ts # src/vs/sessions/browser/layoutActions.ts # src/vs/sessions/browser/workbench.ts # src/vs/sessions/contrib/changes/browser/changes.contribution.ts # src/vs/sessions/contrib/changes/browser/changesView.ts # src/vs/sessions/contrib/changes/browser/media/sessionChangesEditor.css # src/vs/sessions/contrib/changes/browser/sessionChangesEditor.ts # src/vs/sessions/contrib/editor/browser/addTabActions.ts # src/vs/sessions/contrib/editor/browser/editor.contribution.ts # src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.ts # src/vs/sessions/contrib/layout/test/browser/layoutControllerTestUtils.ts # src/vs/sessions/test/browser/layoutActions.test.ts # src/vs/workbench/browser/parts/editor/editorPart.ts
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @benibenjMatched files:
|
There was a problem hiding this comment.
Pull request overview
This PR refines the experimental single-pane detail-panel layout for the Agents window (introduced in #324257), gated behind sessions.layout.singlePaneDetailPanel (default off, byte-identical to the previous layout when off). The main structural change is merging the previously separate ChangesTabController and DetailPanelController into a single SinglePaneDesktopSessionLayoutController, so managed-tab and detail-panel behavior coordinate through one controller (via _isRestoringSessionLayout) instead of a shared service. It also reworks the new-session editor-hide rule (R1) from level-triggered to transition-triggered, adds a dedicated Toggle Details command/menu item, a Hide Editor action, and numerous docked-layout sizing/visibility bug fixes in workbench.ts.
Changes:
- Merge the two single-pane controllers into
SinglePaneDesktopSessionLayoutController, deletechangesTabController.ts/detailPanelController.ts/SinglePaneModeController, and select the controller in a newSessionsLayoutContributionatBlockRestore. - Rework R1 (new-session editor hide) to be transition-triggered using
isEditorRevealedExplicitly(), and remove thesetSuppressDockedEditorRevealSyncmechanism. - Add editor-title actions (
Hide Editor,Toggle Details,Collapse All Diffs), gate single-pane actions onMainEditorAreaVisibleContext, and add docked reveal/hide sizing logic + per-session editor-part restore.
Show a summary per file
| File | Description |
|---|---|
contrib/layout/browser/singlePaneDesktopSessionLayoutController.ts |
New merged controller owning managed tabs, detail mapping, R1, Toggle Details |
contrib/layout/browser/baseSessionLayoutController.ts |
New _registerAuxiliaryControllers/_defaultReopenSidePaneParts hooks; added DI deps (one unused) |
contrib/layout/browser/desktopSessionLayoutController.ts |
Split registration hooks, D10 quick-chat-only hide, sync aux-bar restore |
contrib/layout/browser/sessions.layout.contribution.ts |
Controller selection moved into a contribution class |
browser/workbench.ts |
Docked editor visibility sync, sidebar-collapse sizing, explicit-reveal tracking, last-tab close |
browser/parts/editorPart.ts |
Keeps editor node laid out for shared tab bar; reports node width for reveal sync |
browser/dockedAuxiliaryBarController.ts |
Editor-content-hidden width path; sash disabled when content hidden |
browser/layoutActions.ts |
Original-layout aux toggle retained; single-pane toggle removed (moved to controller) |
contrib/editor/browser/editor.contribution.ts |
Hide Editor action; MainEditorAreaVisibleContext gates; leftover dead const |
contrib/editor/browser/addTabActions.ts |
New File opens pinned; add-tab gated on editor-area visibility |
contrib/changes/browser/* |
SessionChangesEditor.collapseAllDiffs, single-pane multi-diff reveal, header CSS, deleted controllers |
common/contextkeys.ts |
New SinglePaneDetailChangesOrFilesActiveContext |
*.md, .github/skills/sessions/SKILL.md |
Design-doc/scenario/skill updates (some stale references remain) |
| tests | Extended layout harness + new coverage for tabs, R1, detail restore, actions |
The functional changes look internally consistent, and the setting-off path is preserved. My comments are limited to a leftover dead const, an unused newly-added DI dependency, and documentation that still references deleted files (detailPanelController.ts/changesTabController.ts), a nonexistent method name (_registerSinglePaneNewSessionRules), and the old "level-triggered" R1 behavior. Given the size and the intricate, timing-sensitive layout state machine in workbench.ts, the core logic warrants human verification.
Review details
- Files reviewed: 30/30 changed files
- Comments generated: 4
- Review effort level: Medium
Follow-up to #324348 (which auto-merged before the review fixes landed): - remove dead singlePaneEditorTitleAuxiliaryBarOrder const + void statement - remove the unused ICommandService dependency from the base layout controller (and its now-dead test-harness stub) - update SINGLE_PANE_SCENARIOS.md and desktopSessionLayoutController.md for the merged controller, transition-triggered R1, and Toggle Details command Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refines the single-pane detail-panel layout for the Agents window that landed in #324257. The pane renders as one card with a shared editor tab bar spanning the editor content and a docked detail panel (Changes / Files). Everything remains gated behind the experimental setting
sessions.layout.singlePaneDetailPanel; when it is off the Agents window renders exactly as before.What changed
Architecture
ChangesTabController+DetailPanelControllerintoSinglePaneDesktopSessionLayoutController, so the single-pane managed-tab and detail-panel behaviours live on one controller and coordinate through it (via_isRestoringSessionLayout) instead of a shared service. Deleted both controller files and the short-lived coordinator service.Toggle Details
workbench.action.agentSessions.toggleDetailscommand (with its own editor-title menu item) that callstoggleDetails()on the controller, instead of listening on the coreworkbench.action.toggleAuxiliaryBarcommand. Opening details also auto-collapses the sessions list and restores it on close.Default states / restore
workbench.editor.useModal: 'all'(the docked editor lives in the grid, not the modal part), so the side pane no longer appears fully closed when navigating to an existing session. Respects the per-session editor-hidden (Detail-only / side-pane-closed) state.R1 (new-session editor hide)
setSuppressDockedEditorRevealSyncmechanism (interface method, field, gate, and its two tests); R1 is now the sole backstop for spurious width reveals.Editor-title actions
Bug fixes (reload side-pane flicker, transient Files-tab removal emptying the group, per-session detail restore, "close Files tab → New File" reopening, and more).
Testing
npm run typecheck-client,npm run valid-layers-check,npm run compile— clean.desktopSessionLayoutController.test.ts,workbench.test.ts,layoutControllerTestUtils.ts,changesViewActions.test.ts).Notes for reviewers