fix #307574. support opening scm diff in modal.#307575
Draft
fix #307574. support opening scm diff in modal.#307575
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an experimental setting to open Source Control diff editors in a modal editor overlay, and wires it into SCM view interactions to address issue #307574.
Changes:
- Added
scm.allowOpenInModalEditorexperimental setting. - Updated SCM view and SCM history view to open diff editors in
MODAL_GROUPwhen the setting is enabled. - Adjusted an SCM editor menu
whenclause related to Chat setup context keys.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/scm/browser/scmViewPane.ts |
Special-cases SCM diff open to use modal editor overlay when configured. |
src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts |
Opens history diff editors in modal group when configured. |
src/vs/workbench/contrib/scm/browser/scm.contribution.ts |
Registers the new setting and updates an editor menu condition. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in way to open Source Control diff editors in the modal editor overlay, addressing limited editor space on smaller screens when reviewing SCM changes.
Changes:
- Added a new SCM setting (
scm.allowOpenInModalEditor) to toggle opening diffs in the modal editor overlay. - Routed SCM resource diff opens to a new internal command that forces the diff into
MODAL_GROUPwhen the setting is enabled. - Updated SCM history diff opens to optionally target
MODAL_GROUPdirectly viaIEditorService.openEditor.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/scm/browser/scmViewPane.ts | Switches SCM diff opens to a modal-specific diff command when the new setting is enabled. |
| src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts | Optionally opens SCM history diffs in MODAL_GROUP based on the new setting. |
| src/vs/workbench/contrib/scm/browser/scm.contribution.ts | Registers the new experimental setting controlling modal diff behavior in SCM. |
| src/vs/workbench/browser/parts/editor/editorCommands.ts | Adds _workbench.diffInModal and factors diff-opening logic into a shared helper with a column override. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using VS Code on a relatively small monitor (e.g., a laptop), if we have agents view, and file explorer open, it leaves really little space for editor group. This makes it really hard to review changes from time to time since the diff editor is opened in the editor group.
I'd love to propose we allow diff editor (for now limit to sim) to be opened in modal
#307574
Screen.Recording.2026-04-02.at.9.25.02.PM.mov