Skip to content

editors - introduce MODAL_GROUP for a modal editor part#293020

Merged
bpasero merged 7 commits intomainfrom
ben/yelling-canid
Feb 5, 2026
Merged

editors - introduce MODAL_GROUP for a modal editor part#293020
bpasero merged 7 commits intomainfrom
ben/yelling-canid

Conversation

@bpasero
Copy link
Member

@bpasero bpasero commented Feb 5, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 5, 2026 06:20
@bpasero bpasero self-assigned this Feb 5, 2026
Copy link
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 pull request introduces a MODAL_GROUP constant and infrastructure for opening editors in modal overlay windows on top of the main workbench, providing a focused editing experience for specific editors like Settings and Keyboard Shortcuts.

Changes:

  • Adds MODAL_GROUP constant (-4) and IModalEditorPart interface following the pattern established by AUX_WINDOW_GROUP for auxiliary windows
  • Implements ModalEditorPartImpl class that extends EditorPart with modal-specific behaviors (single tab mode, auto-close on empty, merge dirty editors on close)
  • Updates preferences service and user data profile features to open editors in modal when the workbench.editor.allowOpenInModalEditor experimental setting is enabled

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/vs/workbench/services/editor/common/editorService.ts Adds MODAL_GROUP constant and type definition
src/vs/workbench/services/editor/common/editorGroupsService.ts Adds IModalEditorPart interface with onWillClose event and close() method
src/vs/workbench/services/editor/common/editorGroupFinder.ts Updates findGroup() to handle MODAL_GROUP, creating modal editor parts when the feature flag is enabled
src/vs/workbench/services/editor/common/editorGroupColumn.ts Updates column-to-group conversion to recognize MODAL_GROUP
src/vs/workbench/browser/parts/editor/modalEditorPart.ts Implements ModalEditorPart factory and ModalEditorPartImpl with modal-specific UI and behavior
src/vs/workbench/browser/parts/editor/media/modalEditorPart.css Adds CSS styling for modal overlay with dimmed backdrop, shadow, and centered positioning
src/vs/workbench/browser/parts/editor/editorParts.ts Implements createModalEditorPart() with singleton pattern and updates getPartByDocument() to detect focus in modal
src/vs/workbench/browser/parts/editor/editor.ts Adds createModalEditorPart() to IEditorPartsView interface
src/vs/workbench/services/preferences/common/preferences.ts Adds openInModal option to settings and keybindings editor options
src/vs/workbench/services/preferences/browser/preferencesService.ts Updates to use MODAL_GROUP via getEditorGroupFromOptions() when openInModal is true
src/vs/workbench/services/preferences/test/browser/preferencesService.test.ts Refactors test to use TestEditorService instead of group-based approach
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts Updates default settings and keybindings commands to pass openInModal: true
src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts Updates profiles editor to open with MODAL_GROUP directly
src/vs/workbench/browser/workbench.contribution.ts Adds workbench.editor.allowOpenInModalEditor experimental boolean setting
src/vs/workbench/test/browser/workbenchTestServices.ts Adds stub implementations of createModalEditorPart() to test services
src/vs/workbench/services/editor/test/browser/modalEditorGroup.test.ts Comprehensive test suite covering modal creation, singleton behavior, events, options enforcement, and closing
.github/instructions/modal-editor-part.instructions.md Architecture documentation describing the design, implementation, and usage patterns

@bpasero bpasero marked this pull request as ready for review February 5, 2026 11:15
@bpasero bpasero enabled auto-merge (squash) February 5, 2026 11:15
@bpasero bpasero added this to the February 2026 milestone Feb 5, 2026
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@rzhao271

Matched files:

  • src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts

Copy link
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

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comment on lines +69 to +76
- Enforces `showTabs: 'single'` and `closeEmptyGroups: true`
- Overrides `removeGroup` to close modal when last group is removed
- Does not persist state (modal is transient)
- Merges editors back to main part on close

### Key Behaviors

1. **Single Tab Mode**: Modal enforces `showTabs: 'single'` for a focused experience
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The documentation incorrectly states that the modal editor enforces showTabs: 'single' in two places (lines 69 and 76), but the actual implementation in modalEditorPart.ts line 200 enforces showTabs: 'none'. The documentation should be updated to accurately reflect the implementation which hides tabs entirely rather than showing a single tab.

Suggested change
- Enforces `showTabs: 'single'` and `closeEmptyGroups: true`
- Overrides `removeGroup` to close modal when last group is removed
- Does not persist state (modal is transient)
- Merges editors back to main part on close
### Key Behaviors
1. **Single Tab Mode**: Modal enforces `showTabs: 'single'` for a focused experience
- Enforces `showTabs: 'none'` and `closeEmptyGroups: true`
- Overrides `removeGroup` to close modal when last group is removed
- Does not persist state (modal is transient)
- Merges editors back to main part on close
### Key Behaviors
1. **Tabs Hidden**: Modal enforces `showTabs: 'none'` so no tabs are shown

Copilot uses AI. Check for mistakes.
@bpasero bpasero merged commit bf79fb6 into main Feb 5, 2026
27 of 28 checks passed
@bpasero bpasero deleted the ben/yelling-canid branch February 5, 2026 11:33
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.

2 participants