Skip to content

Commit 503edcb

Browse files
lszomoruCopilot
andauthored
Agents - fix issue with the editor part being hidden when the modal editor (ex: settings) opens (#310540)
* Agents - fix issue with the editor part being hidden when the modal editor (ex: settings) opens * Update src/vs/sessions/LAYOUT.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f5b4ab4 commit 503edcb

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

src/vs/sessions/LAYOUT.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ The Agent Sessions Workbench (`Workbench` in `sessions/browser/workbench.ts`) pr
1919
### 2.1 Visual Representation
2020

2121
```
22-
┌─────────┬───────────────────────────────────────────────────────┐
23-
│ │ Titlebar │
24-
│ ├──────────────────────────────────────────────────────┤
25-
│ Sidebar │ Chat Bar │ Auxiliary Bar │
26-
│ ├──────────────────────────────────────────────────────┤
27-
│ │ Panel │
28-
└─────────┴───────────────────────────────────────────────────────┘
22+
┌─────────┬────────────────────────────────────────────────────────────────────
23+
│ │ Titlebar
24+
│ ├───────────────────────────────────────────┬───────────────────────┤
25+
│ Sidebar │ Chat Bar │ Editor (hid.) Auxiliary Bar
26+
│ ├───────────────────────────────────────────┴───────────────────────┤
27+
│ │ Panel
28+
└─────────┴────────────────────────────────────────────────────────────────────
2929
3030
Editors open via MODAL_GROUP into the standard ModalEditorPart overlay
3131
(created on-demand by EditorParts.createModalEditorPart). The main
32-
editor part exists but is hidden (display:none) for future use.
32+
editor part is hidden by default and is only shown for explicit
33+
editor opens or restores that target the main editor part.
3334
```
3435

3536
### 2.2 Parts
@@ -41,7 +42,7 @@ editor part exists but is hidden (display:none) for future use.
4142
| Titlebar | `Parts.TITLEBAR_PART` | Top of right section | Always visible ||
4243
| Sidebar | `Parts.SIDEBAR_PART` | Left, spans full height from top to bottom | Visible | `ViewContainerLocation.Sidebar` |
4344
| Chat Bar | `Parts.CHATBAR_PART` | Top-right section, takes remaining width | Visible | `ViewContainerLocation.ChatBar` |
44-
| Editor | `Parts.EDITOR_PART` | Hidden main part (not in grid); editors open via `MODAL_GROUP` into `ModalEditorPart` overlay | Hidden ||
45+
| Editor | `Parts.EDITOR_PART` | Top-right section, in the grid but hidden by default; explicit opens or restores that target the main editor part can reveal it while modal editors still open via `MODAL_GROUP` into `ModalEditorPart` overlay | Hidden ||
4546
| Auxiliary Bar | `Parts.AUXILIARYBAR_PART` | Top-right section, right side | Visible | `ViewContainerLocation.AuxiliaryBar` |
4647
| Panel | `Parts.PANEL_PART` | Below Chat Bar and Auxiliary Bar (right section only) | Hidden | `ViewContainerLocation.Panel` |
4748

@@ -178,7 +179,7 @@ The sessions sidebar can be resized down to a minimum width of 170px.
178179

179180
### 4.3 Editor Modal
180181

181-
The main editor part is created but hidden (`display:none`). It exists for future use but is not currently visible. All editors are forced to open in the `ModalEditorPart` overlay via the standard `createModalEditorPart()` mechanism.
182+
The main editor part is created hidden (`display:none`) and remains hidden for the default sessions experience. Flows that explicitly open or restore an editor into the main editor part can reveal it, and modal editor opens do not change the visibility of an already visible main editor. Editors without an explicit main-part target still open in the `ModalEditorPart` overlay via the standard `createModalEditorPart()` mechanism.
182183

183184
#### How It Works
184185

@@ -248,7 +249,8 @@ setPartHidden(hidden: boolean, part: Parts): void
248249
- **Panel Part:**
249250
- If the panel is maximized when hiding, it exits maximized state first
250251
- **Editor Part:**
251-
- The main editor part is always hidden (`display:none`); `setEditorHidden()` is a no-op
252+
- The main editor part is hidden by default but can be shown for explicit editor workflows that target the main editor part
253+
- Modal editor opens do not change the current main editor visibility state
252254
- All editors open via `MODAL_GROUP` into the `ModalEditorPart` overlay, which manages its own lifecycle
253255

254256
### 6.2 Part Sizing
@@ -655,6 +657,8 @@ interface IPartVisibilityState {
655657

656658
| Date | Change |
657659
|------|--------|
660+
| 2026-04-16 | Updated the layout visual representation to show the editor part in the top-right row and mark it as hidden by default. |
661+
| 2026-04-16 | Fixed the sessions workbench so modal editor opens no longer hide an already visible main editor part, and documented that the main editor stays hidden by default but can be revealed by explicit non-modal editor flows. |
658662
| 2026-04-15 | Updated the Sessions sidebar so pinned chats render in their own "Pinned" section header using the standard uppercase section styling, and that header only exposes the "Mark All as Done" section action. |
659663
| 2026-04-14 | Documented the sessions account control as a titlebar widget again and noted that it now prefers the signed-in GitHub profile image, falling back to the existing account codicon when the image is unavailable. |
660664
| 2026-04-14 | Updated the sessions-only default configuration so notification toasts default to the top-right corner via `workbench.notifications.position: 'top-right'`, without changing the regular workbench default. |

src/vs/sessions/browser/workbench.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,14 +671,12 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
671671
// Register layout listeners
672672
this.registerLayoutListeners();
673673

674-
// Keep background editor hidden for modal opens, only show for non-modal opens.
674+
// Editor opens should only affect the main editor part when
675+
// they actually target one of the main editor groups. Modal
676+
// opens stay neutral.
675677
this._register(this.editorService.onWillOpenEditor(e => {
676-
const isModalOpen = this.editorGroupService.activeModalEditorPart?.groups.some(group => group.id === e.groupId) ?? false;
677-
678-
if (isModalOpen) {
679-
if (this.partVisibility.editor) {
680-
this.setEditorHidden(true);
681-
}
678+
const targetsMainEditorPart = this.editorGroupService.mainPart.groups.some(group => group.id === e.groupId);
679+
if (!targetsMainEditorPart) {
682680
return;
683681
}
684682

0 commit comments

Comments
 (0)