multiDiffEditor: Apply the editor scrolling settings - #331057
Open
Philipp Wollermann (philwo) wants to merge 2 commits into
Open
multiDiffEditor: Apply the editor scrolling settings#331057Philipp Wollermann (philwo) wants to merge 2 commits into
Philipp Wollermann (philwo) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds coverage and implementation to ensure MultiDiffEditor scrolling behavior respects core editor scrolling settings.
Changes:
- Add browser tests validating wheel scrolling sensitivity, predominant axis behavior, and smooth scrolling in MultiDiffEditor.
- Wire MultiDiffEditor’s root scrollable element to editor configuration values (
mouseWheelScrollSensitivity,fastScrollSensitivity,scrollPredominantAxis,smoothScrolling). - Export the shared smooth scrolling duration constant for reuse.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts | New browser tests asserting MultiDiffEditor respects editor scrolling settings. |
| src/vs/editor/common/viewLayout/viewLayout.ts | Exports SMOOTH_SCROLLING_TIME for reuse outside the module. |
| src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts | Applies editor scrolling configuration to MultiDiffEditor’s scroll container and smooth-scroll duration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
@microsoft-github-policy-service agree |
The multi-file diff editor gives every per-file diff editor `handleMouseWheel: false` and sizes it to its content height, so the one scrollable that hosts all files handles the wheel. That scrollable was set up with fixed values, so four `editor.*` settings had no effect there: - `editor.mouseWheelScrollSensitivity` and `editor.fastScrollSensitivity` fell back to the defaults in `resolveOptions`, 1 and 5. - `editor.scrollPredominantAxis` fell back to its default, true. - `editor.smoothScrolling` was ignored. Smooth scrolling was always on, while a normal editor has it off by default. The same wheel tick that scrolls a normal editor tab by the configured amount moved the diff of a commit by the default amount instead. Read all four settings from the configuration and keep the scrollable in sync with them. The values go through the editor option validation, so odd values behave as they do in a normal editor, and the smooth scroll duration reuses `SMOOTH_SCROLLING_TIME`. This covers every user of the widget: the diff of a commit from the Source Control Graph, the Changes editor, and the notebook multi diff editor. Fixes microsoft#261443 Fixes microsoft#200855 Supersedes microsoft#262669. That change covers the sensitivity settings and the predominant axis but not smooth scrolling, does not validate the values, has an unused import that fails the build, and has no tests.
Philipp Wollermann (philwo)
force-pushed
the
multidiff-scroll-sensitivity
branch
from
August 16, 2026 03:50
4735ef1 to
806e655
Compare
Two problems show up in `scripts/test.sh` but not in the browser test runner, so the first version of these tests only passed in one of the two environments CI uses. The Electron runner creates its window with `show: false`, and Chromium does not run `requestAnimationFrame` in a hidden window. A smooth scroll is scheduled there but never advances, so where the animation ends is not observable. Assert only that the tick is not applied synchronously, which is the part of the behavior the widget is responsible for. Editor contributions such as the word highlighter resolve the diff models by URI. The models belong to the test and are not registered with the model service, so the resolver threw and logged an error, which the Electron runner reports as a test failure. Give those contributions a text model service that hands out the two models behind references that do not dispose them.
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.
I noticed that setting
editor.mouseWheelScrollSensitivitydidn't work in the diff viewer for Git commits. This PR fixes it. :) Two older issues and a PR addressed similar problems, but were still open - I've incorporated their changes and feedback into this one as well.The multi-file diff editor gives every per-file diff editor
handleMouseWheel: falseand sizes it to its content height, so the one scrollable that hosts all files handles the wheel. That scrollable was set up with fixed values, so foureditor.*settings had no effect there:editor.mouseWheelScrollSensitivityandeditor.fastScrollSensitivityfell back to the defaults inresolveOptions, 1 and 5.editor.scrollPredominantAxisfell back to its default, true.editor.smoothScrollingwas ignored. Smooth scrolling was always on,while a normal editor has it off by default.
The same wheel tick that scrolls a normal editor tab by the configured amount moved the diff of a commit by the default amount instead.
Read all four settings from the configuration and keep the scrollable in sync with them. The values go through the editor option validation, so odd values behave as they do in a normal editor, and the smooth scroll duration reuses
SMOOTH_SCROLLING_TIME.This covers every user of the widget: the diff of a commit from the Source Control Graph, the Changes editor, and the notebook multi diff editor.
Fixes #261443
Fixes #200855
Supersedes #262669. That change covers the sensitivity settings and the predominant axis but not smooth scrolling, does not validate the values, has an unused import that fails the build, and has no tests.