editors - introduce MODAL_GROUP for a modal editor part#293020
Conversation
There was a problem hiding this comment.
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_GROUPconstant (-4) andIModalEditorPartinterface following the pattern established byAUX_WINDOW_GROUPfor auxiliary windows - Implements
ModalEditorPartImplclass that extendsEditorPartwith 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.allowOpenInModalEditorexperimental 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 |
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @rzhao271Matched files:
|
| - 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 |
There was a problem hiding this comment.
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.
| - 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 |
No description provided.