Skip to content

feat(Repeater): VirtualizingLayoutContext.VisibleRect - #23111

Merged
MartinZikmund merged 1 commit into
masterfrom
dev/mazi/irvisiblerect
May 7, 2026
Merged

MartinZikmund merged 1 commit into
masterfrom
dev/mazi/irvisiblerect

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

Port VisibleRect property and VisibleRectCore() from WinUI. Wire through RepeaterLayoutContext (delegates to owner.VisibleWindow) and LayoutContextAdapter (returns infinite rect). Port ViewportTests delta exercising VisibleRect vs RealizationRect distinction.

Fixes #22902

GitHub Issue: closes #

PR Type:

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Copilot AI review requested due to automatic review settings April 22, 2026 07: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

Adds WinUI-parity VisibleRect support to VirtualizingLayoutContext and wires it through the ItemsRepeater layout contexts so layouts can distinguish what’s actually visible from what’s realized (cache window).

Changes:

  • Added VirtualizingLayoutContext.VisibleRect and VisibleRectCore().
  • Implemented VisibleRectCore() in RepeaterLayoutContext (delegates to ItemsRepeater.VisibleWindow) and in LayoutContextAdapter (infinite rect).
  • Updated repeater ViewportTests to record/assert VisibleRect behavior alongside RealizationRect.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Uno.UI/UI/Xaml/Controls/Repeater/VirtualizingLayoutContext.cs Introduces VisibleRect API and core virtual method.
src/Uno.UI/UI/Xaml/Controls/Repeater/RepeaterLayoutContext.cs Wires VisibleRect to the repeater owner’s visible window.
src/Uno.UI/UI/Xaml/Controls/Repeater/LayoutContextAdapter.cs Provides an infinite visible rect for non-virtualizing contexts.
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/VirtualizingLayoutContext.cs Removes generated NotImplemented stubs now that the API exists in the real partial.
src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/Repeater/ViewportTests.cs Extends tests to capture/validate VisibleRect vs RealizationRect.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on b738912

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.

@unodevops

Copy link
Copy Markdown
Contributor

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

@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.

@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 22, 2026 09:15
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/irvisiblerect branch from 2854989 to 4032f35 Compare April 22, 2026 09:15

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 20 out of 22 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/Uno.UI/UI/Xaml/Controls/Repeater/ViewManager.cs:873

  • ClearElementToAnimator/MoveOwnershipToAnimator naming is now misleading because the logic was switched to TransitionManager and ItemCollectionTransitionProvider. Renaming these identifiers (and the ElementOwner.Animator enum value where applicable) to reflect transitions rather than an animator would reduce confusion when debugging ownership flows.
		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.

@github-actions

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on 4032f35

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
MartinZikmund force-pushed the dev/mazi/irvisiblerect branch from 4032f35 to 195386e Compare April 27, 2026 09:45
@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings April 27, 2026 14:09
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/irvisiblerect branch from 195386e to 7a89414 Compare April 27, 2026 14:09
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Apr 27, 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 21 out of 23 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build/PackageDiffIgnore.xml Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/irvisiblerect branch from 7a89414 to 25e6b8a Compare April 27, 2026 14:42
@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings May 4, 2026 06:13
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/irvisiblerect branch from 25e6b8a to a7463a8 Compare May 4, 2026 06:13

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 22 out of 24 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

Port VisibleRect property and VisibleRectCore() from WinUI. Wire
through RepeaterLayoutContext (delegates to owner.VisibleWindow) and
LayoutContextAdapter (returns infinite rect). Port ViewportTests delta
exercising VisibleRect vs RealizationRect distinction.

Fixes #22902

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/irvisiblerect branch from a7463a8 to 9054f5d Compare May 6, 2026 13:17
@github-actions github-actions Bot removed the area/build Categorizes an issue or PR as relevant to build infrastructure label May 6, 2026
@MartinZikmund
MartinZikmund enabled auto-merge May 6, 2026 13:23
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@MartinZikmund
MartinZikmund disabled auto-merge May 7, 2026 05:55
@MartinZikmund
MartinZikmund merged commit 82a0ce7 into master May 7, 2026
44 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/irvisiblerect branch May 7, 2026 05:56
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.

[Repeater] VirtualizingLayoutContext.VisibleRect

5 participants