Skip to content

feat(itemsrepeater): Port LinedFlowLayout - #23691

Merged
MartinZikmund merged 55 commits into
masterfrom
dev/doti/port-linedflowlayout
Oct 7, 2026
Merged

MartinZikmund merged 55 commits into
masterfrom
dev/doti/port-linedflowlayout

Conversation

@morning4coffe-dev

Copy link
Copy Markdown
Member

GitHub Issue: closes #22909

PR Type:

✨ Feature

What changed? 🚀

Completes the LinedFlowLayout port from WinUI: measure/arrange, line-breaking, items-info request/update, locked-item support, and the fast/regular realization paths. Also modernizes UniformGridLayout to the .mux file convention and refreshes it to WinUI b8cfb8490.

PR Checklist ✅

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 6m 47s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Gather diff and read key files
  • Review LinedFlowLayout core implementation
  • Review properties, event args, and item aspect ratios
  • Review ElementManager / ViewManager / VirtualizationInfo changes
  • Review runtime tests and unit tests
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship with minor fixes

This is a large, well-structured incremental port. The line-breaking math, fast/regular realization paths, locked-item semantics, and items-info plumbing all closely follow the WinUI C++ source. The incremental #pragma warning suppressions and the internal-visibility seams for white-box testing are sensible choices for a phased port.

2 findings posted as inline comments:

Severity File Issue
Minor LinedFlowLayout.Properties.cs:75–78 #pragma warning disable 67 is stale — both ItemsInfoRequested and ItemsUnlocked are raised in the same PR; keeping the suppression masks future regressions
Minor LinedFlowLayout.mux.cs:684 isForDestructor parameter of InvalidateMeasureTimerStop is accepted but never read; the method body is identical for both values

Other observations (no action required):

  • ItemsUnlocked?.Invoke(this, null!) — passing null! for the object args is the WinUI contract (the WinUI IInspectable args is always null here); acceptable.
  • //context.RecycleElement(element) commented out at line 4595 — preserving upstream bug 41896454 verbatim is correct; the inline comment explains it adequately.
  • #pragma warning disable 169, 414, 649 block in LinedFlowLayout.h.mux.cs — the scope is tight and all suppressed fields are future-use mirrors of WinUI state; acceptable for incremental porting.
  • Generated file changes (Generated/3.0.0.0/) — the #if false || false || false… pattern and the "Skipping already declared…" comments are the standard Uno stub-retirement pattern; no concern.
  • ElementManager.ResizeLayoutBounds and ViewManager DataContext clearing — both fixes are correctly scoped. The ordering change (moving MoveOwnershipToElementFactory before RecycleElement) is safe since no intermediate call site reads virtInfo.Owner between them.
  • OrientationBasedMeasures sign fix (rect.Y -= increment → rect.Y += increment) — clearly correct; the accompanying regression test in Given_UniformGridLayout follows the fail-before / pass-after discipline.
  • The five re-enabled Skia tests in ViewManagerTests.cs that were previously gated behind #4529 ignores appear to be unblocked by the ResizeLayoutBounds / DataContext fixes in this PR.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on 8d74b13

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

@morning4coffe-dev

Copy link
Copy Markdown
Member Author

/apply-sync-gen

@github-actions

github-actions Bot commented Jul 8, 2026

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 Jul 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ morning4coffe-dev
✅ MartinZikmund
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 5m 10s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Read key changed files
  • Review LinedFlowLayout.Properties.cs — prior finding (stale #pragma warning disable 67) fixed in 43aabea5
  • Review LinedFlowLayout.mux.cs — prior finding (isForDestructor param) fixed in 43aabea5; full pass done
  • Review LinedFlowLayout.h.mux.cs
  • Review LinedFlowLayoutItemAspectRatios.mux.cs
  • Review LinedFlowLayoutItemsInfoRequestedEventArgs.mux.cs
  • Review ElementManager.cs / ViewManager.cs / VirtualizationInfo.cs changes
  • Review runtime tests and unit tests
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship with minor fix

The two findings from the prior review (#pragma warning disable 67 stale, isForDestructor dead parameter) were resolved in commit 43aabea5. The code is in good shape overall.

1 new finding posted as an inline comment:

Severity File Issue
Minor LinedFlowLayout.mux.cs:298–299 (float) casts narrow double → float precision then silently widen back; ItemsInfo.m_minWidth/m_maxWidth are double, the casts are redundant and lossy

Other observations (no action required):

  • LinedFlowLayoutItemAspectRatios — block lifecycle, GetEmptyOrFurthestBlock, Resize/Clear semantics all look correct.
  • LinedFlowLayoutItemsInfoRequestedEventArgs — SetItemsRangeEstablishedLength validation chain and ResetLinedFlowLayout/MustClearDataContext disconnect are correct. A handler that fires but returns no aspect ratios (length 0 ≤ 0) is treated as "no info" consistently with the <= 0 guard at RequestItemsInfo line 4911.
  • ElementManager.ResizeLayoutBounds and ViewManager DataContext clearing — both fixes are correctly scoped (Uno-specific workarounds for List<T> vs std::vector::resize and DataContext lifecycle).
  • OrientationBasedMeasures sign fix — rect.Y += increment is correct; the Given_UniformGridLayout regression test follows fail-before/pass-after discipline.
  • DispatcherTimer.Tick event handler — InvalidateMeasureTimerTick(object? sender, object args) matches the EventHandler<object> contract. The WeakReference<LinedFlowLayout> guard in InvalidateMeasureAsync is correct.
  • #pragma warning disable 169, 414, 649 block in LinedFlowLayout.h.mux.cs — scope is tight, all suppressed fields are declared-but-not-yet-consumed future-slice state mirroring WinUI; acceptable for incremental porting.
  • Runtime and unit tests — Given_LinedFlowLayout and Given_LinedFlowLayoutItemAspectRatios cover the white-box-testable helpers and the end-to-end measure/arrange path. All test methods use the correct async Task / void distinction.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221385 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 2364

Details
  • skia-linux-screenshots: 0 changed over 2366

  • skia-windows-screenshots: 2364 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png-dark
    • AppBar_KeyBoard.png
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowFeatures.png
    • AppXamlDefinedResources.png-dark
    • AutomationPropertiesExtensions_Role.png-dark
    • BasicEnability.png
    • BenchmarkDotNet.png
    • BitmapIcon_Monochromatic.png-dark
    • BitmapIcon_Monochromatic.png
    • BorderRightwithmargins.png
    • BorderTopwithmargins.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_Simple_No_Background_With_TextBox.png-dark
    • Border_Simple_No_Background_With_TextBox.png
    • Border_With_ScaleTransform.png-dark
    • Border_With_ScaleTransform.png
    • Button_Inside_Border.png-dark
    • Button_Inside_Border.png

@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 6m 22s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Gather diff and read key files
  • Review LinedFlowLayout core implementation (mux.cs)
  • Review Properties, h.mux, ItemAspectRatios, EventArgs
  • Review ElementManager / ViewManager / VirtualizationInfo changes
  • Review runtime tests and unit tests
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship with minor fix

All three findings from the two prior reviews are resolved in commits 43aabea5 and 53936ae4 — the stale #pragma warning disable 67, the dead isForDestructor parameter, and the lossy (float) casts are all gone. Commit 53936ae4 also trimmed the dead GetItemLineIndex method.

1 new finding posted as an inline comment:

Severity File Issue
Minor Given_LinedFlowLayout.cs:178 Three RaiseItemsInfoRequested tests leave m_itemCount = 0, triggering MUX_ASSERT in DEBUG builds; fix is sut.m_itemCount = 3 (or 5 for the expanded-range test)

Other observations (no action required):

  • 53936ae4 — GetItemLineIndex removal is safe; confirmed no callers remain in the tree.
  • Screenshot comparison run shows 2364/2368 images changed on skia-windows. At 99.8% diff rate across entirely unrelated controls (Border, Button, AnimatedIcon, etc.) this is a baseline drift issue, not a regression introduced by this PR.
  • RequestedRangeStartIndex / RequestedRangeLength as public — intentional Uno exposure for white-box testability during the phased WS-D3 port; acceptable.
  • ItemsUnlocked?.Invoke(this, null!) — null! matches the WinUI contract where the IInspectable args is always null; acceptable.
  • #pragma warning disable 169, 414, 649 in LinedFlowLayout.h.mux.cs — scope is tight; all suppressed fields mirror not-yet-consumed WinUI state; acceptable for incremental porting.
  • DispatcherQueue.TryEnqueue + WeakReference<LinedFlowLayout> guard in InvalidateMeasureAsync — correct pattern; avoids extend-lifetime capture.
  • //context.RecycleElement(element) at line 4595 — preserving upstream Bug 41896454 verbatim; the inline comment explains it.
  • ItemsLayout modelled as a reference type with Clone() — correctly substitutes for WinUI's value-type copy semantics; all value-copy sites use Clone().
  • LinedFlowLayoutItemAspectRatios block lifecycle — GetEmptyOrFurthestBlock, Resize, Clear, SetAt all look correct relative to WinUI.

@morning4coffe-dev
morning4coffe-dev marked this pull request as ready for review July 11, 2026 09:42
@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 8m 50s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Gather diff and read key files
  • Review LinedFlowLayout core implementation (mux.cs)
  • Review Properties, h.mux, ItemAspectRatios, EventArgs
  • Review ElementManager / ViewManager / VirtualizationInfo changes
  • Review runtime tests and unit tests
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship with minor observation

This is the third pass over this PR. All prior findings have been addressed:

  • #pragma warning disable 67 stale suppression → removed in 43aabea5 ✅
  • isForDestructor dead parameter → removed in 43aabea5 ✅
  • (float) precision-loss casts on m_minWidth/m_maxWidth → removed in 53936ae4 ✅

1 new observation posted as inline comments (lines 986 and 994):

Severity File Issue
Minor / Verify LinedFlowLayout.mux.cs:986,994 Math.Min(-1.0, perItemMax) silently drops per-item max widths when no global MaxWidth is set; GetMinWidthFromItemsInfo uses Math.Max which correctly surfaces per-item mins. Whether this is a faithful WinUI asymmetry or a latent bug needs a native WinUI test to confirm.

Other observations (no action required):

  • DispatcherQueue.TryEnqueue in InvalidateMeasureAsync — DispatcherQueueHandler is a delegate void delegate; the lambda is implicitly convertible. The WeakReference<LinedFlowLayout> guard prevents a captured-reference leak. ✓
  • ItemsUnlocked?.Invoke(this, null!) — TypedEventHandler<LinedFlowLayout, object> contract; null! correctly mirrors the WinUI IInspectable* always-null pattern. ✓
  • MUX_ASSERT usage — Confirmed [Conditional("DEBUG")], no release-build impact. ✓
  • GetItemLineIndex removal — Dead private method removed in 53936ae4, eliminating a CS0169 warning. ✓
  • #pragma warning disable 169, 414, 649 block in h.mux.cs — Scope is tight (forward-declared state fields for future workstream slices); acceptable for incremental porting. ✓
  • SetDesiredAspectRatios / SetMinWidths / SetMaxWidths seams — .Clone() on the provided arrays is correct; prevents the external caller from mutating the fast-path buffers after the event.
  • ClearAndFill vs ResizeList semantics — Correct distinction: ClearAndFill destroys prior content (fresh EnsureXxx), ResizeList preserves for the incremental fast-path grow. ✓
  • Runtime tests (Given_LinedFlowLayout) — All async tests correctly use async Task; synchronous tests correctly use void; all [RunsOnUIThread] methods that await use UITestHelper.Load or WaitForIdle. ✓
  • When_VerticalOrientation_Fill_Then_ItemMeasuredWithStretchedHeight — Good regression test with explicit fail-before/pass-after commentary and a discriminating assertion. ✓

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221847 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 85

Details
  • skia-linux-screenshots: 73 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Examples.png-dark
    • Examples.png
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • Basics Pivot Test.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DataTransferManager.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 85 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Image_UseTargetSize.png-dark
    • ContextRequested.png-dark
    • DropDownButtonPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • DisplayInformation.png

@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 4m 26s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Gather diff and read key files
  • Review new commits since last review (d84ebcc4, 8d74b134)
  • Confirm status of prior outstanding findings
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship with minor fix

The two most recent commits are clean:

  • 8d74b134 — the new When_HostedInItemsRepeater_Then_MeasuresAndArrangesWithoutThrowing smoke test is well-structured (DynamicDataTemplate + UITestHelper.Load + WaitForIdle, checks both non-zero height and at least one realized child). No issues.
  • d84ebcc4 — the ValidateChildBounds tolerance extension uses correct <= comparisons and the 0.51 cap covers the 33.3333 / 266.6667 sub-pixel rounding correctly. No issues.

1 finding re-posted as an inline comment (still unresolved from prior pass):

Severity File Issue
Minor Given_LinedFlowLayout.cs:178 m_itemCount stays 0 on all three RaiseItemsInfoRequested test methods; MUX_ASSERT(startIndex + length - 1 < m_itemCount) fires in DEBUG builds. Fix: sut.m_itemCount = 3 (or 5 for the expanded-range test).

Open observation from prior pass (still needs WinUI verification):

GetMaxWidthFromItemsInfo (lines 986, 994) uses Math.Min(m_itemsInfoMaxWidth, perItemMax) — when no global MaxWidth is set, m_itemsInfoMaxWidth = -1.0, so Math.Min(-1.0, 200.0) = -1.0, silently discarding per-item max constraints. The symmetric GetMinWidthFromItemsInfo uses Math.Max and correctly surfaces per-item minimums. This asymmetry is inherited from the WinUI C++ source; please confirm with a native WinUI test (SetMaxWidths without setting MaxWidth) and add a comment if the "drop per-item max" behavior is intentional.

Screenshot comparison run (build 221847) shows 73 (Linux) / 85 (Windows) changed images. These are all unrelated controls (Focus visuals, CalendarView, Clipboard, Gamepad, etc.) and appear to be baseline drift from other in-flight changes rather than regressions from this PR.

@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 1m 12s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Gather new commits since last review
  • Check status of outstanding findings
  • Review new changes
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship ✅

Commit aa4dbffd addresses both outstanding items from the prior review pass cleanly.

All prior findings resolved:

Finding Resolution
#pragma warning disable 67 stale suppression Removed in 43aabea5
isForDestructor dead parameter Removed in 43aabea5
(float) precision-loss casts on m_minWidth/m_maxWidth Removed in 53936ae4
m_itemCount = 0 in tests — MUX_ASSERT fired in DEBUG builds Fixed in aa4dbffd: m_itemCount = 3 (×2) and m_itemCount = 5 for expanded-range test
GetMaxWidthFromItemsInfo asymmetric sentinel behavior undocumented Addressed in aa4dbffd: // Preserve WinUI's sentinel behavior: an unset global max (-1) disables per-item max caps.

No new findings. The aa4dbffd commit is a single-purpose, minimal fix — correct m_itemCount values and one explanatory comment. Both changes are accurate:

  • The item count values (3, 3, 5) satisfy the MUX_ASSERT(startIndex + length - 1 < m_itemCount) invariant for all three test call sites.
  • The sentinel comment correctly documents the WinUI C++ std::min asymmetry relative to GetMinWidthFromItemsInfo's std::max.

Screenshot comparison (build 221847): 73 Linux / 85 Windows changed images over 2368 — all unrelated controls (Focus visuals, CalendarView, Clipboard, Gamepad reading, etc.), consistent with baseline drift from other concurrent changes rather than any regression in this PR.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221860 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 92

Details
  • skia-linux-screenshots: 73 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • EllipsemaskingEllipseGrid.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_Enumeration.png-dark
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • CompositionPath.png
    • Examples.png-dark
    • Examples.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DoubleImageBrushInList.png-dark
  • skia-windows-screenshots: 92 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ClipboardTests.png-dark
    • CompositionPath.png
    • ContextRequested.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Image_UseTargetSize.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png

@github-actions

github-actions Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 3m 6s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Load review tools
  • Gather new commits since last review (a09d9a89, f7f2693c)
  • Review new changes
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: fix-first

Commit a09d9a89 introduced one correctness bug and one missing annotation.

2 findings posted as inline comments:

Severity File Issue
Bug Given_LinedFlowLayout.cs:57 #endif is misplaced inside the first test method body; all 20+ subsequent test methods and the trailing realizedChildren.Should() line sit outside the #if HAS_UNO guard — dangling code with no enclosing namespace/class on WinUI builds, causing compile errors. Move #endif to EOF (after the closing } at line 684).
Minor FlowLayoutTests.cs:1182 ValidateIntersectionWithRealizationWindow is silently excluded on SkiaWasm without a [GitHubWorkItem] tracking the reason; per .claude/rules/runtime-tests.md, every platform exclusion should carry a link so the skip is reversible.

Prior findings — all resolved ✅

Finding Resolved in
#pragma warning disable 67 stale suppression 43aabea5
isForDestructor dead parameter 43aabea5
(float) precision-loss casts on m_minWidth/m_maxWidth 53936ae4
m_itemCount = 0 in tests → MUX_ASSERT in DEBUG builds aa4dbffd
GetMaxWidthFromItemsInfo sentinel asymmetry undocumented aa4dbffd

Other observations (no action required):

  • tolerance: 0.51 additions to ValidateChildBounds in FlowLayoutTests.cs — correctly scoped to the six justification/stretch assertions that involve SpaceEvenly 33.3333/266.6667 rounding; the cap at 0.51 is consistent with the existing pattern from d84ebcc4.
  • Merge commit f7f2693c (sync from feature/breakingchanges) — unrelated to this PR's content; no new issues introduced in the merge itself.

MartinZikmund and others added 2 commits October 5, 2026 11:29
b8cfb8490 does not contain the Repeater sources; LinedFlowLayout and
LayoutsTestHooks are byte-identical between the port baseline and the
winui3/release/2.5.1 tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ScaLtqqNJ7e6VgoJExs2vD
IndexBasedLayoutOrientation is implemented now; the tests still time
out waiting for ScrollView.BringingIntoView, already in the default
StackLayout pass before LinedFlowLayout runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ScaLtqqNJ7e6VgoJExs2vD
Copilot AI lite review requested due to automatic review settings October 5, 2026 09:35

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 19s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Tasks:

  • Identify new changes since last review pass
  • Review new changes against AGENTS.md rules
  • Post inline comments for findings
  • Update summary comment

Review Summary

Verdict: ship with minor nit

Four new commits landed since the last reviewed commit (ccc323b2): 926de07a, 8ab1b0af, 23cac5a2, c41499e2.

What they do:

  • 926de07a — adds the #9080 tracking comment to the SkiaAndroid exclusion on Given_ProgressRing.When_ProgressRing_Visible, directly resolving the prior code-quality-bot finding. ✅
  • 8ab1b0af — narrows several LinedFlowLayout measure/arrange computations (DesiredSize, VisibleRect.Height/.Y, RasterizationScale, MinWidth/MaxWidth) to float before use, matching WinUI's float-based Size/Rect/Point types. Also switches to the existing ElementManager.GetFirstRealizedDataIndex property instead of GetDataIndexFromRealizedRangeIndex(0), matches WinUI's positive-infinity-only virtualization check, and routes two debug fields through their Dbg() accessor methods for consistency with the rest of the file. All of this is corroborated by the h.mux.cs/accessor definitions already in the tree — no dangling references introduced.
  • 23cac5a2 — pure comment/header update: cites winui3/release/2.5.1 instead of b8cfb8490 as the port baseline for LinedFlowLayout/LayoutsTestHooks files, since the byte-identical source actually lives in that tag. No code change.
  • c41499e2 — corrects the [Ignore] reason text on three ItemsViewTests to reflect the real current blocker (ScrollView.BringingIntoView never firing) now that IndexBasedLayoutOrientation is implemented. Text-only.

1 minor finding posted inline:

Severity File Issue
Minor LinedFlowLayout.mux.cs:4802 8ab1b0af silently dropped the explanatory comment on GetMaxWidthFromItemsInfo's sentinel asymmetry (Math.Min vs. the sibling's Math.Max) that was added in aa4dbffd specifically to resolve an earlier review finding. The behavior itself is unchanged — only the documentation regressed.

Other observations (no action required):

  • The (float) narrowing in RaiseItemsInfoRequested (m_minWidth/m_maxWidth) reinstates a cast that an earlier review pass had flagged as "lossy" and asked to remove (53936ae4). Given this commit's stated rationale — WinUI's own struct fields are float — and that the containing ItemsInfo.m_minWidth/m_maxWidth fields remain double only as a storage convenience, this is a deliberate precision-parity fix rather than a regression of the earlier finding.
  • No test was added specifically for the float-precision fix in 8ab1b0af. This is a mechanical/systemic correction (narrowing many call sites to match WinUI's float math) rather than an isolated repro-able bug, so a dedicated regression test is less practical here; the extensive existing Given_LinedFlowLayout/ItemsViewTests suite should catch gross regressions.
  • No event Action/Action<T>, no .Result/.GetAwaiter().GetResult(), no newly-introduced #pragma warning disable, and no platform-suffix violations in this batch.
    (branch: dev/doti/port-linedflowlayout)

@MartinZikmund

Copy link
Copy Markdown
Member

🤖 Addressed PR comments up to this point

  • @MartinZikmund: "rebase this on top of Update ItemsRepeater #23406". Done. Update ItemsRepeater #23406 is on master, so the branch is rebased onto current master with only the 45 LinedFlowLayout commits replayed; the 32 Repeater-sync commits already on master were dropped. Master already carried the StackLayout extent-origin hold, so the branch now adds only the extra resets (on Orientation/Spacing change and on context re-init), built on master's StabilizeExtentOrigin.
  • WinUI parity pass against winui3/release/2.5.1 (LinedFlowLayout sources are byte-identical between the original port baseline and 2.5.1). All of LinedFlowLayout.cpp (~8.1k lines) plus AspectRatios, EventArgs and TestHooks were checked method by method, and no logic drift was found. Fixed in 8ab1b0a: the port kept double precision where WinUI narrows Size/Rect/MinWidth/MaxWidth/RasterizationScale to float, which flipped MinWidth equality checks and ActualLineHeight for sizes that aren't exact floats. Port headers now cite 2.5.1 (23cac5a).
  • Known gap, not addressed here: LinedFlowLayoutItemCollectionTransitionProvider is still unported (CreateDefaultItemTransitionProvider returns null), because Uno's CompositionAnimationGroup is a stub.
  • Build fix for master's new boxing analyzer: ccc323b. Test housekeeping: 926de07 and c41499e.

@unoplatform unoplatform deleted a comment from azure-pipelines Bot Oct 5, 2026
@unoplatform unoplatform deleted a comment from unodevops Oct 5, 2026
@unoplatform unoplatform deleted a comment from azure-pipelines Bot Oct 5, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237393 found UI Test snapshots differences: skia-linux-screenshots: 113, skia-windows-screenshots: 196

Details
  • skia-linux-screenshots: 113 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ColorPickerSample.png-dark
    • ClipboardTests.png-dark
    • ColorPickerSample.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Examples.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 196 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • GridViewScrollIntoViewTest.png-dark
    • GridViewScrollIntoViewTest.png
    • GridViewSelection.png-dark
    • GridViewSelection.png
    • GridViewVariableItemHeight.png-dark
    • GridViewVariableItemHeight.png
    • GridViewVariableItemHeightFromSelector.png-dark
    • GridViewVariableItemHeightFromSelector.png
    • Grid_with_UserControl_HorizonalAlignment.png-dark
    • Grid_with_UserControl_HorizonalAlignment.png
    • Grid_with_UserControl_VerticalAlignment_Fixed_Height.png-dark
    • Grid_with_UserControl_VerticalAlignment_Fixed_Height.png
    • Grid_with_UserControl_VerticalAlignment_Variable_Height.png-dark

MartinZikmund and others added 5 commits October 7, 2026 14:32
FlowLayout.idl only has LineSpacing and MinItemSpacing. The
MinColumnSpacing/MinRowSpacing pair was removed on purpose by the
ItemsRepeater sync (#23406); the samples and tests that set them use
UniformGridLayout, which keeps its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
It only ever fed the native-target viewport optimization, which 7.0
removed along with its callers (c3f7073). Nothing in the framework
calls it, so it was a public virtual that did nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
CustomProperty, VirtualizationInfo and ViewportManagerDownLevel had
picked up changes that WinUI 2.5.1 does not have. They were unrelated
to LinedFlowLayout and made no observable difference: an exception type
swap, a skipped null WeakReference, and a dropped Layout check in a
viewport manager Uno never instantiates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
The StackLayout extent-origin reset, the default-layout cache growth in
ViewportManagerWithPlatformFeatures and the half-away-from-zero rounding
are valid fixes, but none of them is needed by LinedFlowLayout. They
continue, with their tests, in a separate PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
The whole file sits under '#if false', so the added tolerance never
compiled; keep the disabled port verbatim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011swjKyeQhuwHxAJW5R1vk8
Copilot AI lite review requested due to automatic review settings October 7, 2026 12:41

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 33s —— View job


PR Review: feat(itemsrepeater): Port LinedFlowLayout

Verdict: ship (with notes)

This pass covers the five commits since the last review: 9d05c289, a7c4875d, fc0983c5, b64b2d98 and c8aa1bef. Their purpose is to cut the PR back to LinedFlowLayout and move unrelated Repeater fixes elsewhere. I read the diffs and the stat; I did not build or run tests (the sandbox has no merge base with origin/master, so I couldn't diff the full PR against it).

New inline findings: none.

Reverts that reopen earlier findings

The reverts undo fixes that earlier passes had marked resolved. The author says they continue in a separate PR; please make sure that PR exists and is linked, because until it lands these are open again.

  • CustomProperty.SetValue/GetValue (fc0983c5): the CanRead/CanWrite guards are gone. SelectionModel still builds the read-only SelectedItem property with a null setter, so a write throws NullReferenceException. That matches WinUI, but it is a behavior regression versus the pre-port Uno code.
  • ViewportManagerWithPlatformFeatures.RegisterCacheBuildWork (b64b2d98): the gate is back to m_owner.Layout != null. ItemsRepeater.Layout defaults to null, so a repeater using the implicit default StackLayout never grows its realization cache. The author moved the fix, with its tests, to a separate PR.
  • StackLayout extent-origin reset and half-away-from-zero rounding: both were removed (b64b2d98), along with their tests, and also go to the separate PR. Rounding in FlowLayoutAlgorithm, FlowLayout and StackLayout is banker's rounding again, which differs from WinUI at exact half values. LinedFlowLayout itself still uses MidpointRounding.AwayFromZero.
  • VirtualizationInfo.UpdatePhasingInfo (fc0983c5): it wraps null phasing data in WeakReference<T>(null) again. This is harmless on current .NET.

Dropped API surface

a7c4875d deletes VirtualizingLayout.IsSignificantViewportChange, and 9d05c289 deletes the Uno-only FlowLayout.MinRowSpacing/MinColumnSpacing. The commit message says nothing calls the first (the native-target viewport optimization it fed was removed in 7.0). Both are public or protected members, though. If either was shipped in a released package, it needs a PackageDiffIgnore.xml entry, and the "no breaking changes" checkbox should be re-checked. I couldn't confirm whether either was released.

Other notes

  • c8aa1bef restores the WinUI FlowLayoutTests assertions. That is good, since it removes the earlier tolerance loosening.
  • Still open from earlier passes: the GetMaxWidthFromItemsInfo sentinel comment dropped in 8ab1b0af (minor).

@MartinZikmund

Copy link
Copy Markdown
Member

I checked the changes outside LinedFlowLayout against WinUI release/2.5.1 and pushed a cleanup:

  • Reverted FlowLayout.MinColumnSpacing/MinRowSpacing. They're not in FlowLayout.idl, and Update ItemsRepeater #23406 removed them on purpose; the tests that set them use UniformGridLayout. Also reverted the dead VirtualizingLayout.IsSignificantViewportChange (nothing calls it on 7.0).
  • Restored WinUI behavior in CustomProperty, VirtualizationInfo and ViewportManagerDownLevel.
  • Restored FlowLayoutTests.mux.cs: the whole file is #if false, so the added tolerance never compiled.
  • Moved the StackLayout extent-origin reset, the default-layout cache fix and the half-away-from-zero rounding, with their tests, to fix(itemsrepeater): Extent origin reset, default-layout cache, WinUI rounding #25078. They're valid but LinedFlowLayout doesn't need them.

Skia desktop runtime tests (LayoutTests, SelectionModelTests, FlowLayoutCollectionChangeTests, Given_LinedFlowLayout): 48/48 passed.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237880 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 1197

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • DropDownButtonPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png
  • skia-windows-screenshots: 1197 changed over 2474

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonWithIconTest.png-dark
    • AnimatedBackVisualSourceSamplePage.png
    • ApplicationViewSpanningRectsPage.png
    • AppWindowFeatures.png-dark
    • Attributed_text_Simple.png-dark
    • Accessibility_ScreenReader.png-dark
    • AutoBorderStretchwithrightmargin.png-dark
    • Attributed_text_Simple.png
    • AutomationProperties_Relations.png-dark
    • AutoSizedPathCentered.png-dark
    • AutoSizedPathCentered.png
    • AutoSuggestBox_Keyboard.png
    • AutoSuggestBox_Icons.png
    • AutoBorderStretchwithleftmargin.png-dark
    • AutoSuggestBox_Keyboard.png-dark
    • AutomationProperties_AutomationId.png-dark
    • BasicEnability.png-dark
    • AutomationProperties_AutomationId.png
    • BasicEnability.png
    • BitmapIcon_Sizing.png-dark

@mergify

mergify Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@MartinZikmund
MartinZikmund merged commit d211dcd into master Oct 7, 2026
56 checks passed
@MartinZikmund
MartinZikmund deleted the dev/doti/port-linedflowlayout branch October 7, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Repeater] Port LinedFlowLayout (new layout)

6 participants