Skip to content

Improve DataGrid wheel scrolling performance and error handling#5064

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/datagrid-wheel-scroll-judder
Jul 8, 2026
Merged

Improve DataGrid wheel scrolling performance and error handling#5064
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/datagrid-wheel-scroll-judder

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request introduces improvements to icon loading robustness and enhances the smooth scrolling experience in data grids. The most significant changes include making icon decoding more resilient to corrupted or incomplete files, and replacing the timer-based scroll animation with a more natural, frame-based easing approach.

Icon loading robustness:

  • Added the TryDecodeIcon helper methods in PackageCollections.cs to gracefully handle corrupted or incomplete cached icon files by catching decoding errors and logging them, preventing exceptions from surfacing.
  • Updated the icon loading logic in LoadIconAsync to use TryDecodeIcon for both file and HTTP sources, ensuring null is cached when decoding fails.

Data grid scroll animation improvements:

  • Replaced the timer-based scroll animation in DataGridWheelAnimator with a frame-based approach using RequestAnimationFrame, providing smoother and more natural easing for vertical wheel scrolling.
  • Adjusted scroll parameters: increased WheelStep for faster scrolling per notch, and introduced a time constant Tau for exponential easing, resulting in a more responsive and visually appealing glide effect.
  • Removed the unused DispatcherTimer and related code, simplifying the animation logic.

These changes improve both the reliability of icon display and the user experience when scrolling through data grids.

… frames

The wheel-scroll easing ran on a fixed-rate DispatcherTimer whose ticks are
not aligned to the display refresh, so motion juddered on the Installed/Updates
lists where per-row background work keeps the UI thread busy. Advance the ease
from TopLevel.RequestAnimationFrame (vsync-aligned) with time-based decay so it
stays smooth at any refresh rate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 4014277 into main Jul 8, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the fix/datagrid-wheel-scroll-judder branch July 8, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants