Repository navigation
fix(itemsrepeater): Extent origin reset, default-layout cache, WinUI rounding - #25078
Merged
Merged
Conversation
The origin StackLayout holds across measure passes outlived changes to Orientation and Spacing, and a layout state reused for a new context, offsetting the list by the stale value. Version the held origin and reset it on context (un)initialization. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
ViewportManagerWithPlatformFeatures skipped cache build work when Layout was null, so a repeater on its default StackLayout never realized beyond the viewport. WinUI 2.5.1 has no such check. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
The ported layouts use C round(), which rounds halves away from zero; Math.Round defaults to banker's rounding, so x.5 averages and layout rounding landed one unit short half the time. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
Contributor
|
Claude finished @MartinZikmund's task in 19s —— View job Review of #25078Verdict: ship. I found 0 blocking issues and posted no inline comments. I reviewed the diff by inspection only. I did not build the code or run any tests. The pass/fail results in the PR description are the author's own and I haven't confirmed them. Review notes
|
2 of 5 tasks
Contributor
|
The build 237883 found UI Test snapshots differences: Details
|
2 of 5 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GitHub Issue: closes #25076
PR Type:
🐞 Bugfix
What changed? 🚀
Three ItemsRepeater fixes split out of the LinedFlowLayout port (#23691), because LinedFlowLayout doesn't need any of them:
OrientationorSpacingchanges, and it is reset when the layout state is (un)initialized for a context. Before, an outdated origin could offset the whole list.ViewportManagerWithPlatformFeatures.RegisterCacheBuildWorkno longer requiresLayout != null, which matches WinUI 2.5.1. A repeater on its defaultStackLayoutnow builds its cache buffer.FlowLayout.GetAverageLineInfo,FlowLayoutAlgorithm.LayoutRoundandStackLayout's average element size useMidpointRounding.AwayFromZero, matching C++round().Each fix is followed by its own test commit (
Given_ItemsRepeater_FastScrollextent-origin tests,Given_ItemsRepeater.When_No_Layout_Set_Then_Default_StackLayout_Grows_Cache). The rounding fix has no dedicated test.Validation (Skia desktop, runtime tests): all 46 tests in
Given_ItemsRepeater,Given_ItemsRepeater_FastScrollandLayoutTestspass. With the source fixes reverted to master:When_No_Layout_Set_Then_Default_StackLayout_Grows_CacheandWhen_LayoutStateReusedForNewContext_Then_ExtentOriginIsResetfail, so these two are proven fixes.When_OrientationChanges_…still passes on master, as doWhen_ItemsSourceReplaced_…andWhen_ScrollingForward_…. The Orientation/Spacing version counter is therefore defensive hardening: no visible symptom is reproduced yet. The other two act as regression guards.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8