Skip to content

chore(winui-sync): Onboard InfoBadge at WinUI 2.6.5 - #26493

Merged
MartinZikmund merged 3 commits into
masterfrom
dev/mazi/winui-sync-infobadge
Nov 16, 2026
Merged

MartinZikmund merged 3 commits into
masterfrom
dev/mazi/winui-sync-infobadge

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #26492

PR Type:

  • 🤖 Project automation (WinUI port sync onboarding, with port fixes)

What changed? 🚀

Onboards InfoBadge to the WinUI 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

The four code headers named WinUI 1.4.2 (7198c4e6); the two theme XAML files named 2.5.1 and are byte-identical to 2.6.5. The sample code-behind had no header but matches upstream's TestUI page. The catch-up started at 1.4.2.

Upstream changes 1.4.2 → 2.6.5 (2 files, +11 −2)

Change Verdict
InfoBadge.cpp: iconSource.CreateIconElement() → SharedHelpers::MakeIconElementFrom(iconSource) (plus indentation) Ported
InfoBadge.vcxitems: Perf2026 page entries Not applicable (Windows build plumbing)

Nothing skipped, so no skipped-items issue. Upstream has no Strings folder.

Line-by-line review against 2.6.5

Upstream Uno Result
InfoBadge.cpp / .h InfoBadge.cs Gap fixed: OnSizeChanged returned new CornerRadius() where upstream returns CornerRadius() (the control's property), so a locally set CornerRadius was replaced by 0 and the badge rendered square. Gap fixed: the Value < -1 exception passed its message as the parameter name. Still differing, marked: the unreachable trailing return (unreachable upstream too) stays commented out to avoid CS0162
InfoBadge.idl, Generated/InfoBadge.properties.cpp InfoBadge.properties.cs Names, defaults (Value = -1) and callbacks match
InfoBadgeTemplateSettings.cpp / .h, Generated/InfoBadgeTemplateSettings.properties.cpp InfoBadgeTemplateSettings.cs Match
InfoBadge.xaml, InfoBadge_themeresources.xaml FluentTheme copies Byte-identical to 2.6.5, so they are mapped as mirrors (#26484)
APITests/InfoBadgeTests.cs InfoBadgeTests.mux.cs All 3 tests ported. Still differing, marked: Verify.Throws<ArgumentOutOfRangeException> instead of <Exception>, because Uno's Verify.Throws is exact-type (WinUI's E_BOUNDS projects to ArgumentOutOfRangeException)
InteractionTests — No test files upstream
TestUI/InfoBadgePage.xaml(.cs) InfoBadgeTests/InfoBadgePage.xaml(.cs) Matches; mapped with the tests like PipsPager's. Added the headers and upstream's x:Name, and replaced contract5Present:Spacing (UWP contract-conditional namespace) with plain Spacing

All Uno files now carry a MUX Reference header naming their upstream file, with no version: areas.json holds it.

Workaround audit

Location What it does Verdict Evidence
InfoBadge.cs commented-out trailing return Unreachable upstream too Kept, marked Active, it raises CS0162
InfoBadgeTests.mux.cs exact exception type See above Kept, marked MSTestInterop.Verify.Throws calls Assert.ThrowsExactly
Sample #pragma warning disable CS0105 Duplicate using copied from upstream Kept Reason rewritten (was "until the tree is migrated to WinUI")
Sample ReferenceEquals for SelectedItem checks Same semantics as upstream's ==; avoids CS0252 Kept —

Nothing removed, so there is no refactor commit.

Tests

  • Before the fix: Given_InfoBadge.When_CornerRadius_Set_Locally_Then_Used_By_TemplateSettings failed (Expected 1,2,3,4, Actual 0,0,0,0). It passes now.
  • Runtime (Skia desktop, local): InfoBadgeTests (3), Given_InfoBadge (2, new) and every Given_FrameworkElement_And_Leak.When_Add_Remove row, including InfoBadge: 89 passed, 0 failed.
  • Compile: SamplesApp (with Uno.UI, Uno.UI.RuntimeTests and the samples) with analyzers on (no UnoFastDevBuild), 0 errors. Built at net10.0.
  • Tooling: detect.ps1 -AreaFilter infobadge reports up to date, and the 132 Pester tests pass.

No project or MSBuild files changed. The areas.json entry conflicts textually with #26476, #26486 and #26491 (each appends an area); whichever merges later needs a trivial rebase.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu2UutP6MJa47mVagdR

MartinZikmund and others added 3 commits November 15, 2026 09:06
Catch up from 1.4.2: build the icon element with
SharedHelpers.MakeIconElementFrom, as upstream does.

The line-by-line review against 2.6.5 also found a mis-port in
OnSizeChanged: a locally set CornerRadius was replaced by a zero
radius instead of being used, so such badges rendered square. The
Value range exception now passes a parameter name instead of the
message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2UutP6MJa47mVagdR
Add CornerRadius tests for TemplateSettings.InfoBadgeCornerRadius,
mark the exact-type exception check in the ported API test, and align
the sample with upstream's TestUI page (header, x:Name, plain Spacing
instead of the UWP contract-conditional namespace).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2UutP6MJa47mVagdR
Records InfoBadge at winui3/release/2.6.5 (c29edd64ae). The port was
caught up from 1.4.2 and reviewed against 2.6.5 in the preceding
commits. The theme XAML is a verbatim copy of upstream, so it is
mirrored rather than ported, and the sample ported from upstream's
TestUI page is mapped with the tests. Headers now name only their
upstream files; the manifest holds the version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2UutP6MJa47mVagdR
Copilot AI balanced review requested due to automatic review settings November 15, 2026 08:21
@MartinZikmund MartinZikmund added the area/build Categorizes an issue or PR as relevant to build infrastructure label Nov 15, 2026
@MartinZikmund MartinZikmund self-assigned this Nov 15, 2026
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Nov 15, 2026

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 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.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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


Review of #26493: onboard InfoBadge to WinUI sync (2.6.5)

Verdict: ship. I found no blocking issues, so I posted no inline comments (0 critical, 0 major, 0 minor).

What I checked in the diff:

  • Root-cause fix: OnSizeChanged now returns the control's CornerRadius instead of new CornerRadius(), which matches upstream. Given_InfoBadge.When_CornerRadius_Set_Locally_Then_Used_By_TemplateSettings covers it, and the PR reports it failing before the fix and passing after.
  • Upstream catch-up: SharedHelpers.MakeIconElementFrom exists in src/Uno.UI/Helpers/WinUI/SharedHelpers.cs. InfoBar already uses it the same way.
  • Exception fix: ArgumentOutOfRangeException(nameof(Value), message) now passes the parameter name and message in the right order.
  • Workarounds: The two remaining ones are marked with TODO Uno specific comments that are short and explain why. These are the commented-out unreachable return and the exact-type Verify.Throws. The #pragma warning disable is narrowed to CS0105 and has a reason.
  • Sample XAML: contract5Present:Spacing is replaced with plain Spacing. The sample still uses {ThemeResource} for its background.
  • areas.json: The entry looks consistent. The theme XAML files are mapped as mirrors and the tests as a group.
  • Style and commits: Conventional Commit titles, tabs and braces all follow the repo rules. The PR adds no skipped tests, no event Action, and no async issues.

Not verified:

@mergify

mergify Bot commented Nov 15, 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:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 246589 found UI Test snapshots differences: skia-linux-screenshots: 231, skia-windows-screenshots: 310

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png
    • Accessibility_Showcase.png-dark
    • AnimatedVisualsTestbedPage.png
    • Basics.png-dark
    • Basics.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AnimatedBackVisualSourceSamplePage.png
    • AutomationProperties_AutomationId.png-dark
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • AutomationProperties_AutomationId.png
    • ClipboardTests.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest2.png-dark
  • skia-windows-screenshots: 310 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • BenchmarkDotNet.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_AutomationId.png-dark
    • Basics.png-dark
    • Basics.png
    • AnimatedBackVisualSourceSamplePage.png-dark

@morning4coffe-dev morning4coffe-dev 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.

Checked the InfoBadge.cs changes against InfoBadge.cpp upstream (winui3/release/1.8.4, dc46907e):

  • OnSizeChanged / GetCornerRadius now returns the control's CornerRadius — matches return CornerRadius(); (line 97).
  • SharedHelpers.MakeIconElementFrom(iconSource) matches line 68.
  • The Value < -1 exception: upstream throws hresult_out_of_bounds with that message; passing nameof(Value) as the parameter name is a sensible mapping.
  • The commented-out trailing return is unreachable upstream too (line 99).

I didn't review areas.json, the sample page or the new test, and CI currently shows 3 failing checks, so this is a comment rather than an approval.

@MartinZikmund
MartinZikmund merged commit a115cb8 into master Nov 16, 2026
56 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/winui-sync-infobadge branch November 16, 2026 09:50
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WinUI Port Sync: track InfoBadge

5 participants