Skip to content

fix(scrollview): Animate ScrollTo/ScrollBy through the InteractionTracker - #24737

Merged
MartinZikmund merged 5 commits into
masterfrom
dev/mazi/scrollview-animated-scrollto-v2
Oct 8, 2026
Merged

MartinZikmund merged 5 commits into
masterfrom
dev/mazi/scrollview-animated-scrollto-v2

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #24731

Stacked PR 3/7. Base: dev/mazi/scroll-tracker-per-frame. Review only this PR's commits; it merges after the PRs below it.

PR Type:

🐞 Bugfix

What changed? 🚀

InteractionTracker.TryUpdatePositionWithAnimation (and the scale variant) was only a throwing generated stub, so animated ScrollView.ScrollTo/ScrollBy, keyboard Home/End and scrollbar track clicks threw NotImplementedException.

Implemented per WinUI's state table: the tracker enters the CustomAnimation state (ignored while interacting), samples the supplied animation each frame on the UI thread from FrameStarting, clamps, and returns to Idle with the request id so ScrollCompleted fires once.

Tests (Runtime): 4 new Given_ScrollView tests (ScrollTo default options, ScrollBy, interrupted ScrollTo, Home/End) fail before, pass after; 5 MUX ScrollPresenter tests previously ignored for this reason are re-enabled and pass. Standalone variant for master without this stack: dev/mazi/scrollview-animated-scrollto (not opened).

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 ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_016WqaiNE2QBeUszQFongehx

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 4m 22s —— View job


Review complete ✅

  • Gather context (PR description, changed files, diff vs base branch)
  • Review InteractionTracker.cs / state machine changes
  • Review InteractionTrackerCustomAnimationState.cs (core logic)
  • Review InteractionTrackerInteractingState.cs / InteractionTrackerState.cs
  • Review Generated file diffs
  • Review new InteractionTrackerCustomAnimationStateEnteredArgs.cs
  • Review runtime test changes (Given_ScrollView.cs, ScrollPresenterTests.cs, ScrollPresenterViewChangeTests.cs)
  • Post inline comments for findings (none warranted)
  • Post summary

Verdict: Ship. No inline findings posted — I couldn't substantiate a real defect after tracing the code paths below.

Issues by severity: 0 blocking, 0 major, 0 minor.

What I verified, and why it's not a finding:

  • Reentrancy during OnFrameStarting: ApplyValue → SetPosition/SetScale could in theory trigger a reentrant ChangeState that disposes the in-flight CustomAnimationState mid-tick, which would then have gone on to wrongly force the tracker back to Idle with a stale request id. Traced it out: SetPosition/SetScale dispatch Owner.ValuesChanged via NativeDispatcher.Main.Enqueue, not synchronously, so no reentrancy is possible within a single frame tick. Not a bug.
  • Interrupted-animation completion (exercised by the new When_ScrollTo_Interrupted_By_ScrollTo_Then_Ends_At_Second_Target test): InteractionTrackerCustomAnimationState doesn't itself raise RequestIgnored when superseded by a new animation — completion of the interrupted request is handled by pre-existing ScrollPresenter.IdleStateEntered logic (completes "prior" outstanding operations). That logic predates this PR and is unchanged by it.
  • Start()/Stopped subscription ordering in the InteractionTrackerCustomAnimationState constructor (animation is started before the Stopped handler is wired up): confirmed via the concrete KeyFrameAnimation.Start() overrides that Start() never synchronously invokes Stop(), so no event is missed.
  • Generated-file diffs under Uno.UI.Composition/Generated/ are the expected mechanical output of the stub sync generator once a real implementation replaces a [NotImplemented] stub (the #if false pattern is used identically in 650+ other generated files) — not a hand-edit of generated code.
  • New TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation overrides on InteractionTrackerInteractingState mirror the existing sibling TryUpdate* "ignored while interacting" overrides exactly.
  • Event declared (KeyFrameAnimation.Stopped) uses EventHandler, not Action — compliant.
  • Both commits (fix(scrollview): ..., test(scrollview): ...) follow Conventional Commits.
  • New runtime tests are properly gated by the class-level [RunsOnUIThread] on Given_ScrollView, and the MUX [Ignore] removals match the PR description (4 re-enabled, one's ignore-reason updated to a distinct, unrelated cause — EffectiveViewportChangedEventArgs.BringIntoViewDistanceX/Y not implemented).

Cross-cutting note (non-blocking): InteractionTrackerCustomAnimationState.ApplyValue silently no-ops if the evaluated animation value's type doesn't match the expected float/Vector3 for the scale/position case. Harmless for current callers (ScrollView only ever supplies matching animation types) but a mismatched CompositionAnimation type passed by a future caller would silently do nothing rather than surface an error — worth a mental note if this API sees more direct usage.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from 76031e5 to cdda5c4 Compare September 25, 2026 22:28
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 3m 32s —— View job


Review complete ✅

  • Gather context (PR description, changed files, diff vs base branch)
  • Review InteractionTracker.cs / state machine changes
  • Review InteractionTrackerCustomAnimationState.cs (core logic)
  • Review InteractionTrackerInteractingState.cs / InteractionTrackerState.cs
  • Review Generated file diffs
  • Review new InteractionTrackerCustomAnimationStateEnteredArgs.cs
  • Review runtime test changes (Given_ScrollView.cs, ScrollPresenterTests.mux.cs, ScrollPresenterViewChangeTests.mux.cs)
  • Post inline comments for findings (none warranted)
  • Post summary

Verdict: Ship. 0 blocking, 0 major, 0 minor. No inline findings posted.

What I checked, beyond re-verifying the prior automated pass on this PR:

  • Start()/Stopped wiring order in the InteractionTrackerCustomAnimationState constructor: confirmed directly in ScalarKeyFrameAnimation.Start() (and its KeyFrameAnimation base) that Start() only builds the IKeyFrameEvaluator and never synchronously calls Stop(), so subscribing to Stopped afterward can't miss an early completion.
  • OnFrameStarting → KeyFrameAnimation.Evaluate() → synchronous Stop() → _isAnimationRunning = false → ChangeState(Idle) → Dispose() unsubscribing from the same FrameStarting event mid-dispatch: this is safe because .NET multicast delegate invocation snapshots the invocation list, and Dispose() checks _isAnimationRunning before calling _animation.Stop() again, so no double-stop.
  • The no-FrameTarget fallback in OnActivated (jump-to-end, then synchronously ChangeState(Idle)) causes the enqueued CustomAnimationStateEntered notification to later no-op (_disposed guard), so the owner never sees ScrollingInteractionState.Animation for that instant. Traced this into ScrollPresenter.CustomAnimationStateEntered, which only forwards to UpdateState — ScrollCompleted and offset completion are driven entirely off IdleStateEntered/RequestId, so this doesn't affect correctness, and the same _disposed-guarded synchronous-completion pattern already exists in InteractionTrackerInertiaState. Not flagging it.
  • New InteractionTrackerCustomAnimationStateEnteredArgs.cs matches the sibling InteractionTrackerIdleStateEnteredArgs.cs pattern exactly (ctor, properties, no header).
  • Generated-file diffs remain the mechanical stub-sync output, not hand-edits.
  • Test coverage: Given_ScrollView additions are gated by the class-level [RunsOnUIThread]/#if __SKIA__, and the re-enabled MUX tests match the PR's description (4 un-ignored, 1 given an updated, unrelated ignore-reason).
  • Both commits follow Conventional Commits.

Cross-cutting note (non-blocking, carried over from the prior pass): InteractionTrackerCustomAnimationState.ApplyValue silently no-ops when the evaluated animation value's type doesn't match the expected float/Vector3. Harmless today since only ScrollView drives this path with matching types, but worth a mental note if this API gets more direct external usage later.
· Branch: dev/mazi/scrollview-animated-scrollto-v2

Copilot AI balanced review requested due to automatic review settings October 3, 2026 09:43
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from cdda5c4 to 13dee08 Compare October 3, 2026 09:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 6 Medium severity

Open (7)
What changed in this PR

Implements InteractionTracker custom animation support so animated ScrollView/ScrollPresenter view changes no longer throw and can complete correctly.

Changes:

  • Implemented TryUpdatePositionWithAnimation / TryUpdateScaleWithAnimation and a CustomAnimation tracker state that samples animations per frame.
  • Re-enabled previously ignored ScrollPresenter runtime tests that depended on custom animation functionality.
  • Added new Given_ScrollView runtime tests covering animated ScrollTo/ScrollBy, interruption, and Home/End key behavior.
File Description
src/​Uno.UI.RuntimeTests/​Microsoft/​UI/​Xaml/​Controls/​ScrollPresenter/​ScrollPresenterViewChangeTests.mux.cs Removes ignores to re-enable animated offset-change coverage.
src/​Uno.UI.RuntimeTests/​Microsoft/​UI/​Xaml/​Controls/​ScrollPresenter/​ScrollPresenterTests.mux.cs Updates ignore reason now that custom animation is implemented.
src/​Uno.UI.RuntimeTests/​Microsoft/​UI/​Xaml/​Controls/​Given_ScrollView.cs Adds runtime tests validating animated scrolling completion and interruption.
src/​Uno.UI.Composition/​Generated/​3.0.0.0/​Microsoft.UI.Composition.Interactions/​InteractionTrackerCustomAnimationStateEnteredArgs.cs Disables generated stub members to allow real implementation to compile.
src/​Uno.UI.Composition/​Generated/​3.0.0.0/​Microsoft.UI.Composition.Interactions/​InteractionTracker.cs Removes generated throwing stubs for animated update APIs.
src/​Uno.UI.Composition/​Composition/​InteractionTracker/​InteractionTrackerState.cs Adds default state handling for animated position/scale updates.
src/​Uno.UI.Composition/​Composition/​InteractionTracker/​InteractionTrackerInteractingState.cs Ignores animated requests while interacting (raises RequestIgnored).
src/​Uno.UI.Composition/​Composition/​InteractionTracker/​InteractionTrackerCustomAnimationStateEnteredArgs.cs Adds real args type used by CustomAnimationStateEntered.
src/​Uno.UI.Composition/​Composition/​InteractionTracker/​InteractionTrackerCustomAnimationState.cs Implements per-frame animation evaluation & clamping, and state teardown.
src/​Uno.UI.Composition/​Composition/​InteractionTracker/​InteractionTracker.cs Adds public TryUpdate*WithAnimation APIs returning request ids.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 22s —— View job


Review complete ✅

  • Gather context (PR description, changed files, diff vs origin/dev/mazi/scroll-tracker-per-frame)
  • Review InteractionTracker.cs / state machine changes
  • Review InteractionTrackerCustomAnimationState.cs (core logic)
  • Review InteractionTrackerInteractingState.cs / InteractionTrackerState.cs
  • Review Generated file diffs
  • Review new InteractionTrackerCustomAnimationStateEnteredArgs.cs
  • Review runtime test changes (Given_ScrollView.cs, ScrollPresenterTests.mux.cs, ScrollPresenterViewChangeTests.mux.cs)
  • Post inline comments for findings (none warranted)
  • Post summary

Verdict: Ship. 0 blocking, 0 major, 0 minor. No inline findings posted — independently traced the state machine (construction → OnActivated subscription ordering, OnFrameStarting → Evaluate → ChangeState(Idle) → Dispose unsubscription, the self-disposing no-FrameTarget fallback path) and found no defect beyond what the two prior automated passes on this PR already verified.

Cross-cutting note (non-blocking, unchanged from prior passes): InteractionTrackerCustomAnimationState.ApplyValue silently no-ops if the evaluated animation value's type doesn't match the expected float/Vector3. Harmless today since only ScrollView drives this path with matching types; worth a mental note if this API gets more direct external usage later.

What's confirmed solid:

  • TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation on InteractionTracker.cs follow the exact Interlocked.Increment(ref _currentRequestId) pattern as every sibling TryUpdate* overload.
  • InteractionTrackerInteractingState's new overrides mirror the sibling "ignored while interacting" overrides exactly.
  • New InteractionTrackerCustomAnimationStateEnteredArgs.cs matches InteractionTrackerIdleStateEnteredArgs.cs's ctor/property pattern verbatim.
  • KeyFrameAnimation.Stopped is declared EventHandler, not Action — compliant with the repo's events rule.
  • Generated-file diffs under Uno.UI.Composition/Generated/ are the expected mechanical stub-sync output now that a real implementation replaces the [NotImplemented] stub — not hand-edits.
  • Both commits (fix(scrollview): ..., test(scrollview): ...) follow Conventional Commits.
  • Test coverage: 4 new Given_ScrollView tests (default-options ScrollTo, ScrollBy, interrupted ScrollTo, Home/End) plus 4 re-enabled MUX ScrollPresenter tests; one [Ignore] was updated to a distinct, unrelated reason (EffectiveViewportChangedEventArgs.BringIntoViewDistanceX/Y not implemented) rather than silently dropped.
    · Branch: dev/mazi/scrollview-animated-scrollto-v2

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 30s —— View job


Review complete ✅

  • Gather context (PR description, changed files, diff vs base branch)
  • Review InteractionTracker.cs / state machine changes
  • Review InteractionTrackerCustomAnimationState.cs (core logic)
  • Review InteractionTrackerInteractingState.cs / InteractionTrackerState.cs
  • Review Generated file diffs
  • Review new InteractionTrackerCustomAnimationStateEnteredArgs.cs
  • Review runtime test changes (Given_ScrollView.cs, ScrollPresenterTests.mux.cs, ScrollPresenterViewChangeTests.mux.cs)
  • Post inline comments for findings (none warranted)
  • Post summary

Verdict: Ship. 0 blocking, 0 major, 0 minor. No new inline findings.

The diff is unchanged from the previous two automated review passes on this PR (same two commits, same 10 files, same line counts) — this was independently re-traced rather than re-stated, focusing on angles not yet explicitly covered:

  • TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation on InteractionTracker correctly allocate the request id via Interlocked.Increment before delegating to _state, so InteractionTrackerInteractingState's "ignored" override and every other state's "enter CustomAnimation" default (InteractionTrackerState.cs) both receive a valid id — consistent with the sibling TryUpdatePosition/TryUpdateScale pattern.
  • Traced the no-FrameTarget fallback in OnActivated: KeyFrameAnimation.Evaluate(float) (used only there) doesn't auto-Stop() like the parameterless Evaluate() does, but the immediate follow-up ChangeState(Idle) disposes the CustomAnimationState, whose Dispose() explicves _animation.Stop() since _isAnimationRunning is still true — no leaked running animation or missed stop.
  • CloneAnimation() is correctly used for both KeyFrameAnimation (identity clone, returns this) and ExpressionAnimation (per-target snapshot) — confirmed in CompositionAnimation.cs/ExpressionAnimation.cs.
  • Re-enabled MUX tests (ScrollPresenterViewChangeTests.mux.cs, 4 [Ignore] removals) and the updated, unrelated ignore-reason in ScrollPresenterTests.mux.cs match the PR description exactly.
  • New Given_ScrollView tests use UI-thread-safe list mutation inside event handlers (single-threaded under [RunsOnUIThread]), and WaitFor/WaitForCompletion poll with a bounded timeout rather than a fixed sleep.
  • Conventional Commits followed by both commits; no event Action/Action<T> introduced; no edits to Generated/ folders (diffs there are the expected mechanical stub-sync output).

Cross-cutting note (non-blocking, carried over from prior passes, included for completeness): InteractionTrackerCustomAnimationState.ApplyValue silently no-ops if the evaluated animation value's type doesn't match the expected float/Vector3. Harmless today since only ScrollView drives this path with matching types; worth a mental note if this API gets more direct external usage later.
· Branch: dev/mazi/scrollview-animated-scrollto-v2

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 3m 24s —— View job


Review complete ✅

  • Gather context (diff vs origin/dev/mazi/scroll-tracker-per-frame, changed files)
  • Review InteractionTrackerCustomAnimationState.cs (core logic, incl. Copilot's findings)
  • Review InteractionTracker.cs / InteractionTrackerState.cs / InteractionTrackerInteractingState.cs
  • Review InteractionTrackerCustomAnimationStateEnteredArgs.cs (new + Generated diff)
  • Review runtime test changes (Given_ScrollView.cs, ScrollPresenterTests.mux.cs, ScrollPresenterViewChangeTests.mux.cs)
  • Post inline comments for confirmed findings
  • Post summary

Verdict: fix-first. 1 inline finding posted (medium severity, correctness) — 0 blocking, 1 non-blocking-but-real.

Issue posted: a non-KeyFrameAnimation (e.g. an ExpressionAnimation, which WinUI's TryUpdatePositionWithAnimation explicitly supports) never completes, because _isAnimationRunning is only ever cleared via KeyFrameAnimation.Stopped. The tracker would stay stuck in CustomAnimation state forever instead of transitioning to Idle. Harmless today since ScrollPresenter only ever constructs a Vector3KeyFrameAnimation, but it's a latent gap in the public API surface this PR unblocks. See inline comment on InteractionTrackerCustomAnimationState.cs.

Copilot's other findings — independently traced, not reposted (false positives):

  • FrameTimestampInTicks reset to null "clobbering" a concurrent timestamp: traced FrameStarting's dispatch (CompositionTarget.FrameClock.RaiseFrameStarting) — handlers for a given tick run sequentially in a single synchronous loop, all receiving the same timestamp value, and OnFrameStarting's set→evaluate→reset-to-null window fully completes before the next handler runs. FrameStarting is also raised strictly before the later record phase that separately sets/resets the same field (CompositionTarget.Rendering.cs), so there's no overlap. Not reproducible.
  • Generated/ folder "patched" with #if false: confirmed this is the mechanical output of the stub-sync generator (<auto-generated> header, "Skipping already declared ..." comments) reflecting the new hand-written implementation elsewhere — not a manual edit of generated code, consistent with the same pattern used in 650+ other generated files.
  • Test flakiness from Task.Delay(16) / intermediate-offset assertions: in When_ScrollTo_Default_Options_Then_Animates_And_Completes_Once, the delay-based WaitForFrames only runs after WaitForCompletion (a bounded condition poll) and is used for post-completion settling, not to gate the intermediate-offset assertion itself — lower risk than described, though the assertion does assume default ScrollTo animates, which is a reasonable assumption for this control but theoretically sensitive to a future "reduced motion" style setting.

Everything else checked and found solid: InteractionTrackerInteractingState's new TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation overrides correctly mirror the sibling "ignored while interacting" pattern; InteractionTrackerState.cs's default "(re-)enter CustomAnimation" handling is shared correctly across Idle/Inertia/CustomAnimation; KeyFrameAnimation.Evaluate()/Stop() is the only self-reporting completion path, confirming the one real finding above; no event Action/Action<T> introduced; Conventional Commits followed; re-enabled MUX tests match the PR description.
· Branch: dev/mazi/scrollview-animated-scrollto-v2

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from 6b551f2 to 3382e3c Compare October 4, 2026 05:19
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 20s —— View job


Review complete ✅

  • Gather context (diff vs origin/dev/mazi/scroll-tracker-per-frame, changed files, prior review history on this PR)
  • Review InteractionTrackerCustomAnimationState.cs (core logic) against AGENTS.md rules
  • Review InteractionTracker.cs / InteractionTrackerState.cs / InteractionTrackerInteractingState.cs
  • Review InteractionTrackerCustomAnimationStateEnteredArgs.cs (new + Generated diff)
  • Review runtime test changes (Given_ScrollView.cs, ScrollPresenterTests.mux.cs, ScrollPresenterViewChangeTests.mux.cs)
  • Post inline comments for findings
  • Post summary

Verdict: fix-first. 0 new blocking, 0 new major/minor. No new inline comment posted this pass.

Why no new inline comment: the diff is byte-for-byte unchanged from the version already reviewed in the prior pass (same two commits 655dfdfa/3382e3c7, same 10 files). That pass already posted an inline, still-valid finding on InteractionTrackerCustomAnimationState.cs:95 (non-KeyFrameAnimation animations never flip _isAnimationRunning to false, so OnFrameStarting never transitions the tracker back to Idle — TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation are public and, per WinUI parity, accept any CompositionAnimation including ExpressionAnimation). Re-verified this by tracing the same path again: _isAnimationRunning is only set false by OnAnimationStopped, wired up only if (_animation is KeyFrameAnimation ...) in the constructor — confirmed still present and unresolved. Reposting an identical inline comment would just duplicate it; flagging here so it isn't lost before merge.

Everything else checked and still solid (no regressions from the unchanged diff):

  • TryUpdatePosition/TryUpdateScale-style Interlocked.Increment request-id pattern is followed correctly by the new TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation overloads.
  • InteractionTrackerInteractingState's new "ignored while interacting" overrides mirror the sibling overrides exactly.
  • InteractionTrackerCustomAnimationStateEnteredArgs.cs matches the InteractionTrackerIdleStateEnteredArgs.cs ctor/property pattern; Generated/ diffs are the expected mechanical stub-sync output (not hand-edits), consistent with the #if false pattern used in 650+ other generated files.
  • No event Action/Action<T> introduced; KeyFrameAnimation.Stopped correctly uses EventHandler.
  • No edits to Generated/ business logic, only the stub-sync comment/attribute swap.
  • Both commits follow Conventional Commits.
  • Runtime tests are gated by [RunsOnUIThread]/#if __SKIA__; re-enabled MUX [Ignore] removals (4) plus one updated, unrelated ignore-reason match the PR description.

Minor style nit (non-blocking, not re-flagged inline): InteractionTrackerState.cs:51-52 — the Dispose() override has no blank line separating it from TryUpdateScaleWithAnimation above, inconsistent with the blank-line-between-members style used everywhere else in the file.
· Branch: dev/mazi/scrollview-animated-scrollto-v2

Copilot AI balanced review requested due to automatic review settings October 6, 2026 09:46
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from 3382e3c to 34d4d5e Compare October 6, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 14s —— View job


Review summary

Verdict: fix-first. I found no new issues. The diff is the same two commits as the last pass (27c74637, 34d4d5e3).

Issues by severity: 0 blocking, 1 open (medium, carried over), 0 new.

Still open: InteractionTrackerCustomAnimationState.cs never completes for a non-KeyFrameAnimation, such as an ExpressionAnimation.

  • _isAnimationRunning is only cleared by KeyFrameAnimation.Stopped.
  • A non-keyframe animation therefore leaves the tracker in CustomAnimation and never returns it to Idle.
  • The existing inline comment on that file still applies.
  • ScrollPresenter only passes keyframe animations today.
  • The API is public, though.
  • Either give non-keyframe animations a one-shot completion, or reject them and document that.

Cross-cutting notes (non-blocking):

  • ApplyValue silently ignores a value of the wrong type. A debug assert would make a future misuse visible.
  • OnFrameStarting resets FrameTimestampInTicks to null, not to the previous value. Earlier passes judged this safe, because FrameStarting handlers run sequentially before the record phase. Saving and restoring the previous value would be cheap and would remove the doubt.
  • The Generated/ diffs come from the stub-sync output, not hand edits.
  • Both commits follow Conventional Commits, and no event Action was introduced.
    · Branch: dev/mazi/scrollview-animated-scrollto-v2

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 16s —— View job


Review complete ✅

  • Gather context (diff vs origin/dev/mazi/scroll-tracker-per-frame)
  • Re-check InteractionTrackerCustomAnimationState.cs against earlier findings
  • Post summary

Verdict: fix-first. 0 blocking, 1 major or minor issue (still open), no new inline comments.

The branch is unchanged since the last pass. It has the same two commits (27c74637, 34d4d5e3) and the same 10 files.

Still open: the earlier inline finding on InteractionTrackerCustomAnimationState.cs hasn't been addressed. _isAnimationRunning is only cleared through KeyFrameAnimation.Stopped. A non-keyframe animation, such as an ExpressionAnimation passed to the public TryUpdatePositionWithAnimation or TryUpdateScaleWithAnimation, would leave the tracker in CustomAnimation indefinitely. Either of these would fix it:

  • Complete after the first evaluation, as the no-FrameTarget fallback in OnActivated does.
  • Restrict the overloads to KeyFrameAnimation.

This is harmless for ScrollPresenter, which only builds Vector3KeyFrameAnimation. It is still a latent gap in the API this PR makes callable.

Non-blocking notes:

  • ApplyValue silently ignores a value whose type doesn't match the expected float or Vector3.
  • InteractionTrackerState.cs has no blank line between TryUpdateScaleWithAnimation and Dispose(), unlike the rest of the file.
    · Branch: dev/mazi/scrollview-animated-scrollto-v2

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from 34d4d5e to 2191153 Compare October 7, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 15s —— View job


Review summary

Verdict: fix-first. No new findings. The two commits are unchanged (b498b90f, 21911534), and I re-read the diff against origin/dev/mazi/scroll-tracker-per-frame.

Issues by severity: 0 blocking, 1 open (medium, carried over), 0 new.

Still open: InteractionTrackerCustomAnimationState never completes for a non-KeyFrameAnimation, such as an ExpressionAnimation.

  • _isAnimationRunning is only cleared by KeyFrameAnimation.Stopped, which is subscribed only if (_animation is KeyFrameAnimation).
  • For any other animation, OnFrameStarting never reaches ChangeState(Idle). The tracker stays in CustomAnimation and ScrollCompleted never fires.
  • TryUpdatePositionWithAnimation and TryUpdateScaleWithAnimation are public and take any CompositionAnimation.
  • ScrollPresenter only passes a Vector3KeyFrameAnimation, so nothing in the repo hits this today.
  • The existing inline comment on that file still applies. Either give non-keyframe animations a one-shot completion, as the no-FrameTarget branch in OnActivated does, or reject them and document that.

Non-blocking notes:

  • ApplyValue silently ignores a value of the wrong type. A Debug.Assert would surface misuse.
  • OnFrameStarting resets FrameTimestampInTicks to null, not to the previous value. Earlier passes judged this safe, because FrameStarting handlers run sequentially before the record phase. Saving and restoring the previous value is cheap and removes the doubt.
  • InteractionTrackerState.cs has no blank line between TryUpdateScaleWithAnimation and Dispose().
  • The Generated/ diffs are stub-sync output, not hand edits.
  • Both commits follow Conventional Commits, and no event Action is introduced.

No code changes were made, and I did not build or run tests; this was a review by inspection.
· Branch: dev/mazi/scrollview-animated-scrollto-v2

@MartinZikmund
MartinZikmund marked this pull request as draft October 7, 2026 08:35
Base automatically changed from dev/mazi/scroll-tracker-per-frame to master October 8, 2026 09:46
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from 2191153 to 14ff942 Compare October 8, 2026 09:46
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 238149 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 174

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • DisplayInformation.png-dark
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
  • skia-windows-screenshots: 174 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImagesInlineInFlipView.png-dark
    • ImagesInlineInFlipView.png
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Grid_ColSpan_Bottom.png-dark
    • GridWithColumnSpan.png-dark
    • Grid_ColSpan_Bottom.png

@MartinZikmund
MartinZikmund marked this pull request as ready for review October 8, 2026 12:08
Copilot AI balanced review requested due to automatic review settings October 8, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 21s —— View job


Review summary

Verdict: ship. 0 blocking, 0 major, 0 minor. No inline comments posted. This was a review by inspection; I did not build or run tests.

Changes since the last automated pass (ed1997dc, 32352a32, a643b6c3):

  • Keyframe completion fix. InteractionTrackerCustomAnimationState.OnFrameStarting now calls _animation.OnEvaluatedValueApplied() right after ApplyValue. This matches KeyFrameAnimation, which only calls Stop() from that hook (KeyFrameAnimation.cs:75). Stopped therefore fires after the final value lands, _isAnimationRunning clears, and the tracker goes to Idle. The no-FrameTarget fallback in OnActivated uses Evaluate(1.0f) and then goes straight to Idle. Dispose() stops the animation there, so that path is unaffected.
  • FrameTimestampInTicks. The previous value is now saved and restored in the finally block, which addresses the earlier note.
  • Tests. The animated tests force animations on and wait on rendered frames instead of Task.Delay(16). This resolves the earlier flakiness concern.

Previously open item (non-KeyFrameAnimation never completing): I agree with the author's reply and no longer consider it a defect. An ExpressionAnimation has no end of its own, and per the WinUI state table the tracker leaves CustomAnimation on the next TryUpdate* call or a user interaction. ScrollPresenter only passes keyframe animations, and those complete.

Non-blocking notes:

  • ApplyValue silently ignores a value of the wrong type. A Debug.Assert would make misuse visible later.
  • InteractionTrackerState.cs has no blank line between TryUpdateScaleWithAnimation and Dispose().
  • The Generated/ diffs are stub-sync output, not hand edits. Both commits follow Conventional Commits, and no event Action is introduced.
  • The screenshot-comparison differences from build 238149 are numerous (118 Linux, 174 Windows) and none of the listed samples are scroll-related. They are probably unrelated, but please check them against master before merging.
    · Branch: dev/mazi/scrollview-animated-scrollto-v2

MartinZikmund and others added 5 commits October 8, 2026 14:24
…cker

InteractionTracker.TryUpdatePositionWithAnimation/TryUpdateScaleWithAnimation
were generated stubs that threw, so the default animated ScrollView.ScrollTo/
ScrollBy, Home/End and scrollbar track clicks crashed on every Skia target.

The tracker now enters its CustomAnimation state, which samples the supplied
animation once per frame on the UI thread from its target's FrameStarting, at
the frame's timestamp, like the tracker's inertia handlers. It returns to Idle
with the request id when the animation ends, so ScrollPresenter raises
ScrollCompleted once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016WqaiNE2QBeUszQFongehx
Adds Given_ScrollView runtime tests for the default animated ScrollTo/ScrollBy,
interruption by a second ScrollTo and Home/End on a focused ScrollView, and
re-enables the MUX ScrollPresenter offset-animation tests that were ignored
for lack of the InteractionTracker CustomAnimation state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016WqaiNE2QBeUszQFongehx
KeyFrameAnimation now stops from OnEvaluatedValueApplied rather than
Evaluate, so the tracker never left CustomAnimation and ScrollView never
raised ScrollCompleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8YHRRzBxd2qi1Abr5cEfG
Copilot AI balanced review requested due to automatic review settings October 8, 2026 12:24
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/scrollview-animated-scrollto-v2 branch from ed1997d to dda6789 Compare October 8, 2026 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 22s —— View job


Review summary

Verdict: ship. 0 blocking, 0 major, 0 minor. No inline comments posted. This was a review by inspection; I did not build or run tests.

Latest state of InteractionTrackerCustomAnimationState.cs (HEAD dda67890):

  • OnFrameStarting applies the evaluated value, then calls OnEvaluatedValueApplied(). A keyframe animation stops only after its final value has landed, so _isAnimationRunning clears and the tracker goes to Idle with the request id.
  • FrameTimestampInTicks is saved and restored in the finally block, as the earlier review notes asked.
  • Dispose() unsubscribes Stopped and FrameStarting, and stops the animation only if it is still running. This also covers the no-FrameTarget fallback.
  • I agree with the author's reasoning on ExpressionAnimation: it has no end of its own, and the tracker leaves CustomAnimation on the next TryUpdate* call or a user interaction. The earlier "never completes" finding no longer applies.

Non-blocking notes:

  • ApplyValue silently ignores a value of the wrong type. A Debug.Assert would make misuse visible.
  • InteractionTrackerState.cs has no blank line between TryUpdateScaleWithAnimation and Dispose().
  • Build 238149 reports 118 Linux and 174 Windows screenshot differences. None of the listed samples are scroll-related. Please check them against master before merging.
    · Branch: dev/mazi/scrollview-animated-scrollto-v2

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 238192 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 1172

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png
    • DropDownButtonPage.png-dark
    • DisplayInformation.png-dark
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 1172 changed over 2474

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Attributed_text_Simple.png-dark
    • AutomationProperties_Relations.png-dark
    • Basics.png-dark
    • Basics.png
    • BitmapIcon_Monochromatic.png-dark
    • BitmapIcon_Monochromatic.png
    • BorderCenteredwithmargins.png-dark
    • BorderCenteredwithmargins.png
    • BorderLeftwithmargins.png-dark
    • BorderLeftwithmargins.png
    • Border_LinearGradientBrush.png-dark
    • Border_LinearGradientBrush.png
    • Border_Simple.png-dark
    • Border_Simple.png
    • Button_Events.png-dark
    • Button_Events.png
    • ClippingWithOpacity.png-dark
    • ClippingWithOpacity.png
    • ComboBox_Simple.png-dark
    • ComboBox_Simple.png

@mergify

mergify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

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.

@MartinZikmund
MartinZikmund merged commit 5cc7ddf into master Oct 8, 2026
50 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/scrollview-animated-scrollto-v2 branch October 8, 2026 14:35
MartinZikmund added a commit that referenced this pull request Oct 9, 2026
The animated offsets tests enabled by #24737 assume ~60fps: they expect
several ViewChanged within a 50-1000ms animation, and a cancel or
interrupt (queued for 3 ticks, as in WinUI) to land before it ends. On
WebGPU/SwiftShader a frame takes hundreds of ms, so the animation
completes in one or two frames. Lengthen offsets-change animations to
1-5s in these tests via ScrollPresenterTestHooks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L4YBGyfjv1uKVn6FUFxSEF
MartinZikmund added a commit that referenced this pull request Oct 10, 2026
The animated offsets tests enabled by #24737 assume ~60fps: they expect
several ViewChanged within a 50-1000ms animation, and a cancel or
interrupt (queued for 3 ticks, as in WinUI) to land before it ends. On
WebGPU/SwiftShader a frame takes hundreds of ms, so the animation
completes in one or two frames. Lengthen offsets-change animations to
1-5s in these tests via ScrollPresenterTestHooks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L4YBGyfjv1uKVn6FUFxSEF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScrollView.ScrollTo/ScrollBy with animation throw NotImplementedException

4 participants