Skip to content

Agents - maintain maximized state when opening in modal/main editor parts#311877

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/relieved-panther
Apr 22, 2026
Merged

Agents - maintain maximized state when opening in modal/main editor parts#311877
lszomoru merged 1 commit intomainfrom
lszomoru/relieved-panther

Conversation

@lszomoru
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 22, 2026 10:11
@lszomoru lszomoru enabled auto-merge (squash) April 22, 2026 10:11
@lszomoru lszomoru self-assigned this Apr 22, 2026
@lszomoru lszomoru added this to the 1.118.0 milestone Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 9240766a Current: b2a22103

Changed (4)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineChatAffordance/InlineChatOverlay/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
agentSessionsViewer/NeedsInput/Light
Before After
before after

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 aims to preserve the editor “maximized” state when switching between the main editor part and the modal editor part in the Agents (sessions) window.

Changes:

  • Capture the main editor maximized state before moving editors into a modal editor part, and attempt to apply it to the modal.
  • Capture the modal editor part’s maximized state before moving editors back to the main editor part, and attempt to apply it to the main layout.
  • Refactor modal editor part access to use activeModalEditorPart (part + group) rather than only the active group.
Show a summary per file
File Description
src/vs/sessions/contrib/editor/browser/editor.contribution.ts Adds maximize-state capture/restore logic when moving editors between main and modal editor parts in the Agents window.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment on lines +157 to +158
// Maximize
if (isMaximized) {
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

modalPart.toggleMaximized() is called based on the main layout’s isEditorMaximized() value, but modal editor parts can start already maximized (they remember maximized state across instances). In that case this unconditional toggle will invert the modal state and break the intended “inherit maximized state” behavior. Consider toggling only when modalPart.maximized !== isMaximized (or using modalPart.updateOptions({ maximized: isMaximized })).

Suggested change
// Maximize
if (isMaximized) {
// Match the modal editor maximized state to the main editor maximized state
if (modalPart.maximized !== isMaximized) {

Copilot uses AI. Check for mistakes.
Comment on lines +230 to +233
// Maximize
if (isMaximized) {
layoutService.setEditorMaximized(true);
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

When switching from modal back to the main editor, the main editor maximized state is only set when isMaximized is true. If the main layout was maximized before opening the modal and the user un-maximizes the modal while it’s open, the main layout can remain maximized (sidebars/chatbar stay hidden) even though the modal wasn’t maximized on exit. Consider always syncing the main layout to the modal state via layoutService.setEditorMaximized(isMaximized) instead of only setting true conditionally.

Suggested change
// Maximize
if (isMaximized) {
layoutService.setEditorMaximized(true);
}
// Sync the main editor layout to the modal maximized state
layoutService.setEditorMaximized(isMaximized);

Copilot uses AI. Check for mistakes.
@lszomoru lszomoru merged commit 5b56487 into main Apr 22, 2026
30 checks passed
@lszomoru lszomoru deleted the lszomoru/relieved-panther branch April 22, 2026 10:45
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