Skip to content

multiDiffEditor: Apply the editor scrolling settings - #331057

Open
Philipp Wollermann (philwo) wants to merge 2 commits into
microsoft:mainfrom
philwo:multidiff-scroll-sensitivity
Open

multiDiffEditor: Apply the editor scrolling settings#331057
Philipp Wollermann (philwo) wants to merge 2 commits into
microsoft:mainfrom
philwo:multidiff-scroll-sensitivity

Conversation

@philwo

@philwo Philipp Wollermann (philwo) commented Aug 16, 2026

Copy link
Copy Markdown

I noticed that setting editor.mouseWheelScrollSensitivity didn'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: 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 #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.

Copilot AI balanced review requested due to automatic review settings August 16, 2026 02:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts
Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts
Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts
Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts
Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts
Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts Outdated
Comment thread src/vs/workbench/test/browser/multiDiffEditorScrolling.test.ts
@philwo

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

SCM Graph - Scroll speed setting Multi file diff editor ignores smooth scrolling setting

3 participants