Repository navigation
ItemsRepeater Transition manager - #23069
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces WinUI-style collection transition infrastructure for ItemsRepeater by adding an ItemCollectionTransitionProvider pipeline and a new TransitionManager, while beginning to deprecate the legacy ElementAnimator/AnimationManager pathway.
Changes:
- Add
TransitionManagerplusItemCollectionTransition*types and wire them intoItemsRepeater/ViewManager. - Add new
ItemsRepeater.ItemTransitionProviderdependency property and markAnimator/AnimationManageras obsolete. - Add runtime tests validating
ItemCollectionTransitionProviderbehavior and update existing tests to suppress obsolete warnings.
Reviewed changes
Copilot reviewed 26 out of 34 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/Repeater/ViewManager.cs | Switch element-prepared/clear hooks from AnimationManager to TransitionManager. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/TransitionManager.mux.cs | New manager coordinating transition queuing and ownership handoff on completion. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/TransitionManager.h.mux.cs | TransitionManager fields/state tracking and event revoker. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/Layout.cs | Reworked Layout implementation (currently duplicates existing partial members). |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemsRepeater.cs | Wire transition manager into layout/arrange/items-source flows; add obsolete shims. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemsRepeater.Properties.cs | Add ItemTransitionProvider DP; mark Animator DP obsolete. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemCollectionTransitionTriggers.cs | New public triggers enum for transition causation. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemCollectionTransitionProvider*.cs | New transition provider base + queuing/batching logic + event. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemCollectionTransition*.cs | New transition objects, progress object, operation enum, completed args. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/AnimationManager.cs | Mark AnimationManager obsolete. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/* | Update generated stubs to reflect new APIs implemented in source partials. |
| src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_ItemCollectionTransitionProvider.cs | New runtime tests for transition provider behavior. |
| src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/Repeater/InspectingDataSourceTests.cs | Suppress obsolete warnings for Animator usage. |
| src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/Repeater/ElementAnimatorTests.cs | Suppress obsolete warnings for Animator usage. |
| .claude/skills/winui-port/SKILL.md | Tighten porting rule to preserve // comments exactly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7816706 to
8bdf862
Compare
8bdf862 to
7b59d8f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7b59d8f to
61fcc60
Compare
WinAppSDK sync generator drift detected on
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/Uno.UI/UI/Xaml/Controls/Repeater/ViewManager.cs:873
ClearElementToAnimatornow delegates to TransitionManager, but the method name (and the ownership transitionMoveOwnershipToAnimator) still references an animator that no longer exists. Consider renaming this path to reflect transition-based ownership (e.g., TransitionManager/TransitionProvider) to avoid confusion when maintaining this code.
bool ClearElementToAnimator(UIElement element, VirtualizationInfo virtInfo)
{
bool cleared = m_owner.TransitionManager.ClearElement(element);
if (cleared)
{
int clearedIndex = virtInfo.Index;
virtInfo.MoveOwnershipToAnimator();
if (m_lastFocusedElement == element)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e7557d5 to
1a578cd
Compare
WinAppSDK sync generator drift detected on
|
|
/apply-sync-gen |
|
Pushed GitHub does not re-trigger workflows for commits pushed by the default bot, so the WinAppSDK Sync Generator Check will not automatically re-run. To turn it green, push any additional commit (for example |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 23 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Align ItemsRepeater with WinUI C++ source-of-truth: - Remove obsolete Animator/ElementAnimator/AnimationManager/AnimationContext surface entirely (WinUI no longer has these types anywhere). Delete ElementAnimatorTests and related test support. - Delete duplicate Layout.cs — all members already exist in Layout.mux.cs / Layout.uno.cs. - Widen CreateDefaultItemTransitionProvider to protected internal virtual so ItemsRepeater can call it (Uno-specific C# vs WinRT overridable gap). - Replace NotImplemented stubs in Generated/Layout.cs and Generated/ ItemsRepeater.cs with skipping comments (matches generator output). - Restore MUX reference header on ItemsRepeater.cs. - Strengthen AreSame assertions in Given_ItemCollectionTransitionProvider. - Remove unused usings and stale test references. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23069/wasm-skia-net9/index.html |
Detach the TransitionCompleted subscription on Unloaded and reattach on Loaded to avoid leaking ItemsRepeater through a long-lived ItemCollectionTransitionProvider, mirroring the existing layout/data-source revoker pattern in OnUnloaded/OnLoaded. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23069/wasm-skia-net9/index.html |
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23069/wasm-skia-net9/index.html |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23069/wasm-skia-net9/index.html |
1 similar comment
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23069/wasm-skia-net9/index.html |
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
f9a3237 to
abd604b
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23069/wasm-skia-net9/index.html |
|
|
GitHub Issue: closes #22905
PR Type:
What is the current behavior? 🤔
ItemsRepeaterexposed anAnimatordependency property backed by the legacyElementAnimator/AnimationManager/AnimationContexttypes. That surface predated WinUI 1.8 and has been retired upstream in favor of theItemCollectionTransitionProviderpipeline (TransitionManagerlifecycle bridge). Uno still shipped the old surface alongside no transition-provider support, so apps could not consume modern transition providers (e.g.LinedFlowLayoutItemCollectionTransitionProvider) and could not be ported from WinUI cleanly.What is the new behavior? 🚀
TransitionManager(TransitionManager.h/.cpp, tagwinui3/release/1.8.1) as the lifecycle bridge betweenItemsRepeaterandItemCollectionTransitionProvider.ItemsRepeater.ItemTransitionProviderDP andLayout.CreateDefaultItemTransitionProvider()(widened toprotected internal virtual— minimum deviation needed because in WinRToverridableprojects accessibly to the projection but in C#protectedcannot be called fromItemsRepeater; documented inline).Prepare/Clear/BoundsChanged/ layout / collection-change notifications throughTransitionManagerinstead ofAnimationManager.Breaking changes⚠️
This PR consciously deviates from the original
[Obsolete]-keep scope in the linked issue. Following full WinUI parity, the following retired types and members are removed entirely (no references to them remain in the WinUI 1.8.1 Repeater sources):Microsoft.UI.Xaml.Controls.ItemsRepeater.AnimatorpropertyMicrosoft.UI.Xaml.Controls.ElementAnimator(and the protectedDefaultElementAnimatortest type)Microsoft.UI.Xaml.Controls.AnimationManagerMicrosoft.UI.Xaml.Controls.AnimationContextOnElementShown/OnElementHidden/OnElementBoundsChangedvirtual hooks onElementAnimatorMigration: replace
ItemsRepeater.Animator = …withItemsRepeater.ItemTransitionProvider = …. Default behavior is now provided byLayout.CreateDefaultItemTransitionProvider()(overridable in custom layouts). For built-in layouts that ship a default provider (e.g.LinedFlowLayout→LinedFlowLayoutItemCollectionTransitionProvider) the transition surface is automatically wired without any user code changes. Tests that exclusively exercised theAnimatorAPI (ElementAnimatorTests,ElementAnimatorDerived) were removed alongside the API.The removals are recorded in
build/PackageDiffIgnore.xml.PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️
WinUI parity sources used:
D:\…\controls\dev\Repeater\TransitionManager.{h,cpp},ItemsRepeater.{h,cpp}at tagwinui3/release/1.8.1. The Uno port preserves WinUI logic byte-for-byte in*.mux.csfiles; Uno-specific concessions (e.g.#if HAS_UNOcleanup of theTransitionCompletedsubscription onUnloaded/Loadedto avoid .NET event-delegate leaks that don't exist with WinUI'stracker_refruntime) are isolated in*.uno.cspartials.