Skip to content

fix: avoid forced reflows in DiffEditor gutter during scrolling#312599

Open
g122622 wants to merge 1 commit intomicrosoft:mainfrom
g122622:fix/diff-editor-scroll-performance
Open

fix: avoid forced reflows in DiffEditor gutter during scrolling#312599
g122622 wants to merge 1 commit intomicrosoft:mainfrom
g122622:fix/diff-editor-scroll-performance

Conversation

@g122622
Copy link
Copy Markdown
Contributor

@g122622 g122622 commented Apr 26, 2026

Use ResizeObserver to asynchronously track button height changes instead of synchronously reading clientHeight during scroll-triggered layout() calls. This eliminates forced style recalculations that caused significant scrolling performance degradation in the Diff Editor.

The issue was particularly noticeable after extended use when context keys change frequently, triggering menu updates that exacerbated the forced reflow problem.

Fixes #312596

before:

image

after my fix:

image

Use ResizeObserver to asynchronously track button height changes instead
of synchronously reading clientHeight during scroll-triggered layout()
calls. This eliminates forced style recalculations that caused significant
scrolling performance degradation in the Diff Editor.

The issue was particularly noticeable after extended use when context keys
change frequently, triggering menu updates that exacerbated the forced
reflow problem.

Fixes microsoft#312596
Copilot AI review requested due to automatic review settings April 26, 2026 11:01
@g122622
Copy link
Copy Markdown
Contributor Author

g122622 commented Apr 26, 2026

@g122622 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@g122622
Copy link
Copy Markdown
Contributor Author

g122622 commented Apr 26, 2026

@microsoft-github-policy-service agree

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance degradation in Diff Editor due to forced reflows during scrolling

3 participants