Skip to content

test: Add regression test for #2136 - #22990

Merged
MartinZikmund merged 4 commits into
feature/breakingchangesfrom
dev/mazi/repro/2136
Aug 24, 2026
Merged

MartinZikmund merged 4 commits into
feature/breakingchangesfrom
dev/mazi/repro/2136

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

Summary

Adds regression test for #2136.

The reported issue appears to be potentially fixed — the test(s) pass on current master (Skia target).

Test(s) added

  • src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs → When_ListView_ItemsStackPanel_Children_Are_Stretched_To_Full_Width

Notes

The issue was reported on WebAssembly. Runtime tests run on Skia only — the fix should be verified on native targets as well.

The test verifies that items inside a vertical ItemsStackPanel within a ListView stretch to fill the available width (300px container), checking both the panel root and individual ListViewItem containers.

Relates to #2136

Copilot AI lite review requested due to automatic review settings April 8, 2026 17:48
@MartinZikmund
MartinZikmund enabled auto-merge April 8, 2026 17:50

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 a new Uno.UI runtime test intended to prevent regressions related to #2136, focusing on ItemsStackPanel stretching behavior in a ListView.

Changes:

  • Introduces a new Given_ItemsStackPanel_Stretch test class with a regression test asserting full-width stretching for ItemsPanelRoot and the first ListViewItem container.

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

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Jun 8, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions Bot closed this Jun 18, 2026
auto-merge was automatically disabled June 18, 2026 02:22

Pull request was closed

@MartinZikmund MartinZikmund removed the stale This item has been marked as stale and will be closed if there is no activity. label Jun 22, 2026
@MartinZikmund MartinZikmund reopened this Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Gather context
  • Read the changed file
  • Post inline review comments
  • Update summary

Verdict: 2 issues require fixes before merge, 1 is a style nit.

Summary

The test correctly targets the regression (items not stretching in ItemsStackPanel) and uses appropriate runtime-test patterns (UITestHelper.Load, WaitFor, [GitHubWorkItem]). Three issues found:

Severity Count
Must fix 2
Style 1

Must fix:

  1. Missing iOS [Ignore] (line 5488) — The new Given_ItemsStackPanel_Stretch class is a new top-level [TestClass] and is not covered by the #if __APPLE_UIKIT__ [Ignore(...)] guard on Given_ListViewBase. It will run on iOS where all ListView tests are intentionally disabled due to a crash (issue ListView tests on iOS crash on 17.0+ simulators #17101).

  2. Hard-coded 300px width assertions (lines 5522–5532) — Comparing panel.ActualWidth and container.ActualWidth against the constant ContainerWidth = 300 is fragile. The ListView's default ScrollViewer template has its own border/padding that makes the internal viewport narrower than the control width. The correct assertion for the regression guarded here is container.ActualWidth == panel.ActualWidth (i.e., the container stretches to fill the panel), not that both equal exactly 300.

Style:

  1. Verbose comment block (lines 5495–5497) — The three-line comment explains what the test does, which is already conveyed by the method name and [GitHubWorkItem] annotation. Per the repo's code-style rules, comments should only explain the non-obvious why.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 39s —— View job


Code Review

  • Gather context
  • Read the changed file
  • Post inline review comments
  • Update summary

Verdict: 2 issues require fixes before merge, 1 is a style nit.

Summary

The test correctly targets the regression (items not stretching in ItemsStackPanel) and uses appropriate runtime-test patterns (UITestHelper.Load, WaitFor, [GitHubWorkItem]). Three issues found:

Severity Count
Must fix 2
Style nit 1

Must fix:

  1. Missing iOS [Ignore] (line 5781) — The new Given_ItemsStackPanel_Stretch class is not covered by the #if __APPLE_UIKIT__ [Ignore(...)] guard on Given_ListViewBase. It will run on iOS where all ListView tests are intentionally disabled due to a crash (ListView tests on iOS crash on 17.0+ simulators #17101).

  2. Fragile hard-coded 300px assertions + missing WaitFor on panel width (lines 5807–5825) — panel.ActualWidth is read without waiting for layout, and comparing both the panel and container against the fixed constant ContainerWidth = 300 is fragile (the ScrollViewer border/padding in the default ListView template narrows the viewport). The correct assertion for ItemsStackPanel does not stretch its children properly #2136 is container.ActualWidth == panel.ActualWidth — i.e., containers stretch to fill the panel, not that they equal exactly 300.

Style:

  1. Verbose comment block (lines 5788–5792) — The three-line comment narrates what the test's name and [GitHubWorkItem] already convey. Per the repo's code-style rules, comments should only explain the non-obvious why.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Gather context
  • Read the changed file
  • Post inline review comments
  • Update summary

Verdict: 1 issue requires a fix before merge.

What was addressed

The latest commit (f1d2be3) correctly resolved two of the three previously flagged issues:

Issue Status
Missing #if __APPLE_UIKIT__ / [Ignore] guard ✅ Fixed
Container assertion comparing against panel.ActualWidth instead of hard-coded 300 ✅ Fixed
Verbose comment block ✅ Fixed (replaced with a single-line why-comment)

Remaining issue (must fix)

Lines 5809–5817 — Two related problems in the panel assertions:

  1. Missing WaitFor before reading panel.ActualWidth: The code reads sut.ItemsPanelRoot.ActualWidth immediately after WaitForIdle() without a WaitFor(() => sut.ItemsPanelRoot?.ActualWidth > 0) guard. WaitForIdle does not guarantee a non-zero layout pass on the panel.

  2. Fragile assertion against hard-coded 300px: Assert.AreEqual(ContainerWidth, panel.ActualWidth, 2d, ...) is fragile — the ItemsStackPanel sits inside the default ListView ScrollViewer template, which may have border/padding that makes the internal viewport narrower than the control width. The real regression (ItemsStackPanel does not stretch its children properly #2136) is that containers fail to stretch to the panel — not that the panel equals exactly 300. The container vs panel assertion on line 5825 is correct and sufficient; remove the panel-vs-300 check.

See the inline comment for the suggested fix.

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 28s —— View job


Code Review

  • Gather context
  • Read the changed file
  • Post inline review comments
  • Update summary

Verdict: ship ✅

All issues from prior review rounds are resolved in the current branch (38318178).

Previously flagged Status
Missing #if __APPLE_UIKIT__ / [Ignore] guard ✅ Fixed (68f5325)
Verbose comment block ✅ Fixed (68f5325)
Container compared against hard-coded 300 instead of panel width ✅ Fixed (68f5325)
panel.ActualWidth read before layout-pass guarantee ✅ Fixed (3831817)

The test structure is sound: the WaitFor(() => sut.ItemsPanelRoot?.ActualWidth > 0) guard prevents a flaky read; the IsInstanceOfType(ItemsStackPanel) guard makes the intent explicit; the panel-vs-300 assertion (retained intentionally — ensures the panel isn't collapsed, preventing a trivially-passing container check) plus the container-vs-panel assertion together cover both failure modes for #2136. The iOS skip and NativeWinUI exclusion are in place.

No new issues found.

MartinZikmund and others added 3 commits August 22, 2026 13:42
Guard the new test class from Apple UIKit like the rest of the ListView
tests (#17101), assert the default ItemsPanel type, and compare the item
container against the measured panel width.
@MartinZikmund
MartinZikmund changed the base branch from master to feature/breakingchanges August 22, 2026 14:48
@github-actions

github-actions Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 3m 4s —— View job


Code Review

  • Gather context
  • Read the changed file
  • Post inline review comments
  • Update summary

Verdict: 1 minor fix needed.

The test is otherwise well-structured and all previously identified issues have been addressed. One new finding surfaces from the CodeQL static analysis posted since the last review round:

Severity Count
Minor (static analysis) 1

Fix needed:

Nullable flow on container (line 6161) — sut.ContainerFromIndex(0) as ListViewItem yields ListViewItem?. Assert.IsNotNull prevents a runtime null-dereference, but the C# and CodeQL flow analyzers don't trace through assertion methods — so the dereferences at lines 6162 (container.ActualWidth in the WaitFor lambda) and 6165 (container.ActualWidth in the Assert.AreEqual) remain flagged as potential null references. Adding an explicit if (container is null) throw … after the assertion closes the gap for the static analyser.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 229521 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 172

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ContentControl_Inheritance.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • DynamicFont.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Attributed_text_FontSize_Changing.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageIconPage.png-dark
  • skia-windows-screenshots: 172 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • Buttons.png-dark
    • Buttons.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ChatBox.png-dark
    • ChatBox.png
    • FluentStyle_NavigationViewSample.png-dark
    • HierarchicalNavigationViewMarkup.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageBrush_Formats.png-dark
    • ImageBrush_Formats.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png

@MartinZikmund

Copy link
Copy Markdown
Member Author

@copilot address comments on this PR

auto-merge was automatically disabled August 24, 2026 19:36

Head branch was pushed to by a user without write access

@CLAassistant

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.
1 out of 2 committers have signed the CLA.

✅ MartinZikmund
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@MartinZikmund

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@MartinZikmund MartinZikmund added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Aug 24, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 229862 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 189

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • Attributed_text_FontSize_Changing.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ContextRequested.png-dark
    • DynamicFont.png
    • ImageBrush_Stretch.png
    • DropDownButtonPage.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Image_Margin_Large.png
  • skia-windows-screenshots: 189 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Battery.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DynamicFont.png
    • EasClientDeviceInformation.png-dark
    • GeolocatorPositionChanged.png-dark
    • GeolocatorPositionChanged.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • FocusManagerTest.png-dark
    • FocusManagerTest.png
    • Buttons.png-dark
    • Buttons.png
    • ExpanderColorValidationPage.png-dark
    • Focus_FocusState.png-dark

@MartinZikmund
MartinZikmund merged commit 4fdc650 into feature/breakingchanges Aug 24, 2026
46 of 47 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/repro/2136 branch August 24, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants