modal - preserve maximised state in memory#297652
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for remembering whether the modal editor is maximized across modal editor part instances within the same workbench session, improving continuity of the modal editor UX.
Changes:
- Add
maximized?: booleantoIModalEditorPartOptionsand initialize/apply it in the modal editor part implementation. - Track the last maximized state in
EditorPartsand apply it when creating a new modal editor part. - Add a regression test ensuring the maximized state is remembered across modal instances.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/workbench/services/editor/test/browser/modalEditorGroup.test.ts | Adds a test validating maximized state is preserved across modal part instances. |
| src/vs/workbench/browser/parts/editor/modalEditorPart.ts | Initializes modal maximized state from options and supports updating it via updateOptions. |
| src/vs/workbench/browser/parts/editor/editorParts.ts | Remembers maximized state in-memory and uses it as the default on modal creation. |
| src/vs/platform/editor/common/editor.ts | Extends modal editor options API with maximized?: boolean. |
| this.modalEditorPart = undefined; | ||
| })); | ||
|
|
||
| // Track maximized state in memory |
There was a problem hiding this comment.
modalEditorMaximized is only updated via onDidChangeMaximized. If a caller creates the modal with an explicit options.maximized that differs from the remembered value, closing the modal without toggling will leave modalEditorMaximized unchanged, so the next modal may not reflect the last modal’s maximized state. Consider explicitly syncing modalEditorMaximized to the created part’s initial maximized (or to options.maximized when provided), and add a test that covers creating a modal with maximized: true/false without toggling.
| // Track maximized state in memory | |
| // Track maximized state in memory | |
| this.modalEditorMaximized = options?.maximized ?? this.modalEditorMaximized; |
No description provided.