Skip to content

sessions: refine the single-pane detail-panel layout#324348

Merged
sandy081 merged 12 commits into
mainfrom
agents/agents-window-redesign-single-pane
Jul 5, 2026
Merged

sessions: refine the single-pane detail-panel layout#324348
sandy081 merged 12 commits into
mainfrom
agents/agents-window-redesign-single-pane

Conversation

@sandy081

@sandy081 sandy081 commented Jul 5, 2026

Copy link
Copy Markdown
Member

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

  • Merged ChangesTabController + DetailPanelController into SinglePaneDesktopSessionLayoutController, 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

  • Registered a dedicated workbench.action.agentSessions.toggleDetails command (with its own editor-title menu item) that calls toggleDetails() on the controller, instead of listening on the core workbench.action.toggleAuxiliaryBar command. Opening details also auto-collapses the sessions list and restores it on close.

Default states / restore

  • A created session opens the side pane to Editor-only (Changes editor visible, detail panel closed) by default; a Changes/file editor becoming active no longer force-opens the detail (the only exception is restoring the detail after a transient browser-tab hide). New-session views open to the Files detail.
  • Reveal the docked editor part for created sessions on switch even with 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)

  • Reworked to be transition-triggered: hide only when the editor just became visible or the view was just entered with the editor visible — so switching to the Files tab while the editor is already visible no longer hides it. Entering the new-session view always resets to editor-closed.
  • Removed the setSuppressDockedEditorRevealSync mechanism (interface method, field, gate, and its two tests); R1 is now the sole backstop for spurious width reveals.

Editor-title actions

  • Hide the "Hide Editor" action while the editor area is maximized.
  • Moved "Collapse All Diffs" to the editor title bar (from the Changes editor header).

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.
  • Sessions / LayoutController / Changes / Layout Actions unit suites: all passing (extensive new coverage in desktopSessionLayoutController.test.ts, workbench.test.ts, layoutControllerTestUtils.ts, changesViewActions.test.ts).

Notes for reviewers

sandy081 and others added 12 commits July 3, 2026 19:39
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>
… 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
Copilot AI review requested due to automatic review settings July 5, 2026 02:56
@sandy081 sandy081 self-assigned this Jul 5, 2026
@sandy081
sandy081 enabled auto-merge (squash) July 5, 2026 02:56
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

@benibenj

Matched files:

  • src/vs/sessions/browser/parts/editorPart.ts
  • src/vs/sessions/browser/workbench.ts
  • src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.ts
  • src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.md
  • src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.ts
  • src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.ts
  • src/vs/sessions/contrib/layout/browser/singlePaneDesktopSessionLayoutController.ts
  • src/vs/sessions/contrib/layout/test/browser/desktopSessionLayoutController.test.ts
  • src/vs/sessions/contrib/layout/test/browser/layoutControllerTestUtils.ts
  • src/vs/workbench/browser/parts/editor/editorPart.ts

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 5f595aed Current: 5bac0ab6

Changed (1)

sessions/inputBanners/sessionInputBanners/CIFailuresLoading/Light
Before After
before after

1 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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, delete changesTabController.ts / detailPanelController.ts / SinglePaneModeController, and select the controller in a new SessionsLayoutContribution at BlockRestore.
  • Rework R1 (new-session editor hide) to be transition-triggered using isEditorRevealedExplicitly(), and remove the setSuppressDockedEditorRevealSync mechanism.
  • Add editor-title actions (Hide Editor, Toggle Details, Collapse All Diffs), gate single-pane actions on MainEditorAreaVisibleContext, 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

Comment thread src/vs/sessions/contrib/editor/browser/editor.contribution.ts
Comment thread src/vs/sessions/SINGLE_PANE_SCENARIOS.md
@sandy081
sandy081 merged commit 5cfa715 into main Jul 5, 2026
30 checks passed
@sandy081
sandy081 deleted the agents/agents-window-redesign-single-pane branch July 5, 2026 03:11
@vs-code-engineering vs-code-engineering Bot added this to the 1.128.0 milestone Jul 5, 2026
sandy081 added a commit that referenced this pull request Jul 5, 2026
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>
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.

3 participants