Skip to content

ItemsRepeater Transition manager - #23069

Merged
MartinZikmund merged 8 commits into
masterfrom
dev/mazi/repeater-transitionmanager
May 6, 2026
Merged

MartinZikmund merged 8 commits into
masterfrom
dev/mazi/repeater-transitionmanager

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Apr 17, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #22905

PR Type:

  • ✨ Feature

What is the current behavior? 🤔

ItemsRepeater exposed an Animator dependency property backed by the legacy ElementAnimator / AnimationManager / AnimationContext types. That surface predated WinUI 1.8 and has been retired upstream in favor of the ItemCollectionTransitionProvider pipeline (TransitionManager lifecycle 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? 🚀

  • Ports TransitionManager (TransitionManager.h/.cpp, tag winui3/release/1.8.1) as the lifecycle bridge between ItemsRepeater and ItemCollectionTransitionProvider.
  • Adds ItemsRepeater.ItemTransitionProvider DP and Layout.CreateDefaultItemTransitionProvider() (widened to protected internal virtual — minimum deviation needed because in WinRT overridable projects accessibly to the projection but in C# protected cannot be called from ItemsRepeater; documented inline).
  • Routes element Prepare / Clear / BoundsChanged / layout / collection-change notifications through TransitionManager instead of AnimationManager.
  • Updates the generated Layout / ItemsRepeater stubs so the new members no longer collide with the MUX partials.

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.Animator property
  • Microsoft.UI.Xaml.Controls.ElementAnimator (and the protected DefaultElementAnimator test type)
  • Microsoft.UI.Xaml.Controls.AnimationManager
  • Microsoft.UI.Xaml.Controls.AnimationContext
  • The associated OnElementShown / OnElementHidden / OnElementBoundsChanged virtual hooks on ElementAnimator

Migration: replace ItemsRepeater.Animator = … with ItemsRepeater.ItemTransitionProvider = …. Default behavior is now provided by Layout.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 the Animator API (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:

Other information ℹ️

WinUI parity sources used: D:\…\controls\dev\Repeater\TransitionManager.{h,cpp}, ItemsRepeater.{h,cpp} at tag winui3/release/1.8.1. The Uno port preserves WinUI logic byte-for-byte in *.mux.cs files; Uno-specific concessions (e.g. #if HAS_UNO cleanup of the TransitionCompleted subscription on Unloaded / Loaded to avoid .NET event-delegate leaks that don't exist with WinUI's tracker_ref runtime) are isolated in *.uno.cs partials.

Copilot AI review requested due to automatic review settings April 17, 2026 07:19

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.

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 TransitionManager plus ItemCollectionTransition* types and wire them into ItemsRepeater/ViewManager.
  • Add new ItemsRepeater.ItemTransitionProvider dependency property and mark Animator/AnimationManager as obsolete.
  • Add runtime tests validating ItemCollectionTransitionProvider behavior 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.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/repeater-transitionmanager branch from 7816706 to 8bdf862 Compare April 17, 2026 14:31
@MartinZikmund
MartinZikmund marked this pull request as ready for review April 20, 2026 11:59
Copilot AI review requested due to automatic review settings April 20, 2026 11:59
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/repeater-transitionmanager branch from 8bdf862 to 7b59d8f Compare April 20, 2026 12:01

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.

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.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/repeater-transitionmanager branch from 7b59d8f to 61fcc60 Compare April 21, 2026 12:29
@github-actions

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on 61fcc60

The Uno.WinAppSDKSyncGenerator produced changes that are not committed on this PR.

To apply automatically (PRs from branches in this repo only): comment /apply-sync-gen on this PR and a bot will push chore: Sync generator run to the head branch.

To apply manually (required for PRs from forks):

  1. Download the sync-generator-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply sync-generator.patch
    git add -A
    git commit -m "chore: Sync generator run"
    git push
    

Or re-run the generator locally on Windows via build\run-api-sync-tool.cmd.

Copilot AI review requested due to automatic review settings April 21, 2026 13:25

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.

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

  • ClearElementToAnimator now delegates to TransitionManager, but the method name (and the ownership transition MoveOwnershipToAnimator) 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.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/repeater-transitionmanager branch from e7557d5 to 1a578cd Compare April 22, 2026 09:14
@github-actions

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on 1a578cd

The Uno.WinAppSDKSyncGenerator produced changes that are not committed on this PR.

To apply automatically (PRs from branches in this repo only): comment /apply-sync-gen on this PR and a bot will push chore: Sync generator run to the head branch.

To apply manually (required for PRs from forks):

  1. Download the sync-generator-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply sync-generator.patch
    git add -A
    git commit -m "chore: Sync generator run"
    git push
    

Or re-run the generator locally on Windows via build\run-api-sync-tool.cmd.

@MartinZikmund

Copy link
Copy Markdown
Member Author

/apply-sync-gen

@github-actions

Copy link
Copy Markdown
Contributor

Pushed chore: Sync generator run to this PR branch.

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 git commit --allow-empty -m "ci: re-run") or ask a maintainer to re-run the check.

Copilot AI review requested due to automatic review settings April 22, 2026 16:15
@MartinZikmund
MartinZikmund removed the request for review from Copilot April 22, 2026 16:15
@CLAassistant

CLAassistant commented Apr 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI review requested due to automatic review settings April 23, 2026 06:23
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Apr 23, 2026

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.

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.

Comment thread build/PackageDiffIgnore.xml Resolved
MartinZikmund and others added 3 commits April 27, 2026 16:08
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]>
@unodevops

Copy link
Copy Markdown
Contributor

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]>
Copilot AI review requested due to automatic review settings April 27, 2026 14:39

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.

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.

@unodevops

Copy link
Copy Markdown
Contributor

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings May 4, 2026 07:00

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.

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.

@unodevops

Copy link
Copy Markdown
Contributor

1 similar comment
@unodevops

Copy link
Copy Markdown
Contributor

MartinZikmund and others added 2 commits May 5, 2026 15:48
Copilot AI review requested due to automatic review settings May 5, 2026 13:48
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/repeater-transitionmanager branch from f9a3237 to abd604b Compare May 5, 2026 13:48
@MartinZikmund
MartinZikmund enabled auto-merge May 5, 2026 13:49

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 210888 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund merged commit 43019e2 into master May 6, 2026
66 of 67 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/repeater-transitionmanager branch May 6, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Repeater] TransitionManager + ItemTransitionProvider property (replaces AnimationManager)

6 participants