Repository navigation
[net11.0] Make remaining platform APIs public - #37945
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37945Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37945" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/Core/src/Platform/iOS/SemanticExtensions.cs — In the 2-parameter PostAccessibilityFocusNotification overload, the extension receiver… |
What changed in this PR
This PR promotes several remaining .NET 11 platform API “TODO” items to public across iOS/MacCatalyst, Android, and Windows, and updates the corresponding platform-specific PublicAPI.Unshipped.txt entries to match the newly exposed surface area.
Changes:
- Windows: Make
Microsoft.Maui.Platform.MauiBorderAutomationPeer(and ctor) public and add its public/protected API entries. - iOS/MacCatalyst: Make
SemanticExtensions.PostAccessibilityFocusNotificationoverloads public and add API entries. - Android: Make
WindowExtensions.ConfigureTranslucentSystemBarspublic and add API entry. - Controls iOS/MacCatalyst: Make
Editor.MapAutoSizepublic and add API entries.
| File | Description |
|---|---|
| src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt | Adds PublicAPI entries for MauiBorderAutomationPeer and its protected overrides now that the type is public. |
| src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Adds PublicAPI entries for the newly public SemanticExtensions.PostAccessibilityFocusNotification overloads. |
| src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Adds PublicAPI entries for the newly public SemanticExtensions.PostAccessibilityFocusNotification overloads. |
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Adds PublicAPI entry for WindowExtensions.ConfigureTranslucentSystemBars. |
| src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs | Promotes MauiBorderAutomationPeer and its constructor to public with XML docs. |
| src/Core/src/Platform/iOS/SemanticExtensions.cs | Promotes PostAccessibilityFocusNotification overloads to public and adds XML docs. |
| src/Core/src/Platform/Android/WindowExtensions.cs | Promotes ConfigureTranslucentSystemBars to public and adds XML docs. |
| src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Adds PublicAPI entry for Editor.MapAutoSize on MacCatalyst. |
| src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Adds PublicAPI entry for Editor.MapAutoSize on iOS. |
| src/Controls/src/Core/Editor/Editor.iOS.cs | Promotes Editor.MapAutoSize to public with XML docs. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b04b632c-3a21-4bbc-ae04-f99ab2370ea4
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
src/Core/src/Platform/iOS/SemanticExtensions.cs — In the 2-parameter PostAccessibilityFocusNotification overload, the extension receiver… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/Core/src/Platform/iOS/SemanticExtensions.cs:45
- The 1-parameter PostAccessibilityFocusNotification overload is now public but does not validate
platformView(unlike the 2-parameter overload). For a public API, it’s better to make the null contract explicit (and document it) rather than potentially passing null into UIKit.
/// <remarks>This method must be called on the UI thread.</remarks>
public static void PostAccessibilityFocusNotification(this UIView platformView)
{
UIAccessibility.PostNotification(UIAccessibilityPostNotification.ScreenChanged, platformView);
}
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b04b632c-3a21-4bbc-ae04-f99ab2370ea4
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@jfversluis — new AI review results are available based on commit
f314c3a.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ SKIPPED
No tests were detected in this PR.
Recommendation: Add tests to verify the fix using the write-tests-agent.
📋 Pre-Flight — Context & Validation
Issue: #30205 - [NET 11.0][Windows] Expose MauiBorderAutomationPeer as public for Border
PR: #37945 - [net11.0] Make remaining platform APIs public
Platforms Affected: Android, iOS, Mac Catalyst, Windows
Files Changed: 10 implementation/API-surface, 0 test
Key Findings
- The materialized PR commit promotes four existing platform APIs from
internaltopublic:Editor.MapAutoSize,WindowExtensions.ConfigureTranslucentSystemBars,MauiBorderAutomationPeerand its constructor, and bothSemanticExtensions.PostAccessibilityFocusNotificationoverloads. - Six platform-specific
PublicAPI.Unshipped.txtfiles record the newly public signatures. The current local squash contains 53 additions and 15 deletions. - The linked issue requests the Windows
MauiBorderAutomationPeerexposure. The PR deliberately completes three additional explicit .NET 11 visibility TODOs. - The current revision explicitly validates the non-null Android
Activityand both non-null iOS extension receivers. This resolves the only inline review comment. - Gate result supplied by the caller: SKIPPED - no tests detected in this PR. The gate was not rerun.
- For bounded iOS candidate validation, the nearest existing targeted regression is the Controls device-test
Accessibilitycategory:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Accessibility". - The worktree contains pre-existing unrelated tracked and untracked changes under
.github/andeng/. Candidate attempts must preserve them and obey the try-fix baseline/restore protocol.
Code Review Summary
Verdict: SKIPPED
Confidence: N/A
Errors: 0 | Warnings: 0 | Suggestions: 0
Key code review findings:
- A separate expert-review agent was intentionally not launched; the execution contract defers the dedicated expert pass to STEP 5b.
- The try-fix skill's required inline self-review remains mandatory for each candidate.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #37945 | Directly promote four existing platform APIs, document their contracts, validate newly public non-null arguments, and update six API manifests | SKIPPED (no PR tests detected) | 10 files | Original PR |
Changed Files
src/Controls/src/Core/Editor/Editor.iOS.cssrc/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txtsrc/Core/src/Platform/Android/WindowExtensions.cssrc/Core/src/Platform/Windows/MauiBorderAutomationPeer.cssrc/Core/src/Platform/iOS/SemanticExtensions.cssrc/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txtsrc/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txtsrc/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txtsrc/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
🔬 Code Review — Deep Analysis
Code Review — PR #37945
Independent Assessment
What this changes: Promotes four existing platform-specific API groups to public visibility for .NET 11, adds XML documentation and platform-specific public API baselines, and introduces argument validation on the newly public Android and iOS entry points.
Inferred motivation: External consumers need supported access to platform helpers and the Windows MauiBorderAutomationPeer that were previously internal despite explicit TODOs to expose them.
Findings
⚠️ Warning — The two-view iOS overload exposes an unclear receiver contract
src/Core/src/Platform/iOS/SemanticExtensions.cs:58 validates the extension receiver but otherwise ignores it and posts only for inputView. A null inputView silently does nothing, which makes the two overloads asymmetric and freezes a surprising public contract. Preserve the required API identity but document that the receiver is not the notification target and that a null inputView is a no-op.
⚠️ Warning — The Android receiver's null behavior is undocumented
src/Core/src/Platform/Android/WindowExtensions.cs:60 documents and enforces a non-null activity, while a null window receiver is accepted and silently skipped by downstream helpers. The public XML contract should state that null is allowed and results in no configuration.
Test Coverage
The trusted Gate was skipped because no tests were detected. The changes primarily expose existing implementations, but the new runtime guards and public contracts have no focused regression coverage.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: The visibility changes and public API baselines are structurally coherent, but two newly public null/target semantics are not accurately documented. Because the API contracts become durable once shipped and required validation is absent, apply the focused documentation corrections and validate the affected projects before preferring this implementation.
🛠️ Try-Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | claude-opus-5 / try-fix |
Compile-time nullable contracts, graceful no-op behavior, and consolidated iOS overload implementation | BLOCKED - baseline not established; test not run | 0 files | The mandatory baseline script rejected the pre-existing dirty worktree before creating an allow-list |
| 2 | gpt-5.6-sol / try-fix |
Mechanism exhaustion: exact CLR API identities require public declarations; wrappers, friends, and IL rewriting do not preserve the requested source API shape | BLOCKED - baseline not established; test not run | 0 files | No genuinely distinct third exposure mechanism exists, and the baseline guard independently prohibited edits |
| PR | PR #37945 | Directly promote four existing platform APIs, add runtime argument guards, and update six API manifests | SKIPPED (Gate) | 10 files | Gate detected no PR tests |
Candidate 1 Narrative
Candidate 1 designed a compile-time-contract alternative to the PR's direct in-place visibility
promotion. It would keep the newly public parameters non-nullable, preserve existing internal runtime
behavior with graceful no-op handling instead of adding new exceptions, and consolidate the two iOS
PostAccessibilityFocusNotification overloads onto one implementation path. This is mechanism-level
different from the PR's distributed runtime fail-fast guards: external misuse is diagnosed at the
caller's compile time while existing in-tree callers do not inherit a new exception path.
The candidate could not be implemented. The mandatory
EstablishBrokenBaseline.ps1 command rejected approximately 58 pre-existing tracked changes under
.github/ and eng/; .github/.baseline-state.json was never created, so no tracked file was
legally editable or safely restorable. The attempt preserved those caller-owned changes, captured an
explicitly empty diff and zero inline self-review findings, did not run the targeted iOS Accessibility
device test against unchanged code, and ran the exact mandatory restore command. Restore reported the
expected no-state result (Restored False) because baseline setup failed before any edit.
Full narrative: ../try-fix-1/content.md
Candidate 2 Narrative
Candidate 2 evaluated the remaining mechanism space after excluding both the PR's direct promotion
with runtime guards and Candidate 1's nullable/no-op/overload-consolidation design. C# and CLR
accessibility is encoded on the exact declaration and bounded by its declaring type. A wrapper,
forwarding extension, replacement type, or inherited member has a different API identity;
InternalsVisibleTo does not support arbitrary callers; a partial type cannot redeclare the same
signature with different accessibility; reflection does not create a source-visible public symbol;
and post-build IL rewriting would evade the source public API analyzer. Runtime null handling and body
factoring are contract choices, not distinct mechanisms for exposing the requested exact APIs.
Candidate 2 therefore declined to manufacture a disguised duplicate. Independently, the mandatory
baseline command rejected the same approximately 58 pre-existing .github/ and eng/ changes before
creating .github/.baseline-state.json. No tracked file was edited, the captured diff is explicitly
empty, the targeted iOS Accessibility device test was not run against unchanged code, and the inline
self-review recorded zero findings. The exact restore command completed with the accepted no-state
result (Restored False).
Full narrative: ../try-fix-2/content.md
Comparison
Candidate 1 is the only conceptual behavior-level alternative: it changes public-boundary null
enforcement and consolidates the iOS implementation while still requiring public metadata. Candidate
2 establishes that there is no separate accessibility mechanism capable of exposing the exact API
identities. Neither alternative was implementable or testable in this worktree because the mandatory
baseline could not be established. The PR remains the only implemented candidate, but the supplied
Gate result is merely SKIPPED, not positive validation.
Execution State
Completed candidates: 2 of 2.
Exhausted: Yes - both permitted models were invoked exactly once and no additional candidate or
reviewer invocation is allowed in STEP 5a.
Selected fix: PR #37945 provisionally, because it is the only implemented exposure mechanism.
This is not a positive test result: Gate found no PR tests and both alternatives were blocked before
implementation.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr-plus-reviewer
The submitted PR uses the only viable mechanism for exposing the requested exact CLR API identities: promote the existing declarations in place and record their platform-specific public API signatures. The expert pass found two durable-contract gaps in that implementation, both in documentation for intentionally nullable or non-target parameters. pr-plus-reviewer preserves the submitted signatures and runtime behavior, resolves both findings with one focused 2-file XML-documentation patch, and is the only candidate with positive targeted validation.
Comparative ranking
| Rank | Candidate | Implementation | Validation | Expert assessment | Outcome |
|---|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Complete PR fix plus precise Android and iOS public-contract documentation | PASS — iOS Controls Accessibility: 8 passed, 0 failed; XHarness exit 0 | Resolves both inline findings without changing API shape or behavior | Winner |
| 2 | pr |
Complete 10-file visibility/API-baseline change | Gate SKIPPED — no PR tests detected | Two moderate public API documentation findings remain | Lower than the validated refinement |
| 3 | try-fix-1 |
Concept only: compile-time null contracts, graceful no-op behavior, and iOS overload consolidation; no files changed | BLOCKED before implementation; test not run | Alters runtime contract and never produced a reviewable diff | Not eligible to win |
| 4 | try-fix-2 |
Mechanism-exhaustion analysis only; no alternate implementation or files changed | BLOCKED before implementation; test not run | Correctly observes that wrappers/friends/IL rewriting cannot expose the same API identities, but supplies no candidate | Not eligible to win |
No candidate failed a regression test. The ranking therefore gives the successfully validated implementation priority over the skipped and blocked candidates, consistent with the required test-result ordering.
Expert findings and resolution
SemanticExtensions.PostAccessibilityFocusNotification(UIView?)validates but does not target its extension receiver, and a nullinputViewis a no-op. The winning patch documents both facts.WindowExtensions.ConfigureTranslucentSystemBarsaccepts a nullableWindowreceiver but the submitted XML documentation did not explain that null silently skips configuration. The winning patch documents that contract.
The raw PR remains accurate in its public API declarations, platform manifests, and overall approach. Request changes only because the winning reviewer refinement is not present in submitted PR HEAD and the trusted Gate did not permit approval.
Required change
Apply pr-plus-reviewer/reviewer.patch to the PR. Its complete candidate source diff is available at pr-plus-reviewer/candidate.patch; no additional repair or test iteration was performed.
📱 UI Tests — Editor,ViewBaseTests
Detected UI test categories: Editor,ViewBaseTests
✅ Deep UI tests — 197 passed, 0 failed, 4 skipped across 2 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
Editor |
85/89 (4 skipped) ✓ | — |
ViewBaseTests |
112/112 ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The refined PR preserves the only viable exact API-exposure mechanism while resolving both expert findings with precise public-contract documentation. It also passed the targeted iOS Accessibility run (8 passed, 0 failed), whereas the raw PR was unvalidated and both try-fix candidates were blocked without implementations.
Address the actionable findings in this review before merging.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b04b632c-3a21-4bbc-ae04-f99ab2370ea4

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!
Summary
Promotes the remaining explicit .NET 11 platform API TODOs to public:
Editor.MapAutoSizeon iOS and Mac CatalystWindowExtensions.ConfigureTranslucentSystemBarson AndroidMauiBorderAutomationPeerand its constructor on WindowsSemanticExtensions.PostAccessibilityFocusNotificationoverloads on iOS and Mac CatalystAdds XML documentation and the corresponding platform-specific
PublicAPI.Unshipped.txtentries. All exposed signatures use types that were already public.Closes #30205
Validation
Controls.Core.csproj/Core.csproj—net11.0-windows10.0.19041.0Controls.Core.csproj/Core.csproj—net11.0-android37.0Controls.Core.csproj/Core.csproj—net11.0-ios26.5Controls.Core.csproj/Core.csproj—net11.0-maccatalyst26.5