Skip to content

[net11.0] Make remaining platform APIs public - #37945

Merged
kubaflo merged 4 commits into
net11.0from
jfversluis-finish-net11-visibility-apis
Aug 28, 2026
Merged

kubaflo merged 4 commits into
net11.0from
jfversluis-finish-net11-visibility-apis

Conversation

@jfversluis

Copy link
Copy Markdown
Member

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.MapAutoSize on iOS and Mac Catalyst
  • WindowExtensions.ConfigureTranslucentSystemBars on Android
  • MauiBorderAutomationPeer and its constructor on Windows
  • Both SemanticExtensions.PostAccessibilityFocusNotification overloads on iOS and Mac Catalyst

Adds XML documentation and the corresponding platform-specific PublicAPI.Unshipped.txt entries. All exposed signatures use types that were already public.

Closes #30205

Validation

  • Controls.Core.csproj / Core.csproj — net11.0-windows10.0.19041.0
  • Controls.Core.csproj / Core.csproj — net11.0-android37.0
  • Controls.Core.csproj / Core.csproj — net11.0-ios26.5
  • Controls.Core.csproj / Core.csproj — net11.0-maccatalyst26.5

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 28, 2026 13:07
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37945

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37945"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added s/agent-review-in-progress AI review is currently running for this PR and removed s/agent-review-in-progress AI review is currently running for this PR labels Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity 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.PostAccessibilityFocusNotification overloads public and add API entries.
  • Android: Make WindowExtensions.ConfigureTranslucentSystemBars public and add API entry.
  • Controls iOS/MacCatalyst: Make Editor.MapAutoSize public 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.

@kubaflo kubaflo added the s/agent-review-in-progress AI review is currently running for this PR label Aug 28, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b04b632c-3a21-4bbc-ae04-f99ab2370ea4
Copilot AI review requested due to automatic review settings August 28, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Lite
Findings: None

Issues resolved since last review (1)
Severity Finding
Low severity 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);
		}

@MauiBot

This comment has been minimized.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Aug 28, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b04b632c-3a21-4bbc-ae04-f99ab2370ea4
Copilot AI review requested due to automatic review settings August 28, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Lite
Findings: None

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added s/agent-review-in-progress AI review is currently running for this PR and removed s/agent-review-in-progress AI review is currently running for this PR labels Aug 28, 2026
@kubaflo kubaflo added the s/agent-review-in-progress AI review is currently running for this PR label Aug 28, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 2 findings

See inline comments for details.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

@jfversluis — new AI review results are available based on commit f314c3a.

Gate No Tests Confidence Low Platform Android


🗂️ 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 internal to public: Editor.MapAutoSize, WindowExtensions.ConfigureTranslucentSystemBars, MauiBorderAutomationPeer and its constructor, and both SemanticExtensions.PostAccessibilityFocusNotification overloads.
  • Six platform-specific PublicAPI.Unshipped.txt files record the newly public signatures. The current local squash contains 53 additions and 15 deletions.
  • The linked issue requests the Windows MauiBorderAutomationPeer exposure. The PR deliberately completes three additional explicit .NET 11 visibility TODOs.
  • The current revision explicitly validates the non-null Android Activity and 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 Accessibility category:
    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/ and eng/. 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.cs
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
  • src/Core/src/Platform/Android/WindowExtensions.cs
  • src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs
  • src/Core/src/Platform/iOS/SemanticExtensions.cs
  • src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
  • src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
  • src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
  • src/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

  1. SemanticExtensions.PostAccessibilityFocusNotification(UIView?) validates but does not target its extension receiver, and a null inputView is a no-op. The winning patch documents both facts.
  2. WindowExtensions.ConfigureTranslucentSystemBars accepts a nullable Window receiver 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.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Aug 28, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b04b632c-3a21-4bbc-ae04-f99ab2370ea4
Copilot AI review requested due to automatic review settings August 28, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Lite
Findings: None

@kubaflo
kubaflo merged commit 3f2685b into net11.0 Aug 28, 2026
32 of 35 checks passed
@kubaflo
kubaflo deleted the jfversluis-finish-net11-visibility-apis branch August 28, 2026 23:05
@github-actions github-actions Bot added this to the .NET 11.0-preview7 milestone Aug 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-core-platform Integration with platforms platform/android platform/ios platform/macos macOS / Mac Catalyst platform/windows s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants