Repository navigation
[NET 11] Fix Material 3 AppBar lift highlight with custom BarBackgroundColor - #38396
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38396Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38396" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
|
Validated AI summary concern and addressed the valid concerns. |
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
|
|
||
| if (barBackground is SolidColorBrush solidColor) | ||
| if (!RuntimeFeature.IsMaterial3Enabled) | ||
| { |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[major] Logic and Correctness — The new if (!RuntimeFeature.IsMaterial3Enabled) gate makes UpdateBarBackground a no-op for all Material 3 apps. Concrete failure: when Material 3 is enabled and UseMauiAndroidSystemBarBackgrounds is false (opt-out), UpdateTopChrome returns early and no fallback background update runs, so Toolbar.BarBackground changes are dropped instead of updating the visible toolbar background.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@Dhivya-SF4094 — new AI review results are available based on commit
ffe81d7.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ INCONCLUSIVE
Platform: ANDROID · Base: net11.0 · Merge base: c871b803
🩺 Could not verify — environment/infrastructure error. The gate ran the tests but hit an environment error (an emulator/simulator/Appium/XHarness flake, a device that would not boot, or an empty/invalid result file), so it could not record a real pass/fail. The /review to retry on a fresh agent.
Gate infrastructure: a required .NET workload was not installed on the gate agent (missing: android), so the project could not be built (NETSDK1147). The agent'sdotnet workload restoredid not take effect — this is NOT a code build error. Retry on a fresh agent.
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
📱 NavigationPageTests (BarBackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling) Category=NavigationPage |
||
📱 ShellTests (BackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling) Category=Shell |
🔴 Without fix — 📱 NavigationPageTests (BarBackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling): ⚠️ ENV ERROR · 332s
Error-relevant lines (filtered from the build log):
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
🟢 With fix — 📱 NavigationPageTests (BarBackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling): ⚠️ ENV ERROR · 73s
Error-relevant lines (filtered from the build log):
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Core/maps/src/Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Core/maps/src/Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
🔴 Without fix — 📱 ShellTests (BackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling): ⚠️ ENV ERROR · 73s
Error-relevant lines (filtered from the build log):
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
🟢 With fix — 📱 ShellTests (BackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling): ⚠️ ENV ERROR · 73s
Error-relevant lines (filtered from the build log):
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net11.0-android]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
/home/vsts/work/1/s/.dotnet/sdk/11.0.100-rc.2.26465.113/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/vsts/work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net11.0-android37.0]
⚠️ Failure Details
⚠️ NavigationPageTests (BarBackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling) without fix:Gate infrastructure: a required .NET workload was not installed on the gate agent (missing: android), so the project could not be built (NETSDK1147). The agent'sdotnet workload restoredid not take effect — this is NOT a code build error. Retry on a fresh agent.⚠️ ShellTests (BackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling) without fix:Gate infrastructure: a required .NET workload was not installed on the gate agent (missing: android), so the project could not be built (NETSDK1147). The agent'sdotnet workload restoredid not take effect — this is NOT a code build error. Retry on a fresh agent.⚠️ NavigationPageTests (BarBackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling) with fix:Gate infrastructure: a required .NET workload was not installed on the gate agent (missing: android), so the project could not be built (NETSDK1147). The agent'sdotnet workload restoredid not take effect — this is NOT a code build error. Retry on a fresh agent.⚠️ ShellTests (BackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling) with fix:Gate infrastructure: a required .NET workload was not installed on the gate agent (missing: android), so the project could not be built (NETSDK1147). The agent'sdotnet workload restoredid not take effect — this is NOT a code build error. Retry on a fresh agent.
📁 Fix files reverted (2 files)
src/Controls/src/Core/Platform/Android/AndroidSystemChrome.cssrc/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
📋 Pre-Flight — Context & Validation
PR #38396 Pre-Flight
Context
- Title:
[NET 11] Fix Material 3 AppBar lift highlight with custom BarBackgroundColor - Issue: #37844
- Base / merge base:
net11.0/c871b803d4 - Head:
ffe81d7d0d97564e5d2cc1c7e3ced0a60e4feee9 - Platform: Android
- Problem: With Material 3 and
MauiAndroidSystemBarsUseMauiChromeenabled, a custom NavigationPage or Shell bar background masks the AppBarLayout lift-on-scroll highlight.
Current PR Diff
The directly inspected patch changes four files:
src/Controls/src/Core/Platform/Android/AndroidSystemChrome.cssrc/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cssrc/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.Android.cssrc/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs
For Material 3, ToolbarExtensions.UpdateBarBackground no longer paints the child Toolbar background. AndroidSystemChrome.UpdateAppBarBackground clears AppBar tint state, restores the preserved original MaterialShapeDrawable when needed, sets its fill to a custom solid color, and supplies AppBarLayout.SetLiftOnScrollColor with a luminance-based computed color. Clearing or switching to a non-solid brush clears the custom lift color. Non-Material-3 behavior retains the prior tint path.
The current revision addresses two findings from the prior review: gradient/image-to-solid transitions now recover the original Material drawable, and solid-to-default/non-solid transitions clear stale lift color state.
Tests and Gate Evidence
The PR adds these Android device tests:
NavigationPageTests.BarBackgroundColorPreservesMaterial3AppBarLiftOnScrollStylingShellTests.BackgroundColorPreservesMaterial3AppBarLiftOnScrollStyling
The already-completed current gate is INCONCLUSIVE, not a product failure: all four before/after runs were blocked by missing Android workload NETSDK1147. Do not rerun gate verification and do not modify gate/content.md.
An earlier review run found both tests passed on the broken baseline. The NavigationPage test did not induce lift, while the Shell test forced SetLifted(true) and duplicated the implementation's lightening formula. A passing candidate run therefore would validate build/execution but would not independently prove #37844 is fixed.
Use only these bounded Android device-test commands:
- Primary:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=NavigationPage" - Mandatory regression:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=Shell"
Each candidate gets one implementation/test pass and at most one focused correction/retest. Never run a full suite.
Alternative Constraints
The candidate must be mechanism-level different from the PR's direct MaterialShapeDrawable.FillColor mutation plus custom luminance-derived SetLiftOnScrollColor.
Two concepts from the prior review were blocked before implementation and must also be treated as prior approaches:
- Installing a stateful AppBar tint
ColorStateListthat derives normal/lifted tones from theme or elevation. - Merely clearing/removing the child Toolbar paint layer while leaving the baseline AppBar update path unchanged.
Run the try-fix baseline/restore protocol exactly. .github/.baseline-state.json must exist after baseline establishment, contain no NewFiles, and restrict edits to its RevertedFiles. The expected production allow-list is the two production files above; test files are read-only unless the baseline state explicitly says otherwise. Preserve all unrelated dirty and untracked harness files.
Other Evidence
- Regression cross-reference: CLEAN; no recent labeled bug-fix overlap in the modified files.
- Public GitHub metadata was retrieved through the unauthenticated API because
ghhas no credentials in this environment.
🔬 Code Review — Deep Analysis
Expert Code Review — PR #38396
Verdict: NEEDS_CHANGES
Confidence: medium
Independent assessment
The submitted change preserves Material 3 AppBar lift-on-scroll styling for custom solid top-bar colors by applying the color to the AppBar's MaterialShapeDrawable, configuring a lifted color, and avoiding a toolbar background that would obscure the AppBar. The approach is sound for the enabled system-chrome path.
Finding
❌ Error — Material 3 disables the existing toolbar fallback unconditionally
src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs:186 now makes UpdateBarBackground a no-op whenever Material 3 is enabled. When RuntimeFeature.UseMauiAndroidSystemBarBackgrounds is false, UpdateTopChrome does not apply the AppBar background either, so custom BarBackground updates are dropped entirely. This also affects non-solid backgrounds in the same opt-out configuration.
Blast radius and failure-mode probing
- The mapper is shared by Android NavigationPage and Shell toolbar initialization and updates.
- No new static state or subscriptions are introduced.
- Material 3 with MAUI system-bar backgrounds enabled follows the intended new AppBar path.
- Material 3 with MAUI system-bar backgrounds disabled has neither the new AppBar path nor the old toolbar fallback.
- The added tests cover the enabled positive path but not the Material 3 opt-out path that exposes the regression.
Required correction
Retain toolbar background application when Material 3 is enabled but MAUI system-bar background handling is disabled, while continuing to avoid the toolbar override when the new AppBar path is active. Add focused coverage for that configuration.
The supplied Gate result is inconclusive because the tests could not be built or run; it is not treated as a regression-test failure.
🛠️ Try-Fix — Analysis & Comparison
PR #38396 Try-Fix Aggregate
Candidate 1 - Lift-State Foreground Scrim
Result
Blocked
Approach
Use a lift-state foreground scrim on AppBarLayout while preserving the Material 3 background state machine. The custom bar color would be composited as an overlay rather than written into MaterialShapeDrawable.FillColor.
Prior Approaches Avoided
- The PR's direct
MaterialShapeDrawable.FillColormutation plus a MAUI luminance-derivedSetLiftOnScrollColor. - A stateful AppBar tint
ColorStateListcontaining normal and lifted tones. - Merely clearing the Toolbar paint while leaving the baseline AppBar path unchanged.
Mechanism-Level Difference
This design would leave native Material lifted-state computation authoritative and composite the requested custom color as a separate foreground layer. It would neither replace the drawable's base fill nor supply a MAUI-computed lifted color.
Baseline, Diff, and Files
pwsh .github/scripts/EstablishBrokenBaseline.ps1 rejected the pre-existing dirty worktree and did not create .github/.baseline-state.json. Without an authoritative RevertedFiles allow-list, the attempt was blocked before editing production or test files. The exact candidate diff is empty and no files changed.
Required Test Results
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=NavigationPage"- Blocked, exit code 1 (NETSDK1147: Android workload missing); no test executed.pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=Shell"- Blocked, exit code 1 (NETSDK1147: Android workload missing); no test executed.
Each command ran exactly once. No correction/retest or workload installation was attempted after the shared environment blocker.
Failure Analysis and Self-Review
The baseline script could not safely isolate the PR production files from unrelated dirty worktree changes, and both allowed test commands encountered the already-known missing Android workload. The foreground-scrim mechanism was therefore not implemented, compiled, deployed, or behaviorally tested. Earlier gate evidence also showed these tests can pass without the fix. Inline expert self-review recorded 0 findings because the candidate diff was empty.
Artifacts and Restore
- Artifact directory:
CustomAgentLogsTmp/PRState/38396/PRAgent/try-fix/attempt-1 - Restore command:
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore - Restore result:
Restored=False,Message=No baseline state found, the permitted no-state path because no candidate edit occurred.
Candidate 2 - Native Elevation-Overlay Tint
Result
Blocked
Approach
Use MaterialShapeDrawable's native elevation-overlay pipeline with one non-stateful drawable tint. The design would restore the original Material 3 drawable, initialize its elevation-overlay provider, apply the requested solid color through the drawable's own tint input rather than a view-level AppBar tint, and leave the Material 3 Toolbar unpainted.
Prior Approaches Avoided
- The PR's direct
MaterialShapeDrawable.FillColormutation plus a MAUI luminance-derivedSetLiftOnScrollColor. - A stateful AppBar tint
ColorStateListcontaining separately derived normal and lifted tones. - Merely clearing/removing the Toolbar paint layer while leaving the baseline AppBar path unchanged.
- Candidate 1's foreground scrim/composited overlay.
Mechanism-Level Difference
The baseline view-level BackgroundTintList applies a final Porter-Duff filter after the drawable renders, flattening the native Material lift appearance. This design would feed one custom color into MaterialShapeDrawable; as AppBar lift changes drawable elevation, Material Components' elevation-overlay provider would recompute the rendered tone internally. It uses neither MAUI-computed lifted colors, a stateful tint list, nor an added compositing layer.
Baseline, Diff, and Files
pwsh .github/scripts/EstablishBrokenBaseline.ps1 rejected the pre-existing dirty worktree and did not create .github/.baseline-state.json. Without an authoritative RevertedFiles allow-list, the attempt was blocked before editing production or test files. The exact candidate diff is empty and no files changed.
Required Test Results
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=NavigationPage"- Blocked, exit code 1 (NETSDK1147: Android workload missing); no test executed.pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=Shell"- Blocked, exit code 1 (NETSDK1147: Android workload missing); no test executed.
Each command ran exactly once. No correction/retest or workload installation was attempted after the shared environment blocker.
Failure Analysis and Self-Review
The baseline script could not safely isolate the PR production files from unrelated dirty worktree changes, and both allowed validation commands encountered the already-known missing Android workload. The elevation-overlay mechanism was therefore not implemented, compiled, deployed, or behaviorally tested. Earlier gate evidence also showed these tests can pass without the fix. Inline expert self-review recorded 0 findings because the candidate diff was empty.
Artifacts and Restore
- Artifact directory:
CustomAgentLogsTmp/PRState/38396/PRAgent/try-fix/attempt-2 - Restore command:
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore - Restore result:
Restored=False,Message=No baseline state found, the permitted no-state path because no candidate edit occurred.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the description is detailed and accurate, but the title uses a .NET version prefix instead of identifying the Android-specific platform and AppBar component in the repository's preferred format.
Recommended title
[Android] AppBar: Preserve Material 3 lift highlight with custom BarBackgroundColor (.NET 11)
Recommended description
### Issue Detail
In .NET 11 with Material 3 enabled, the `AppBarLayout` applies a lift-on-scroll highlight when the page content is scrolled. However, when a custom `BarBackgroundColor` is set on a `NavigationPage` or Shell page, the AppBar highlight is no longer applied.
### Root Cause
In Material 3, the `AppBarLayout` uses its `MaterialShapeDrawable` and lift-on-scroll color to apply the highlighted background when the content is scrolled. When `NavigationPage.BarBackgroundColor` is customized, the existing implementation applied the color directly to the toolbar background. This caused the toolbar background to override the Material 3 AppBar background, preventing the `AppBarLayout` from applying its lifted highlight color.
> [!NOTE]
> This change depends on the Android system bar handling introduced in [#35463](https://github.com/dotnet/maui/pull/35463). To enable the Material 3 AppBar/system bar behavior covered by this fix, the `MauiAndroidSystemBarsUseMauiChrome` API must be enabled in the application project:
> `<MauiAndroidSystemBarsUseMauiChrome>true</MauiAndroidSystemBarsUseMauiChrome>`
### Description of Change
Updated the Material 3 AppBar background handling in `AndroidSystemChrome` to apply the customized `BarBackgroundColor` to the existing `MaterialShapeDrawable` instead of overriding the toolbar background. The corresponding lift-on-scroll color is also configured on the `AppBarLayout`, while the Material 3 toolbar path leaves the parent AppBar background visible.
This allows the customized toolbar color to be preserved while still allowing Material 3 to change the AppBar color when the content is scrolled, restoring the expected highlight effect for both `NavigationPage` and Shell.
Android device coverage was added for the `NavigationPage` custom-color update path and the Shell lifted-state path.
> [!NOTE]
> This fix currently supports solid `BarBackgroundColor` values. Material 3's native `AppBarLayout` lift-on-scroll implementation operates on a solid `ColorStateList`/color and does not provide native support for applying the lift highlight to gradient backgrounds. Therefore, gradient `BarBackgroundColor` values are not included in this fix.
### Validated the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac
### Issues Fixed
Fixes #37844
### Screenshots
| Before | After |
|---|---|
| <video src="https://github.com/user-attachments/assets/a5f2a83d-ecbe-43a7-9d08-ae7187e2ba41"> | <video src="https://github.com/user-attachments/assets/ad96874d-6798-4896-a228-5625eca55cfe"> |
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winning candidate: pr-plus-reviewer
The submitted PR has the right core Material 3 AppBar approach, but the expert review identified a concrete regression: ToolbarExtensions.UpdateBarBackground becomes a no-op for every Material 3 app, including the default/system-chrome opt-out configuration where AndroidSystemChrome.UpdateTopChrome also returns without painting the AppBar. pr-plus-reviewer is the only implemented candidate that preserves the intended lift-on-scroll fix while restoring the existing toolbar fallback for that configuration.
Comparative ranking
| Rank | Candidate | Implementation | Regression validation | Assessment |
|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Submitted fix plus a focused fallback correction and strengthened opt-out coverage | Blocked, not failed: both required category commands stopped before test execution because the one permitted build-task preparation could not complete without the Android workload | Best code-level result; directly resolves the verified expert finding with minimal blast radius |
| 2 | pr |
Complete submitted Material 3 AppBar fix and two device tests | Gate INCONCLUSIVE due missing Android workload | Core enabled-path fix is plausible, but the Material 3 opt-out regression is blocking |
| 3 | try-fix-2 |
Native MaterialShapeDrawable elevation-overlay concept only; no code or candidate diff |
Blocked by baseline safety and missing workload | Potentially native-aligned, but entirely speculative and cannot outrank an implemented correction |
| 4 | try-fix-1 |
AppBar foreground-scrim concept only; no code or candidate diff | Blocked by baseline safety and missing workload | Unimplemented and adds a separate compositing layer with unassessed visual/lifecycle behavior |
No candidate recorded a regression-test failure, and no candidate recorded a regression-test pass. The required rule preferring passing candidates therefore does not distinguish this field; the ranking uses verified implementation correctness while retaining explicit validation uncertainty.
Why pr-plus-reviewer wins
The correction changes the toolbar gate from Material-3-only to the actual ownership condition: suppress toolbar painting only when both Material 3 and MAUI Android system-chrome handling are active. When the feature is disabled, the established solid/gradient toolbar path remains responsible for the visible background. The enhanced existing opt-out test verifies that ownership boundary without changing the submitted enabled-path behavior.
Remaining uncertainty
The candidate passed git diff --check, but it could not be compiled or behaviorally exercised. The one required build-task preparation failed with NETSDK1147 because the Android workload is unavailable; the NavigationPage and Shell commands then each ran once and stopped on the expected stale/missing build-task guard. This is not evidence of a product regression, but it prevents approval. The submitted PR should incorporate reviewer.patch and obtain Android device-test coverage in a prepared environment.
📱 UI Tests — Button,Label,Layout
Detected UI test categories: Button,Label,Layout
✅ Deep UI tests — 422 passed, 0 failed, 7 skipped across 3 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
Button |
104/106 (2 skipped) ✓ | — |
Label |
123/125 (2 skipped) ✓ | — |
Layout |
195/198 (3 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The reviewer-enhanced PR preserves the submitted Material 3 AppBar fix while restoring toolbar background updates when MAUI Android system-chrome handling is disabled. It is the only implemented candidate that resolves the expert reviewer's concrete regression, although Android validation remained blocked by the missing workload/build-task environment.
Address the actionable findings in this review before merging.
…pplied (#39660) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details - On Android with Material 3 enabled, ShellBackgroundColor no longer colors the navigation toolbar . Both direct assignments and styles are affected. ### Root Cause - PR #38396 skips direct toolbar coloring for Material 3, relying on AppBar coloring instead. However, AppBar coloring requires MauiAndroidSystemBarsUseMauiChrome, which defaults to false. Without that opt-in, neither path applies the background. ### Description of Change **Bug fix:** * Updated the condition in `ToolbarExtensions.cs` so that the bar background is set when either Material3 is not enabled or when `UseMauiAndroidSystemBarBackgrounds` is not enabled. This ensures the navigation bar background color is applied correctly on Android. **Testing improvements:** * Added a new test case `Issue39599` in `TestCases.HostApp` to manually verify that the navigation bar background color is blue and the title color is white. * Added an automated UI test for `Issue39599` in `TestCases.Shared.Tests` to verify that the Shell background color is applied as expected on Android. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #39599 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac ### Output | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/5a7e0f2f-79a8-49f0-bc96-3cb76a5557fd"> | <img src="https://github.com/user-attachments/assets/d4717595-906d-4ae9-bc25-fa8432213abe"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
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!
Issue Detail
In .NET 11 with Material 3 enabled, the AppBarLayout applies a lift-on-scroll highlight when the page content is scrolled. However, when a custom BarBackgroundColor is set on a NavigationPage or Shell page, the AppBar highlight is no longer applied.
Root Cause
In Material 3, the AppBarLayout uses its MaterialShapeDrawable and lift-on-scroll color to apply the highlighted background when the content is scrolled. When NavigationPage.BarBackgroundColor is customized, the existing implementation applied the color directly to the toolbar background. This caused the toolbar background to override the Material 3 AppBar background, preventing the AppBarLayout from applying its lifted highlight color.
Note
This change depends on the Android system bar handling introduced in #35463. To enable the Material 3 AppBar/system bar behavior covered by this fix, the MauiAndroidSystemBarsUseMauiChrome API must be enabled in the application project:
<MauiAndroidSystemBarsUseMauiChrome>true</MauiAndroidSystemBarsUseMauiChrome>Description of Change
Updated the Material 3 AppBar background handling to apply the customized BarBackgroundColor to the existing MaterialShapeDrawable instead of overriding the toolbar background. The corresponding lift-on-scroll color is also configured on the AppBarLayout.
This allows the customized toolbar color to be preserved while still allowing Material 3 to change the AppBar color when the content is scrolled, restoring the expected highlight effect.
Note
This fix currently supports solid BarBackgroundColor values. Material 3's native AppBarLayout lift-on-scroll implementation operates on a solid ColorStateList/color and does not provide native support for applying the lift highlight to gradient backgrounds. Therefore, gradient BarBackgroundColor values are not included in this fix.
Validated the behaviour in the following platforms
Issues Fixed:
Fixes #37844
Screenshots
37844_BeforeFix.mov
37844_AfterFix.mov