Skip to content

Smooth package-list scrolling and stop re-parsing SVG icons on every scroll#5051

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/5011-package-list-scroll
Jul 7, 2026
Merged

Smooth package-list scrolling and stop re-parsing SVG icons on every scroll#5051
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/5011-package-list-scroll

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request introduces two main improvements: smoother DataGrid wheel scrolling and significant performance optimization for SVG icon loading. The new DataGridWheelAnimator class provides a WinUI-like eased scroll experience, and the SvgIcon control now memoizes parsed SVGs to avoid redundant parsing and asset loading, greatly improving UI responsiveness during heavy DataGrid usage.

UI/UX Improvements:

  • Added DataGridWheelAnimator to enable eased, animated wheel scrolling for DataGrid, replacing the default instant jump with a smoother experience. This is achieved by driving the internal scroll method via reflection and gradually applying the scroll delta. (src/UniGetUI.Avalonia/Views/Controls/DataGridWheelAnimator.cs, src/UniGetUI.Avalonia/Views/Controls/DataGridWheelAnimator.csR1-R65)
  • Integrated the new scroll animator by attaching it to PackageList in the packages page, so users benefit from the improved scrolling immediately. (src/UniGetUI.Avalonia/Views/SoftwarePages/AbstractPackagesPage.axaml.cs

Performance Optimizations:

  • Refactored SvgIcon to cache parsed SVGs using a thread-safe dictionary, preventing repeated parsing and asset loading for the same icon URI. This greatly reduces UI thread work and improves scrolling performance when icons are reused. (src/UniGetUI.Avalonia/Views/Controls/SvgIcon.cs
  • Moved SVG parsing logic into a static method and record, ensuring that geometry and viewbox calculations are performed once per unique asset and reused efficiently. (src/UniGetUI.Avalonia/Views/Controls/SvgIcon.cs

@GabrielDuf Gabriel Dufresne (GabrielDuf) linked an issue Jul 7, 2026 that may be closed by this pull request
4 tasks
@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 10d0a5b into main Jul 7, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the fix/5011-package-list-scroll branch July 7, 2026 13:45
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.

[BUG] Laggy Listview Scrolling Behavior

2 participants