Skip to content

modal - preserve maximised state in memory#297652

Merged
bpasero merged 1 commit intomainfrom
ben/boring-krill
Feb 25, 2026
Merged

modal - preserve maximised state in memory#297652
bpasero merged 1 commit intomainfrom
ben/boring-krill

Conversation

@bpasero
Copy link
Copy Markdown
Member

@bpasero bpasero commented Feb 25, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 25, 2026 10:52
@bpasero bpasero enabled auto-merge (squash) February 25, 2026 10:52
@bpasero bpasero self-assigned this Feb 25, 2026
@bpasero bpasero added this to the February 2026 milestone Feb 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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?: boolean to IModalEditorPartOptions and initialize/apply it in the modal editor part implementation.
  • Track the last maximized state in EditorParts and 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
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// Track maximized state in memory
// Track maximized state in memory
this.modalEditorMaximized = options?.maximized ?? this.modalEditorMaximized;

Copilot uses AI. Check for mistakes.
@bpasero bpasero merged commit cd0c48e into main Feb 25, 2026
24 checks passed
@bpasero bpasero deleted the ben/boring-krill branch February 25, 2026 11:09
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants