When working on the Agents workbench layout, always follow these guidelines:
1. Read the Specification First
The authoritative specification for the Agents layout lives at:
src/vs/sessions/LAYOUT.md
Before making any changes to the layout code, read and understand the current spec. It defines:
- The fixed layout structure (grid tree, part positions, default sizes)
- Which parts are included/excluded and their visibility defaults
- Titlebar configuration and custom menu IDs
- Editor modal overlay behavior and sizing
- Part visibility API and events
- Agent session part classes and storage keys
- Workbench contributions and lifecycle
- CSS classes and file structure
2. Keep the Spec in Sync
If you modify the layout implementation, you must update LAYOUT.md to reflect those changes. The spec should always match the code. This includes:
- Adding/removing parts or changing their positions
- Changing default visibility or sizing
- Adding new actions, menus, or contributions
- Modifying the grid structure
- Changing titlebar configuration
- Adding new CSS classes or file structure changes
Update the Revision History table at the bottom of LAYOUT.md with a dated entry describing what changed.
3. Implementation Principles
When proposing or implementing changes, follow these rules from the spec:
- Maintain fixed positions — Do not add settings-based position customization
- Panel must span the right section width — The grid structure places the panel below Chat Bar and Auxiliary Bar only
- Sidebar spans full height — Sidebar is in the main content branch, spanning from top to bottom
- New parts go in the right section — Any new parts should be added to the horizontal branch alongside Chat Bar and Auxiliary Bar
- Preserve no-op methods — Unsupported features (zen mode, centered layout, etc.) should remain as no-ops, not throw errors
- Handle pane composite lifecycle — When hiding/showing parts, manage the associated pane composites
- Use agent session parts — New part functionality goes in the agent session part classes (
SidebarPart, AuxiliaryBarPart, PanelPart, ChatBarPart, ProjectBarPart), not the standard workbench parts
- Use separate storage keys — Agent session parts use their own storage keys (prefixed with
workbench.agentsession. or workbench.chatbar.) to avoid conflicts with regular workbench state
- Use agent session menu IDs — Actions should use
Menus.* menu IDs (from sessions/browser/menus.ts), not shared MenuId.* constants
4. Key Files
| File |
Purpose |
sessions/LAYOUT.md |
Authoritative layout specification |
sessions/browser/workbench.ts |
Main layout implementation (Workbench class) |
sessions/browser/menus.ts |
Agents menu IDs (Menus export) |
sessions/browser/layoutActions.ts |
Layout actions (toggle sidebar, panel, secondary sidebar) |
sessions/browser/paneCompositePartService.ts |
AgenticPaneCompositePartService |
sessions/browser/media/style.css |
Layout-specific styles |
sessions/browser/parts/parts.ts |
AgenticParts enum |
sessions/browser/parts/titlebarPart.ts |
Titlebar part, MainTitlebarPart, AuxiliaryTitlebarPart, TitleService |
sessions/browser/parts/sidebarPart.ts |
Sidebar part (with footer and macOS traffic light spacer) |
sessions/browser/parts/chatBarPart.ts |
Chat Bar part |
sessions/browser/parts/auxiliaryBarPart.ts |
Auxiliary Bar part (with run script dropdown) |
sessions/browser/parts/panelPart.ts |
Panel part |
sessions/browser/parts/projectBarPart.ts |
Project Bar part (folder entries, icon customization) |
sessions/contrib/configuration/browser/configuration.contribution.ts |
Sets workbench.editor.useModal to 'all' for modal editor overlay |
sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts |
Title bar widget and agent picker |
sessions/contrib/chat/browser/runScriptAction.ts |
Run script split button for titlebar |
sessions/contrib/accountMenu/browser/account.contribution.ts |
Account widget for sidebar footer |
sessions/electron-browser/parts/titlebarPart.ts |
Desktop (Electron) titlebar part |
5. Testing Changes
After modifying layout code:
- Verify the build compiles without errors via the
VS Code - Build task
- Ensure the grid structure matches the spec's visual representation
- Confirm part visibility toggling works correctly (show/hide/maximize)
- Test that editors open in the
ModalEditorPart overlay and that it closes properly
- Verify sidebar footer renders with account widget
1---2name: agent-sessions-layout3description: Agents workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agents workbench layout.4---56When working on the Agents workbench layout, always follow these guidelines:78## 1. Read the Specification First910The authoritative specification for the Agents layout lives at:1112**`src/vs/sessions/LAYOUT.md`**1314Before making any changes to the layout code, read and understand the current spec. It defines:1516- The fixed layout structure (grid tree, part positions, default sizes)17- Which parts are included/excluded and their visibility defaults18- Titlebar configuration and custom menu IDs19- Editor modal overlay behavior and sizing20- Part visibility API and events21- Agent session part classes and storage keys22- Workbench contributions and lifecycle23- CSS classes and file structure2425## 2. Keep the Spec in Sync2627If you modify the layout implementation, you **must** update `LAYOUT.md` to reflect those changes. The spec should always match the code. This includes:2829- Adding/removing parts or changing their positions30- Changing default visibility or sizing31- Adding new actions, menus, or contributions32- Modifying the grid structure33- Changing titlebar configuration34- Adding new CSS classes or file structure changes3536Update the **Revision History** table at the bottom of `LAYOUT.md` with a dated entry describing what changed.3738## 3. Implementation Principles3940When proposing or implementing changes, follow these rules from the spec:41421. **Maintain fixed positions** — Do not add settings-based position customization432. **Panel must span the right section width** — The grid structure places the panel below Chat Bar and Auxiliary Bar only443. **Sidebar spans full height** — Sidebar is in the main content branch, spanning from top to bottom454. **New parts go in the right section** — Any new parts should be added to the horizontal branch alongside Chat Bar and Auxiliary Bar465. **Preserve no-op methods** — Unsupported features (zen mode, centered layout, etc.) should remain as no-ops, not throw errors476. **Handle pane composite lifecycle** — When hiding/showing parts, manage the associated pane composites487. **Use agent session parts** — New part functionality goes in the agent session part classes (`SidebarPart`, `AuxiliaryBarPart`, `PanelPart`, `ChatBarPart`, `ProjectBarPart`), not the standard workbench parts498. **Use separate storage keys** — Agent session parts use their own storage keys (prefixed with `workbench.agentsession.` or `workbench.chatbar.`) to avoid conflicts with regular workbench state509. **Use agent session menu IDs** — Actions should use `Menus.*` menu IDs (from `sessions/browser/menus.ts`), not shared `MenuId.*` constants5152## 4. Key Files5354| File | Purpose |55|------|---------|56| `sessions/LAYOUT.md` | Authoritative layout specification |57| `sessions/browser/workbench.ts` | Main layout implementation (`Workbench` class) |58| `sessions/browser/menus.ts` | Agents menu IDs (`Menus` export) |59| `sessions/browser/layoutActions.ts` | Layout actions (toggle sidebar, panel, secondary sidebar) |60| `sessions/browser/paneCompositePartService.ts` | `AgenticPaneCompositePartService` |61| `sessions/browser/media/style.css` | Layout-specific styles |62| `sessions/browser/parts/parts.ts` | `AgenticParts` enum |63| `sessions/browser/parts/titlebarPart.ts` | Titlebar part, MainTitlebarPart, AuxiliaryTitlebarPart, TitleService |64| `sessions/browser/parts/sidebarPart.ts` | Sidebar part (with footer and macOS traffic light spacer) |65| `sessions/browser/parts/chatBarPart.ts` | Chat Bar part |66| `sessions/browser/parts/auxiliaryBarPart.ts` | Auxiliary Bar part (with run script dropdown) |67| `sessions/browser/parts/panelPart.ts` | Panel part |68| `sessions/browser/parts/projectBarPart.ts` | Project Bar part (folder entries, icon customization) |69| `sessions/contrib/configuration/browser/configuration.contribution.ts` | Sets `workbench.editor.useModal` to `'all'` for modal editor overlay |70| `sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts` | Title bar widget and agent picker |71| `sessions/contrib/chat/browser/runScriptAction.ts` | Run script split button for titlebar |72| `sessions/contrib/accountMenu/browser/account.contribution.ts` | Account widget for sidebar footer |73| `sessions/electron-browser/parts/titlebarPart.ts` | Desktop (Electron) titlebar part |7475## 5. Testing Changes7677After modifying layout code:78791. Verify the build compiles without errors via the `VS Code - Build` task802. Ensure the grid structure matches the spec's visual representation813. Confirm part visibility toggling works correctly (show/hide/maximize)824. Test that editors open in the `ModalEditorPart` overlay and that it closes properly835. Verify sidebar footer renders with account widget