Repository navigation
fix(scrollview): Scroll by wheel like WinUI's ScrollView - #24738
Conversation
|
Claude finished @MartinZikmund's task in 4m 15s —— View job Claude's Review
Verdict: fix-first — the core change is correct and well-isolated, but I found 2 minor/moderate test-quality issues worth addressing before merge. Issues found: 2 (both
Verified independently (not flagged, but worth noting since it's the crux of the change): I re-derived the braking curve math by hand — Other checks (events use |
5204d5b to
2728398
Compare
|
Claude finished @MartinZikmund's task in 2m 25s —— View job Claude's Review
Verdict: fix-first — the core change is correct and well-isolated, but 2 minor/moderate test-quality issues remain outstanding from the prior review pass (unchanged in this revision). Issues found: 2 (both
Verified independently (crux of the change): re-derived the braking curve math by hand — Other checks (events use Branch · |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new curve test can race before capturing its baseline and its tolerance still accepts linear motion.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Updates ScrollView wheel scrolling to match WinUI’s measured 32-DIP braking behavior.
Changes:
- Implements the quadratic wheel-inertia curve.
- Preserves remaining distance across wheel notches.
- Adds runtime coverage for distance, timing, and repeated notches.
Review result: Changes required; 2 moderate test reliability/coverage issues.
| File | Description |
|---|---|
Given_ScrollView.cs |
Tests wheel distance and motion. |
Given_InteractionTracker.cs |
Updates expected wheel values. |
InteractionTrackerPointerWheelInertiaHandler.cs |
Implements the braking curve. |
InteractionTrackerInertiaState.cs |
Carries remaining wheel distance forward. |
InteractionTrackerIdleState.cs |
Calculates initial wheel velocity. |
InteractionTracker.cs |
Changes each notch to 32 DIP. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
dd53c66 to
9c7da5b
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 7
Open (7)
The comment “only ever raises the velocity” is not generally true if a subsequent wheel input is in… · New Measuring curve timing using wall-clock timestamps insideCompositionTarget.Renderingmay be… · NewFindLastIndexcan return-1if no sample is exactly0(e.g., if the first recorded Rendering… · New Measuring curve timing using wall-clock timestamps insideCompositionTarget.Renderingmay be… · NewFindLastIndexcan return-1if no sample is exactly0(e.g., if the first recorded Rendering… · New Tighten timing tolerance to distinguish braking behavior Capture a baseline frame before injecting wheel input
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (11)
FindLastIndex(sample => sample.Position == 0)relies on exact float equality and can return -1… · New This test now depends directly on aninternalimplementation helper… · New The tolerance0.01onVerticalOffsetis extremely tight for a runtime/UI test (timing, DPI… · NewFindLastIndexcan return-1if no sample is exactly0(e.g., if the first recorded Rendering… Measuring curve timing using wall-clock timestamps insideCompositionTarget.Renderingmay be…FindLastIndexcan return-1if no sample is exactly0(e.g., if the first recorded Rendering… Measuring curve timing using wall-clock timestamps insideCompositionTarget.Renderingmay be… The comment “only ever raises the velocity” is not generally true if a subsequent wheel input is in… Tighten timing tolerance to distinguish braking behavior Capture a baseline frame before injecting wheel input The comment “only ever raises the velocity” is not generally true when wheel input arrives in the… · New
|
Claude finished @MartinZikmund's task in 2m 36s —— View job Claude's Review
Verdict: fix-first — the production curve change is correct and the two previously-flagged test-quality issues (hardcoded curve constants, overly-tight timing tolerance) are confirmed fixed in this revision. I found 2 new issues worth addressing before merge. Issues found: 2 (moderate — test coverage / reliability, no production-code correctness issues)
Verified independently (re-confirmed from the prior review pass since the curve itself is unchanged): the braking curve math — Other checks (events use |
|
Claude finished @MartinZikmund's task in 3m 4s —— View job Claude's Review
Verdict: fix-first — the curve math and production changes are correct (re-verified by hand: Issues found: 3 (posted as inline comments)
Other checks (events use |
|
Claude finished @MartinZikmund's task in 31s —— View job Claude's ReviewVerdict: fix-first. The production change is correct. All three open items are in test or comment code. HEAD is Production code. The curve Issues: 3 inline (2 moderate, 1 minor)
Cross-cutting
|
The InteractionTracker moved a ScrollView 48 DIP per notch at a constant velocity for 250ms, then stopped dead. Use the curve measured on WinUI 3: 32 DIP per notch whatever the viewport, along v0 * (1 - (t/T)^2) over T = 257ms, which starts without a jump and eases into the stop. A notch arriving mid-motion restarts the curve over what is left plus the notch, which only ever raises the velocity. The motion starts on the next frame rather than after WinUI's compositor latency. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016WqaiNE2QBeUszQFongehx
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016WqaiNE2QBeUszQFongehx
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
A notch against the motion shrinks what is left, so the restart does not always raise the velocity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Times each frame by its RenderingTime, the timestamp the tracker was advanced to, so the check needs no wall clock and no rest frame, and it fails for the old linear motion. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @MartinZikmund's task in 18s —— View job Claude's ReviewVerdict: ship. HEAD is What changed since the last pass: the curve test was rewritten ( Production code. The curve is Earlier findings, now resolved
Remaining notes (not blocking)
|
Port the wheel logic from WinUI's lifted compositor (dwmcorei.dll public symbols) instead of the curve fitted to measurements: a sine ease-out D·sin(π/2·t/T) over T = 250ms toward the clamped target, the target moved from the running wheel target, the duration shortened by the share of the move a clamp leaves, and a notch that leaves the target at the current position ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @MartinZikmund's task in 26s —— View job Claude's ReviewVerdict: ship after small fixes. I reviewed by inspection and did not build or run anything. HEAD is What changed since the last pass. The wheel curve is no longer the quadratic braking curve. It is now a sine ease-out,
Production code looks correct.
Inline findings: 1, a minor style nit (missing blank line before a doc comment). Cross-cutting
|
|
Claude finished @MartinZikmund's task in 24s —— View job Review of the latest push (
|
4c50d7e to
2a9cddc
Compare
|
The build 238269 found UI Test snapshots differences: Details
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |



GitHub Issue: closes #24732
PR Type:
🐞 Bugfix
What changed? 🚀
Uno moved a ScrollView 48 DIP per wheel notch at constant speed for 250 ms. It now follows WinUI's own wheel logic, which lives in the lifted compositor rather than in the WinUI sources (
ScrollPresenteronly setsVisualInteractionSource.PointerWheelConfig). The logic below was read fromdwmcorei.dll(WinAppSDKinteractiveexperiences2.1.9) using its public symbols:CInteractionTracker::ScrollToPosition): a keyframe animation with sine ease-out, D·sin(π/2·t/T), over T = 250 ms (MousewheelAnimationDurationMs). There is no first-frame jump.ProcessMousewheelManipulation): new target = running wheel target + delta, clamped, in either direction. The curve restarts from the current position, and a notch that leaves the target at the current position is ignored.CalculatePositionAnimationDuration): when the target is clamped, T shrinks by clamped/unclamped distance, with a 0.001 s floor.ninput.dllas "lines to scroll" × 16 px through the DPI, so it may depend on scale and the Windows setting. That still has to be confirmed at another scale.The earlier measured fit, v0·(1 − (t/T)²) over 257 ms, stayed within 2% of the sine, which is why measurement alone couldn't tell the two apart.
Tests (Runtime):
RenderingTime(the timestamp the tracker was advanced to), must imply the same start of the sine curve within 3 ms. That holds on any refresh rate. Linear motion (47 ms spread) and the old quadratic (9 ms) both fail.Measured with the scroll-smoothness probe from #24711 (
sample=Scrolling/ScrollSmoothnessTester&scrollprobe=...). newFps = presented frames showing a newly recorded frame per second; judder = RMS residual of the offset against a local quadratic through neighbouring presented frames.Full runtime suite (Skia Win32, 150% scale): no new failures versus master; the remaining failures are pre-existing (ListViewBase ×6, ScrollPresenterTests ×3 at fractional scale).
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_016WqaiNE2QBeUszQFongehx