Skip to content

Add required-only modal mode for editor overlays#302290

Open
joshspicer wants to merge 4 commits intomainfrom
copilot/tiny-gull
Open

Add required-only modal mode for editor overlays#302290
joshspicer wants to merge 4 commits intomainfrom
copilot/tiny-gull

Conversation

@joshspicer
Copy link
Member

@joshspicer joshspicer commented Mar 16, 2026

Lets us use modal for Chat Customizations while it may not be ready for other, existing editors.

Summary

  • add a new workbench.editor.useModal mode: required-only
  • make default product.quality !== 'stable' ? 'some' : 'required-only'
  • add EditorInputCapabilities.RequiresModal and gate MODAL_GROUP usage in required-only
  • mark Chat Customizations editor input as RequiresModal
  • keep some/all behavior as supersets and add config migration from essential-only to required-only

Validation

  • npm run compile-check-ts-native

Copilot AI review requested due to automatic review settings March 16, 2026 23:13
@vs-code-engineering
Copy link

📬 CODENOTIFY

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

@bpasero

Matched files:

  • src/vs/workbench/browser/workbench.contribution.ts
  • src/vs/workbench/common/editor.ts
  • src/vs/workbench/services/editor/common/editorGroupFinder.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

Adds a new “required-only” modal overlay mode to the workbench editor opening logic, allowing only explicitly-marked editor inputs to open in the modal editor part. This is used to ensure specific editors (e.g. Chat Customizations) can still open modally while reducing modal usage by default.

Changes:

  • Introduces workbench.editor.useModal = 'required-only' and sets it as the stable default (with migration from essential-only).
  • Adds EditorInputCapabilities.RequiresModal and gates MODAL_GROUP creation/usage under required-only.
  • Marks the Chat Customizations management editor input as RequiresModal.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/services/editor/common/editorGroupFinder.ts Gates MODAL_GROUP creation under required-only based on a new editor input capability.
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.ts Flags the Chat Customizations management editor as requiring modal.
src/vs/workbench/common/editor.ts Adds EditorInputCapabilities.RequiresModal capability bit.
src/vs/workbench/browser/workbench.contribution.ts Extends setting schema, updates default, and adds config migration to required-only.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +128 to 141
else if (preferredGroup === MODAL_GROUP) {
const modalMode = configurationService.getValue<string>('workbench.editor.useModal');
if (modalMode === 'required-only') {
// Only allow modal for editors that explicitly require it
const editorInput = isEditorInputWithOptions(input) ? input.editor : input;
if (isEditorInput(editorInput) && editorInput.hasCapability(EditorInputCapabilities.RequiresModal)) {
group = editorGroupService.createModalEditorPart(options?.modal)
.then(part => part.activeGroup);
}
} else if (modalMode !== 'off') {
group = editorGroupService.createModalEditorPart(options?.modal)
.then(part => part.activeGroup);
}
}
Comment on lines +128 to +140
else if (preferredGroup === MODAL_GROUP) {
const modalMode = configurationService.getValue<string>('workbench.editor.useModal');
if (modalMode === 'required-only') {
// Only allow modal for editors that explicitly require it
const editorInput = isEditorInputWithOptions(input) ? input.editor : input;
if (isEditorInput(editorInput) && editorInput.hasCapability(EditorInputCapabilities.RequiresModal)) {
group = editorGroupService.createModalEditorPart(options?.modal)
.then(part => part.activeGroup);
}
} else if (modalMode !== 'off') {
group = editorGroupService.createModalEditorPart(options?.modal)
.then(part => part.activeGroup);
}
@mjbvz mjbvz modified the milestones: 1.112.0, 1.113.0 Mar 17, 2026
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 17, 2026

@joshspicer I am moving this to 1.113 since it is targeting main. Please bring it in as a candidate if needed

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

I do not see the advantage of this over using MODAL_GROUP when opening the editor. What problem is this trying to solve?

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.

4 participants