Repository navigation
[Extensibility] Controls: Restore public AlertManager interfaces - #36633
Conversation
The gesture and alert "platform manager" extension points were introduced on net11.0 but shipped as internal, so consumers cannot use them to swap in their own implementations. - GestureManager (#33365, tracked by #33364) added IGesturePlatformManager, IGesturePlatformManagerFactory, and IGesturePlatformManagerProvider as internal, with a TODO to make them public in .NET 11. - AlertManager (#34228) added IAlertManager and IAlertManagerSubscription as public, but that surface was reverted for servicing in #35024, leaving them internal on net11.0. Flip all five interfaces to public (no signature changes), remove the "make public in NET11" TODO, and add the corresponding PublicAPI.Unshipped.txt entries for all seven TFMs. The AlertManager entries match those originally added in #34228. Concrete GesturePlatformManager/AlertManager implementations remain internal; consumers provide their own via DI, a handler-scoped provider, or a custom IAlertManager. Fixes #33364 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 81d4ef33-303c-42b0-9686-5917808c5361
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36633Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36633" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR makes the gesture and alert “platform manager” extension-point interfaces public on the net11.0 branch, enabling external consumers to replace MAUI’s default gesture/alert handling via DI or handler-scoped providers. It also records the new public surface in PublicAPI.Unshipped.txt across all supported TFMs.
Changes:
- Changed five interfaces from
internaltopublic(IAlertManager,IAlertManagerSubscription, and the threeIGesturePlatformManager*interfaces). - Removed the “make public in NET11” TODO for the gesture provider interface.
- Added corresponding entries to all 7
PublicAPI.Unshipped.txtfiles.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/src/Core/Platform/GestureManager/IGesturePlatformManager.cs | Makes the gesture platform manager interface public. |
| src/Controls/src/Core/Platform/GestureManager/IGesturePlatformManagerFactory.cs | Makes the DI factory interface public. |
| src/Controls/src/Core/Platform/GestureManager/IGesturePlatformManagerProvider.cs | Makes the handler-scoped provider interface public and removes the TODO. |
| src/Controls/src/Core/Platform/AlertManager/IAlertManager.cs | Makes the alert manager interface public. |
| src/Controls/src/Core/Platform/AlertManager/IAlertManagerSubscription.cs | Makes the alert subscription interface public. |
| src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the net ref-surface list. |
| src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the netstandard ref-surface list. |
| src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the Android ref-surface list. |
| src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the iOS ref-surface list. |
| src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the MacCatalyst ref-surface list. |
| src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the Windows ref-surface list. |
| src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | Adds the newly-public APIs to the Tizen ref-surface list. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 3 findings
See inline comments for details.
|
Current main 1531512 failure is infrastructure: |
|
/azp run maui-pr |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Replacement main 1531831 currently has one transient |
|
Replacement main 1531831 added one known unrelated Helix failure: |
|
Final current-head CI classification: main replacement 1531831 has only the transient Android AAPT cache/resource failure and known #35934 |
Resolve PublicAPI conflicts by retaining both the latest converter entries and the alert and gesture extension contracts across every TFM. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66f84348-6476-4097-8b7f-f240338e85c3
|
Resolved the new |
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Fresh main CI |
|
/azp run maui-pr |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Replacement main |
|
/azp run maui-pr |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Device CI |
AI Review Summary
🗂️ Review Sessions — click to expand🚦 Gate — Test Before & After FixGate Result: ✅ PASSEDPlatform: ANDROID · Base: net11.0 · Merge base:
🔴 Without fix — 🧪 AlertManagerTests: FAIL ✅ · 81sError-relevant lines (filtered from the build log): 🟢 With fix — 🧪 AlertManagerTests: PASS ✅ · 56s(no coded error found; showing last 1200 chars) 🔴 Without fix — 📱 PageTests:
|
| Category | Tests | Snapshot diffs |
|---|---|---|
Page |
26/26 ✓ | 1 diff PNG |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🔗 Regression Cross-Reference
🔍 Regression Cross-Reference
⚠ Overlaps with prior bug-fix PRs — same files modified, but no exact line revert detected.
| File | Fix PR | Fixed issue(s) |
|---|---|---|
src/Controls/src/Core/Page/Page.cs |
#35916 |
🧪 Regression Tests to Verify
These tests were added by the overlapping fix PRs. Running them to verify no side-effect regressions:
| Fix PR | Type | Test | Filter |
|---|---|---|---|
| #35916 | UITest | Issue35756 | Issue35756 |
🧪 Regression Test Results
❌ FAILED — 0 passed, 1 failed, 0 skipped
| Fix PR | Test | Type | Result |
|---|---|---|---|
| #35916 | Issue35756 | UITest | ❌ FAILED |
📋 Pre-Flight — Context & Validation
Issue: #34104 - Restore public AlertManager extension points (part of #34099)
PR: #36633 - [Extensibility] Controls: Restore public AlertManager interfaces
Platforms Affected: All Controls TFMs (net, Android, iOS, MacCatalyst, Windows, Tizen, netstandard); test platform requested: android
Files Changed: 19 implementation/API/docs files, 2 test files
Key Findings
- The PR restores
Microsoft.Maui.Controls.Platform.IAlertManagerandIAlertManagerSubscriptionfrominternaltopublicand adds matchingPublicAPI.Unshipped.txtentries for all Controls TFMs. - The current PR fix also updates public-contract documentation for
AlertArguments,ActionSheetArguments, andPromptArguments, removesEditorBrowsable(Never)from those argument DTOs, and corrects obsolete page-busy wording. - Added focused unit tests assert the alert interfaces are public and the argument DTOs are public/discoverable. The supplied gate result says tests fail without the PR fix and pass with it.
- Mandatory regression test for every alternative candidate:
pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Issue35756".
Code Review Summary
Verdict: NEEDS_DISCUSSION
Confidence: low
Errors: 0 | Warnings: 0 | Suggestions: 0
Key code review findings:
- ℹ No code correctness findings were identified; the expert reviewer returned
[]. - ℹ CI status could not be authoritatively verified in this environment, so confidence remains low under code-review skill rules.
- ℹ Public API impact is intentional: two platform alert interfaces become public again, and exposed argument DTOs become discoverable.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #36633 | Make IAlertManager/IAlertManagerSubscription public, update all PublicAPI baselines, align argument DTO docs/discoverability, and add visibility/discoverability unit tests. |
✅ PASSED (Gate) | 21 files | Original PR |
🔬 Code Review — Deep Analysis
Code Review — PR #36633
Independent Assessment
What this changes: Restores IAlertManager and IAlertManagerSubscription to the public API surface, adds PublicAPI entries for all TFMs, aligns exposed AlertArguments/ActionSheetArguments/PromptArguments docs with public-contract status, and updates obsolete Page.IsBusy/page-busy wording.
Inferred motivation: Restore third-party alert/dialog extension points that were previously reverted from net11.0, while keeping runtime behavior unchanged.
Reconciliation with PR Narrative
Author claims: Public AlertManager interfaces are restored; argument DTO docs/EditorBrowsable and obsolete wording were fixed; ~ PublicAPI prefix was intentionally not applied; validation passed locally.
Agreement/disagreement: Matches the code. I found no runtime behavior change beyond accessibility/docs. The ~ prefix prior finding appears obsolete: current entries are nullable-annotated and existing shipped obsolete APIs are not sufficient evidence that ~ means obsolete.
Prior Review Reconciliation
| Prior ❌ Error Finding | Source | Status | Evidence |
|---|---|---|---|
| Argument types exposed through public interfaces were hidden/internal-use documented | Copilot/MauiBot | ✅ Fixed | AlertArguments.cs:7-25, ActionSheetArguments.cs:9-27, PromptArguments.cs:7-25 now document public-contract status and no longer use EditorBrowsable(Never). |
RequestPageBusy / OnPageBusy obsolete text said removed in .NET 11 |
MauiBot | ✅ Fixed | IAlertManager.cs:55-59, IAlertManagerSubscription.cs:46-51, AlertManager.cs:101-116, Page.cs:58-59 use future-release/no-replacement wording. |
Obsolete PublicAPI entries need ~ prefix |
MauiBot | 🔄 Obsolete | PR narrative says analyzer validation fails with ~; current entries use nullable annotations. No code evidence supports this as an unresolved blocker. |
| Tests did not directly assert restored interfaces are public | PureWeen | ✅ Fixed | AlertManagerTests.cs:557-568 asserts both interface types are public. |
Blast Radius Assessment
- Runs for all instances: No runtime code path changed; only public accessibility/docs/PublicAPI/test assertions.
- Startup impact: No new startup work.
- Static/shared state: No new static/shared runtime state.
- Public API impact: Yes — two interfaces are restored as public and argument DTO discoverability is changed.
External Output Contract
| Consumer token/pattern | Producer location | Producer emission condition | Consumer assumption | Ordinary negative case | Downstream effect |
|---|---|---|---|---|---|
| N/A | N/A | No changed regex/string classifier for external tool output found | N/A | N/A | N/A |
CI Status
- Required-check result: Undetermined.
gh pr checks --requiredfailed becauseghis unauthenticated. - Classification: Undetermined; public GitHub check-run data was mixed/pending at review time.
- Action taken: Confidence capped low; no LGTM per skill rules.
Findings
No ❌ Error, maui-expert-reviewer returned [].
Failure-Mode Probing
- Custom
IAlertManagerregistered in DI:Window.TryResolveAlertManager()resolves it and callsSubscribe(); unchanged behavior. - Interface re-hidden in a future PR: new
AlertManagerInterfacesArePublictest fails even with InternalsVisibleTo. - Page-busy obsolete members: retained with default interface bodies where supported, so existing
Page.IsBusyforwarding still compiles. - Argument DTO usability: constructors/properties remain public and no longer hidden from IntelliSense.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: I found no current code blocker in the PR’s public API restoration. However, required CI could not be authoritatively verified from this environment, so the skill rules prohibit LGTM.
🛠️ Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix-1 | Minimal public surface: make IAlertManager / IAlertManagerSubscription public, remove EditorBrowsable(Never) from exposed argument DTOs, add PublicAPI entries. |
✅ PASS tests, not selected | 12 files | Passed AlertManagerTests and Android Issue35756, but left previously identified public-contract documentation/obsolete-message concerns unresolved. |
| 2 | try-fix-2 | Public-contract-only documentation: candidate 1 plus fixes to interface obsolete wording and argument DTO XML docs, while avoiding implementation/platform/Page/doc-polish edits. | ✅ PASS | 12 files | Passed all required tests and addresses candidate 1's quality gap with a smaller surface than the PR. |
| PR | PR #36633 | Make alert interfaces public; add PublicAPI entries; update argument DTO docs/discoverability; update obsolete wording across interfaces, Page, implementation/platform files, and delegate docs; add tests. | ✅ PASSED (Gate) | 21 files | Original PR; broader documentation normalization. |
Candidate Details
try-fix-1 — Minimal Public Surface
- Approach: Restored the two interfaces and API baselines, removed
EditorBrowsable(Never)from the exposed argument DTOs, and avoided documentation/obsolete-message cleanup. - Primary test:
dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --filter "FullyQualifiedName~AlertManagerTests" --no-restore— ✅ 29/29 passed. - Regression test:
pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Issue35756"— ✅ passed on Android emulator. - Failure/learning: Test-pass was not enough: expert-review context required fixing misleading public API documentation. This candidate left DTO docs implying internal-only use and left interface page-busy obsolete text claiming removal in .NET 11, so it was not demonstrably better than the PR.
- Diff/artifacts:
CustomAgentLogsTmp/PRState/36633/PRAgent/try-fix/attempt-1/andCustomAgentLogsTmp/PRState/36633/PRAgent/try-fix-1/content.md.
try-fix-2 — Public-Contract-Only Documentation
- Approach: Restored public interfaces, removed
EditorBrowsable(Never)from the argument DTOs, added PublicAPI entries, and updated only the XML docs/obsolete messages directly visible through the public alert contract (IAlertManager,IAlertManagerSubscription,AlertArguments,ActionSheetArguments,PromptArguments). It intentionally did not touchPage.cs,AlertManager.cs, platformAlertManager.*.cs,DelegateAlertSubscription.cs, or tests. - Primary test:
dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --filter "FullyQualifiedName~AlertManagerTests" --no-restore— ✅ 29/29 passed. - Regression test:
pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Issue35756"— ✅ 1/1 passed on Android emulator. - Self-review:
reviewer-findings.json=[]. - Diff/artifacts:
CustomAgentLogsTmp/PRState/36633/PRAgent/try-fix/attempt-2/andCustomAgentLogsTmp/PRState/36633/PRAgent/try-fix-2/content.md.
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 1 | Yes | Candidate 1 tested the smallest public-surface hypothesis; it passed tests but failed selection due documentation quality gaps. |
| claude-opus-4.7 | 1 | Yes | Candidate 2 incorporated candidate 1's lesson and limited documentation fixes to the public contract. |
| gpt-5.3-codex | N/A | Not queried | Stopped per user criterion after candidate 2 passed all tests and was demonstrably narrower than the PR while preserving public-contract quality. |
| gpt-5.5 | N/A | Not queried | Stopped per user criterion after candidate 2 passed all tests and was demonstrably narrower than the PR while preserving public-contract quality. |
Exhausted: No — stopped because candidate 2 passed all tests and is a viable, narrower alternative.
Selected Fix: Candidate #2 — It keeps the externally visible API restoration and necessary public-contract documentation corrections, passes the focused unit tests and mandatory Android Issue35756 regression, and avoids the PR's extra implementation/platform/Page documentation edits. The PR remains broader and more globally consistent; candidate #2 is preferable if the goal is the smallest correct fix for the alert extensibility regression.
🏁 Report — Final Recommendation
Comparative Report — PR #36633
Candidates compared
| Candidate | Result | Strengths | Weaknesses |
|---|---|---|---|
pr |
✅ Gate passed | Restores the two public AlertManager interfaces, restores all PublicAPI baselines, makes exposed argument DTOs discoverable, updates public-contract docs, and adds focused regression/unit coverage. | Expert reviewer found two moderate public API documentation issues: the obsolete busy methods are optional only on TFMs with default interface methods, but are required under netstandard2.0. |
pr-plus-reviewer |
✅ Targeted unit tests passed; gate inherited from PR | Keeps the PR's complete restoration and tests, and fixes the expert-review documentation issue by explicitly documenting the default-interface-method / netstandard2.0 implementation split. |
Slightly longer obsolete messages, but the extra wording is justified by public cross-target behavior. |
try-fix-1 |
✅ Passed primary and Android regression tests | Smallest functional public-surface restoration. | Leaves the public argument DTO documentation under-specified/misleading and leaves stale obsolete wording; also has the same cross-target busy-member ambiguity once the interfaces become public. |
try-fix-2 |
✅ Passed primary and Android regression tests | Narrower than the PR while fixing candidate 1's most important public-contract documentation gaps. | Still has the same default-interface-method / netstandard2.0 ambiguity in the public busy-member docs; omits the PR's broader tests/docs normalization outside the strict public contract. |
No candidate in STEP 5a failed the required regression tests. If any candidate had failed regression tests, it would be ranked below the passing candidates by rule.
Ranking
pr-plus-reviewer— best overall. It preserves the PR's complete tested fix and resolves the only expert-review findings.pr— functionally correct and tested, but should not beatpr-plus-reviewerbecause the expert-review findings remain unaddressed.try-fix-2— viable narrower alternative, but lower than the PR-based reviewer candidate because it still carries the same busy-member documentation ambiguity and omits the PR's focused test additions from the candidate diff.try-fix-1— passes tests, but leaves more public-contract documentation debt than every other passing candidate.
Winning candidate
Winner: pr-plus-reviewer
pr-plus-reviewer is the single winning candidate because it keeps the raw PR's proven API restoration and test coverage, then applies the expert review's only actionable feedback. The change is documentation/obsolete-message-only on the newly public interfaces and does not alter runtime behavior or public member shape.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
Document that obsolete busy members may be omitted only on TFMs with default interface methods and require an empty implementation on netstandard2.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66f84348-6476-4097-8b7f-f240338e85c3
|
Applied the final public-contract review follow-up in |
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
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
Restores the public AlertManager extension points on
net11.0.PR #34228 introduced
IAlertManagerandIAlertManagerSubscriptionas public APIs for third-party platform backends, addressing #34104 under #34099. PR #35024 reverted that public surface for the servicing release, leaving the interfaces internal onnet11.0.This PR makes only these two existing interfaces public again:
Microsoft.Maui.Controls.Platform.IAlertManagerMicrosoft.Maui.Controls.Platform.IAlertManagerSubscriptionIt also restores their
PublicAPI.Unshipped.txtentries across all seven TFMs. Interface method signatures and runtime behavior are unchanged; documentation,EditorBrowsable, and obsolete-message metadata are aligned with the restored public contract.Gesture APIs are intentionally no longer part of this PR. Their public factory contract and the incompatible-handler fix are owned by #36655, which builds on merged PR #33365.
Review follow-ups
Addressed the review findings on the public surface:
IAlertManager/IAlertManagerSubscriptionpublic exposesAlertArguments,ActionSheetArgumentsandPromptArguments(inMicrosoft.Maui.Controls.Internals) as part of the contract. These were alreadypublicbut marked[EditorBrowsable(Never)]and documented "for internal use only", which was contradictory. Applied the smallest safe change: removed the[EditorBrowsable(Never)]attribute and replaced the misleading remarks with documentation stating the types are part of the stable public contract. Namespaces and signatures are unchanged, so there is no public API shape change (noPublicAPI.*.txtedits are required). All argument properties that external implementers consume are public and usable.RequestPageBusy/OnPageBusy(kept as obsolete DIMs becausePage.IsBusystill routes through them) previously claimed they were "obsolete in .NET 10 and will be removed in .NET 11". Both interfaces wereinternalin .NET 10 and are being shipped (not removed) in .NET 11, so the doc comments and[Obsolete]messages now use version-agnostic "will be removed in a future release" wording.~-prefix request intentionally not applied. A review comment asked to prefix the obsoleteRequestPageBusy/OnPageBusyPublicAPI.Unshipped.txtentries with~. This was investigated and is incorrect: the~prefix marks nullable-oblivious entries, not obsolete ones. These entries are nullable-annotated (Page!), so adding~makes theMicrosoft.CodeAnalysis.PublicApiAnalyzersvalidation fail withRS0016("is not part of the declared public API"). Verified empirically by running the analyzer inValidatemode both ways, and confirmed by existing precedent ([Obsolete]Microsoft.Maui.IBorderis listed without~inPublicAPI.Shipped.txt). The entries are therefore kept without~.Merge note
This PR is configured for a merge commit. Do not use the original first commit message as the merge description: it predates the alert-only split and contains a stale
Fixes #33364line. #33364 was owned and closed by merged PR #36655, and must not be attributed to this alert PR.Issues
DisplayAlert,DisplayActionSheet,DisplayPromptAsync) needs a public extensibility point #34104Validation
Controls.Core.csprojbuilds fornet11.0with 0 warnings and 0 errors, includingPublicAPIanalyzer validation (PublicApiType=Validate).AlertManagerTestspass (29/29), including direct assertions thatIAlertManagerandIAlertManagerSubscriptionremain public and theAlertArgumentTypesArePartOfSupportedPublicContracttheory that guards the argument types staying public and notEditorBrowsableState.Never.Net11 base synchronization (
92aaa2f7d77)net11.0without rebasing or rewriting history. The only conflicts were fivePublicAPI.Unshipped.txtfiles; each now retains the base converter additions plus the alert and gesture contracts, matching the auto-merged Windows/Tizen ordering.AlertManagerTestspass 29/29 andControls.Corebuilds fornet11.0with PublicAPI validation enabled, zero warnings, and zero errors.14817878and fresh CI builds1533204 / 1533205 / 1533206are active. Main1533204hit an Azure Node/libuvUseDotNetcrash before test execution; replacement1533239then hit the same cross-PR transient.buildtasksstaging failure as [Extensibility] Essentials: Bridge DI implementations to static facades #36657, so main was rerun as1533275. Auto-merge remains armed with the merge-commit method.Final cross-target contract clarification (
368320180c4)netstandard2.0implementers must provide an empty implementation. Runtime behavior and API signatures are unchanged.AlertManagerTestsremain 29/29 andControls.Corebuilds fornet11.0with PublicAPI validation enabled, zero warnings, and zero errors.14819533and current-head CI builds1533477 / 1533478 / 1533479are active. Auto-merge remains armed with the merge-commit method.