Repository navigation
chore(winui-sync): Onboard RadioButtons at WinUI 2.6.5 - #26491
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Claude finished @MartinZikmund's task in 25s —— View job Review summaryVerdict: ship, with minor notes. I read the diff by inspection only. I did not build or run any tests here, so the runtime results in the PR description are unverified by me. Issues by severity: 0 blocking, 0 major, 3 minor. All 3 are inline comments on skipped tests. Cross-cutting notes
|
|
This pull request is merged. |
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Compared against RadioButtons.cpp, ColumnMajorUniformToLargestGridLayout.cpp and RadioButtonsElementFactory.cpp at winui3/release/2.6.5. The gaps described in the PR are real and the fixes match upstream:
OnChildPreviewKeyDown: Left now callsTryMoveFocus(Left, …)/HandleEdgeCaseFocus(true, …), identical to the C++ (it was a copy of the Right branch).OnApplyTemplate: handlers are now replaced through theSerialDisposablerevokers, so re-templating no longer stacks them.- Layout:
1.192092896e-07Fequalsnumeric_limits<float>::epsilon(),m_largestChildSizestarts at(0, 0), andValidateGreaterThanZerois static and throwsArgumentException(hresult_invalid_argument). The local function stands in for the lambda correctly. RadioButtonsElementFactory.UserElementFactory/GetElementCorenow follow the C++ branch order (DataTemplate,DataTemplateSelector, custom factory) and pass the template down to theRadioButton.
Things to look at:
- CI: the new
RadioButtonsInteractionTestsfail on two platforms.RadioButtonsInteractionTests.BasicKeyboardTestis in the failed list of the iOS Skia runtime tests 3 job, andRadioButtonsInteractionTests.ScrollViewerSettingSelectionDoesNotMoveFocusis in the failed list of the macOS Skia job. Since upstream disables its interaction test class as unreliable, these may need[PlatformCondition]exclusions or a retry-safe form. - Overlap with #26324: both PRs edit
RadioButtonsElementFactory.cs, and #26324 changes it to theMicrosoft.UI.Xaml.IElementFactoryargs. Herem_itemTemplateWrapper = (IElementFactoryShim)customElementFactory;will throwInvalidCastExceptionfor a custom factory that isn't a shim (upstream assigns it directly), and the file will conflict whichever PR merges second. OnRepeaterElementPrepared/Clearing: the+=/-=pair works becauseClearingalways precedes recycling, and the#if !HAS_UNObranch keeps the C++ChildHandlersshape. TheIsLoaded && IsInLiveTreeguard beforeSelect(-1)exists only becauseItemsRepeater.OnUnloadedUnoraises a fake Reset, so it may be worth fixing that at the source later.
350d6fe to
ed1fb1e
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Claude finished @MartinZikmund's task in 25s —— View job Review summaryVerdict: fix-first. I reviewed the diff by inspection only. I did not build or run anything, so I have not verified the runtime results in the PR description. Issues: 1 major, 2 moderate, 1 nit. All four are inline comments. Cross-cutting notes
|
ed1fb1e to
c53a54c
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Claude finished @MartinZikmund's task in 15s —— View job Review summaryVerdict: fix-first. This is a read-only review of the current branch. I did not build or run anything, so the runtime results in the PR description are unverified by me. Issues: 0 blocking, 1 major (open CI failures), 0 new inline findings. The earlier inline comments still stand, so I did not repeat them. Resolved since the last review
Still open
Cross-cutting notes
|
c53a54c to
129198f
Compare
|
Claude finished @MartinZikmund's task in 11s —— View job Review summaryVerdict: fix-first. This is a read-only review by inspection. I did not build or run any tests, so the runtime results in the PR description are unverified by me. The Issues: 0 blocking, 1 major, 1 nit. The earlier inline threads already cover both, so I added no new inline comments. Still open
Cross-cutting notes
|
🤖 Addressed PR comments up to this point@morning4coffe-dev (review):
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247312 found UI Test snapshots differences: Details
|
d0ec9bd to
7d619b3
Compare
|
Claude finished @MartinZikmund's task in 15s —— View job Review summaryVerdict: ship. This is a read-only review by inspection. I did not build or run any tests, so the runtime results in the PR description are unverified by me. The Issues: 0 blocking, 0 major, 0 new. I posted no inline comments. Resolved since the last review
Remaining notes (non-blocking)
|
7d619b3 to
7e69506
Compare
|
Claude finished @MartinZikmund's task in 11s —— View job Review summaryVerdict: ship. This is a read-only review by inspection. I did not build or run any tests, so the runtime results in the PR description are unverified by me. The Issues: 0 blocking, 0 major, 0 new. I posted no inline comments. Checked on the current head (
Non-blocking notes
|
Upstream RadioButtons is unchanged from WinUI 1.4.1 to 2.6.5, so the catch-up is the line-by-line review of a port that predates the MUX Reference headers: - Left arrow moved focus Right and treated the first item as the last - ColumnMajorUniformToLargestGridLayout compared against float.Epsilon instead of FLT_EPSILON, and started from Size.Empty - The element factory ignored DataTemplateSelector and reset the wrapper for unrecognized values - Template and items-source handlers are now revoked on re-template - Drop the RS3 check and use InputKeyboardSource like upstream Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm
- ElementPrepared re-checked the container at SelectedIndex (#4689). Selection set before load now works without it: covered by When_SelectedIndex_Set_Before_Load and When_SelectedItem_Set_Before_Load. - The repeater Unloaded handler stood in for the C++ destructor. The layout lives in the control's own template, so its handler cannot keep the control alive; the leak tests pass without it. - Items had an unused internal setter; upstream is get-only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm
- Port the InteractionTests as runtime tests, with the test page rebuilt in code. AccessKeys is ignored (AccessKeyInvoked is not implemented, #17130), GamepadCanEscapeAndDoesNotSelectWithFocus is ignored as upstream, and RS2MultiColumnKeyboardTest is not a test method upstream. - Rename RadioButtonTests.mux.cs after its upstream file and align VerifyIsEnabledChangeUpdatesVisualState with it. - Cover SelectedItem set before load. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
7e69506 to
e228b2c
Compare
|
Claude finished @MartinZikmund's task in 11s —— View job Review summaryVerdict: ship. This is a read-only review based on the PR context and the earlier threads. I did not build or run anything, so the runtime results in the PR description are unverified by me. The Issues: 0 blocking, 0 major, 0 new. Resolved since earlier reviews
Non-blocking notes
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247401 found UI Test snapshots differences: Details
|
GitHub Issue: closes #26490
PR Type:
What changed? 🚀
Onboards
RadioButtonsto theWinUI Port Sync, recorded at WinUI 2.6.5. Before the area was added, the port was caught up to the latest stable release, reviewed line by line against it, and its Uno workarounds were audited.Starting point
Only the automation peer had a
MUX Referenceheader (WinUI 1.8.4). The other 8 files predate the header convention. Upstreamcontrols/dev/RadioButtonsis byte-identical from 1.4.1 (the oldest tag with thecontrols/devlayout) to 2.6.5, apart fromRadioButtons.vcxitems, so the catch-up started at 1.4.1 (702b954f) and every gap came from the review.Upstream changes 1.4.1 → 2.6.5 (1 file, +9)
RadioButtons.vcxitems: Perf2026 page entriesNothing skipped, so no skipped-items issue. Upstream has no
Stringsfolder.Line-by-line review against 2.6.5
RadioButtons.cpp/.hRadioButtons.cs,RadioButtons.Header.csTryMoveFocus(Right, …)andHandleEdgeCaseFocus(false, …)(a copy of the Right branch), so Left moved focus right in multi-column groups. Template, repeater and items-source handlers are now revoked on re-template instead of stacking. The RS3 check andKeyboardStateTrackerare replaced byInputKeyboardSourceas upstream.MoveFocuscallsUIElement.Focusas upstream. Still differing, marked: Checked/Unchecked handlers are removed directly instead of through theChildHandlersattached property; the destructor is not portedRadioButtons.idl,Generated/RadioButtons.properties.cppRadioButtons.Properties.csItemsis now get-only as upstreamColumnMajorUniformToLargestGridLayout.cpp/.h,.properties.cpp,RadioButtonsPrimitives.idlColumnMajorUniformToLargestGridLayout(.Properties).csfloat.Epsilon(1.4e-45) instead ofnumeric_limits<float>::epsilon()(1.19e-7);m_largestChildSizestarted atSize.Emptyinstead of{0,0};ValidateGreaterThanZerois static and throwsArgumentException(E_INVALIDARG)RadioButtonsElementFactory.cpp/.hRadioButtonsElementFactory.csDataTemplateSelectorwas ignored, aDataTemplatewas used unwrapped (so its template never reached wrapped items), and unrecognized values reset the wrapperRadioButtonsAutomationPeer.cpp/.hRadioButtonsAutomationPeer.csRadioButtonsTestHooks.cpp/.h/.idlRadioButtonsTestHooks.csRadioButtons.xaml,RadioButtons_themeresources.xaml,RadioButton.xamlRadioButton_themeresources.xaml(CommonStyles) belongs to the core RadioButton, so it is left to thebuttonsareaAPITests/RadioButtonsTests.csRadioButtonsTests.mux.cs(renamed fromRadioButtonTests.mux.cs)VerifyIsEnabledChangeUpdatesVisualStatealigned with the 2.6.5 shapeInteractionTests/RadioButtonsTests.csRadioButtonsInteractionTests.mux.cs(new)AccessKeysis[Ignore]d (UIElement.AccessKeyInvokedis not implemented, #17130).GamepadCanEscapeAndDoesNotSelectWithFocusis ignored as upstream.RS2MultiColumnKeyboardTesthas no[TestMethod]upstream. Note that upstream disables the whole class as unreliable, so these expectations were never checked in WinUI CIAll Uno files now carry a
MUX Referenceheader naming their upstream file.Workaround audit
OnRepeaterElementPreparedSelectedIndex(#4689)When_SelectedIndex_Set_Before_Loadand the newWhen_SelectedItem_Set_Before_LoadOnRepeaterUnloadedGiven_FrameworkElement_And_Leak.When_Add_Removerows pass, including RadioButtonsItemsinternal setterOnRepeaterElementClearingIsLoaded && IsInLiveTreeguardItemsRepeater.OnUnloadedUnostill raises a fake Reset on unload. Covered byWhen_RadioButtons_Unload_SelectedIndex/SelectedItem#if HAS_UNOChecked/Unchecked handlersChildHandlersrevokers#if !HAS_UNOHeaderTemplateValueDoesNotInheritDataContextThe
refactorcommit holds the removals on their own.Tests
RadioButtonsInteractionTests(16),RadioButtonsTests(2),Given_RadioButtons_UITest(4, 1 new),Given_RadioButtonand everyGiven_FrameworkElement_And_Leak.When_Add_Removerow: 119 passed, 0 failed, 2 skipped (the two ignored tests above).MultiColumnKeyboardTest,SingleRowKeyboardTest,DisabledItemsKeyboardTestandDisabledItemsAtTopOfColumnKeyboardTestfailed on the first Left press (for example Expected 3, Actual 6). They pass now.NativeWinUI, becauseKeyboardHelperis a no-op on WinAppSDK; their expected values come from upstream.Uno.UI.UnitTestshas only the 12 known timezone failures (When_Gregorian_FixedDate*).Uno.UIandUno.UI.RuntimeTests.Genericwith analyzers on (noUnoFastDevBuild), 0 errors. Built at net10.0.detect.ps1 -AreaFilter radiobuttonsreports up to date, and the 132 Pester tests pass.No project or MSBuild files changed. The
areas.jsonentry conflicts textually with #26486 (both append an area); whichever merges second needs a trivial rebase.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNtzW3o9yaCzcTjhsgHm