Fix iOS Shell tab badge styling - #35565
Conversation
Apply Shell badge styling to the actual native tab bar item after iOS ShellSectionRenderer creates or replaces it during async icon updates. Add focused iOS device coverage for initial badge colors and preserving those colors after title/icon changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35565Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35565" |
Keep the focused Shell badge tests in the existing Shell device-test category instead of adding a new category. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/review -b feature/regression-check -p ios |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/review -b feature/regression-check -p ios |
|
|
|
/review -b feature/refactor-copilot-yml |
🔍 Multimodal Code Review — PR #35565Reviewers: Claude Opus 4.7 (expert-reviewer) + visual screenshot analysis ✅ Visual Review (Screenshots)The before/after screenshots clearly confirm the fix works:
The visual evidence is convincing — the fix correctly bridges the gap between the MAUI 🔴 Major Finding
When This is the exact scenario exercised by the third test ( Suggested fix: appearance.WeakBadgeTextAttributes = badgeTextColor is null
? null
: new UIStringAttributes { ForegroundColor = badgeTextColor.ToPlatform() }.Dictionary;🟡 Moderate Findings
🟢 Minor Findings
👍 What's Good
Review performed with Claude Opus 4.7 expert reviewer + visual screenshot analysis |
|
/review -b feature/refactor-copilot-yml |
|
|
AI code review for net11.0 targetVerdict: LGTM (minor notes) iOS/MacCatalyst Shell change that applies tab-badge background/text colors through What looks good
Minor notes (non-blocking)
CI: Failing legs ( Confidence: Medium. The appearance edge cases look handled; iOS rendering should be visually verified. Automated, non-approval review comment from the net11.0 fleet reviewer. Not a substitute for human approval. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AI code review refresh for net11.0 targetHead reviewed: 177f4aa Verdict: LGTM (with an unrelated-CI caveat — see below). Non-approval; this is automated reviewer feedback only. What changed since the prior review (round 11, marker
|
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Fixes iOS Shell tab badge styling so
BadgeColorandBadgeTextColorare applied to the actual nativeUITabBarItemused by each Shell section, including theUITabBarAppearancebadge state values that drive rendering on iOS 15+ / iOS 26.ShellSectionRenderercan asynchronously create or replace itsTabBarItemafter loading the tab icon. That path only restored title/accessibility metadata, so custom badge colors could be lost and iOS would render default red/white badges. This change reuses the existing Shell badge helper after the native item is created, updates badge property changes through the renderer's currentViewController.TabBarItem, and keeps null badge colors on the system defaults.Screenshots
Before/after screenshots were captured locally on iPhone 17 Pro iOS 26.2:
shell-badge-before.png— visible default iOS red/white Shell tab badges before the fixshell-badge-after.png— visible green#00C853Shell tab badges with dark#111111text after the fixshell-toolbar-badges-sandbox.png— Sandbox sample showing Shell tab badges and primary ToolbarItem badges styled consistently after the appearance fixBefore

After

Full with ToolBarIcon

Testing
dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -c Release -f net11.0-ios -r iossimulator-arm64 /p:CodesignRequireProvisioningProfile=false /p:ValidateXcodeVersion=false /p:TreatWarningsAsErrors=falsedotnet xharness apple test --app artifacts/bin/Controls.DeviceTests/Release/net11.0-ios/iossimulator-arm64/Microsoft.Maui.Controls.DeviceTests.app --target ios-simulator-64_26.2 --device 07C63EC0-C474-428F-A850-30D7D9D2D991 -o artifacts/log/shell-ios --timeout 00:30:00 -v --set-env=TestFilter=Category=Shell—205 Passed, 0 FailedPATH="$PWD/CustomAgentLogsTmp/Sandbox/bin:$PATH" _MauiDotNetVersion=10.0 MtouchLink=SdkOnly pwsh .github/scripts/BuildAndRunSandbox.ps1 -Platform ios -DeviceUdid 07C63EC0-C474-428F-A850-30D7D9D2D991