Repository navigation
Revert "Let a Style set Shell.FlyoutBackgroundColor" - #40200
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40200Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40200" |
This comment has been minimized.
This comment has been minimized.
|
@dalexsoto stamp |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the revert restoring Shell’s previous flyout background behavior.
No open issues 🎉
What changed in this PR
Reverts #39839 on main, restoring .NET MAUI Shell’s previous flyout background behavior until the candidate fix is forwarded. This intentionally restores the style limitation described in #9736.
Changes:
- Restores normal binding precedence for the default
Shell.FlyoutBackgroundColor, preventing style setters from overriding it. - Removes the two tests introduced with the reverted fix; default theme colors and the Android Material 3 path remain unchanged.
| File | Description |
|---|---|
src/Controls/tests/Core.UnitTests/AppThemeTests.cs |
Removes the style-override and default-theme tests added by #39839. |
src/Controls/src/Core/Shell/Shell.cs |
Removes explicit lowest binding specificity and its explanatory comment. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
|
/rebase |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 71a3fc7.
PR Test Gate🧪 Gate analysis — click to expand❌ Failed. The selected tests did not meet the expected outcomes. Inspect the evidence before changing the test or fix. 🧪 Unit tests
Execution log excerptsWithout fix With fix PR head: 71a3fc76. Without-fix baseline: 9c11f2d8. |
<!-- 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! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Revert dotnet#39839 on `main` as requested. This restores the previous behavior: a `Style` cannot override the default `Shell.FlyoutBackgroundColor` binding until the candidate fix is forwarded to `main`. The identical implementation and regression tests are already on `candidate/11.0.1xx-sr2`, where they were included in dotnet#40170 (commit `706b461e9296fd30f7ff3c057dacf2025d60a698`). A separate candidate PR for the same patch would be empty, so this PR changes only `main`. ### Validation - Verified the commit is the exact inverse of `9291bfb20edde2cc822b8e2a110f63d2b3425e09`; both changed files match their pre-fix blobs. - `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --verbosity quiet` — passed. - `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~AppThemeTests' --verbosity quiet` — passed: 15 tests before the revert and 13 after removal of the two reverted tests. - `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-build --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~ShellTests|FullyQualifiedName~StyleTests' --verbosity quiet` — passed: 147 tests. - With the two original regression tests temporarily retained against the reverted implementation, `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~StyleSetsShellFlyoutBackgroundColor|FullyQualifiedName~ShellFlyoutBackgroundColorFollowsTheThemeWithoutAStyle' --logger 'console;verbosity=normal'` — expected failure: the style test received white instead of red; the default-theme test passed. The temporarily retained tests were removed again before committing. - The combined selection `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~AppThemeTests|FullyQualifiedName~ShellTests|FullyQualifiedName~StyleTests' --verbosity quiet` failed `CorrectDefaultRadioButtonThemeColorsInLightAndDarkModes` (159 passed, 1 failed). The same failure occurred with the original patch restored on the unmodified `main` baseline (161 passed, 1 failed); the isolated selections above pass. - `dotnet format Microsoft.Maui.sln --no-restore --verify-no-changes --include src/Controls/src/Core/Shell/Shell.cs src/Controls/tests/Core.UnitTests/AppThemeTests.cs --exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet` — passed. ### 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. --> Related to dotnet#9736; this revert intentionally restores the issue on `main`. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
<!-- 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! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Revert dotnet#39839 on `main` as requested. This restores the previous behavior: a `Style` cannot override the default `Shell.FlyoutBackgroundColor` binding until the candidate fix is forwarded to `main`. The identical implementation and regression tests are already on `candidate/11.0.1xx-sr2`, where they were included in dotnet#40170 (commit `706b461e9296fd30f7ff3c057dacf2025d60a698`). A separate candidate PR for the same patch would be empty, so this PR changes only `main`. ### Validation - Verified the commit is the exact inverse of `9291bfb20edde2cc822b8e2a110f63d2b3425e09`; both changed files match their pre-fix blobs. - `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --verbosity quiet` — passed. - `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~AppThemeTests' --verbosity quiet` — passed: 15 tests before the revert and 13 after removal of the two reverted tests. - `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-build --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~ShellTests|FullyQualifiedName~StyleTests' --verbosity quiet` — passed: 147 tests. - With the two original regression tests temporarily retained against the reverted implementation, `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~StyleSetsShellFlyoutBackgroundColor|FullyQualifiedName~ShellFlyoutBackgroundColorFollowsTheThemeWithoutAStyle' --logger 'console;verbosity=normal'` — expected failure: the style test received white instead of red; the default-theme test passed. The temporarily retained tests were removed again before committing. - The combined selection `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~AppThemeTests|FullyQualifiedName~ShellTests|FullyQualifiedName~StyleTests' --verbosity quiet` failed `CorrectDefaultRadioButtonThemeColorsInLightAndDarkModes` (159 passed, 1 failed). The same failure occurred with the original patch restored on the unmodified `main` baseline (161 passed, 1 failed); the isolated selections above pass. - `dotnet format Microsoft.Maui.sln --no-restore --verify-no-changes --include src/Controls/src/Core/Shell/Shell.cs src/Controls/tests/Core.UnitTests/AppThemeTests.cs --exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet` — passed. ### 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. --> Related to dotnet#9736; this revert intentionally restores the issue on `main`. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@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!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.Description of Change
Revert #39839 on
mainas requested. This restores the previous behavior: aStylecannot override the defaultShell.FlyoutBackgroundColorbinding until the candidate fix is forwarded tomain.The identical implementation and regression tests are already on
candidate/11.0.1xx-sr2, where they were included in #40170 (commit706b461e9296fd30f7ff3c057dacf2025d60a698). A separate candidate PR for the same patch would be empty, so this PR changes onlymain.Validation
9291bfb20edde2cc822b8e2a110f63d2b3425e09; both changed files match their pre-fix blobs.dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --verbosity quiet— passed.dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~AppThemeTests' --verbosity quiet— passed: 15 tests before the revert and 13 after removal of the two reverted tests.dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-build --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~ShellTests|FullyQualifiedName~StyleTests' --verbosity quiet— passed: 147 tests.dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~StyleSetsShellFlyoutBackgroundColor|FullyQualifiedName~ShellFlyoutBackgroundColorFollowsTheThemeWithoutAStyle' --logger 'console;verbosity=normal'— expected failure: the style test received white instead of red; the default-theme test passed. The temporarily retained tests were removed again before committing.dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-restore -c Debug -p:IncludeIosTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false --filter 'FullyQualifiedName~AppThemeTests|FullyQualifiedName~ShellTests|FullyQualifiedName~StyleTests' --verbosity quietfailedCorrectDefaultRadioButtonThemeColorsInLightAndDarkModes(159 passed, 1 failed). The same failure occurred with the original patch restored on the unmodifiedmainbaseline (161 passed, 1 failed); the isolated selections above pass.dotnet format Microsoft.Maui.sln --no-restore --verify-no-changes --include src/Controls/src/Core/Shell/Shell.cs src/Controls/tests/Core.UnitTests/AppThemeTests.cs --exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet— passed.Issues Fixed
Related to #9736; this revert intentionally restores the issue on
main.