You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix .Animate() configuration comparison and removal ordering - #1499
Changes to .Animate() alone can be skipped because shallow comparison does not check AnimationConfig. Outgoing implicit channels are also cleared too late when the configuration is removed, allowing setters to trigger the previous animation once more.
This change compares AnimationConfig by value and releases dropped implicit channels before handler dispatch. It handles both complete removal and narrowing the property flags, such as changing Opacity | Scale to Opacity. Equivalent configurations remain eligible for skipping.
Cleanup uses the difference between the old and new flags:
Remove only channels no longer declared by .Animate().
Preserve layout-owned Offset when both renders retain LayoutAnimation.AnimateOffset.
Skip cleanup when no channels were dropped.
Keep the existing post-update installation order, so independently declared transitions can be reapplied without a later cleanup deleting them.
Clean the original control before dispatch, leaving freshly mounted replacements untouched.
The animation guide is shortened to user-facing behavior, with the flags and compositor-ceiling paragraphs kept together. Relative source links and line-number anchors are removed from both the template and generated guide. The changelog is updated accordingly.
Follow-up to the animation review discussion in #1472.
Related design: spec 014, Feature 3.
This PR covers:
.Animate() configuration changes being skipped.
Outgoing implicit channels being cleared too late during complete removal.
Dropped channels remaining installed when the animation flags are narrowed.
The remaining shallow-comparison gaps for other animation extras will be addressed in a follow-up PR, including consideration of a grouped configuration design and its performance impact.
Handoff-Visual transform-write conflicts after .Animate() or WithAnimation also remain for a separate follow-up. AnimationHelper is unchanged here.
Test plan
Added unit coverage for configuration addition/removal, curve changes, property-flag changes, and separately allocated equivalent configurations.
Added native coverage for direct Update and parent child-skip paths, including successful skipping of equivalent configurations.
Extended ConfigurationAcrossUpdates with a narrowing step after expansion, verifying that Scale is removed while Opacity and its duration remain.
Covered complete removal and flag narrowing on ordinary Buttons, including .Set(...) writes without manually stopping the outgoing animation.
Checked that the dropped Scale channel is absent before the setter writes, preventing it from triggering the old animation.
Verified retained layout Offset inside the setter, before the later layout pass could recreate it, and checked retained Offset/Size afterward.
Verified that the independently declared Scale transition retains its own 170 ms duration after the update.
Confirmed the narrowing regressions fail before the fix: 11 assertions failed, and all passed after applying the mask-difference change.
Latest validation results:
Release unit-project build: passed, 0 warnings and 0 errors.
Release native Host build: passed, 0 warnings and 0 errors.
Related unit tests: 332 passed, 16 skipped, 0 failed.
The reason will be displayed to describe this comment to others. Learn more.
Fix looks right for the full-removal case and the tests are solid. Two things before merging. The source links in the animation guide will fail the strict mkdocs check, and narrowing the Animate flags still leaves the dropped channels installed. Details inline.
Thank you for your review and continued guidance. I’ve pushed the documentation cleanup and flag-narrowing fix, with tests covering direct updates, parent child-skip, setter ordering, retained layout Offset, and independent transitions. I’ve also updated the PR description to reflect these changes and the latest test results.
I’d like to address the remaining animation-extras comparisons in a separate follow-up PR, where I can assess the grouped configuration approach and its performance impact.
Could you please take another look when you have time? Thank you!
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Removing a Button’s .Animate() can incorrectly clear the retained outer layout’s Offset animation, causing .Set(...) writes to run without the intended animation.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Preserve outer layout animation when an inner decorator removes its animation
src/Reactor/Core/Reconciler.Update.cs:219
For Flyout(Button("Go").Animate(curve, AnimateProperty.Offset), content).LayoutAnimation(layout) with layout Offset enabled, removing the Button's .Animate() clears the retained outer layout's Offset channel because both Button-local LayoutAnimation values are null. An Offset write in the Button's .Set(...) then runs without that animation; the outer update reinstalls it too late. Account for retained layout ownership across decorators sharing the control, and add an inside-setter assertion for this arrangement.
Resolve the CHANGELOG conflict under Fixed by keeping both the .Animate() entries and main's new entries.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes to
.Animate()alone can be skipped because shallow comparison does not checkAnimationConfig. Outgoing implicit channels are also cleared too late when the configuration is removed, allowing setters to trigger the previous animation once more.This change compares
AnimationConfigby value and releases dropped implicit channels before handler dispatch. It handles both complete removal and narrowing the property flags, such as changingOpacity | ScaletoOpacity. Equivalent configurations remain eligible for skipping.Cleanup uses the difference between the old and new flags:
.Animate().LayoutAnimation.AnimateOffset.The animation guide is shortened to user-facing behavior, with the flags and compositor-ceiling paragraphs kept together. Relative source links and line-number anchors are removed from both the template and generated guide. The changelog is updated accordingly.
Linked issue / spec
Fixes #1498.
Follow-up to the animation review discussion in #1472.
Related design: spec 014, Feature 3.
This PR covers:
.Animate()configuration changes being skipped.The remaining shallow-comparison gaps for other animation extras will be addressed in a follow-up PR, including consideration of a grouped configuration design and its performance impact.
Handoff-Visual transform-write conflicts after
.Animate()orWithAnimationalso remain for a separate follow-up.AnimationHelperis unchanged here.Test plan
Updateand parent child-skip paths, including successful skipping of equivalent configurations.ConfigurationAcrossUpdateswith a narrowing step after expansion, verifying that Scale is removed while Opacity and its duration remain..Set(...)writes without manually stopping the outgoing animation.Latest validation results:
mkdocs build --strict: passed.git diff --check: passed.Documentation generation also reported unresolved-cref notices on unrelated reference pages; those pages are unchanged.
The full unit suite, full solution build, packaged/AOT tests, and E2E tests were not run.
Risk / breaking changes