Repository navigation
fix(scrollview): Tick InteractionTracker inertia per frame - #24736
Conversation
|
Claude finished @MartinZikmund's task in 6m 53s —— View job Review completeVerdict: ship — the per-frame retick is a solid, well-reasoned replacement for the thread-pool timers, and the state-machine edge cases (interrupt-under-a-held-finger, abort-without-move, reentrant Findings: 2, both low severity / non-blocking (posted inline)
What I verified while reviewing (no issue found):
Runtime tests were reviewed by inspection only (no Base for this review: |
b1dce38 to
fb644d8
Compare
|
Claude finished @MartinZikmund's task in 1m 33s —— View job Review completeVerdict: ship — re-checked this trigger and confirmed the diff against Findings: 0 new. I independently re-walked the full diff (all 17 files) against the
Both remain open/unaddressed in this snapshot; not re-posting duplicate inline comments for them. Cross-cutting notes (no issue):
|
|
Claude finished @MartinZikmund's task in 1m 57s —— View job Review completeVerdict: ship. This trigger re-reviews the PR after a new commit (
Findings: 0. I re-read the new commit's full diff against all three affected files line by line:
No new inline comments posted — nothing new to flag beyond what's already resolved. The two previously-open findings are now closed by this commit. Runtime tests were reviewed by inspection only (no Base for this review: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Source-less trackers can stall in multi-window applications because their inertia is tied to the first window’s frame target.
Review effort: Balanced
Findings: 1
What changed in this PR
Moves ScrollView inertia and wheel motion from timers to UI-thread frame ticks for smoother high-refresh-rate scrolling.
Changes:
- Adds frame-driven inertia handling and synchronous position propagation.
- Supports fractional wheel deltas and touch interruption.
- Adds Skia runtime coverage for scrolling behavior.
Review verdict: Fix-first — 1 blocking bug identified.
| File | Description |
|---|---|
CompositionTarget.Rendering.cs |
Registers the fallback frame-target resolver. |
CompositionTarget.FrameClock.cs |
Exposes frame ticks and resolves fallback targets. |
InputManager.Pointers.ManagedDirectManip.cs |
Interrupts inertia on press and completes gestures. |
InputManager.Pointers.Managed.cs |
Preserves fractional wheel deltas. |
CoreServices.cs |
Exposes XamlRoot lookup internally. |
Given_ScrollView.cs |
Tests wheel precision, frame synchronization, and touch interruption. |
InteractionTrackerState.cs |
Adds activation, interruption, and entry tracking. |
InteractionTrackerPointerWheelInertiaHandler.cs |
Converts wheel inertia to frame-driven motion. |
InteractionTrackerInteractingState.cs |
Handles inertia-interrupting presses. |
InteractionTrackerInertiaState.cs |
Starts and interrupts frame inertia. |
InteractionTrackerIdleState.cs |
Accepts fractional wheel deltas. |
InteractionTrackerFrameInertiaHandler.cs |
Implements shared frame-based inertia scheduling. |
InteractionTrackerCustomAnimationState.cs |
Updates wheel-delta type. |
InteractionTrackerActiveInputInertiaHandler.cs |
Converts touch inertia to frame-driven motion. |
InteractionTrackerActiveInputInertiaHandler.AxisHelper.cs |
Uses frame elapsed time for damping. |
InteractionTracker.cs |
Resolves frame targets and synchronizes position updates. |
ICompositionTarget.cs |
Adds frame-starting and interval contracts. |
Compositor.skia.cs |
Tracks and resolves frame drivers. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
2ef4a73 to
34f903c
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: 1
Open (6)
Free-standing trackers stall when first window stops presenting The default no-op implementation forFrameStartingmakes it easy for anICompositionTarget… · New Backdating the start timestamp byFrameIntervalInTickscan produce an incorrect first-step delta… · New This assertion hard-codes the expected pixels-per-detent (48px) which the production comment notes… · New This test relies on reflection to access a private field (m_interactionTracker), which is brittle… · NewInteractionTrackerActiveInputInertiaHandlernow inherits from… · New
|
Claude finished @MartinZikmund's task in 2m 52s —— View job Review complete
Verdict: ship. Findings: 0 new, 0 inline comments posted. I re-walked the full diff against Both previously-flagged, low-severity findings from earlier review passes are now resolved:
Cross-cutting notes (no new issue):
Runtime tests were reviewed by inspection only (no |
34f903c to
c8129a4
Compare
|
Claude finished @MartinZikmund's task in 1m 47s —— View job Review complete
Verdict: ship. No new commits landed since the last review pass. Status of previously-raised findings (all already posted inline by me or Copilot — not re-posted):
No cross-cutting concerns beyond what's already on the thread. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new tests lack required cleanup and issue traceability metadata.
Review effort: Balanced
Findings: 1
Open (8)
Free-standing trackers stall when first window stops presenting Clear shared WindowContent after tests to prevent state leakage · New This test relies on reflection to access a private field (m_interactionTracker), which is brittle… This assertion hard-codes the expected pixels-per-detent (48px) which the production comment notes… Backdating the start timestamp byFrameIntervalInTickscan produce an incorrect first-step delta… The default no-op implementation forFrameStartingmakes it easy for anICompositionTarget… Add required issue traceability metadata to regression test class · NewInteractionTrackerActiveInputInertiaHandlernow inherits from…
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24736/wasm-skia-net9/index.html |
|
The build 237827 found UI Test snapshots differences: Details
|
A composition target that silently never raised FrameStarting would leave inertia stuck, so implementers must now provide it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LtnnfqgXbPx1pR2QSUWcGj
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LtnnfqgXbPx1pR2QSUWcGj
Clear the window content after each test, link the tests to #24730, derive the wheel expectation from the tracker's detent size and read the tracker through an internal accessor instead of reflection. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LtnnfqgXbPx1pR2QSUWcGj
|
Claude finished @MartinZikmund's task in 24s —— View job Review completeVerdict: ship. Findings: 0 new, so no inline comments. This pass covered the three commits added since the last review: Open Copilot items these commits address:
Still open, non-blocking:
Validation: I did not run the runtime tests. The only runtime evidence on record is the full-suite run in the PR description, which predates these three commits. The commits are small and mechanical, but the interface change and the test edits have not been compiled or run since. |
|
The build 237842 found UI Test snapshots differences: Details
|
|
|
The wheel inertia lasts a fixed time, so a slow macOS agent recorded only 3-4 frames and failed the frames >= 5 precondition before the mismatch check ever ran. Assert the mismatches first and only require two frames. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011jrRt9mLQkJpfv6uqds4Xx
|
Claude finished @MartinZikmund's task in 15s —— View job Review completeVerdict: ship. Findings: 0 new, so no inline comments. This pass covers the one commit added since the last review,
Still open, non-blocking: a free-standing Validation: Code review only, by inspection. I did not run the runtime tests. The runtime evidence on record is the full-suite run in the PR description, which predates the last four commits. The latest CI build (237842) is reported as failed on Uno.UI - CI, and I did not investigate that failure. |
|
The build 237876 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. |
A tracker with no VisualInteractionSource has no window to name, so it was ticked on the first window's frames through a static resolver. It now subscribes to a compositor-wide tick that runs on every window's frames, at the latest of their timestamps, as WinUI's compositor ticks trackers. CompositionTargets register with the compositor as hosts, so the static resolver and the CoreServices.GetXamlRoot exposure go away. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011jrRt9mLQkJpfv6uqds4Xx
|
Claude finished @MartinZikmund's task in 28s —— View job Review completeVerdict: ship. The new commit Findings: 1 low-severity inline comment, non-blocking.
What I checked, no issue found:
Validation: code review by inspection only. I did not build or run the runtime tests. CI build 237842 was reported as failed, and I did not investigate it. |
|
The build 237950 found UI Test snapshots differences: Details
|
Since #24736 the tracker advances once per frame instead of on a 17ms timer. WaitTrackerLogs returned once the logs were unchanged for 100ms, so on software-rendered lanes (WebGPU on SwiftShader), where a frame takes longer than that, it sampled the logs mid-motion and saw 0-1 ValuesChanged. Wait for IdleStateEntered instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01L4YBGyfjv1uKVn6FUFxSEF
Since #24736 the tracker advances once per frame instead of on a 17ms timer. WaitTrackerLogs returned once the logs were unchanged for 100ms, so on software-rendered lanes (WebGPU on SwiftShader), where a frame takes longer than that, it sampled the logs mid-motion and saw 0-1 ValuesChanged. Wait for IdleStateEntered instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01L4YBGyfjv1uKVn6FUFxSEF



GitHub Issue: closes #24730
PR Type:
🐞 Bugfix
What changed? 🚀
The problem
ScrollViewscrolls through anInteractionTracker. On Uno, the tracker's touch inertia (fling) and mouse-wheel motion were advanced by a 17 msSystem.Threading.Timeron the thread pool, which wrote the tracker's position and state from that thread. Consequences:MouseWheelDelta < 120) were integer-divided to0, so slow two-finger touchpad scrolling did nothing.ScrollViewdid not stop it until the finger moved past the drag threshold.What this PR does
FrameStartingand compute the position from the frame timestamp. The thread-pool timers are gone. A new shared base class,InteractionTrackerFrameInertiaHandler, holds the subscribe/unsubscribe and timing logic, so each handler only implementsAdvance(elapsed).InteractionTrackerFrameInertiaHandler,*InertiaHandler,ICompositionTarget.FrameStartingSetPositionnow raises thePositionproperty change synchronously, so theTranslationexpression bound to it is updated before the frame is recorded.IInteractionTrackerOwner.ValuesChangedstays queued, as before.InteractionTracker.SetPositionReceivePointerWheeltakes adoublenumber of detents, so a 30-unit touchpad delta scrolls a quarter of a detent instead of nothing.InputManager.Pointers.Managed, tracker statesScrollView. The tracker switches from Inertia to Interacting as soon as the finger touches down, not once it has moved. When the tracker takes over inertia, the gesture recognizer's own inertia ends, since nothing applies its updates.InputManager.Pointers.ManagedDirectManip,InteractionTrackerInertiaState/InteractingStateWinUI parity
tracker.Positionare evaluated in that same frame. Per-frame ticking with a synchronous position change matches that. The "60 FPS" in the old code comment comes from an outdated docs line, not from how the compositor actually behaves.delta * max(48, 15% of viewport) / 120(GetVerticalScrollWheelDelta,TextBoxView.cpp), with no integer division. Precision touchpads go to the tracker directly (VisualInteractionSourceRedirectionMode.CapableTouchpadAndPointerWheelinScrollPresenter::SetupVisualInteractionSourceRedirectionMode).ScrollPresenter::OnPointerPressedcallsVisualInteractionSource.TryRedirectForManipulationon touch down, which hands the contact to the tracker straight away.ScrollPresenter::InteractingStateEnteredalready handles the Inertia → Interacting transition. Uno'sOnStartinghook runs on the press for the same reason.Known limitation
A free-standing
InteractionTrackerwith noVisualInteractionSourcehas no visual to name its window, so it is driven by the first window's composition target (Compositor.FrameDriverTargetResolver, markedTODO Uno). This does not affectScrollView/ScrollPresenter, which always attach a source.Evidence
Measured on Win32 at 119 Hz with the scroll-smoothness probe from #24711 (
sample=Scrolling/ScrollSmoothnessTester&scrollprobe=...). "newFps" counts the presented frames per second that show a newly recorded frame.Galaxy Z Fold7 (120 Hz) and iPhone 13 Pro (120 Hz) show the same pattern: ~55–70 → 117–120.
New runtime tests in
Given_ScrollViewcover one change each: a sub-detent wheel delta scrolls, every recorded frame shows the tracker's position, and a finger held on coasting content stops it. 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_01LtnnfqgXbPx1pR2QSUWcGj