Skip to content

fix: Implement IOrientedPanel on ItemsStackPanel (fixes #25266) - #25855

Merged
MartinZikmund merged 1 commit into
unoplatform:masterfrom
seragAhmed:fix/itemsstackpanel-oriented-panel
Nov 20, 2026
Merged

MartinZikmund merged 1 commit into
unoplatform:masterfrom
seragAhmed:fix/itemsstackpanel-oriented-panel

Conversation

@seragAhmed

@seragAhmed seragAhmed commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25266

PR Type:

🐞 Bugfix

What changed? 🚀

Selector.GetItemsHostOrientations() only recognizes StackPanel and IOrientedPanel. ItemsStackPanel did not implement IOrientedPanel, so a ListView / ComboBox using a horizontal ItemsStackPanel was reported as (Vertical, Vertical).

Like WinUI, ItemsStackPanel now implements IOrientedPanel:

  • LogicalOrientation returns Orientation
  • PhysicalOrientation returns Orientation (WinUI's get_PhysicalOrientation forwards to the logical orientation for this panel)

These are explicit interface implementations, so the public API surface is unchanged. The existing internal override Orientation? PhysicalOrientation on Panel is untouched. ItemsWrapGrid (where physical is the opposite of Orientation) is not implemented in Uno, so it is out of scope.

Validation

  • Unit test in Given_Selector ([GitHubWorkItem] Selector.GetItemsHostOrientations reports Vertical for a horizontal ItemsStackPanel #25266): When_ItemsStackPanel_GetItemsHostOrientations, data-driven for Horizontal and Vertical. It calls the protected GetItemsHostOrientations() through a small Selector subclass with an ItemsStackPanel as ItemsPanelRoot, and checks both orientations.
    • Without the fix: the Horizontal case fails (Expected:<Horizontal>. Actual:<Vertical>); the Vertical case passes either way.
    • With the fix: both pass.
  • Given_Selector, Given_ListViewBase*, Given_ComboBox, Given_ItemsControl (net10.0): 84 passed, 3 skipped, 0 failed.
  • Full Uno.UI.UnitTests run (net10.0, Windows): 4443 passed, 23 skipped, 12 failed. The 12 failures are all When_Calendar.When_Gregorian_FixedDate*, which depend on the machine's local time zone (UTC+3 here), fail the same way on branches that don't touch these types, and are unrelated to this change.
  • Runtime tests were not run locally.

PR Checklist ✅

…5266)

Selector.GetItemsHostOrientations only recognized StackPanel and
IOrientedPanel, so a horizontal ItemsStackPanel was reported as
Vertical. Like WinUI, ItemsStackPanel now implements IOrientedPanel,
with both the logical and physical orientation equal to Orientation.
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Oct 31, 2026
@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 242770 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • Accessibility_ScreenReader.png-dark
    • AppBarButtonTest.png
    • AppBarButtonWithIconTest.png-dark
    • ApplicationViewMode.png
    • AppBar_KeyBoard.png-dark
    • AppWindowFeatures.png-dark
    • Application_DispatcherShutdownMode.png-dark
    • AppWindowTitleBar Properties.png
    • AppWindowPresenters.png
    • Attributed_text_Simple.png-dark
    • Arrange_Performance01.png-dark
    • AuthenticationBroker_Demo.png-dark
    • Attributed_text_Supserscript.png
    • AutomationProperties_AutomationId.png
    • AutoBorderStretchwithleftmargin.png
    • AutoSizedPathCentered.png-dark
    • AutomationPropertiesExtensions_Role.png
    • AutoSizedPathCentered.png
    • AutomationProperties_AutomationId.png-dark
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • Arrange_Performance01.png
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithbottommargin.png
    • AutomationProperties_AutomationId.png
    • AutomationProperties_Landmark.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics.png-dark
    • Basics.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BindableDrawerLayout_ChangePane.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • BitmapImage_vs_SvgImageSource.png

@unodevops

Copy link
Copy Markdown
Contributor

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

@seragAhmed

Copy link
Copy Markdown
Contributor Author

Given_CalendarView.When_NextMonth_InQuickSequence on Desktop Linux WebGPU failed again on the retry here, and it also fails on #25908. It doesn't go through the code this PR changes. IOrientedPanel's only consumer is Selector.GetItemsHostOrientations (used for keyboard navigation; FlipView overrides it), and CalendarView lays out with CalendarPanel, not ItemsStackPanel. Could someone take a look or re-run it when convenient?

@seragAhmed
seragAhmed force-pushed the fix/itemsstackpanel-oriented-panel branch from 5511d77 to 9ae963a Compare November 5, 2026 14:56
@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@MartinZikmund MartinZikmund left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @seragAhmed! This matches WinUI 1:1 (ItemsStackPanel_Partial.cpp: get_LogicalOrientation returns Orientation, get_PhysicalOrientation forwards to it), and the test fails without the fix as it should.

Optional nit: the ItemsStackPanel arm in ListViewBase.GetPanelOrientation() (ListViewBase.DragDrop.mux.cs) is now redundant, and its comment saying ItemsStackPanel doesn't implement IOrientedPanel is stale. Feel free to drop the arm and fix the comment, or leave it for a follow-up.

@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 247855 found UI Test snapshots differences: skia-linux-screenshots: 210, skia-windows-screenshots: 282

Details
  • skia-linux-screenshots: 210 changed over 2500

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • AnimatedVisualsTestbedPage.png
    • Buttons.png
    • Accessibility_Showcase.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AppWindowTitleBar Properties.png
    • Basics.png-dark
    • Basics.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • AppWindowTitleBar Properties.png-dark
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • ComboBox_MaxDropdownHeight.png-dark
  • skia-windows-screenshots: 282 changed over 2500

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppWindowTitleBar Properties.png-dark
    • AppWindowTitleBar Properties.png
    • AutomationProperties_AutomationId.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AutomationProperties_AutomationId.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • BreadcrumbBarPage.png-dark

@MartinZikmund
MartinZikmund merged commit 7f34693 into unoplatform:master Nov 20, 2026
48 checks passed
@welcome

welcome Bot commented Nov 20, 2026

Copy link
Copy Markdown

🎉 Congratulations on getting your very first pull request merged into Uno Platform! This is a huge milestone — you are now officially part of the community of contributors helping shape the future of cross-platform .NET development, and your code will reach developers and apps all over the world. 🌍

We are genuinely grateful for the time and care you put into this contribution. Every PR — big or small — makes Uno Platform better for everyone, and we hope this is the first of many. We cannot wait to see what you build next! 🚀

As a small thank-you, we would love to send you some swag so you can wear your contributor status with pride. And if you have any feedback or ideas on how we can make contributing to Uno Platform even better, please open a feedback issue — we truly value your perspective.

giphy
Welcome to the family, and merci beaucoup! 👋❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selector.GetItemsHostOrientations reports Vertical for a horizontal ItemsStackPanel

4 participants