Skip to content

fix(buttons): Sync Button controls with WinUI 2.6.5 - #26470

Merged
MartinZikmund merged 7 commits into
masterfrom
sync/winui/buttons
Nov 23, 2026
Merged

MartinZikmund merged 7 commits into
masterfrom
sync/winui/buttons

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #26469

PR Type:

💬 Other: automated sync of ported WinUI code

What changed? 🚀

Ports the upstream changes to Button controls up to WinUI 2.6.5 and moves its sync baseline.

  • Port build: passed (no tests were run)
  • Skipped items: 0

Sync to WinUI 2.6.5 (7198c4e690 → c29edd64ae)

Upstream changes

  • RadioButton_Partial.cpp/.h: OnGroupNamePropertyChanged now calls UpdateRadioButtonGroup().
  • RadioButton_Partial.cpp/.h: new EnterImpl override that calls UpdateRadioButtonGroup() when entering live.
  • RadioButton_Partial.cpp: UpdateRadioButtonGroup returns early if the button is unchecked or has no group parent. It also computes the parent once up front and makes sure the parent's DXaml peer exists.
  • RadioButton_Partial.cpp/.h: GetParentForGroup now walks the core visual tree and returns a CDependencyObject. FocusNextElementInGroup was adapted to match.
  • RadioButton_Partial.cpp: SetFocusedElement result is checked with IFC_RETURN.
  • Annotation-only changes (_In_ on EnterImpl/LeaveImpl params, MeasureOverride _In_ removal, final -> override on ButtonBase::EnterImpl, trailing newline): Button.cpp, Button.h, ButtonBase_Partial.h, HyperLinkButton_Partial.cpp/.h, RadioButton UnregisterFromGroup.
  • No changes: ButtonBaseKeyProcess.h, Button_Partial., all other AutomationPeer files, ButtonBase_Partial.cpp, CheckBox, RepeatButton*, ToggleButton*.

Ported

  • RadioButton_Partial.cpp (OnGroupNamePropertyChanged) -> RadioButton.mux.cs: added UpdateRadioButtonGroup() call.
  • RadioButton_Partial.cpp/.h (EnterImpl) -> RadioButton.mux.cs: added a private protected override void EnterImpl(bool live) that calls UpdateRadioButtonGroup() when live.
  • RadioButton_Partial.cpp (UpdateRadioButtonGroup) -> RadioButton.mux.cs: early return when unchecked, early return when there is no parent, parent computed once up front.
  • RadioButton.mux.cs had no MUX header, so I added one with tag winui3/release/2.6.5.

Not applicable

  • Button.cpp / Button.h _In_ SAL annotations: C++ annotations only.
  • ButtonBase_Partial.h final -> override: C++ virtual specifier, nothing to port.
  • HyperLinkButton MeasureOverride _In_ removal and trailing newline: C++ annotation/whitespace.
  • UnregisterFromGroup _In_ annotation: C++ annotation.
  • GetParentForGroup core-side visual-relative walk: the Uno version already uses Parent / VisualTree.GetRootForElement, which has no peer-resurrection problem.
  • DXaml peer creation block in UpdateRadioButtonGroup: Uno has no separate peer for the core object.
  • IFC_RETURN(result.GetHResult()) after SetFocusedElement: HRESULT plumbing.

Skipped

  • None

PR Checklist ✅

@github-actions github-actions Bot added the winui-sync Automated sync of code ported from WinUI label Nov 14, 2026
@CLAassistant

CLAassistant commented Nov 14, 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.
1 out of 2 committers have signed the CLA.

✅ 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

@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 246500 found UI Test snapshots differences: skia-linux-screenshots: 200, skia-windows-screenshots: 308

Details
  • skia-linux-screenshots: 200 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • Basics.png-dark
    • Basics.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppWindowTitleBar Properties.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • DisplayInformation.png-dark
    • Accessibility_Showcase.png
    • Accessibility_Showcase.png-dark
    • AppWindowTitleBar Properties.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • BasicAcrylicBrushTest.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest.png
    • ButtonClippingTestsControl.png-dark
  • skia-windows-screenshots: 308 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png-dark
    • AppWindowTitleBar Properties.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • AnimatedVisualsTestbedPage.png-dark
    • BenchmarkDotNet.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AppWindowTitleBar Properties.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png
    • BasicAcrylicBrushTest2.png-dark
    • CalendarView_Theming.png-dark

Adds the button controls' styles to the area: the upstream CommonStyles files (Button, CheckBox, HyperlinkButton, RadioButton, RepeatButton, ToggleButton _themeresources.xaml) and their FluentTheme copies. Until now the area tracked no style changes at all. All six copies match WinUI 2.6.5 apart from their headers (compared ignoring whitespace), so their headers now name 2.6.5 and detection reports the area up to date at its 2.6.5 baseline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw
@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Nov 14, 2026
The area is tracked, so its MUX Reference headers name only the upstream file; the area's baseline records the version. 16 files, 17 header lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2Uow7dC9EJ2fL3Hkw
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 246534 found UI Test snapshots differences: skia-linux-screenshots: 250, skia-windows-screenshots: 312

Details
  • skia-linux-screenshots: 250 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_AutomationId.png-dark
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • AnimatedVisualsTestbedPage.png-dark
    • AppWindowTitleBar Properties.png
    • BitmapIcon_Foreground.png-dark
    • BitmapIcon_Foreground.png
    • Buttons.png-dark
    • Buttons.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • Accessibility_Showcase.png-dark
    • AnimatedBackVisualSourceSamplePage.png
    • AppWindowTitleBar Properties.png-dark
    • Basics.png-dark
    • Basics.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
  • skia-windows-screenshots: 312 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BenchmarkDotNet.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Accessibility_Showcase.png-dark
    • AnimatedBackVisualSourceSamplePage.png-dark
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • Basics.png-dark
    • Basics.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AnimatedBackVisualSourceSamplePage.png
    • AutomationProperties_AutomationId.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png

Moves the branch's baseline into build/winui-sync/areas/buttons.json, which
replaced areas.json on master (#26653).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzaC5dx4oo2ZVG5BHB
@unodevops

Copy link
Copy Markdown
Contributor

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

@MartinZikmund
MartinZikmund marked this pull request as ready for review November 23, 2026 10:27
@mergify

mergify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@unodevops

Copy link
Copy Markdown
Contributor

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

GetParentForGroup used the VisualTree's RootVisual for named groups,
which is null for content hosted in a XAML island (desktop windows). The
2.6.5 sync made UpdateRadioButtonGroup return early on a null parent, so
checking a button no longer unchecked the others in its named group.
Port CDependencyObject::GetTreeRoot(publicParentOnly: true), as upstream
GetParentForGroup uses, instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNtzaC5dx4oo2ZVG5BHB
@MartinZikmund

Copy link
Copy Markdown
Member

Pushed 9cdf87e to fix a regression in this sync, which made Given_RadioButton.When_GroupName_Custom and When_GroupName_Custom_Two_Containers fail on every Skia leg. Both pass on master.

Cause. GetParentForGroup returned VisualTree.GetRootForElement(...) (the tree's RootVisual) for named groups. That is null for content hosted in a XAML island, which includes desktop windows. Before this sync a null parent was harmless, because every named-group button got the same null. The 2.6.5 port added upstream's "no parent: let EnterImpl handle it" early return to UpdateRadioButtonGroup, so for named groups the update stopped running, and checking a button no longer unchecked the others.

Fix. Port CDependencyObject::GetTreeRoot(publicParentOnly: true), which is what upstream's GetParentForGroup uses (VisualRelativeKind_Root). It walks up to the topmost ancestor below the root visual or island root. This also drops the Uno-specific line.

Validation. Locally on Skia desktop with retries off, the two tests fail on the branch before the fix and pass after it. All 37 tests in Given_RadioButton, Given_RadioButtons, Given_RadioButtons_UITest, RadioButtonsTests and RadioButtonsInteractionTests pass (2 skipped). The strict Uno.UI build is clean.

@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 248370 found UI Test snapshots differences: skia-linux-screenshots: 236, skia-windows-screenshots: 263

Details
  • skia-linux-screenshots: 236 changed over 2502

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppWindowTitleBar Properties.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AnimatedVisualsTestbedPage.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • Accessibility_Showcase.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_AutomationId.png
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • Border_CornerRadius_Binding.png-dark
    • Basics.png-dark
    • Border_CornerRadius_Binding.png
    • Basics.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
  • skia-windows-screenshots: 263 changed over 2502

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppWindowTitleBar Properties.png-dark
    • AutomationProperties_AutomationId.png
    • AnimatedVisualsTestbedPage.png-dark
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • AnimatedVisualsTestbedPage.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png

@MartinZikmund
MartinZikmund merged commit c52d92c into master Nov 23, 2026
51 checks passed
@MartinZikmund
MartinZikmund deleted the sync/winui/buttons branch November 23, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation winui-sync Automated sync of code ported from WinUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WinUI Sync] Button controls → WinUI 2.6.5

4 participants