Skip to content

[.NET 11] Make overdue handler mapper APIs public - #37946

Merged
kubaflo merged 4 commits into
net11.0from
jfversluis-fix-overdue-visibility-apis
Aug 29, 2026
Merged

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

Conversation

@jfversluis

@jfversluis jfversluis commented Aug 28, 2026 •

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!

Description of Change

Promotes five implemented platform handler mapper methods that were scheduled to become public in .NET 10 but remained internal:

  • Android CarouselViewHandler.MapLoop
  • Android CarouselViewHandler.MapItemsLayout
  • iOS/MacCatalyst CarouselViewHandler2.MapItemsLayout
  • Windows ShellHandler.MapFlyoutBackgroundImage
  • Windows SwitchHandler.MapSwitchMinimumWidth

These mapper entry points have clear handler-customization value and match the visibility of equivalent mapper methods on other handlers and platforms. MapSwitchMinimumWidth uses the strongly typed (ISwitchHandler, ISwitch) mapper contract while retaining the existing concrete SwitchHandler behavior gate; the other methods retain their existing signatures. Control behavior is unchanged. MapFlyoutBackgroundImage now uses the handler-aware FireAndForget overload so unexpected asynchronous failures are logged through the handler's service provider. The applicable Android, iOS, Mac Catalyst, and Windows PublicAPI.Unshipped.txt baselines are updated.

Tizen's ShellHandler.MapFlyoutBackgroundImage remains internal because it is an unimplemented no-op.

Issues Fixed

N/A

Validation

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

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:12
@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 -- 37946

Or

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

@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: None

What changed in this PR

This PR promotes several previously-internal platform handler mapper entry points to public for .NET 11, enabling app/handler customization scenarios without changing runtime behavior, and updates the corresponding PublicAPI baselines.

Changes:

  • Make mapper methods public for Windows SwitchHandler and Windows ShellHandler.
  • Make mapper methods public for Android CarouselViewHandler and iOS/MacCatalyst CarouselViewHandler2.
  • Update PublicAPI.Unshipped.txt files for the affected TFMs to reflect the new public surface.
File Description
src/​Core/​src/​PublicAPI/​net-windows/​PublicAPI.Unshipped.txt Adds the newly-public Windows SwitchHandler.MapSwitchMinimumWidth API entry.
src/​Core/​src/​Handlers/​Switch/​SwitchHandler.Windows.cs Changes MapSwitchMinimumWidth from internal → public.
src/​Controls/​src/​Core/​PublicAPI/​net-windows/​PublicAPI.Unshipped.txt Adds the newly-public Windows ShellHandler.MapFlyoutBackgroundImage API entry.
src/​Controls/​src/​Core/​PublicAPI/​net-maccatalyst/​PublicAPI.Unshipped.txt Adds the newly-public CarouselViewHandler2.MapItemsLayout API entry for MacCatalyst.
src/​Controls/​src/​Core/​PublicAPI/​net-ios/​PublicAPI.Unshipped.txt Adds the newly-public CarouselViewHandler2.MapItemsLayout API entry for iOS.
src/​Controls/​src/​Core/​PublicAPI/​net-android/​PublicAPI.Unshipped.txt Adds the newly-public Android CarouselViewHandler mapper API entries (MapItemsLayout, MapLoop).
src/​Controls/​src/​Core/​Handlers/​Shell/​ShellHandler.Windows.cs Changes MapFlyoutBackgroundImage from internal → public.
src/​Controls/​src/​Core/​Handlers/​Items2/​CarouselViewHandler2.iOS.cs Changes MapItemsLayout from internal → public.
src/​Controls/​src/​Core/​Handlers/​Items/​CarouselViewHandler.Android.cs Changes MapLoop and MapItemsLayout from internal → public.
Suppressed comments (2)

src/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cs:149

  • handler?.PlatformView is misleading here because handler has already been dereferenced (handler.GetRequiredService(...)). The null-conditional can’t prevent a null-ref and suggests a level of null-safety that isn’t present. Also, GetRequiredService will throw if the service is missing, so provider is not null is redundant.
			var provider = handler.GetRequiredService<IImageSourceServiceProvider>();
			if (handler?.PlatformView is not null && provider is not null)
			{
				handler.PlatformView.UpdateBackgroundImageSourceAsync(view.FlyoutBackgroundImage, provider, view.FlyoutBackgroundImageAspect).FireAndForget();
			}

src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs:104

  • handler?.UpdateLayout() doesn’t actually make this method null-safe because handler is dereferenced on the next line. Either consistently assume non-null (as mapper calls do) or add a full null guard; as-written it’s confusing and can mask real nullability issues now that this API is public.
		public static void MapItemsLayout(CarouselViewHandler2 handler, CarouselView carouselView)
		{
			handler?.UpdateLayout();
			(handler.Controller as CarouselViewController2)?.UpdateScrollingConstraints();
		}

@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 — 3 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@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: 19a4b089-5da9-4802-80d0-b1aa2de1e012
Copilot AI review requested due to automatic review settings August 28, 2026 17: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: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity src/​Controls/​src/​Core/​Handlers/​Shell/​ShellHandler.Windows.cs — FireAndForget() without a handler/logger will swallow exceptions in Release builds with no…

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 19a4b089-5da9-4802-80d0-b1aa2de1e012
Copilot AI review requested due to automatic review settings August 28, 2026 18:09

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
Medium severity src/​Controls/​src/​Core/​Handlers/​Shell/​ShellHandler.Windows.cs — FireAndForget() without a handler/logger will swallow exceptions in Release builds with no… View resolved comment

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot 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 — 1 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR s/agent-review-in-progress AI review is currently running for this PR labels Aug 28, 2026
Keep the public typed mapper signature while retaining the existing concrete SwitchHandler behavior gate for custom handlers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 19a4b089-5da9-4802-80d0-b1aa2de1e012
Copilot AI review requested due to automatic review settings August 29, 2026 00:21

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 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Medium severity src/​Core/​src/​Handlers/​Switch/​SwitchHandler.Windows.cs — MapSwitchMinimumWidth is now public and uses the strongly-typed (ISwitchHandler, ISwitch)…
Low severity src/​Controls/​src/​Core/​Handlers/​Shell/​ShellHandler.Windows.cs — PR description says "Runtime behavior is unchanged", but MapFlyoutBackgroundImage now uses…

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Aug 29, 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 — 1 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 b9743c2.

Gate No Tests Confidence Low Platform Windows


🗂️ 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

PR #37946 Pre-Flight

Context

  • Title: [.NET 11] Make overdue handler mapper APIs public
  • State: Open, targeting net11.0
  • PR head: b9743c281457a44d12ce6bf21f5484e4fd4c8d15
  • Materialized review commit: 487eec6bc97f575563f644e2a2a00096a08b0182
  • Issue: None (Issues Fixed: N/A)
  • Intent: Promote five implemented platform mapper methods from internal to public so handler customizations can call them:
    • Android CarouselViewHandler.MapLoop
    • Android CarouselViewHandler.MapItemsLayout
    • iOS/MacCatalyst CarouselViewHandler2.MapItemsLayout
    • Windows ShellHandler.MapFlyoutBackgroundImage
    • Windows SwitchHandler.MapSwitchMinimumWidth
  • Gate: SKIPPED because the PR adds no tests. Gate verification must not be rerun.
  • Test platform: Windows.

Direct Diff Assessment

The PR changes 9 files (+18/-17):

  1. CarouselViewHandler.Android.cs: removes overdue TODOs and makes MapLoop and MapItemsLayout public without changing their signatures or bodies.
  2. CarouselViewHandler2.iOS.cs: makes MapItemsLayout public and changes handler?.UpdateLayout() to handler.UpdateLayout().
  3. ShellHandler.Windows.cs: makes MapFlyoutBackgroundImage public, changes its null guard, removes a redundant provider null check after GetRequiredService, and changes .FireAndForget() to .FireAndForget(handler).
  4. SwitchHandler.Windows.cs: makes MapSwitchMinimumWidth public, narrows its parameters from (IViewHandler, IView) to (ISwitchHandler, ISwitch), and retains the concrete SwitchHandler behavior gate.
  5. The Android, iOS, MacCatalyst, and two Windows PublicAPI.Unshipped.txt files add the corresponding API entries.

The core requirement is public API exposure. The iOS null-call change, Windows Shell async-observation change, and Windows Switch signature change go beyond visibility and therefore form the main alternative-design surface. Public API baselines must exactly match each candidate's signatures.

Existing Conventions and Constraints

  • Android uses the active Items/ handler; iOS/MacCatalyst uses the active Items2/ handler.
  • Mapper methods are ordinarily public static extension points, and platform mapper signatures must remain compatible with their mapper declarations.
  • Handler mapper updates must preserve mapper extensibility, null/lifecycle safety, native behavior, and UI-thread assumptions.
  • Public API entries must be analyzer-accurate; analyzer suppression is prohibited.
  • Each candidate may modify only files listed by .github/.baseline-state.json after EstablishBrokenBaseline.ps1 runs.
  • The worktree contains unrelated pre-existing changes. Candidates must preserve them and must restore only through pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore.

Bounded Validation

No primary test was detected, and no mandatory regression-test list was supplied. Do not invent or run a full test suite. Use one narrow Windows implementation/API-surface validation pass:

dotnet build src/Controls/src/Core/Controls.Core.csproj -f net11.0-windows10.0.19041.0 --no-restore

This transitively builds Core.csproj and exercises the Windows source and Public API analyzers. Because it is build validation rather than a behavioral test, report that limitation explicitly; do not claim behavioral coverage.


🔬 Code Review — Deep Analysis

Expert PR Evaluation

Independent Assessment

What this changes: The submitted diff promotes five existing platform handler mapper methods from internal to public, records the resulting platform-specific API surfaces, tightens the Windows Switch mapper parameters to ISwitchHandler/ISwitch, and routes Windows Shell background-image task failures through the handler-aware FireAndForget overload.

Inferred motivation: The methods were explicitly marked for public exposure, and making mapper entry points public enables supported handler customization while aligning equivalent platform APIs.

Expert Finding

⚠️ Warning — Public Switch mapper narrows its advertised handler contract

src/Core/src/Handlers/Switch/SwitchHandler.Windows.cs:70 publishes MapSwitchMinimumWidth(ISwitchHandler, ISwitch) but still applies the update only when the handler is the concrete SwitchHandler. A custom ISwitchHandler therefore silently retains WinUI's default minimum width even though ISwitchHandler.PlatformView already exposes the required ToggleSwitch. The implementation should call handler.PlatformView?.UpdateMinWidth(view) directly so its behavior matches the new public interface-level contract.

No actionable issue was found in the Android CarouselView visibility changes, the iOS/MacCatalyst CarouselViewHandler2.MapItemsLayout promotion, the Windows Shell visibility/exception-logging change, or the added PublicAPI.Unshipped.txt entries.

Prior Review Reconciliation

Prior finding Current status Evidence
Major: the broad (IViewHandler, IView) Switch signature would freeze an imprecise API ✅ Fixed in the submitted PR Current HEAD uses (ISwitchHandler, ISwitch) and records that signature in PublicAPI.Unshipped.txt.
Moderate: iOS handler?.UpdateLayout() was followed by an unconditional dereference ✅ Fixed in the submitted PR Current HEAD consistently calls handler.UpdateLayout().
Moderate: Windows Shell checked handler?.PlatformView only after dereferencing the handler and redundantly checked a required service for null ✅ Fixed in the submitted PR Current HEAD checks PlatformView first and then resolves the required service.
Moderate: removing the Switch concrete-type gate broadens behavior to custom handlers ⚠️ Deliberate tradeoff requiring confirmation This is the behavior the new public ISwitchHandler contract advertises; pr-plus-reviewer makes it explicit and consistent rather than silently no-oping.

No unresolved prior ❌ error-level finding was found on the current submitted diff.

Blast Radius and Failure Modes

  • The CarouselView methods retain their existing mapper bodies, so ordinary mapper execution, reconnects, empty collections, loop changes, and layout replacement are unchanged.
  • The Shell mapper remains Windows-only and now checks PlatformView before resolving services; the handler-aware fire-and-forget overload improves error observability without changing image application.
  • The Switch mapper runs for every Windows Switch minimum-width update. The concrete-type gate is observable only for alternate ISwitchHandler implementations, but that is precisely the extensibility scenario exposed by the new public signature.
  • No external tool-output classification or Trim/NativeAOT reachability contract is changed.

Test and Review Evidence

The trusted Gate was skipped because the PR adds no tests. Public check data for submitted HEAD b9743c281457a44d12ce6bf21f5484e4fd4c8d15 shows the platform build and integration legs passing, but the overall maui-pr and Helix monitor checks failing on three Resizetizer tests: two temporary-file cleanup IOExceptions and one BadExit. The PR does not modify Resizetizer code, but none of the exact test names appeared in the five sampled recent net11.0 baseline check results, so canonical MAUI CI rules classify the failures as Needs human investigation, not confidently unrelated. Required-context metadata was unavailable anonymously.

Verdict: NEEDS_DISCUSSION

Confidence: low

Summary: The raw PR is structurally sound, and four of the five promotions accurately preserve existing behavior. The Windows Switch mapper should be aligned with its newly public interface contract before merge; current red CI is in an unrelated subsystem by scope but remains indeterminate without an exact baseline match.


🛠️ Try-Fix — Analysis & Comparison

PR #37946 — Try-Fix Candidate 1

Result: Blocked (baseline could not be established; no code applied; worktree unmodified)

Approach designed

Visibility-only API promotion with bodies and signatures frozen.

Promote the five overdue mapper methods from internal to public and add the matching
PublicAPI.Unshipped.txt entries, while leaving every method body and every parameter list
byte-identical to the baseline. Delete only the now-satisfied
// TODO: Change the modifier to public in .NET 10 comments.

File Planned edit
src\Controls\src\Core\Handlers\Items\CarouselViewHandler.Android.cs MapLoop, MapItemsLayout: internal -> public; bodies untouched
src\Controls\src\Core\Handlers\Items2\CarouselViewHandler2.iOS.cs MapItemsLayout: internal -> public; keep handler?.UpdateLayout()
src\Controls\src\Core\Handlers\Shell\ShellHandler.Windows.cs MapFlyoutBackgroundImage: internal -> public; keep the handler?.PlatformView is not null && provider is not null guard and the bare .FireAndForget()
src\Core\src\Handlers\Switch\SwitchHandler.Windows.cs MapSwitchMinimumWidth: internal -> public; keep (IViewHandler handler, IView view) and the view is ISwitch / handler is SwitchHandler gate
5 x PublicAPI.Unshipped.txt (Controls net-android/net-ios/net-maccatalyst/net-windows, Core net-windows) Entries matching those exact, unchanged signatures

Prior approach avoided

The PR (materialized commit 487eec6b) uses a promote-and-refactor mechanism: it couples the
visibility change with three unrelated behavioral / API-shape riders.

  1. iOS CarouselViewHandler2.MapItemsLayout: handler?.UpdateLayout() -> handler.UpdateLayout().
  2. Windows ShellHandler.MapFlyoutBackgroundImage: guard restructured into an early
    handler.PlatformView is null return, the provider is not null check deleted, and
    .FireAndForget() -> .FireAndForget(handler).
  3. Windows SwitchHandler.MapSwitchMinimumWidth: signature narrowed from (IViewHandler, IView) to
    (ISwitchHandler, ISwitch) while the concrete SwitchHandler downcast gate is retained.

Shared failure mechanism: each rider is a runtime or API-shape change that the only available
validation for this PR — a compile plus Public API analyzer pass — structurally cannot observe. A
regression in null/lifecycle handling, in async fault observation, or in mapper-invocation
reachability would ship behind a fully green build; and the narrowed public signature, once shipped,
is permanently frozen. The riders buy no verified benefit and carry unverifiable risk.

Mechanism-level difference

This candidate decouples API surface from implementation where the PR couples them.

Cause-to-effect chain, PR: edit body or signature -> build is green (analyzer only diffs declared
surface, never behavior) -> an unobserved behavior delta ships.

Cause-to-effect chain, candidate: edit only the accessibility modifier -> compiled IL for every
mapper is identical to baseline apart from the metadata visibility flag -> no execution path can
diverge, so the "unobserved behavior delta" link is never created.
All residual risk collapses onto
the PublicAPI.Unshipped.txt entries, and that is exactly the one thing the Public API analyzer
verifies exhaustively: any mismatch between declared and recorded surface becomes a hard build error
(RS0016/RS0017), i.e. the risk is moved from an unverifiable class into a fully verified one.

Freezing MapSwitchMinimumWidth at (IViewHandler, IView) also preserves optionality: a narrower
(ISwitchHandler, ISwitch) form can still be added later as an additive overload, whereas the PR's
in-place narrowing is a one-way door taken without behavioral evidence.

Exact diff

None. No file was modified. git diff scoped to the nine PR target files is empty
(attempt-1/fix.diff is a 0-byte file), and git status --porcelain -- src/ returns nothing both
before and after the attempt.

The attempt was blocked at the mandatory baseline step, before any edit was permitted. Per try-fix
Principle 7, with no .github/.baseline-state.json there is no RevertedFiles allow-list, so no
tracked file may be edited.

Command and result

Baseline (Step 2, mandatory) — FAILED:

pwsh .github/scripts/EstablishBrokenBaseline.ps1
=> ERROR: DIRTY WORKING DIRECTORY - Cannot establish baseline
=> throw: "EstablishBrokenBaseline.ps1 failed: Working directory is not clean." (line 392)

git status --porcelain --untracked-files=no lists ~58 modified/deleted tracked files, all
harness-owned and unrelated to this PR: .github/scripts/** (including EstablishBrokenBaseline.ps1
itself), .github/skills/**, eng/scripts/**. None of the nine PR target files is dirty. Verified
after the throw: Test-Path .github/.baseline-state.json = False.

Primary validation (Step 7) — NOT RUN:

dotnet build src\Controls\src\Core\Controls.Core.csproj -f net11.0-windows10.0.19041.0 --no-restore

Deliberately not executed. With no allow-list, the worktree still contains HEAD (487eec6b) content,
i.e. the PR's own fix. Building it would have compiled the PR rather than a candidate — zero
comparative signal — while consuming the single authorized validation pass. No candidate diff existed
to validate. Recorded with this rationale in attempt-1/test-output.log.

Honest scope note, had it run: that command is build + Public API analyzer validation only, never
behavioral coverage. It cannot exercise the Android or iOS/MacCatalyst mapper paths at all (wrong
TFM) and cannot exercise Windows Shell or Switch runtime behavior.

Failure analysis

Two constraints are simultaneously binding and mutually exclusive:

  1. EstablishBrokenBaseline.ps1 demands a fully clean tracked worktree and exposes no escape hatch
    (its only parameters are -BaseBranch, -DryRun, -Restore — no -Force, no -AllowDirty, no
    path allow-list). Its auto-restore branch did not fire because no prior baseline state existed.
  2. The invocation contract and try-fix Principle 8 require preserving all pre-existing unrelated
    worktree changes and untracked paths.

Every route past the gate violates constraint 2 or a hard skill rule:

  • git checkout -- . / git restore / git reset / git stash — destroys or hides the pre-existing
    harness edits; forbidden outright by Principle 6 (script-only restoration).
  • git add . && git commit (the script's own printed remedy) — converts preserved worktree state into
    history and moves HEAD off the materialized review commit 487eec6b that the orchestrator's
    parent-vs-PR comparison depends on. That is not preservation.
  • Editing EstablishBrokenBaseline.ps1 to relax the gate — it is tracked, is in no allow-list (none
    exists), and is itself one of the pre-existing modified files.
  • Hand-rolling git checkout <merge-base> -- <9 files> — bypasses the state tracking the restore path
    depends on; forbidden by Principle 6.

The blocker is therefore environmental, not analytical. This is exactly the documented Blocked path:
"If the state file was not created ... report Blocked immediately and proceed to Step 9 without
modifying tracked files."

Guidance for subsequent candidates: any sequential try-fix attempt in this worktree hits the
identical gate; re-running the script expecting a different outcome is wasted work. The harness must
reconcile the pre-existing .github/** and eng/scripts/** modifications before try-fix starts.
Structural fix worth considering: the dirty check (~line 379) uses a bare
git status --porcelain --untracked-files=no; scoping it to the merge-base fix files would let
try-fix run in harness worktrees that legitimately carry unrelated edits, without weakening
protection against unrestored fix-file drift.

Self-review count

0 findings (reviewer-findings.json = []).

There is no diff to review — nothing was applied, so there is no code to walk against
.github/agents/maui-expert-reviewer.md. The empty array is the honest zero-diff result, not a
suppressed or skipped review. reviewer-findings.diff is correspondingly empty, and Step 7.5 drift
detection is a no-op. Performed inline; no sub-agent, reviewer, rubber-duck, or cross-pollination
agent was launched at any point.

Restoration result

pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore
=> No baseline state found. Nothing to restore.
=> Restored = False, Message = "No baseline state found"

Restored False is the expected and accepted completion for this verified no-state path: Step 2
reported Blocked before changing any file, and it was confirmed that baseline state was never created.
Post-restore verification: git status --porcelain -- src/ is empty — zero attempt-created changes to
any of the nine target files. All ~58 pre-existing harness worktree modifications and untracked paths
were left exactly as found; no git checkout, git restore, git reset, git stash, rm, or
Remove-Item was used at any point.

Artifacts

CustomAgentLogsTmp\PRState\37946\PRAgent\try-fix\attempt-1\ — baseline.log, approach.md,
reviewer-findings.json, reviewer-findings.diff, result.txt (Blocked), fix.diff (empty),
test-output.log, analysis.md, restore.log. Artifact gate: PASSED (all 8 required files
present).


PR #37946 — Try-Fix Candidate 2

Result: Blocked (mandatory baseline failed; no candidate code was applied; no validation was run)

Approach

Compatibility-preserving strongly typed forwarding overload. The mapper declarations were inspected before design:

  • SwitchHandler.Mapper is IPropertyMapper<ISwitch, ISwitchHandler> and registers MapSwitchMinimumWidth, while the broken-parent implementation accepts the broader (IViewHandler, IView) pair.
  • Android CarouselViewHandler.Mapper, iOS/MacCatalyst CarouselViewHandler2.Mapper, and ShellHandler.Mapper already use concrete handler/view type pairs matching their broken-parent methods.

The focused alternative therefore keeps the existing Windows Switch mapper implementation as an internal compatibility entry point and adds an exact public (ISwitchHandler, ISwitch) overload that forwards into it. The exact overload is the best method-group match for PropertyMapper<ISwitch, ISwitchHandler>, while the cast in its forwarding call selects the old broad overload. The old body remains the single behavior implementation. The four Controls methods already have exact strongly typed mapper signatures, so they are promoted without body changes. Matching PublicAPI entries record only the five public signatures.

Prior approaches avoided

The materialized PR (487eec6b) uses promote-and-refactor: it promotes all five methods, replaces the Switch signature in place, removes iOS null-conditional dispatch, and rewrites Windows Shell guard/provider/async-observation behavior. Candidate 1 uses visibility-only exact-signature/body promotion for every method, including publicly freezing the broad Switch (IViewHandler, IView) signature. Candidate 1 never applied code because the mandatory clean-tree baseline gate failed.

This candidate avoids both mechanisms. It does not couple promotion to runtime refactors, and it does not expose the broad Switch signature. Instead, it adds a typed public boundary while retaining the old internal method and behavior.

Mechanism-level difference

For the PR, narrowing happens in place: internal code and mapper binding lose the broad entry point, and three bodies/signatures change together. For candidate 1, the broad Switch entry point itself becomes public and is permanently frozen.

For candidate 2, overload resolution is the boundary adapter: PropertyMapper<ISwitch, ISwitchHandler> and external callers bind to the exact public overload; that overload casts only for its call into the unchanged internal (IViewHandler, IView) implementation. Thus existing internal source compatibility and baseline behavior remain available, while the public contract is the strongly typed mapper shape. The four Controls methods need no adapter because their mapper declarations already exactly match their concrete signatures.

Exact diff

Applied diff: none. attempt-2/fix.diff is exactly 0 bytes. The baseline failed before an allow-list existed, so applying any tracked-file edit was forbidden.

Exact candidate patch designed relative to the broken parent (not applied):

--- CarouselViewHandler.Android.cs
-       // TODO: Change the modifier to public in .NET 10.
-       internal static void MapLoop(CarouselViewHandler handler, CarouselView carouselView)
+       public static void MapLoop(CarouselViewHandler handler, CarouselView carouselView)
        { /* baseline body unchanged */ }
-       // TODO: Change the modifier to public in .NET 10.
-       internal static void MapItemsLayout(CarouselViewHandler handler, CarouselView carouselView)
+       public static void MapItemsLayout(CarouselViewHandler handler, CarouselView carouselView)
        { /* baseline body unchanged */ }

--- CarouselViewHandler2.iOS.cs
-       // TODO: Change the modifier to public in .NET 10.
-       internal static void MapItemsLayout(CarouselViewHandler2 handler, CarouselView carouselView)
+       public static void MapItemsLayout(CarouselViewHandler2 handler, CarouselView carouselView)
        {
            handler?.UpdateLayout();
            (handler.Controller as CarouselViewController2)?.UpdateScrollingConstraints();
        }

--- ShellHandler.Windows.cs
-       //TODO: Make it public in .NET 10.
-       internal static void MapFlyoutBackgroundImage(ShellHandler handler, Shell view)
+       public static void MapFlyoutBackgroundImage(ShellHandler handler, Shell view)
        {
            var provider = handler.GetRequiredService<IImageSourceServiceProvider>();
            if (handler?.PlatformView is not null && provider is not null)
            {
                handler.PlatformView.UpdateBackgroundImageSourceAsync(view.FlyoutBackgroundImage, provider, view.FlyoutBackgroundImageAspect).FireAndForget();
            }
        }

--- SwitchHandler.Windows.cs
-       // TODO: Make it public in .NET 10.0
        internal static void MapSwitchMinimumWidth(IViewHandler handler, IView view)
        {
            // entire baseline body unchanged
        }
+
+       public static void MapSwitchMinimumWidth(ISwitchHandler handler, ISwitch view)
+       {
+           MapSwitchMinimumWidth((IViewHandler)handler, view);
+       }

The exact PublicAPI additions would be:

~static Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler.MapItemsLayout(Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler handler, Microsoft.Maui.Controls.CarouselView carouselView) -> void
~static Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler.MapLoop(Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler handler, Microsoft.Maui.Controls.CarouselView carouselView) -> void
~static Microsoft.Maui.Controls.Handlers.Items2.CarouselViewHandler2.MapItemsLayout(Microsoft.Maui.Controls.Handlers.Items2.CarouselViewHandler2 handler, Microsoft.Maui.Controls.CarouselView carouselView) -> void
~static Microsoft.Maui.Controls.Handlers.ShellHandler.MapFlyoutBackgroundImage(Microsoft.Maui.Controls.Handlers.ShellHandler handler, Microsoft.Maui.Controls.Shell view) -> void
static Microsoft.Maui.Handlers.SwitchHandler.MapSwitchMinimumWidth(Microsoft.Maui.Handlers.ISwitchHandler! handler, Microsoft.Maui.ISwitch! view) -> void

The iOS entry would be added to both net-ios and net-maccatalyst; the others go to their respective net-android or net-windows files. Nullable-oblivious markers are preserved exactly as analyzer baselines require.

Command and result

Mandatory baseline command:

pwsh .github\scripts\EstablishBrokenBaseline.ps1

Result: exit 1 with DIRTY WORKING DIRECTORY - Cannot establish baseline. Approximately 58 pre-existing tracked harness files under .github/** and eng/scripts/** are modified/deleted. After failure, .github/.baseline-state.json did not exist, so there was no RevertedFiles allow-list.

Authorized primary validation:

dotnet build src\Controls\src\Core\Controls.Core.csproj -f net11.0-windows10.0.19041.0 --no-restore

Not run. No candidate diff could legally be applied; running it would validate the materialized PR at HEAD rather than candidate 2. If run on an applied candidate, this command would be Windows build and Public API analyzer validation only—not behavioral coverage, and not execution of Android or iOS/MacCatalyst code.

Failure analysis

The blocker is identical environmental state, not a candidate compile/runtime failure. The baseline script requires a clean tracked worktree, while the invocation requires preserving all unrelated pre-existing changes. Script-only restoration forbids Git checkout/restore/reset/stash cleanup, and a missing baseline state forbids edits. No bypass was attempted. Because no code existed to compile, the bounded validation pass was deliberately preserved rather than spent on the PR implementation.

Inline expert self-review

0 findings (reviewer-findings.json is []). The overarching principles, handler mapper/public API, logic/regression, async/threading, complexity, and routed platform/CollectionView concerns were read and applied inline. Because no candidate line was applied, there was no changed right-side line on which to record a concrete finding; this zero count does not claim behavioral verification of the designed patch. reviewer-findings.diff is empty and the Step 7.5 target-diff comparison found no drift. No child or reviewer agent was launched.

Restoration result

The exact permitted restore command ran:

pwsh .github\scripts\EstablishBrokenBaseline.ps1 -Restore

It returned exit 0 with No baseline state found. Nothing to restore, Restored = False. This is the expected no-state restoration outcome: baseline creation failed before edits and .github/.baseline-state.json never existed. Post-restore git status --porcelain -- src is empty; all nine target files have zero attempt-created drift. Every pre-existing unrelated tracked modification and untracked path was preserved.

Artifacts

All mandatory artifacts exist under CustomAgentLogsTmp\PRState\37946\PRAgent\try-fix\attempt-2\: baseline.log, approach.md, reviewer-findings.json, reviewer-findings.diff, result.txt, fix.diff, test-output.log, analysis.md, and restore.log. The artifact gate passed.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Winner: pr-plus-reviewer

pr-plus-reviewer is the strongest candidate because it retains the PR's focused, strongly typed public API while fixing the expert review's only actionable contract mismatch: MapSwitchMinimumWidth(ISwitchHandler, ISwitch) now operates on every ISwitchHandler instead of silently ignoring implementations that are not the concrete SwitchHandler.

Comparative Evaluation

Rank Candidate Applied state Validation Assessment
1 pr-plus-reviewer PR plus one reviewer change Local build blocked before compilation: missing project.assets.json (NETSDK1004); submitted-head CI is red on three indeterminate Resizetizer failures Best API/implementation alignment and smallest corrective diff.
2 pr Submitted nine-file fix Gate skipped because no PR tests were detected; submitted-head CI has the same three Resizetizer failures Four promotions are sound, but the public Switch mapper advertises interface support while retaining a concrete-handler no-op gate.
3 try-fix-2 Blocked; no patch applied Not run The designed typed forwarding overload preserves baseline code, but forwards into the same concrete-handler gate and therefore does not resolve the expert finding. It also adds unnecessary overload complexity.
4 try-fix-1 Blocked; no patch applied Not run Visibility-only promotion minimizes body changes, but would freeze the overly broad (IViewHandler, IView) Switch API and retain bare Shell FireAndForget, making it less precise and less observable than the submitted approach.

No alternative candidate has a passing regression result. Submitted-head CI ran 22,824 tests and reported three Resizetizer failures while the relevant build/integration legs passed; pr-plus-reviewer inherits that submitted code and has no post-refinement test result because its local build was blocked. Both STEP 5a attempts were blocked before applying code or running validation. Therefore no regression-failing candidate is ranked above a regression-passing candidate; none passed.

Why the Reviewer Refinement Wins

  • Public contract correctness: ISwitchHandler already provides the typed ToggleSwitch platform view, so a concrete SwitchHandler check is unnecessary and contradicts the newly published interface-level signature.
  • Minimality: The refinement changes one expression in one method and leaves all five Public API declarations, platform scoping, mapper registration, and the PR's Shell exception logging intact.
  • Cross-platform safety: Android CarouselView and iOS/MacCatalyst CarouselViewHandler2 bodies remain unchanged apart from the PR's already-reviewed visibility/null-call cleanup. The Windows Shell change continues to guard a disconnected platform view and uses handler-aware exception logging.
  • Better than STEP 5a designs: Neither try-fix candidate produced an executable patch. Their proposed Switch designs also retain a contract mismatch or expose a broader API than the mapper requires.

Remaining Uncertainty

The reviewer patch passed git diff --check, but the required Windows build was environmentally blocked because the sandbox lacked restore output. The Gate was also skipped because the PR contains no tests.

For submitted HEAD, all visible platform build and integration legs passed, while maui-pr, Build Analysis, and the Helix monitor are red on three Resizetizer tests. Two failures are temporary-file cleanup IOExceptions and one is a Helix BadExit; none touch code changed by this PR. However, the exact test names did not recur in five sampled recent net11.0 baseline check results, so MAUI's deterministic CI rules require Needs human investigation rather than a confident unrelated classification. Required-check configuration could not be read anonymously. The implementation recommendation is therefore based on source-level type and behavior analysis, not a clean CI or candidate-runtime signal.

Required Change

Apply the one-line pr-plus-reviewer change from pr-plus-reviewer/reviewer.patch to the submitted PR. The PR should then receive normal Windows build/Public API analyzer validation in an environment with restored assets.


📱 UI Tests — CollectionView,Shell,ViewBaseTests

Detected UI test categories: CollectionView,Shell,ViewBaseTests

[!WARNING]
No UI test results were produced for the detected categories. The trusted gate was
skipped before build/test verification, so it does not prove that the PR build is healthy.
The deep UI stage also returned no results; inspect the independent CI checks and retry the
review if those categories still need coverage.


🧭 Next Steps — reviewer changes required

The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.

Why: The reviewer candidate preserves the PR's strongly typed public mapper API while removing the concrete SwitchHandler gate that made custom ISwitchHandler implementations silently no-op. Its required build was environmentally blocked by missing restore assets, but both try-fix candidates were also blocked and neither produced an applied alternative.

Address the actionable findings in this review before merging.

@MauiBot MauiBot added s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-review-in-progress AI review is currently running for this PR labels Aug 29, 2026
@kubaflo
kubaflo merged commit e88628f into net11.0 Aug 29, 2026
35 of 38 checks passed
@kubaflo
kubaflo deleted the jfversluis-fix-overdue-visibility-apis branch August 29, 2026 21:36
@github-actions github-actions Bot added this to the .NET 11.0-preview7 milestone Aug 29, 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-controls-collectionview CollectionView, CarouselView, IndicatorView 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