Repository navigation
[iOS] Add legacy Done accessory compatibility switch - #36776
Conversation
Lift the Liquid Glass button 4 points while retaining the 44-point accessory height, and update focused device and visual coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5 # Conflicts: # src/Core/src/Platform/iOS/MauiDoneAccessoryView.cs
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
… and no deep results Fixes a two-sided always-finish gap exposed by the split PostReview job: when a PR's BASE branch fails to build (e.g. a broken inflight/* base), every stage produces nothing. RunPost defers with aiSummaryReviewId= 'DEFERRED' (non-empty), so the PostReview job's review-incomplete notice is SKIPPED — while Stage 3's deferred path found no PRAgent content and no deep results and merely LOGGED 'leaving the notice as the honest outcome', deferring to a notice that was never posted. Result: the PR got zero feedback (observed on #36776, base inflight/current, build 14768589). Stage 3 now posts the review-incomplete notice itself in that branch (adds BUILD_BUILDID to its env), so the PR is always finished with a notice. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AI Review Summary
🗂️ Review Sessions — click to expand🚦 Gate — Test Before & After FixGate Result:
|
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
📱 MauiDoneAccessoryViewAppContextSwitchCollection (LegacyDoneAccessorySwitchSelectsExpectedImplementation) Category=Entry |
🛠️ BUILD ERROR | ✅ PASS — 163s |
🔴 Without fix — 📱 MauiDoneAccessoryViewAppContextSwitchCollection (LegacyDoneAccessorySwitchSelectsExpectedImplementation): 🛠️ BUILD ERROR · 215s
Error-relevant lines (filtered from the build log):
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(25,52): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneAccessorySwitch' [/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-ios]
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(31,27): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneAccessorySwitch' [/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-ios]
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(44,49): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneAccessorySwitch' [/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-ios]
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(50,49): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneAccessorySwitch' [/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-ios]
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(59,49): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneAccessorySwitch' [/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-ios]
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(66,28): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneAccessorySwitch' [/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-ios]
Build FAILED.
🟢 With fix — 📱 MauiDoneAccessoryViewAppContextSwitchCollection (LegacyDoneAccessorySwitchSelectsExpectedImplementation): PASS ✅ · 163s
(no coded error found; showing last 1200 chars)
hineName": "FV2NR7P0CC-1",
"exitCode": 0,
"exitCodeName": "SUCCESS",
"platform": "apple",
"device": "iPhone 11 Pro",
"deviceOsVersion": "26.5",
"files": [
{
"name": "test-ios-simulator-64_26.5-16AE04F7-0FED-415F-B6DC-BAC37BF79357.log",
"type": "executionlog"
},
{
"name": "list-ios-simulator-64_26.5-20260726_153038.log",
"type": "devicelist"
},
{
"name": "test-ios-simulator-64_26.5-20260726_153048.log",
"type": "testlog"
},
{
"name": "iPhone 11 Pro.log",
"type": "systemlog"
},
{
"name": "Microsoft.Maui.Core.DeviceTests.log",
"type": "systemlog"
},
{
"name": "com.microsoft.maui.core.devicetests.log",
"type": "applicationlog"
},
{
"name": "xunit-test-ios-simulator-64_26.5-20260726_153048.xml",
"type": "xmllog"
}
]
}
<<XHARNESS_RESULT_END>>
XHarness exit code: 0
Passed: 0
Failed: 0
Tests completed successfully
⚠️ Failure Details
- 🛠️ MauiDoneAccessoryViewAppContextSwitchCollection (LegacyDoneAccessorySwitchSelectsExpectedImplementation) without fix: build failed before tests could run
/Users/cloudtest/vss/_work/1/s/src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs(25,52): error CS0117: 'MauiDoneAccessoryView' does not contain a definition for 'UseLegacyDoneA...
📁 Fix files reverted (1 files)
src/Core/src/Platform/iOS/MauiDoneAccessoryView.cs
📋 Pre-Flight — Context & Validation
Issue: #36412, #36413, #36756 - iOS 26 Done accessory compatibility follow-up
PR: #36776 - [iOS] Add legacy Done accessory compatibility switch
Platforms Affected: iOS
Files Changed: 1 implementation, 1 test
Key Findings
- PR adds an internal, default-off
AppContextswitch (Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory) that restores the legacy full-widthUIToolbarDone accessory on iOS 26+. - The selected accessory mode is snapshotted in
_useGlassButtonduringMauiDoneAccessoryViewconstruction, keeping rendering, hit-testing, and Done dispatch consistent even if the process-wide switch changes later. - Device tests were added under the iOS Core device-test area and cover default, explicit modern, explicit legacy, construction-time snapshot, action dispatch, and hit-test behavior.
- The prior gate was inconclusive due to build/environment issues; per instructions, it is not treated as a failing fix and was not rerun.
Code Review Summary
Verdict: NEEDS_DISCUSSION
Confidence: low
Errors: 0 | Warnings: 0 | Suggestions: 1
Key code review findings:
- ℹ
src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs:63-68restores an originally-unsetAppContextswitch asfalse; effective product behavior is preserved, but same-process retries no longer distinguish unset from explicitly false.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #36776 | Snapshot the AppContext switch into _useGlassButton in each accessory instance and branch initialization, hit-testing, and Done dispatch from that field. |
src/Core/src/Platform/iOS/MauiDoneAccessoryView.cs, src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs |
Original PR; gate build/run was inconclusive and not rerun. |
🔬 Code Review — Deep Analysis
Code Review — PR #36776
Independent Assessment
What this changes: Adds an internal iOS AppContext switch (Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory) so iOS 26+ MauiDoneAccessoryView can opt back into the legacy full-width UIToolbar Done accessory. The selected mode is snapshotted per instance and reused for initialization, hit-testing, and Done dispatch. Adds iOS device coverage for default, explicit modern, explicit legacy, and construction-time behavior.
Inferred motivation: Provide a compatibility escape hatch for apps relying on the old full-width Done toolbar/touch-blocking behavior while keeping the iOS 26 Liquid Glass close button as the default.
Reconciliation with PR Narrative
Author claims: Default-off compatibility switch, set before MAUI controls are created; each accessory records the selected path at construction; iOS < 26 remains legacy; device tests cover the relevant paths.
Agreement/disagreement: The implementation matches these claims. _useGlassButton is assigned before Initialize() and all later behavior uses the instance field rather than re-reading global switch state.
Prior Review Reconciliation
| Prior ❌ Error Finding | Source | Status | Evidence |
|---|---|---|---|
| No prior ❌ Error findings found. | Review bodies, inline comments, issue comments | n/a | Queried all three surfaces. Existing MauiBot issue comment reported inconclusive gate/CI, not code ❌ findings. |
Blast Radius Assessment
- Runs for all instances: Default behavior runs for all iOS Done accessories; legacy behavior only when the process-wide switch is enabled before construction.
- Startup impact: No app-startup path; switch is read during accessory construction.
- Static/shared state: Yes,
AppContextswitch is process-wide, but instance snapshotting prevents later switch changes from mixing rendering/hit-test/action behavior within one accessory.
CI Status
- Required-check result:
gh pr checks --requiredunavailable (ghunauthenticated). Public GitHub check-runs showmaui-prfailing. - Classification: Undetermined/likely unrelated from available public evidence. Failures include
SimpleTemplateTest.cscompile errors and Helix unit failures outside the changed iOS accessory files; no authenticated baseline comparison available. - Action taken: Invoked
azdo-build-investigator;ci-analysisskill was unavailable in this environment. Confidence capped low; noLGTMbecause CI is red/tool-limited.
Findings
💡 Suggestion — Switch test cannot restore the “unset” AppContext state
src/Core/tests/DeviceTests/Platform/iOS/MauiDoneAccessoryViewTests.iOS.cs:63-68
The finally block restores an originally-unset switch as false:
AppContext.SetSwitch(
MauiDoneAccessoryView.UseLegacyDoneAccessorySwitch,
wasConfigured && previousValue);That preserves effective product behavior, but permanently changes process state from “unset” to “set=false”, so same-process retries no longer exercise the unset-default branch. Consider documenting this limitation or structuring the default assertion so it remains covered independently.
Failure-Mode Probing
- Switch changed after construction: Existing accessories remain internally consistent because
_useGlassButtonis readonly and captured before initialization. - iOS < 26 with switch true/false:
OperatingSystem.IsIOSVersionAtLeast(26)short-circuits, so legacy toolbar remains used. - Missing/collected glass button:
HitTestreturnsnull; no exception.SendDoneClickeduses the cached/found button only on glass path. - Handler reconnect/new controls: New accessory instances observe the current switch; no new static subscriptions are added.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: I found no blocking code issue in the production implementation; the switch logic and per-instance snapshot are sound. However, CI is red and authenticated required-check inspection was unavailable, so the skill rules prevent LGTM; human follow-up on CI is needed before merge.
🛠️ Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix-1 | Add MauiDoneAccessoryView.Create(...) factory overloads and route iOS input-control call sites through them. |
✅ Pass | 7 files | Preserves behavior but adds indirection and touches more files than the PR; not better. |
| 2 | try-fix-2 | Remove the per-instance snapshot and re-read the AppContext switch dynamically in initialization, hit-testing, and Done dispatch. |
❌ Fail | 1 file | Failed LegacyDoneAccessorySwitchSelectsExpectedImplementation; dynamic reads can mismatch an existing accessory's native subtree after the switch changes. |
| 3 | try-fix-3 | Keep construction-time binding but snapshot an explicit AccessoryMode enum instead of a boolean. |
✅ Pass | 1 file | Viable but more verbose than the PR's boolean snapshot without materially improving behavior. |
| PR | PR #36776 | Snapshot the compatibility switch into _useGlassButton during construction and branch initialization, hit-testing, and Done dispatch from that instance field. |
2 files | Original PR remains the best candidate on simplicity and correctness. |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| code-review + MAUI expert rules | 1 | Yes | Candidate 1 explored call-site/factory centralization. |
| try-fix failure feedback | 2 | Yes | Candidate 2 tested dynamic switch reads and proved the need for construction-time binding. |
| try-fix failure feedback | 3 | Yes | Candidate 3 incorporated that lesson with explicit enum state. |
| final expert review | 4 | No | Remaining variants are trivial reshufflings of construction-time state (bool, enum, helper method) or are worse because they either spread call-site changes or re-read mutable global state. |
Exhausted: Yes
Selected Fix: PR #36776 — The PR's _useGlassButton construction-time snapshot is the simplest passing design. Candidate 2 demonstrated why avoiding the snapshot is incorrect, and candidates 1/3 passed but were more complex without improving safety.
Test Command Used for Candidates
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Entry" -SkipXcodeVersionCheckNotes
- The baseline helper could not establish a clean baseline because the review worktree already contained unrelated uncommitted changes. Per autonomous-execution instructions, candidate source changes were applied surgically and restored after each attempt without modifying
gate/content.md. - Candidate 3's captured output contains stale failed-test lines from prior appended device-test logs, but the latest application summary and XHarness result for candidate 3 reported success.
🏁 Report — Final Recommendation
Comparative Analysis — PR #36776
Candidates compared
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | pr |
Best balance of correctness and simplicity. It snapshots the switch decision once per accessory and consistently uses that instance state for construction, hit-testing, and Done dispatch. | |
| 2 | pr-plus-reviewer |
pr |
The expert reviewer found no actionable issues, so this candidate is behaviorally identical to pr. It ranks just below pr only because there is no actual delta to prefer over the submitted fix. |
| 3 | try-fix-3 |
✅ Pass | Correct and viable. The explicit AccessoryMode enum makes the state self-describing, but it is more verbose than the PR's boolean snapshot and does not improve behavior or test coverage. |
| 4 | try-fix-1 |
✅ Pass | Correct but more invasive. Adding factory overloads and changing every call site preserves behavior, but it touches seven files without solving a problem the PR leaves unsolved. |
| 5 | try-fix-2 |
❌ Fail | Incorrect. Dynamic switch reads allow an already-created legacy toolbar to later use glass-path hit-testing/dispatch after the switch changes, which the regression test caught. Failed regression candidates must rank below passing candidates. |
Key comparison
The decisive requirement is per-instance consistency. MauiDoneAccessoryView builds either a legacy toolbar or a glass button when it is constructed; later behavior must match that native subtree. The PR's _useGlassButton snapshot satisfies that requirement with the smallest implementation surface.
try-fix-2 proves why dynamic global switch reads are unsafe: a process-wide switch can change after an accessory is created, causing rendering, hit-testing, and Done dispatch to disagree. try-fix-1 and try-fix-3 both preserve correctness, but each adds complexity without improving the observable behavior.
Winning candidate
Winner: pr
The submitted PR fix wins because it is the simplest passing design and the expert review found no required changes. The gate remains inconclusive due to environment/build issues, but it is not a failed regression result and does not outweigh the PR's stronger simplicity/correctness tradeoff against the other passing candidates.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
…nto PR head) Inflight-targeted PRs (base inflight/current | inflight/candidate) were reviewed on the PR head AS-IS. When a base-branch fix landed AFTER the PR branched, the stale PR head kept rebuilding the old (broken) base, so the gate build failed and NO UI tests ran. Example: #36787 fixed inflight/current build breaks after #36776 was cut, yet #36776's review still failed to build the pre-fix code. Fix: for inflight targets, merge the CURRENT base branch into the PR head at every checkout point so the review builds the PR on top of the latest base: - Both 'Resolve PR base branch' steps (CopilotReview + Deep stages) merge origin/<base> into the PR head before Build MSBuild Tasks (best-effort; on conflict, build the PR head as-is since buildtasks is continueOnError). - Review-PR.ps1 Setup (authoritative) resets to PR head then merges origin/<base>; a genuine conflict is reported as a merge conflict and bails (needs rebase). A PR that FIXES a broken base still builds because its fix is on HEAD. This makes inflight reviews test what will actually land (PR + latest base), not stale code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
…GradientBrush (#36808) > [!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! ### Problem `GradientBrush` (added in #36746) keys its subscription ref-count dictionary with `System.Collections.Generic.ReferenceEqualityComparer.Instance`, which is **.NET 5+ only**. `Controls.Core` also targets **netstandard2.0/2.1**, so the shared build breaks: ``` src/Controls/src/Core/GradientBrush.cs(13,71): error CS0122: 'ReferenceEqualityComparer' is inaccessible due to its protection level [Controls.Core.csproj::TargetFramework=netstandard2.0] ``` This blocks every build of `inflight/current` (including Copilot PR reviews on inflight PRs, e.g. #36776, where the gate could not build the base). ### Fix Replace the BCL comparer with a small self-contained reference-identity comparer that works on **every** TFM — equality by object reference, hash from `RuntimeHelpers.GetHashCode` — preserving the leak fix's exact semantics. The other `ReferenceEqualityComparer` uses (`ShellRenderer.cs`, `MapHandler.Android.cs`) are in platform-specific files that only compile for .NET TFMs, so they are unaffected. ### Risk Minimal — behaviorally identical to `ReferenceEqualityComparer.Instance`; no public API change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
<!-- 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! ### Description of Change Adds a temporary, default-off `AppContext` compatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar. The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls: ```csharp AppContext.SetSwitch("Microsoft.Maui.Platform.iOS.UseLegacyDoneAccessory", true); ``` This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset. The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior. Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value. ### Issues Fixed Follow-up compatibility escape hatch for #36412, #36413, and #36756. ### Testing - Core iOS Entry device tests on iOS 26.5: 243 run, 242 passed, 1 skipped, 0 failed - Core iOS Entry device tests on iOS 18.6: 243 run, 242 passed, 1 skipped, 0 failed - New compatibility-switch test passed on both exact simulator runtimes --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c80a2e76-7ce5-417a-b4fe-0e24bb5d39f5
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 of Change
Adds a temporary, default-off
AppContextcompatibility switch for iOS applications that specifically depend on the legacy full-width Done toolbar.The pass-through Liquid Glass close button remains the default on iOS 26+. To explicitly restore the legacy toolbar, set the switch before creating MAUI controls:
This opt-out intentionally restores the complete legacy behavior: the blue system Done/checkmark affordance and the full-width toolbar that intercepts touches. Applications that do not depend on that behavior should leave the switch unset.
The switch remains internal implementation rather than adding permanent public MAUI API. Each accessory records the selected path when it is constructed, preventing later process-wide switch changes from creating mismatched rendering, action dispatch, and hit-testing behavior.
Device coverage verifies the unset default, explicit modern, and explicit legacy paths; construction-time behavior; Done dispatch; full-width legacy hit interception; and glass-path pass-through hit testing. Earlier iOS versions continue using the legacy toolbar regardless of the switch value.
Issues Fixed
Follow-up compatibility escape hatch for #36412, #36413, and #36756.
Testing