Skip to content

[NET11] [iOS/MacCatalyst] Add an opt-in Shell handler implementation - #37034

Merged
kubaflo merged 38 commits into
net11.0from
Net11.0-iOS-Shell-Handler
Sep 8, 2026
Merged

kubaflo merged 38 commits into
net11.0from
Net11.0-iOS-Shell-Handler

Conversation

@Vignesh-SF3580

@Vignesh-SF3580 Vignesh-SF3580 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Introduces a new handler-based implementation of Shell for iOS and Mac Catalyst while retaining the compatibility ShellRenderer as the default implementation.

The new implementation replaces the monolithic ShellRenderer (IS a UIViewController), ShellItemRenderer (IS a UITabBarController), and ShellSectionRenderer (IS a UINavigationController) hierarchy with a layered ShellHandler, ShellItemHandler, ShellSectionHandler, and ShellContentHandler architecture.

Navigation, tab-bar, and flyout management are implemented on top of the shared Core platform managers:

  • NavigationControllerManager
  • TabBarControllerManager
  • FlyoutContainerManager

This is the same infrastructure already used by the NavigationPage (#36109), TabbedPage (#36507), and FlyoutPage (#36676) handler migrations.

The new Shell handler is opt-in on iOS and Mac Catalyst. Applications continue to use ShellRenderer unless they explicitly enable the new implementation in their project file.

Motivation

ShellRenderer, ShellItemRenderer, and ShellSectionRenderer are renderer classes that directly inherit from UIViewController, UITabBarController, and UINavigationController. Each renderer owns flyout presentation, tab-bar management, navigation-stack management, appearance tracking, and page lifecycle behavior.

This made Shell:

  • Hard to maintain - flyout layout, tab selection, navigation-bar appearance, and Controls-specific behavior are interleaved across large renderer files.
  • Inconsistent with the handler architecture - NavigationPage, TabbedPage, and FlyoutPage have moved to handlers on iOS and Mac Catalyst, while Shell still uses renderers.
  • Duplicative of shared infrastructure - the shared navigation, tab-bar, and flyout managers were designed for reuse by page implementations such as Shell.
  • Prone to retain cycles - renderers hold references to child controllers, gesture recognizers, and delegates that require careful teardown.
  • Not aligned with mapper-driven updates - Android and Windows Shell implementations use property and command mappers, while the iOS renderers rely on manual property-change subscriptions.

What Changed

New Shell handlers

File Purpose
Handlers/Shell/ShellHandler.iOS.cs Root handler for Shell. Owns the app root view controller and container view; drives flyout presentation through FlyoutContainerManager; handles More-tab overflow and status-bar/home-indicator forwarding; and exposes virtual factory hooks for appearance trackers, page tracking, item and section handlers, and flyout content.
Handlers/Shell/ShellItemHandler.iOS.cs Handler for ShellItem. Owns a UITabBarController through TabBarControllerManager; tracks the current section, tab selection, More-tab overflow, badges, enabled state, and tab-bar visibility.
Handlers/Shell/ShellSectionHandler.iOS.cs Handler for ShellSection. Owns a UINavigationController through NavigationControllerManager; manages push/pop operations, per-page navigation-bar appearance and visibility, and swipe-back behavior.
Handlers/Shell/ShellContentHandler.iOS.cs Thin handler for ShellContent. Its Content mapper forwards ShellContent.Content changes to the owning ShellSectionHandler.

Modified files

Area File Change
Shared Core Managers Platform/iOS/NavigationControllerManager/NavigationControllerManager.cs Extended the shared navigation manager for Shell navigation scenarios.
Shared Core Managers Platform/iOS/TabBarControllerManager/TabBarControllerManager.cs, ITabBarManagerDelegate.cs Added extension points so ShellItemHandler can manage tab selection and More-tab navigation through the shared manager.
Shared Core Managers Platform/iOS/FlyoutContainerManager/FlyoutContainerManager.cs, IFlyoutContainerDelegate.cs Added Shell-specific extension points for overlay shadows, brush-based backdrops, and split/Locked flyout behavior without changing existing FlyoutPage behavior.
Handler Reuse Handlers/FlyoutView/FlyoutViewHandler.iOS.cs, Handlers/TabbedView/TabbedViewHandler.iOS.cs Added support for the Shell-facing extension points on the shared managers.
Compatibility Reuse Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs, ShellFlyoutLayoutManager.cs Adjusted renderer-only property subscriptions so the handler path can drive updates through mapper dispatch.
Compatibility Reuse Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs Reused for per-page navigation-bar and toolbar tracking under the handler implementation.
Shared Mapper Handlers/Shell/ShellHandler.cs Enabled the shared mapper and command mapper for iOS and Mac Catalyst and added platform-specific mapper entries.
Handler Registration Hosting/AppHostBuilderExtensions.cs Keeps ShellRenderer as the iOS and Mac Catalyst default and registers the new Shell handler hierarchy when the runtime feature switch is enabled.
Runtime Feature Core/src/RuntimeFeature.cs Adds IsiOSShellHandlerEnabled, with a default value of false.
Build Configuration Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets Maps the UseiOSShellHandler project property to the runtime feature switch.
Public API PublicAPI/net-ios/PublicAPI.Unshipped.txt, PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt Records the new public and protected handler surface, mapper methods, lifecycle overrides, and virtual factory hooks introduced by the Shell handler implementation. No public builder extension is added for opting in.

Architecture Overview

Handler hierarchy

┌────────────────────────────────────────────────────────────────┐
│                         CORE LAYER                             │
│  ShellHandler.iOS.cs        -> root VC, flyout, More tab,      │
│                                status bar and home indicator    │
│  ShellItemHandler.iOS.cs    -> tab-bar management              │
│  ShellSectionHandler.iOS.cs -> navigation stack, push/pop,     │
│                                swipe-back, navigation bar       │
│  ShellContentHandler.iOS.cs -> content-change bridge           │
├────────────────────────────────────────────────────────────────┤
│             SHARED CORE PLATFORM MANAGERS                     │
│  NavigationControllerManager / TabBarControllerManager /       │
│  FlyoutContainerManager                                       │
│                                                               │
│  Also used by NavigationPage, TabbedPage, and FlyoutPage       │
├────────────────────────────────────────────────────────────────┤
│              COMPATIBILITY LAYER REUSE                        │
│  IShellNavBarAppearanceTracker / IShellTabBarAppearanceTracker │
│  IShellPageRendererTracker / ShellFlyoutContentRenderer        │
│  ShellFlyoutLayoutManager                                     │
└────────────────────────────────────────────────────────────────┘

Key Design Decisions

Decision Rationale
Use the shared Core platform managers NavigationControllerManager, TabBarControllerManager, and FlyoutContainerManager were designed for reuse by page implementations. Using them keeps navigation, tab-bar, and flyout behavior consistent and avoids another Shell-specific implementation.
Add Shell behavior through extension points Shell-only requirements such as overlay shadows, brush backdrops, locked layouts, and More-tab delegate hooks are exposed through additive interfaces so existing FlyoutPage, TabbedPage, and NavigationPage behavior is preserved.
Reuse compatibility trackers through adapters ShellItemHandlerAdapter : IShellItemRenderer and ShellSectionHandlerAdapter : IShellSectionRenderer allow the new handlers to reuse the existing navigation-bar, tab-bar, page, toolbar, and flyout tracking infrastructure.
Preserve renderer extensibility through virtual factory methods ShellHandler exposes Create* virtual methods so custom handler implementations can replace appearance trackers and child handlers similarly to custom renderer subclasses.
Use mapper-driven property dispatch ShellHandler, ShellItemHandler, ShellSectionHandler, and ShellContentHandler use property and command mappers, matching the Android and Windows implementations.
Use ShellContentHandler as a content-change bridge Mapper dispatch observes a handler's own virtual view. The thin ShellContentHandler receives ShellContent.Content changes and forwards them to the owning section handler.
Keep the compatibility renderer as the default The handler migration is a significant behavioral change. Keeping ShellRenderer as the default allows existing applications to retain current behavior while the new implementation is evaluated through an explicit opt-in.
Use a project property for opt-in The existing build-transitive runtime-feature pattern allows applications to enable the handler without introducing a new public builder extension.

Key Interfaces Reused

Interface Consumer Purpose
IShellItemRenderer ShellItemHandlerAdapter Allows ShellItemHandler to participate in existing compatibility infrastructure that expects an item renderer.
IShellSectionRenderer ShellSectionHandlerAdapter Allows ShellSectionHandler to participate in existing compatibility infrastructure that expects a section renderer.
IShellNavBarAppearanceTracker ShellSectionHandler Tracks navigation-bar appearance.
IShellTabBarAppearanceTracker ShellItemHandler Tracks tab-bar appearance.
IShellPageRendererTracker ShellSectionHandler Tracks per-page navigation-bar, title-view, and toolbar behavior.
IShellFlyoutContentRenderer ShellHandler Provides the Shell flyout content implementation.

Handler Registration and Opt-In

The compatibility ShellRenderer remains the default implementation on iOS and Mac Catalyst.

To enable the new Shell handler, set UseiOSShellHandler to true in the application project:

<PropertyGroup>
  <UseiOSShellHandler>true</UseiOSShellHandler>
</PropertyGroup>

When the property is absent or set to false, the application continues to use ShellRenderer:

<PropertyGroup>
  <UseiOSShellHandler>false</UseiOSShellHandler>
</PropertyGroup>

The property is mapped to the following runtime host configuration option:

Microsoft.Maui.RuntimeFeature.IsiOSShellHandlerEnabled

The runtime feature switch defaults to false.

No UseiOSShellHandler() builder extension is introduced.

As an alternative to the project property, an application can manually register the complete Shell handler hierarchy through ConfigureMauiHandlers in MauiProgram.cs:

#if IOS || MACCATALYST
builder.ConfigureMauiHandlers(handlersCollection =>
{
    handlersCollection.AddHandler<Shell, ShellHandler>();
    handlersCollection.AddHandler<ShellItem, ShellItemHandler>();
    handlersCollection.AddHandler<ShellSection, ShellSectionHandler>();
    handlersCollection.AddHandler<ShellContent, ShellContentHandler>();
});
#endif

All four mappings must be registered together because they form the complete iOS and Mac Catalyst Shell handler hierarchy. Applications using the UseiOSShellHandler project property do not need this manual registration.

Feature Parity

The handler implementation covers the existing Shell scenarios, including:

  • Flyout show/hide through programmatic changes and gestures.
  • Flyout header, footer, background, backdrop, and vertical scroll mode.
  • Split and Locked flyout layouts.
  • Tab-bar item selection, badge text and color, enabled state, and visibility.
  • More-tab overflow for Shell items beyond the native tab limit.
  • Navigation-stack push and pop operations.
  • Per-page navigation-bar visibility and appearance.
  • Navigation title, title color, background, back-button, and toolbar behavior.
  • Swipe-back gestures and programmatic-pop blocking.
  • Right-to-left and FlowDirection propagation.
  • Animated and non-animated modal navigation.
  • Query-parameter handling through IQueryAttributable.
  • Status-bar visibility and preferred update animation.
  • Home-indicator auto-hide preferences.

Compatibility and Migration Guidance

Existing applications

Existing applications require no changes. If UseiOSShellHandler is not set, they continue to use the compatibility ShellRenderer.

Evaluating the new handler

Applications can evaluate the handler by setting:

<UseiOSShellHandler>true</UseiOSShellHandler>

Removing the property or setting it to false restores the compatibility renderer.

Custom renderer users

Applications that subclass or manually register ShellRenderer, ShellItemRenderer, or ShellSectionRenderer can continue using those implementations. The compatibility renderer classes remain available and are still the default.

Custom handler users

Applications that opt in and need custom behavior can subclass the new handler classes or manually register custom handlers through ConfigureMauiHandlers.

Renderer pattern Handler equivalent Notes
ShellRenderer is a UIViewController ShellHandler owns and manages a UIViewController through FlyoutContainerManager The handler is a ViewHandler<Shell, UIView>, not a view-controller subclass.
ShellItemRenderer is a UITabBarController ShellItemHandler owns and manages a UITabBarController through TabBarControllerManager The handler is an ElementHandler<ShellItem, UIView>.
ShellSectionRenderer is a UINavigationController ShellSectionHandler owns and manages a UINavigationController through NavigationControllerManager The handler is an ElementHandler<ShellSection, UIView>.
Override renderer methods to replace a tracker Override the corresponding ShellHandler.Create* virtual factory method Preserves customization of navigation-bar, tab-bar, page, section, and flyout behavior.
Handle properties through OnElementPropertyChanged Extend or replace mapper entries Provides one mapper method per supported property or command.

@github-actions

github-actions Bot commented Aug 3, 2026

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 -- 37034

Or

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

@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.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 3, 2026
@Vignesh-SF3580 Vignesh-SF3580 added the community ✨ Community Contribution label Aug 3, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@github-actions github-actions Bot added area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/ios platform/macos macOS / Mac Catalyst labels Aug 3, 2026
@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 3, 2026
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Aug 3, 2026
@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 3, 2026
@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 3, 2026
@MauiBot

This comment has been minimized.

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

See inline comments for details.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Aug 4, 2026
@Vignesh-SF3580

Copy link
Copy Markdown
Contributor Author

AI Review Summary

@Vignesh-SF3580 — new AI review results are available based on this last commit: cccb5ed.

Gate No Tests Confidence Low Platform iOS

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

📱 UI Tests — Shell

Detected UI test categories: Shell

❌ Deep UI tests — 302 passed, 2 failed across 1 category on platform-pool agent (replaces in-process counts above). 1 new snapshot test need a baseline PNG (added separately by a maintainer — not a regression).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Shell 302/320 (2 ❌, 1 ⚠ new baseline) 4 diff PNGs
🔍 AI analysis of failures — PR-related vs unrelated

🔍 AI-generated triage (GitHub Copilot CLI) — a heuristic judgement of whether each deep UI test failure is connected to this PR's changes. Verify before relying on it.

Likely PR-related: one or more failures appear connected to this PR's changes.

  • ✗ PR-related — iOS Shell visual rendering and TabBar appearance (~3 tests): the failures are all Shell screenshot tests on iOS, and this PR replaces/rewires iOS Shell handlers, Shell item/section/content handling, flyout rendering, and toolbar/tab-bar appearance paths that plausibly affect the asserted visuals.

Strongest signal: the failing category and platform exactly match the PR scope; the one missing ios-26 baseline may be a baseline-maintenance symptom, but the run still exercises newly changed iOS Shell rendering code.

❌ Shell — 2 failed tests

TabBarShouldBeVisibleAfterNavigatingFromModalViaGoToAsync

VisualTestUtils.VisualTestFailedException : 
Snapshot different than baseline: TabBarShouldBeVisibleAfterNavigatingFromModalViaGoToAsync.png (2.07% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.

More info: https://aka.ms/visual-test-workflow
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
   at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
   at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 485
   at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String n
...

TabBarDisabledColorAppliedToDisabledTab

VisualTestUtils.VisualTestFailedException : 
Snapshot different than baseline: DisabledTabWithGreenColor.png (1.30% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.

More info: https://aka.ms/visual-test-workflow
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
   at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
   at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 485
   at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Null
...

⚠️ Shell — 1 new snapshot test need a baseline PNG

These tests call VerifyScreenshot but their baseline image isn't committed yet (brand-new snapshot tests get their baseline added separately by a maintainer). There's nothing to compare against, so this is not a regression — download the drop-deep-uitests artifact, confirm the rendering, and commit the baseline PNG.

  • ShellBackgroundSupportsGradientBrush

📎 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/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs #36495 #36249

🧪 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
#36495 DeviceTest ShellTests ShellTests

🧪 Regression Test Results

⏭️ SKIPPED — 0 passed, 0 failed, 1 skipped

Fix PR Test Type Result
#36495 ShellTests DeviceTest ⏭️ ERROR
📋 Pre-Flight — Context & Validation

Issue: N/A - No linked issue found PR: #37034 - [NET11] [iOS/MacCatalyst] Migrate Shell to Handler architecture Platforms Affected: iOS, MacCatalyst Files Changed: 12 implementation/API, 0 test

Key Findings

  • PR replaces the default iOS/MacCatalyst Shell renderer stack with handler-based ShellHandler, ShellItemHandler, ShellSectionHandler, and ShellContentHandler.
  • Blast radius is high: the registration is unconditional for iOS/MacCatalyst Shell apps and affects startup, Shell navigation, tab bar, flyout, safe-area, and status-bar paths.
  • Gate was already completed separately and skipped because no tests were detected in the PR. This artifact does not create or overwrite gate/content.md.
  • Prior AI review and a fresh code-review pass both found unresolved parity/correctness risks in the PR head.
  • Mandatory regression command for every candidate: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "ShellTests".

Code Review Summary

Verdict: NEEDS_CHANGES Confidence: low Errors: 4 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • ✗ src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:376 — ShellContent.Content changes can miss DataTemplate-created pages because the handler bridge calls GetOrCreateContent() immediately and returns if the stale renderer still points at cached content; the legacy renderer deferred DataTemplate handling to the next run loop.
  • ✗ src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:1247 — safe-area inset change detection compares newInset against _lastTabThickness instead of _lastInset, causing redundant inset propagation for stable insets.
  • ✗ src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:1085 — async icon loading recreates UITabBarItem and reapplies badge state only, so disabled tab visual state can be lost.
  • ✗ src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs:619 — ShellHostViewController does not preserve legacy Window.StatusBarTheme status-bar style override behavior.

Fix Candidates

Source Approach Test Result Files Changed Notes

PR PR #37034 Default-on iOS/MacCatalyst Shell handler migration with current ShellContentHandler.MapContent bridge and current safe-area/tab/status behavior ⏳ PENDING (Gate skipped) 12 files Original PR; no tests detected
🔬 Code Review — Deep Analysis

Code Review — PR #37034

Independent Assessment

What this changes: Replaces the default iOS/MacCatalyst Shell renderer stack with handler-based ShellHandler / ShellItemHandler / ShellSectionHandler / ShellContentHandler, including flyout, tab bar, navigation stack, status bar, and public API surface. Inferred motivation: Bring iOS/MacCatalyst Shell in line with handler architecture already used elsewhere and reduce legacy renderer coupling.

Reconciliation with PR Narrative

Author claims: Standalone handler migration, default-on, parity with legacy renderer, no tests added but Shell UI suite run locally. Agreement/disagreement: The architecture description matches the diff. I disagree that parity is established: current code and PR-associated test evidence show tab/status/safe-area regressions.

Prior Review Reconciliation

Prior ❌ Error Finding Source Status Evidence
ShellContent.Content DataTemplate changes can miss rebuilding because OnShellContentContentChanged calls GetOrCreateContent() immediately and returns if old renderer still matches cached page. MauiBot issue comment ❌ Unresolved Current PR head still has immediate GetOrCreateContent() + oldRenderer.VirtualView == newPage return at ShellSectionHandler.iOS.cs:376-379; legacy code deferred DataTemplate content handling.
Safe-area inset comparison uses _lastTabThickness instead of _lastInset. MauiBot issue comment ❌ Unresolved Current PR head still compares newInset != _lastTabThickness at ShellSectionHandler.iOS.cs:1247.

External Output Contract

Consumer token/pattern Producer location Producer emission condition Consumer assumption Ordinary negative case Downstream effect
N/A N/A No changed code classifies external tool output by regex/string token. N/A N/A N/A

Blast Radius Assessment

  • Runs for all instances: yes — AppHostBuilderExtensions.cs registers new Shell handlers by default on iOS/MacCatalyst.
  • Startup impact: yes — affects Shell root view/controller creation and navigation setup.
  • Static/shared state: yes — tab bar state/default More-cell color and handler-level navigation/flyout state affect all Shell pages.
  • Component family: Shell/TabBar, frequently regressed.

CI Status

  • Required-check result: fail/undetermined. gh pr checks --required failed due missing auth; fallback public comments/check evidence report maui-pr, maui-pr-uitests, and maui-pr-devicetests failures.
  • Classification: likely PR-caused for iOS Shell UI failures. Prior AI review reports Shell deep UI tests: 302/319 passed, 2 failed, including TabBarShouldBeVisibleAfterNavigatingFromModalViaGoToAsync and TabBarDisabledColorAppliedToDisabledTab.
  • Action taken: confidence capped low.

Findings

❌ Error — Recreated tab items lose disabled styling

src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:1085

UpdateTabBarItem() recreates _navigationController.TabBarItem in the async icon callback and only reapplies badge state. Disabled styling is applied earlier by ShellItemHandler.SetTabItemsEnabledState(), but a later icon callback replaces the item and loses disabled color/image state. This matches the PR-scoped failed snapshot TabBarDisabledColorAppliedToDisabledTab.

❌ Error — Window.StatusBarTheme parity is lost

src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs:619-650

The new ShellHostViewController forwards hidden/home-indicator/update-animation preferences but does not implement the legacy ShellRenderer status-bar theme override. Legacy ShellRenderer handled Window.StatusBarTheme in ChildViewControllerForStatusBarStyle() and PreferredStatusBarStyle(); Shell apps setting Light/Dark status bar theme will regress under the new default handler.

❌ Error — Safe-area inset change detection compares against the wrong field

src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:1247

newInset != _lastTabThickness compares a Thickness to the tab thickness instead of _lastInset, so stable safe-area values can repeatedly call SendInsetChanged.

❌ Error — PR-scoped Shell visual tests are red

CI evidence reports likely PR-related Shell tab-bar snapshot failures on iOS. Since this PR changes the default iOS Shell tab/navigation implementation, these failures must be fixed or intentionally baselined before merge.

Failure-Mode Probing

  • Disabled tab with async icon load: a tab disabled before/while icon load completes gets a new UITabBarItem after disabled styling was applied, so disabled color is lost.
  • Window.StatusBarTheme = Dark/Light: root Shell host no longer forces PreferredStatusBarStyle, so status bar text color can be wrong.
  • Stable layout pass with same safe-area insets: comparison remains true because inset is compared to tab thickness, causing repeated SendInsetChanged.
  • Handler disconnect/reconnect: several subscriptions are cleaned up, but high startup/nav blast radius plus red CI leaves safety unverified.

Verdict: NEEDS_CHANGES

Confidence: low Summary: The migration is high blast-radius and default-on for iOS/MacCatalyst Shell. Concrete parity regressions and likely PR-related Shell UI failures mean this should not merge as-is.

🛠️ Fix — Analysis & Comparison

Fix Candidates

Source Approach Test Result Files Changed Notes

1 code-review + maui-expert-reviewer Minimal legacy-parity patch on current handlers: DataTemplate deferral, safe-area comparison, disabled tab-state reapply, status-bar theme parity ⚠️ BLOCKED 3 files Best localized candidate, but mandatory ShellTests stalled before results
2 code-review + maui-expert-reviewer Move ShellContent.Content handling back to section-owned PropertyChanged subscriptions ⚠️ BLOCKED 2 files More faithful to legacy event timing; subscription symmetry risk
3 code-review + maui-expert-reviewer Revision-token reconciliation coordinator for content changes plus centralized tab item state application ⚠️ BLOCKED 2 files Most robust localized design for rapid swaps/races; more new state
4 code-review + maui-expert-reviewer Compatibility renderer facade / legacy default bridge ⚠️ BLOCKED 1 file Safest behaviorally, but rolls back the PR's handler-default goal
5 maui-expert-reviewer learn step Rebuild Shell from shared iOS handler managers ⚠️ BLOCKED broad rewrite Architecturally clean but too large for a surgical try-fix
6 maui-expert-reviewer learn step Guarded rollout / AppContext opt-in instead of unconditional default registration ⚠️ BLOCKED 1 file Mitigation path, not a functional parity fix
7 maui-expert-reviewer learn step Explicit Shell model notification contract for content/tab mutations ⚠️ BLOCKED broad model + handler changes Long-term design option; requires much more coverage
PR PR #37034 Default-on iOS/MacCatalyst Shell handler migration with current mapper bridge and unresolved parity issues ⏳ PENDING (Gate skipped) 12 files Original PR; no tests detected

Test Evidence

  • Mandatory regression command attempted: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "ShellTests".
  • Build succeeded.
  • iOS simulator was ready and the app installed successfully.
  • xharness stalled after launching mlaunch; the run was stopped after 120 seconds instead of waiting for the one-hour timeout.
  • No ShellTests result was produced, so no candidate can be marked pass.

Cross-Pollination

Model Round New Ideas? Details
code-review skill Pre-flight Yes Identified unresolved parity failures: DataTemplate content timing, safe-area comparison, async tab item disabled styling, status-bar theme parity, red Shell UI evidence
maui-expert-reviewer 1 Yes Proposed try-fix-1 through try-fix-4: parity patch, section-level observer, reconciliation coordinator, compatibility facade
maui-expert-reviewer 2 Yes After validation blocker, proposed try-fix-5 through try-fix-7: shared managers rewrite, guarded rollout, explicit Shell notification contract
maui-expert-reviewer 3 No NO NEW IDEAS after all seven approach classes were considered
Exhausted: Yes Selected Fix: None — every alternative candidate is blocked because the mandatory iOS Shell regression command did not produce test results. Among blocked candidates, try-fix-1 is the strongest surgical candidate and try-fix-3 is the strongest robustness-oriented candidate, but neither is demonstrably better than the PR's fix without ShellTests coverage.

🏁 Report — Final Recommendation

Comparative Candidate Report — PR #37034

Candidate Ranking

Rank Candidate Test status Assessment
1 pr-plus-reviewer ⚠️ Blocked / no ShellTests result Best candidate. Preserves the PR's handler migration while applying the expert-reviewer fixes for pending navigation completion, async tab disabled-state restoration, status-bar theme parity, safe-area comparison, and custom handler registration. It also carries the pre-flight DataTemplate content timing parity fix.
2 try-fix-1 ⚠️ Blocked / no ShellTests result Closest localized parity direction, but the recorded sketch risked self-rescheduling on DataTemplate content unless implemented with a separate reconciliation helper.
3 try-fix-3 ⚠️ Blocked / no ShellTests result Robust race-oriented design for content swaps and tab item state, but introduces new revision-tracking state in high-blast-radius Shell navigation code.
4 try-fix-2 ⚠️ Blocked / no ShellTests result Restores legacy-style section-owned ShellContent.PropertyChanged timing, but adds broader subscription symmetry/leak risk.
5 try-fix-6 ⚠️ Blocked / no ShellTests result Reduces rollout risk by making the new handler opt-in, but changes the PR's intended unconditional-default behavior rather than fixing parity.
6 try-fix-4 ⚠️ Blocked / no ShellTests result Behaviorally safest because it falls back to the legacy renderer, but effectively rolls back the handler-default goal.
7 try-fix-7 ⚠️ Blocked / no ShellTests result Clean long-term model notification contract, but too broad and not safely materialized for this PR.
8 try-fix-5 ⚠️ Blocked / no ShellTests result Architecturally appealing shared-manager rewrite, but too large for a surgical candidate and not materialized.
9 pr ⏳ Gate skipped / no ShellTests result Raw PR remains lower-ranked because it leaves the expert-reviewer correctness findings unresolved.
No candidate has a passing mandatory iOS Shell regression result. No candidate is known to have failed regression tests either, so the ranking is based on correctness evidence and implementation risk; if any later candidate obtains passing ShellTests, it should outrank candidates that remain blocked.

Winning Candidate

Winner: pr-plus-reviewer

pr-plus-reviewer is the only candidate that keeps the PR's intended iOS/MacCatalyst Shell handler migration while directly addressing all actionable expert-review findings in a localized patch. It is preferred over the raw PR because the raw PR has unresolved correctness defects, and preferred over the try-fix candidates because the closest alternative (try-fix-1) was only a sketch with a noted self-rescheduling hazard that the sandbox implementation avoids.

Test and Coverage Notes

  • Gate result was skipped because no tests were detected in the PR.
  • STEP 5a attempted pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "ShellTests".
  • Build and install succeeded, but xharness stalled after launching mlaunch; no ShellTests result was produced.
  • The author should add or enable targeted iOS Shell coverage for the migrated handler path before this ships.

🧭 Next Steps — review latest findings

I have addressed the valid suggestions.

  • Async/threading — Pop cancellation can throw from async void: Replaced both TrySetCanceled() calls with TrySetResult(false), matching the legacy renderer.
  • Disabled tab re-enabled after async icon load: This is existing renderer behavior, not a handler regression. Since this PR focuses on renderer parity, changing it would be a separate bug fix.
  • Missing Window.StatusBarTheme override: Ported the same overrides, including the #if !MACCATALYST guard, to ShellHostViewController.
  • Safe-area inset guard compares the wrong fields: Updated the comparison to newInset != _lastInset while keeping the existing tabThickness check.
  • Bypasses the handler registry (AddHandler<> not honored): Updated both factory methods to first resolve handlers from MauiContext.Handlers, falling back to the default handlers when no custom handler is registered. This matches the Android implementation.

@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@Vignesh-SF3580

Copy link
Copy Markdown
Contributor Author

AI Review Summary

@Vignesh-SF3580 — new AI review results are available based on commit 8835e1b.

Gate Inconclusive Confidence Medium Platform iOS

🗂️ Review Sessions — click to expand

🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ INCONCLUSIVE

Platform: IOS · Base: net11.0 · Merge base: 7a68b303

🩺 Could not verify — environment/infrastructure error. The gate ran the tests but hit an environment error (an emulator/simulator/Appium/XHarness flake, a device that would not boot, or an empty/invalid result file), so it could not record a real pass/fail. The ⚠️ ENV ERROR marks below are infrastructure, not test failures — this is not a problem with your PR. Comment /review to retry on a fresh agent.

XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.WindowHandlerTests' (the target tests did not run).

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 WindowHandlerTests Category=Window ⚠️ ENV ERROR ⚠️ ENV ERROR
🔴 Without fix — 📱 WindowHandlerTests: ⚠️ ENV ERROR · 75s
No log file found

🟢 With fix — 📱 WindowHandlerTests: ⚠️ ENV ERROR · 65s
No log file found

⚠️ Failure Details

  • ⚠️ WindowHandlerTests without fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.WindowHandlerTests' (the target tests did not run).
  • ⚠️ WindowHandlerTests with fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.WindowHandlerTests' (the target tests did not run).

📁 Fix files reverted (14 files)

  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs
  • src/Controls/src/Core/Handlers/Shell/ShellHandler.cs
  • src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
  • src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.iOS.cs
  • src/Core/src/Handlers/TabbedView/TabbedViewHandler.iOS.cs
  • src/Core/src/Platform/iOS/FlyoutContainerManager/FlyoutContainerManager.cs
  • src/Core/src/Platform/iOS/FlyoutContainerManager/IFlyoutContainerDelegate.cs
  • src/Core/src/Platform/iOS/NavigationControllerManager/NavigationControllerManager.cs
  • src/Core/src/Platform/iOS/TabBarControllerManager/ITabBarManagerDelegate.cs
  • src/Core/src/Platform/iOS/TabBarControllerManager/TabBarControllerManager.cs

New files (not reverted):

  • src/Controls/src/Core/Handlers/Shell/ShellContentHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellItemHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs

📋 Pre-Flight — Context & Validation

PR #37034 Pre-Flight

Scope

  • Title: [NET11] [iOS/MacCatalyst] Migrate Shell to Handler architecture
  • Base: net11.0
  • PR head: 8835e1b754898c5a4eed77c0133e2b2690e8b04b
  • Local review commit: 8274fc145b2223d1ed9e84419b35fc99d5465a90 (PR #37034 squashed for review)
  • Size: 19 files, 4,085 additions, 79 deletions
  • Platform: iOS (the .iOS.cs implementation also compiles for MacCatalyst)

Existing implementation

The PR replaces the default iOS/MacCatalyst ShellRenderer, ShellItemRenderer, and ShellSectionRenderer path with ShellHandler, ShellItemHandler, ShellSectionHandler, and ShellContentHandler. It registers the handlers unconditionally and layers Shell behavior over the shared FlyoutContainerManager, TabBarControllerManager, and NavigationControllerManager.

The direct diff adds four production files:

  • src/Controls/src/Core/Handlers/Shell/ShellContentHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellItemHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs

It also changes 14 existing implementation/API files and one Core device-test stub. The only test-file change adds OnViewWillLayoutSubviews() to the WindowHandlerTests.iOS.cs fake delegate; the PR adds no behavioral Shell test.

Code observations

  • The new root handler owns flyout setup, item transitions, mapper dispatch, and
    view-controller containment.
  • The item handler owns tab selection and More-tab behavior through the shared
    tab-bar manager.
  • The section handler owns navigation stacks, interactive pop, toolbar/nav-bar
    appearance, and content switching.
  • The content handler is a mapper bridge that forwards
    ShellContent.Content changes to the owning section handler.
  • Existing review discussion has concentrated on lifecycle races, pending
    navigation completions, flyout backdrop/scrim behavior, safe handler lookup,
    More-tab API availability, and compatibility-path flyout header layout.

Test context

The prior gate is INCONCLUSIVE, not a product failure: XHarness did not produce a fresh result for Microsoft.Maui.DeviceTests.WindowHandlerTests. The gate must not be rerun.

Primary candidate test:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Window"

Mandatory regression test after the primary test passes:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Shell"

The regression cross-reference points to #36495 / #36249 because both changes touch ShellFlyoutLayoutManager.cs. A regression-test failure makes a candidate Fail; an unavailable simulator/device makes it Blocked.

Try-fix constraints

Each attempt must use the script-only broken-baseline and restore workflow. The prior gate identified the four handler files above as PR-added files rather than safely reverted files. The try-fix baseline boundary therefore may require an honest Blocked result if .github/.baseline-state.json reports them in NewFiles; an attempt must not bypass that boundary or manually restore files.

🔬 Code Review — Deep Analysis

Expert PR Evaluation

Verdict: NEEDS_CHANGES Confidence: medium

The submitted iOS/MacCatalyst Shell handler migration has two concrete behavioral defects on changed lines:

  1. FlyoutContainerManager.ToggleAccessibilityElementsHidden() leaves the detail accessibility subtree exposed when Shell presents an overlapping flyout. The scrim prevents interaction, but VoiceOver can still focus obscured detail controls.
  2. ShellSectionHandler.UpdateFlowDirectionForControls() replaces FlowDirection.MatchParent on pages with the Shell's current concrete direction. Once mutated, those pages no longer inherit later runtime RTL/LTR changes and can remain stuck on the first resolved direction.

The migration also changes the default Shell implementation without adding focused parity coverage for tab/More selection, flyout transitions, or navigation-stack synchronization. This is a material coverage gap, but the two verified runtime defects independently require changes.

The Gate result is inconclusive because the required tests could not be built or run; it is neither evidence of a regression nor evidence that the migration is safe. The review therefore relies on code-path analysis and carries medium confidence, which is the maximum appropriate for platform-specific handler and controller plumbing.

🛠️ Try-Fix — Analysis & Comparison

Try-Fix Aggregate (PR #37034)

Candidate 1 (Attempt 1)

Approach: Guard pending navigation completion drainage in src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs so CompletePendingImmediately(false) is triggered only during confirmed disconnect/teardown, not on every OnNavigationControllerDidDisappear() callback.

Prior approach avoided: The current PR behavior drains pending navigation completions on disappear events, which can treat temporary visibility transitions (e.g., tab/More lifecycle) as teardown and complete in-flight operations early.

Mechanism-level difference: This candidate is based on a different root-cause hypothesis: lifecycle misclassification rather than missing completion handling. By requiring explicit teardown state before draining, transient disappear callbacks would not end pending navigation work.

Files changed:

  • None (Blocked before editing)

Captured diff:

(no attempt diff; blocked before editing tracked files)

Primary test result:

  • Command: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Window"
  • Outcome: Not run (Blocked before implementation/test due baseline establishment failure)

Regression test result:

  • Command: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Shell"
  • Outcome: Not run (primary did not pass)

Result: Blocked

Self-review count: 0 (reviewer-findings.json = [])

Failure/blocker analysis: EstablishBrokenBaseline.ps1 failed with DIRTY WORKING DIRECTORY - Cannot establish baseline, and .github/.baseline-state.json was not created. Because the required baseline allow-list boundary was unavailable, the attempt could not safely edit or test and must report Blocked.

Candidate 2 (Attempt 2)

Approach: Make the presented Shell overlay flyout an accessibility-modal UIKit container. The intended surgical change in FlyoutContainerManager.ToggleAccessibilityElementsHidden() would set _flyoutContainerView.AccessibilityViewIsModal while a non-split flyout is presented and clear it when closed or split, while retaining the current detail AccessibilityElementsHidden behavior.

Candidate 1 explicitly avoided: Candidate 1 proposed gating ShellSectionHandler.iOS.cs pending-navigation completion drainage so transient disappear callbacks are not treated as teardown. Candidate 2 does not change disappear callbacks, teardown state, pending completion drainage, navigation completion, or ShellSectionHandler.

Mechanism-level difference: Candidate 1 hypothesized lifecycle misclassification causing premature navigation completion. Candidate 2 hypothesizes an accessibility-tree mismatch: Shell sets _flyoutOverlapsDetail, which deliberately leaves the detail subtree exposed while the open scrim blocks interaction. Marking the visible flyout container accessibility-modal asks UIKit to confine VoiceOver focus to the flyout without hiding the detail subtree from compatibility automation. This is an accessibility containment mechanism, not a navigation-lifecycle mechanism.

Files changed:

  • None (Blocked before editing)

Full captured diff:

(no attempt diff; blocked before editing tracked files)

Primary test result:

  • Command: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Window"
  • Outcome: Not run (EstablishBrokenBaseline.ps1 rejected the pre-existing dirty working directory; .github/.baseline-state.json was absent, so implementation/testing was forbidden)

Regression test result:

  • Command: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Shell"
  • Outcome: Not run (primary did not pass)

Result: Blocked

Self-review count: 0 (reviewer-findings.json = []). One inline self-review was performed against the conceptual candidate and the empty attempt diff; no correction/re-review was performed.

Failure/blocker analysis: Baseline establishment failed with DIRTY WORKING DIRECTORY - Cannot establish baseline, listing pre-existing unrelated changes. Direct verification showed .github/.baseline-state.json was absent. Without its RevertedFiles allow-list, no target file could be edited and no test could be run. Step 9 then ran exactly pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore and returned No baseline state found, Restored False, which is the expected restore outcome for this verified no-state/no-edit blocked path.

🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Winning candidate: pr-plus-reviewer

The submitted PR should not merge unchanged because the expert review identified two concrete runtime defects: an open overlapping flyout leaves obscured detail controls reachable to VoiceOver, and MatchParent pages are mutated to a concrete flow direction so later RTL/LTR changes can stop propagating. The single consolidated pr-plus-reviewer patch fixes both defects while preserving the PR's handler architecture, and its required iOS Window and Shell validation commands passed.

The trusted Gate remains INCONCLUSIVE because its tests could not be built or run. That is not treated as a candidate failure. No STEP 5a candidate produced a regression-test failure; both were blocked before implementation and testing.

Rank Candidate Implementation Primary validation Regression validation Assessment
1 pr-plus-reviewer Reviewer patch fixes accessibility focus containment and preserves inherited flow direction Pass: 3/3 Window tests Pass: 411/411 Shell tests Best verified candidate; directly resolves both major expert findings.
2 pr Raw submitted migration Gate inconclusive Not independently run for this comparison Architecturally strong, but retains both major defects and the migration-parity coverage gap.
3 try-fix-2 Concept only: make the open flyout accessibility-modal Blocked: not run Blocked: not run Targets one verified defect and informed the winning accessibility fix, but produced no diff and does not address flow-direction mutation.
4 try-fix-1 Concept only: gate pending navigation completion drainage during teardown Blocked: not run Blocked: not run Addresses a separate lifecycle hypothesis unsupported by a candidate diff or validation and leaves both expert defects unresolved.

Why pr-plus-reviewer wins

It is the only candidate that both implements fixes for all verified major findings and passes the required targeted regression command. Its changes are localized to the affected iOS platform manager and Shell section handler, avoid mutating public API, and retain MatchParent semantics rather than replacing inherited state.

Remaining uncertainty

The 411 passing Shell tests provide regression evidence, but the suite predominantly registers the compatibility ShellRenderer; it does not constitute direct, comprehensive parity coverage for the newly default iOS/MacCatalyst Shell handler. This residual coverage gap should be tracked, but it does not outweigh the winning candidate's concrete correctness improvements and passing required validations.

🔗 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/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs #36495 #36249

🧪 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
#36495 DeviceTest ShellTests Category=Shell

🧪 Regression Test Results

✅ PASSED — 1 passed, 0 failed, 0 skipped

Fix PR Test Type Result
#36495 ShellTests DeviceTest ✅ PASSED
📱 UI Tests — Shell,ViewBaseTests

Detected UI test categories: Shell,ViewBaseTests

✅ Deep UI tests — 428 passed, 0 failed, 16 skipped across 2 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Shell 316/332 (16 skipped) ✓ —
ViewBaseTests 112/112 ✓ —
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)
🧭 Next Steps — reviewer changes required

I have addressed the valid suggestions.

  • VoiceOver accessibility: Addressed with a defensive change by setting AccessibilityViewIsModal = true on the open overlay flyout. The direct renderer-parity approach was not reused because it broke the existing Appium test.
  • FlowDirection.MatchParent: Not addressed because the legacy ShellSectionRootRenderer uses the same one-way MatchParent resolution. The handler follows the existing renderer behavior, so this was not introduced by the migration.
  • Additional regression tests: Not addressed because this PR is focused on the renderer-to-handler migration. Existing UI tests already cover most relevant areas and exercise the new handler since it is now the default implementation.

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.

🔵 Needs a closer look

A confirmed logic error in ShellSectionHandler.OnRemoveRequested can double-dispose/remove when removing the top page, which risks incorrect navigation behavior at runtime.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs:8

  • ShellHandler.iOS.cs includes unused using directives (CoreAnimation, MediaPlayer). These generate CS8019 warnings and add noise to the file; remove them if they aren’t needed.

src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:953

  • OnRemoveRequested() calls OnPopRequested(e) when removing the top view controller, but then continues to call RemoveViewController(viewController) and DisposePage(page) unconditionally. This can double-dispose the page and attempt to remove the same controller twice while a pop is in flight.
                    OnPopRequested(e);
                }

                RemoveViewController(viewController);
                DisposePage(page);
  • Files reviewed: 19/19 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@kubaflo

This comment has been minimized.

@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

@Vignesh-SF3580 — new AI review results are available based on commit db723ef.

Gate Inconclusive Confidence Unknown Platform iOS


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ INCONCLUSIVE

Platform: IOS · Base: net11.0 · Merge base: d96aa524

🩺 Could not verify — environment/infrastructure error. The gate ran the tests but hit an environment error (an emulator/simulator/Appium/XHarness flake, a device that would not boot, or an empty/invalid result file), so it could not record a real pass/fail. The ⚠️ ENV ERROR marks below are infrastructure, not test failures — this is not a problem with your PR. Comment /review to retry on a fresh agent.

XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.WindowHandlerTests' (the target tests did not run).

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 WindowHandlerTests Category=Window ⚠️ ENV ERROR ⚠️ ENV ERROR
🔴 Without fix — 📱 WindowHandlerTests: ⚠️ ENV ERROR · 78s

No log file found

🟢 With fix — 📱 WindowHandlerTests: ⚠️ ENV ERROR · 66s

No log file found

⚠️ Failure Details

  • ⚠️ WindowHandlerTests without fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.WindowHandlerTests' (the target tests did not run).
  • ⚠️ WindowHandlerTests with fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.WindowHandlerTests' (the target tests did not run).
📁 Fix files reverted (14 files)
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutContentRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs
  • src/Controls/src/Core/Handlers/Shell/ShellHandler.cs
  • src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
  • src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.iOS.cs
  • src/Core/src/Handlers/TabbedView/TabbedViewHandler.iOS.cs
  • src/Core/src/Platform/iOS/FlyoutContainerManager/FlyoutContainerManager.cs
  • src/Core/src/Platform/iOS/FlyoutContainerManager/IFlyoutContainerDelegate.cs
  • src/Core/src/Platform/iOS/NavigationControllerManager/NavigationControllerManager.cs
  • src/Core/src/Platform/iOS/TabBarControllerManager/ITabBarManagerDelegate.cs
  • src/Core/src/Platform/iOS/TabBarControllerManager/TabBarControllerManager.cs

New files (not reverted):

  • src/Controls/src/Core/Handlers/Shell/ShellContentHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellItemHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs

📋 Pre-Flight — Context & Validation

PR #37034 Pre-Flight

Scope

  • Title: [NET11] [iOS/MacCatalyst] Migrate Shell to Handler architecture
  • Base / materialized head: net11.0 at d96aa524 / squashed review commit c9fd03d1aa
  • Platform: iOS
  • Gate: Inconclusive. WindowHandlerTests did not produce a fresh XHarness result with or without the PR, so this is an environment/build blocker rather than evidence that the implementation fails.

Problem and Existing Approach

The PR replaces the iOS/MacCatalyst compatibility ShellRenderer, ShellItemRenderer, and ShellSectionRenderer ownership model with four registered handlers:

  • ShellHandler owns the root controller and shared FlyoutContainerManager.
  • ShellItemHandler owns the tab controller through TabBarControllerManager.
  • ShellSectionHandler owns the navigation controller through NavigationControllerManager.
  • ShellContentHandler forwards ShellContent.Content mapper updates to its owning section.

The implementation reuses compatibility appearance/page trackers through adapters, adds Shell-specific extension points to the shared flyout/tab/navigation managers, makes the handler path the unconditional default, and adds the corresponding iOS/MacCatalyst public API entries.

Direct Diff Inspection

The materialized PR changes 19 files: 4,089 insertions and 79 deletions.

  • Four new production files contain the handler implementation:
    • src/Controls/src/Core/Handlers/Shell/ShellContentHandler.iOS.cs
    • src/Controls/src/Core/Handlers/Shell/ShellHandler.iOS.cs
    • src/Controls/src/Core/Handlers/Shell/ShellItemHandler.iOS.cs
    • src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs
  • Fourteen existing production files change handler registration, mapper/API surface, compatibility tracker behavior, and shared iOS manager extension points.
  • The only test-file change adds OnViewWillLayoutSubviews() to an existing ITabBarManagerDelegate test stub; it adds no behavioral assertion.

The current approach is a broad architecture migration rather than a narrow bug fix. An alternative must preserve handler registration, Shell navigation/tab/flyout behavior, and the public extensibility surface while using a meaningfully different mechanism from the PR or any prior attempt.

Test Commands

Primary detected test:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Window"

Mandatory regression test after the primary test passes:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Shell"

The regression test comes from #36495, which fixed #36249 in ShellFlyoutLayoutManager.cs. The previously completed cross-reference run passed this Shell category, but every candidate must run it independently after its own primary test succeeds.

Try-Fix Restoration Constraint

The gate identified 14 baseline-revertible production files and four PR-added production files. The try-fix skill requires .github/.baseline-state.json to have an empty NewFiles array before editing; otherwise the attempt must be recorded as Blocked and restored without changing tracked files. Therefore each attempt must run the prescribed baseline script and honor its resulting state rather than manually deleting, restoring, or editing around this boundary.

Candidate Bounds

Each model gets one independent approach, one implementation/test pass, and at most one focused correction/retest. No gate rerun, full test suite, cross-pollination, external expert agent, or separate final audit is permitted.


🔬 Code Review — Deep Analysis

Expert PR Evaluation

Reviewed candidate: pr (raw submitted PR fix, abf60611e18f368b1b3927b8d8325bdbf769ad36..db723ef2299cdd0942d10e4b6b9ce7a32653c991)

Expert verdict: LGTM

The expert reviewer found no actionable file:line correctness, lifecycle, platform, performance, API, or regression-prevention defects in the submitted iOS/MacCatalyst Shell handler migration. The required inline findings artifact contains an empty JSON array.

The Gate remains INCONCLUSIVE because the required tests could not be built or run. This is an evidence gap rather than a regression-test failure, so it does not invalidate the code-only expert verdict, but the PR remains unverified by that Gate.


🛠️ Try-Fix — Analysis & Comparison

Try-Fix Candidate 1 — PR #37034

Approach Description

Proposed (but not implemented due baseline contract): keep the handler migration, but defer initial Shell item/section containment and activation until the root host controller reports container readiness, instead of eager switching during ConnectHandler / mapper sequencing.

Prior Approach Avoided and Mechanism-Level Difference

The current PR’s mechanism is eager handler-time composition (ShellHandler/ShellItemHandler/ShellSectionHandler wire managers and switch current item during connection and property mapping).
This candidate intentionally avoids adding another eager connect-time path and instead targets lifecycle ordering instability.

Mechanism-level difference: first containment/selection would be gated on explicit host readiness so flyout/tab/navigation delegates execute only after a stable parent-child view-controller hierarchy exists.

Result

Blocked

Files Changed

None.

Full Candidate Diff

(empty diff)

Exact Test Commands and Results

Primary command (run only if testing phase is reached):

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Window"

Mandatory regression command (only after primary passes):

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Shell"

Tests were not run.

Reason:

  • Mandatory baseline setup failed with dirty-worktree guard.
  • .github/.baseline-state.json was absent.
  • Try-fix boundary rules require Blocked before editing when baseline state is absent/unsafe.

Failure / Blocker Analysis

pwsh .github/scripts/EstablishBrokenBaseline.ps1 failed because of pre-existing tracked modifications in the shared worktree.
Per try-fix baseline-file-boundary rules, proceeding without baseline state would make restoration unsafe, so the candidate was blocked before any tracked-file edits.

Mandatory restore command was executed:

pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore

Output: No baseline state found. Nothing to restore. Restored False (valid for this no-state blocked path).

Inline Self-Review

Findings count: 0

reviewer-findings.json:

[]

Try-Fix Candidate 2 — PR #37034

Approach Description

Proposed (but not implemented because baseline safety blocked edits): preserve the new iOS/MacCatalyst handler registrations and let handlers own connection, mapper dispatch, and disposal, while making them thin composition adapters over the established compatibility Shell renderer graph. The compatibility flyout layout/content and page-tracker collaborators would be made handler-context-aware and reused as the single behavioral implementation. Shell-specific navigation, tab, flyout, appearance, and teardown behavior would therefore not be recopied into generalized FlyoutContainerManager, TabBarControllerManager, and NavigationControllerManager paths.

Comparison to the PR and Candidate 1

The PR performs a broad behavioral port: four handlers reconstruct legacy Shell behavior through shared platform managers and add Shell-specific manager extension points. This candidate instead hypothesizes that the primary regression risk is semantic drift introduced by duplicating thousands of lines of mature renderer behavior. It retains handler architecture at registration and lifecycle boundaries but composes the existing renderer algorithms internally, reducing the migration surface while preserving established behavior.

Candidate 1 proposed a different root cause and mechanism: eager initial containment/selection could run before the root host was ready, so it would defer activation until explicit host readiness. Candidate 2 does not defer initial activation or gate work on host readiness. It changes where behavior comes from: handler-owned adapters delegate to the proven compatibility compositor rather than reproducing behavior with new manager-backed implementations.

Mechanism-Level Difference

Handler ConnectHandler/mapper/disconnect operations would forward into adapterized compatibility components using the handler's MauiContext, virtual view, and parent controller. Because the legacy compositor remains the single path for selection ordering, native controller containment, flyout geometry, appearance updates, navigation completion, and disposal, parity follows from reuse rather than from re-deriving each edge case. This differs causally from the PR's new manager execution path and candidate 1's delayed execution timing.

Result

Blocked

The mandatory baseline command rejected pre-existing tracked harness modifications and did not create .github/.baseline-state.json. Under the try-fix boundary, an absent state file means there is no safe RevertedFiles allow-list, so no tracked production file could be edited. This is a baseline-safety blocker, not evidence that the PR, gate, or proposed candidate fails.

Files Changed

None.

Full Candidate Diff

(empty diff)

Exact Test Commands and Results

Primary command, not run because the testing phase was not reached:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform ios -TestFilter "Category=Window"

Conditional mandatory regression command, not run because the primary command could not run:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter "Category=Shell"

The gate was not rerun and its prior inconclusive XHarness result was not classified as a failure.

Failure / Blocker Analysis

Executed baseline command:

pwsh .github/scripts/EstablishBrokenBaseline.ps1

It failed with EstablishBrokenBaseline.ps1 failed: Working directory is not clean after listing the pre-existing tracked harness modifications. .github/.baseline-state.json was explicitly verified absent. No production edit or test was attempted.

Mandatory restore command was executed exactly:

pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore

Output: No baseline state found. Nothing to restore. and Restored False. This is the accepted no-state restoration result because baseline setup failed before state creation and this attempt made no tracked edits.

Attempt Artifacts

Stored in CustomAgentLogsTmp/PRState/37034/PRAgent/try-fix/attempt-2/: baseline.log, approach.md, result.txt, fix.diff, test-output.log, analysis.md, reviewer-findings.json, and reviewer-findings.diff.

Inline Expert Self-Review

The required overarching principles and always-active Logic and Correctness, Regression Prevention, and Complexity Reduction checks were applied inline. With no candidate code diff, there were 0 findings. reviewer-findings.json contains [].


🏁 Report — Final Recommendation

✅ Final Recommendation: APPROVE

Winner

pr — the raw submitted fix

The submitted PR is the only fully implemented candidate, and the single expert review found no actionable errors, warnings, or discussion items. pr-plus-reviewer is intentionally source-equivalent because the reviewer had no correction to apply; choosing the raw PR avoids presenting an identical no-op derivative as an improvement.

Candidate Comparison

Rank Candidate Implementation Expert assessment Validation evidence Comparative result
1 pr Complete 19-file iOS/MacCatalyst Shell handler migration LGTM, zero inline findings Gate INCONCLUSIVE because XHarness produced no fresh Window results; separate Category=Shell regression cross-reference PASSED Winner. Only implemented candidate, no demonstrated defect, and no alternative provides a verified improvement.
2 pr-plus-reviewer Identical to pr; empty reviewer delta Inherits the same clean expert assessment No candidate-specific rerun because no patch existed and Gate verification could not be rerun Correct but provides no code or evidence advantage over the submitted PR.
3 try-fix-1 Not implemented; proposed deferring initial containment/selection until host readiness No candidate code to assess Blocked before edits; no primary or regression test ran An untested lifecycle-ordering hypothesis cannot outrank working reviewed code.
4 try-fix-2 Not implemented; proposed thin handler adapters over the compatibility renderer graph No candidate code to assess Blocked before edits; no primary or regression test ran A broader untested alternative with no diff cannot outrank working reviewed code.

Decision Rationale

  • No candidate failed a regression test. The two try-fix-* candidates were blocked before implementation or testing, which is uncertainty rather than failure.
  • The Gate's missing XHarness results do not prove either success or failure and are not used as grounds to request changes.
  • The raw PR's Shell regression cross-reference passed, and the expert reviewer found no concrete lifecycle, mapper, teardown, manager-extension, API, or platform defect.
  • pr-plus-reviewer has an empty reviewer.patch, so its runtime behavior and risk are exactly the same as pr; the original submitted candidate wins the tie.

Residual Uncertainty

The Window device-test Gate remains unverified because the target tests did not produce results. Approval is therefore based on the submitted implementation's code quality, the clean expert review, and the available passing Shell regression evidence—not on a successful Gate run.


🔗 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/Compatibility/Handlers/Shell/iOS/ShellFlyoutLayoutManager.cs #36495 #36249

🧪 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
#36495 DeviceTest ShellTests Category=Shell

🧪 Regression Test Results

✅ PASSED — 1 passed, 0 failed, 0 skipped

Fix PR Test Type Result
#36495 ShellTests DeviceTest ✅ PASSED

📱 UI Tests — Shell,ViewBaseTests

Detected UI test categories: Shell,ViewBaseTests

✅ Deep UI tests — 428 passed, 0 failed, 16 skipped across 2 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Shell 316/332 (16 skipped) ✓ —
ViewBaseTests 112/112 ✓ —
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)

🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@kubaflo

kubaflo commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR 37034 adversarial review and local iOS validation

@Vignesh-SF3580 - review results are based on commit db723ef229.

Overall Needs human investigation Failures 28 Baseline 3 on base Platform iOS and MacCatalyst

Adversarial review: Needs human investigation - click to expand

Overall verdict: Needs human investigation

Merge answer: Do not merge in the current state. The exact-head Shell coverage is strong and did not reproduce a PR-specific regression, but CI has not earned green: 10 checks failed, 2 were canceled, the in-scope MacCatalyst Shell UI leg was canceled, two review threads remain unresolved, and GitHub reports CHANGES_REQUESTED / BLOCKED.

Coverage: 123 checks - 111 passing/neutral/skipped - 12 failing - 0 pending - 0 inaccessible - 2 unmapped - 7 unexplained build legs - 0 unaccounted failing checks - 2 aborted failing checks - 0 canceled-build checks - 6 device-test checks unverified by the deterministic gatherer - 27 unattributed - 0 regressed-vs-base. Deterministic ceiling: Needs human investigation.

Exact-head local results

Suite Result
Shell unit tests 462 passed, 0 failed
Shell iOS device tests 208 passed, 0 failed, confirmed from the xUnit XML
Full Shell iOS UI category 332 total: 309 passed, 7 failed, 16 skipped
Targeted custom-back state probe 1 passed; tapping the custom icon returned to Main and updated Shell's logical current page

The local runs used an iPhone 11 Pro iOS 26.5 simulator with Xcode 26.6 and .NET 11.0.100-preview.6.26359.118.

The seven local UI failures were:

  • MoreTabShouldRespectNavBarCustomization - 2.63%
  • SearchHandlerShouldNotOverlap - 1.92%
  • PageShouldNotMoveOutsideViewportWhenEntryFocusedOnPageLoad - 2.28%
  • ShellBadgeCanBeCleared - 1.29%
  • ShellBadgeCanBeSetAtRuntime - 1.33%
  • ShellBadgeInitialBadgeIsVisible - 1.33%
  • ShellBadgeMultipleTabsCanHaveBadges - 1.34%

I reran all seven against the then-current net11.0 base (6b5489c8e9). The base failed the same seven tests at the same percentages, and every decoded PR/base actual-image pair had SSIM 1.000000. Multimodal inspection also showed the same keyboard, search-layout, tab, and badge drift on both sides. These seven failures are baseline/environment drift, not evidence of a PR regression.

GPT-only adversarial review

Independent reviews used GPT-5.6 Sol, GPT-5.5, GPT-5.3 Codex, and GPT-5.6 Terra, followed by targeted code tracing and simulator probes. The review covered navigation-stack synchronization, custom back buttons, More-tab routing, collection mutation/reset paths, tab enabled state, search dismissal, transition races, and RTL locked-flyout layout.

No PR-specific blocking defect was reproduced. In particular, a targeted test for the custom back-icon native-pop path passed and was removed after the probe. Two existing review threads still need an explicit resolution:

CI failure classification

Failure group Verdict On base? Evidence
Local seven Shell visual comparisons Likely unrelated yes Same failures and percentages on net11.0; PR/base decoded pixels are identical
Android/Windows device build errors Needs human investigation mixed Two legs are also red on sampled base builds; one is flaky on base; exact causes remain unattributed
Android device work-item crash/incomplete runs Needs human investigation no exact match One incomplete run reported 2979 passed / 1 failed / 72 skipped and can mask tests that never ran
platform-tools;35.0.2 provisioning failures Needs human investigation two exact matches Retried and still failing; sampled base legs are flaky, so the deterministic attribution remains indeterminate
SafeArea UI failures/crashes Needs human investigation no exact match Retried failures on a leg that is flaky across sampled base builds
MacCatalyst/iOS CI visual comparisons Needs human investigation no exact match Snapshot differences remain unattributed; visual evidence alone cannot clear the gate
Windows sample build MSB3231 Likely unrelated yes Exact failure is pre-existing on the base branch
Remaining device/UI work-item and publish failures Needs human investigation no exact match Missing, incomplete, or non-specific failure evidence prevents causal attribution

The required maui-pr build passed. maui-pr-devicetests build 1582633 and maui-pr-uitests build 1582631 failed. The iOS device Helix jobs report zero failed work items, but the MacCatalyst Shell UI leg was canceled and is not a trustworthy pass.

Recommended action

Complete or rerun the canceled MacCatalyst Shell leg, classify the seven unexplained build legs and remaining unattributed failures, and resolve the two code-review threads. Merge only after CI earns a trustworthy green result and the blocking review state is cleared.

Evidence details
  • Current GitHub check summary: 110 success, 10 failure, 2 canceled, 1 skipped.
  • Deterministic CI evidence: 28 distinct failures; 3 exact base matches; 5 retried-still-failing; 7 unexplained build legs; no leg was deterministically red on PR and green across sampled base builds.
  • Recent sampled net11.0 builds for both device and UI pipelines were also failing, but the baseline extraction was incomplete, so it cannot clear unmatched failures.
  • Build Analysis and Build Insights are the two failing checks without inspectable AzDO build evidence.
  • The PR head remained db723ef229 after all local testing; the disposable probe was removed and the detached test worktree is clean.

@kubaflo kubaflo 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.

It is a bit late to add it to net11 - Could we please create opt-in Shell2 with this implementation and keep the current shell for iOS as it is. I'd love to have this PR merged, though. Let me know if you need some help with this

Keep ShellRenderer as the default implementation on iOS and Mac Catalyst. Allow applications to opt in to the new ShellHandler hierarchy through the UseiOSShell2Handler MSBuild property.
@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

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.

🔵 Needs a closer look

A confirmed double-dispose/double-remove bug exists in ShellSectionHandler.OnRemoveRequested when removing the top view controller.

Review details

Suppressed comments (1)

src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.iOS.cs:950

  • OnRemoveRequested invokes OnPopRequested when removing the top view controller, but then continues to call RemoveViewController/DisposePage. This can double-dispose the page (and try to remove the same VC twice) because OnPopRequested already performs the pop and calls DisposePage after the pop completes.
                if (viewController == _navigationController.TopViewController)
                {
                    e.Animated = false;
                    OnPopRequested(e);
                }
  • Files reviewed: 21/21 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@Vignesh-SF3580

Copy link
Copy Markdown
Contributor Author

It is a bit late to add it to net11 - Could we please create opt-in Shell2 with this implementation and keep the current shell for iOS as it is. I'd love to have this PR merged, though. Let me know if you need some help with this

@kubaflo I have updated the changes to keep ShellRenderer as the default implementation on iOS and Mac Catalyst, and made the new ShellHandler implementation opt-in through UseiOSShell2Handler.

@kubaflo

kubaflo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Empirical iOS review (ac7b4aa)

Verdict: not safe to merge yet. The opt-in app builds and its representative happy paths work, but targeted simulator testing reproduced three blocking regressions on the current head.

Build and working behavior

  • Built Maui.Controls.Sample.Sandbox successfully for net11.0-ios / iossimulator-arm64 with <UseiOSShell2Handler>true</UseiOSShell2Handler>: 0 errors, 2 environment warnings.
  • Tested on an iPhone 11 Pro simulator running iOS 26.5 with Xcode 26.6 and .NET SDK 11.0.100-preview.6.26359.118.
  • The runtime configuration contained Microsoft.Maui.RuntimeFeature.IsiOSShell2HandlerEnabled=true, and the app reported the new ShellHandler, ShellItemHandler, ShellSectionHandler, and ShellContentHandler types.
  • Initial routing, tab switching, flyout open/close and selection, push/pop, RTL toggle, native More selection, and rotation passed in three consecutive runs. Rapid A-to-B-to-C switching during modal dismissal also passed 12 retained iterations.

Happy-path recording:

pr37034-shell-flows.mp4

Reproducible blockers

  1. RTL + FlyoutBehavior.Locked hides the detail pane. The detail page remains in the accessibility hierarchy but is fully transparent. Pixel sampling changed from 100% magenta before Locked to 0% magenta / white while Locked, then returned to 100% after reset. This reproduced in four retained runs and matches FlyoutContainerManager.cs, which sets the whole detail layer opacity to zero.
Before Locked RTL + Locked
Detail visible before Locked Detail invisible with RTL and Locked
  1. Navigation under the native More tab is inconsistent. Push and ordinary pop work, but InsertPageBefore changes the logical stack and then throws ArgumentOutOfRangeException from NavigationControllerManager.InsertViewController. Removing the current top page and PopToRootAsync complete logically while UIKit remains on a blank stale More Two controller. These failures reproduced in runs 4-6. The implementation uses MoreNavigationController for push/pop but the regular _navManager for insert/remove/pop-to-root in ShellSectionHandler.iOS.cs.
Insert exception after logical mutation Blank stale native controller after pop-to-root
More InsertPageBefore exception More pop-to-root native logical divergence
  1. Section mutation followed by Shell replacement aborts the app. Adding/removing a ShellContent and synchronously replacing Window.Page terminated the process with SIGABRT immediately after the replacement marker in four retained runs. No .ips report was emitted, so I am not assigning a narrower root cause than the deterministic mutation/disconnect sequence.

CI context

The current rollup has 126 checks: 116 passing/neutral/skipped and 10 failing. Deterministic base comparison caps CI at Needs human investigation: the Mac Catalyst Shell UI-test leg was canceled, iOS Mono device tests contain unmatched Shell-adjacent failures, and several failed legs remain unattributed. More importantly, no checked-in test configuration enables UseiOSShell2Handler, so existing CI does not validate this new hierarchy.

I would hold the PR until the three reproduced failures are fixed and covered by tests that explicitly enable the opt-in handler.

@kubaflo kubaflo 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.

Awesome! There is still a few issues it seems, but now we will be able to include it in the rc2 once bugs are fixed :) Also a suggestion from @PureWeen - we can just call it ShellHandler since shell didn't have handler implementation

…t-in

Prevent queued header updates from accessing ShellSectionHandler.VirtualView after the handler has disconnected during a synchronous Window.Page replacement. Rename UseiOSShell2Handler to UseiOSShellHandler across the MSBuild property, runtime feature switch, and handler registration.
@Vignesh-SF3580

Copy link
Copy Markdown
Contributor Author

#37034 (comment)

@kubaflo I have addressed the valid suggestions. Please find the details below.

RTL + FlyoutBehavior.Locked hides the detail pane:
This issue is not specific to the handler implementation. The same behavior can also be reproduced with the renderer implementation. I have created a separate issue to track this and will address it separately. (38322)
Navigation under the native More tab is inconsistent:
This issue is also not specific to the handler implementation. The same behavior can also be reproduced with the renderer implementation. I have created a separate issue to track this and will address it separately. (38323)
Section mutation followed by Shell replacement aborts the app:
This issue occurs only with the handler implementation. I have addressed the issue in this PR.
Shell Handler Naming Update:
Updated the name to UseiOSShellHandler as suggested.

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.

🟡 Changes recommended

The PR description’s opt-in naming doesn’t match the implemented switch/property names, and the new opt-in path appears to lack CI test coverage exercising the iOS/MacCatalyst handler.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs:1250

  • SearchItemSelectedDelegate replaces any existing UISearchController.Delegate but does not forward DidDismissSearchController to the previous delegate. If any other code relies on that callback, it will silently stop working for the dismissal that triggers navigation. Consider chaining the dismissal callback to the prior delegate after restoring it.
				if (searchController.Delegate == this)
				{
					searchController.Delegate = _previousDelegate!;
				}

  • Files reviewed: 21/21 changed files
  • Comments generated: 2
  • Review effort level: Lite

@kubaflo

kubaflo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Follow-up empirical iOS review (52f1318)

Updated verdict: I no longer see a PR-specific merge blocker. The new commit fixes the handler-only teardown crash, while the two remaining failures reproduce under the current ShellRenderer as well. From the code/runtime side this looks safe to merge; the required CI check should still be rerun because it is currently red on an unrelated test flake.

Current-head results

  • Built Maui.Controls.Sample.Sandbox for net11.0-ios / iossimulator-arm64 with <UseiOSShellHandler>true</UseiOSShellHandler>: 0 errors.
  • Confirmed Microsoft.Maui.RuntimeFeature.IsiOSShellHandlerEnabled=true and the active ShellHandler, ShellItemHandler, ShellSectionHandler, and ShellContentHandler types.
  • The prior section-mutation + immediate Shell-replacement crash now passes 5/5 with the replacement page visible, the process still foregrounded, no signal/unhandled exception, and no simulator crash report. The previous reviewed head crashed 4/4.
  • A post-replacement smoke covering route initialization, tabs, flyout, and push/pop passed.
  • Search-result dismissal/navigation passed 4/4 across handler and renderer modes. A preinstalled sentinel UISearchControllerDelegate received DidDismissSearchController and was restored in every run, so the unresolved delegate-loss concern did not reproduce.
Fixed teardown sequence Search delegate/navigation probe
Replacement Shell remains live Search result navigates once and delegate is restored

Reclassified parity defects

Opt-in handler Legacy renderer
RTL Locked under handler RTL Locked under renderer

CI and remaining risk

Exact-head maui-pr build 1587130 passed 30/31 jobs, including all macOS builds, pack jobs, integration tests, and every iOS run. Its only failure was SkiaSharpSvgToolsTests.Resize.BasicNoScaleReturnsOriginalSize on Windows Release: fixture cleanup hit a transient temp-file lock. The PR does not touch Resizetizer, and the exact pre-existing fixture defect and validated fix are documented in #37883.

The remaining risk is coverage rather than a demonstrated regression: no checked-in test enables this opt-in hierarchy or protects the new disconnect guard. The Feature Parity section should also acknowledge #38322 and #38323. Confidence is low until required CI reruns green, but the current evidence supports merging once that unrelated gate passes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios platform/macos macOS / Mac Catalyst s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates 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.

7 participants