Repository navigation
[.NET 12] Native bottom sheets for iOS and Android - #40658
jfversluis wants to merge 42 commits into
Conversation
A page pushed with PushModalAsync (or a Shell route) presents as the platform's own bottom sheet when BottomSheet.IsEnabled is set: UISheetPresentationController on iOS/Mac Catalyst and Material's BottomSheetDialogFragment on Android. Other platforms show a regular modal. Attached properties: IsEnabled, Detents (Medium, Large, FitContent, Fraction, Height; up to three), SelectedDetent (two-way), HasDragHandle, IsDismissible and CornerRadius, with XAML type converters and iOS-specific edge-attached and scrolling-expands options. The modal stack stays in sync when the user dismisses a sheet natively (swipe, outside tap, back), including Shell routes, ModalPopping vetoes, Navigating deferrals and modals pushed meanwhile. Shell no longer loops forever when a ModalPopping handler cancels a route's modal pop. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Mac Catalyst shows the page in a window sheet, but UIKit still drew the grabber on the presenting window, where it floated over the dimmed content and moved with the selected detent. Also annotate nullable locals in the Android deferral device test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 7 findings · ⚠️ 1 breaking change
Reviewed commit db01fee.
Warning
Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:
See inline comments for details.
Apps can check it to choose a different presentation on platforms without a native bottom sheet, such as Windows, where the page is shown as a regular modal page. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The iOS 15 test has incorrect detent expectations that cause timeouts, alongside unresolved defects in fraction round-tripping, navigation cancellation, and Android sheet background precedence.
4 open issues
What changed in this PR
Adds native bottom sheets to .NET MAUI through existing modal navigation and Shell routing, using UIKit on iOS/Mac Catalyst and Material on Android. Windows retains regular modal presentation.
Changes:
- Adds attached properties, configurable detents, XAML converters, and platform support detection.
- Integrates native sheet presentation, selection, dismissal, and modal-stack synchronization.
- Adds unit, XAML, and device tests for sheet behavior and navigation cancellation.
| File | Description |
|---|---|
| src/Controls/tests/Xaml.UnitTests/BottomSheetProperties.xaml.cs | Tests attached-property parsing and binding across XAML inflators. |
| src/Controls/tests/Xaml.UnitTests/BottomSheetProperties.xaml | Defines sheet properties for XAML tests. |
| src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.BottomSheet.iOS.cs | Adds UIKit presentation and interaction test helpers. |
| src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.BottomSheet.cs | Tests presentation, dismissal, selection, and back handling. |
| src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.BottomSheet.Android.cs | Adds Material helpers and deferred-dismissal coverage. |
| src/Controls/tests/Core.UnitTests/ShellModalTests.cs | Tests sheet routing and canceled or deferred dismissals. |
| src/Controls/tests/Core.UnitTests/ModalNavigationPlatformTests.cs | Tests platform-dismissal synchronization and restoration. |
| src/Controls/tests/Core.UnitTests/BottomSheetTests.cs | Tests detent validation, conversion, and resolution. |
| src/Controls/src/Core/Shell/ShellSection.cs | Integrates sheet routes and detects canceled modal pops. |
| src/Controls/src/Core/Shell/ShellNavigationParameters.cs | Carries a guard for stale dismissal navigation. |
| src/Controls/src/Core/Shell/ShellNavigationManager.cs | Checks dismissal validity after navigation deferrals. |
| src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt | Records the new .NET Standard API surface. |
| src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt | Records the new .NET API surface. |
| src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt | Records the new Windows API surface. |
| src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Records the new Mac Catalyst API surface. |
| src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Records the new iOS API surface. |
| src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt | Records the new Android API surface. |
| src/Controls/src/Core/PlatformConfiguration/iOSSpecific/Page.cs | Adds compact-height and scrolling preferences. |
| src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.cs | Reconciles native dismissals with modal navigation. |
| src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.BottomSheet.Android.cs | Implements Material sheet presentation and behavior. |
| src/Controls/src/Core/Platform/ModalNavigationManager/ModalNavigationManager.Android.cs | Tracks sheet fragments and manages their lifecycle. |
| src/Controls/src/Core/Platform/ModalNavigationManager/ModalDialogEvents.Android.cs | Shares modal input-event forwarding. |
| src/Controls/src/Core/Platform/iOS/ControlsModalWrapper.cs | Connects UIKit sheet configuration and delegate callbacks. |
| src/Controls/src/Core/Platform/iOS/BottomSheetPresentation.cs | Maps detents and properties to UIKit sheets. |
| src/Controls/src/Core/Page/Page.cs | Consumes back presses for non-dismissible sheets. |
| src/Controls/src/Core/BottomSheet/BottomSheetDetentTypeConverter.cs | Parses individual detents and XAML detent lists. |
| src/Controls/src/Core/BottomSheet/BottomSheetDetentResolver.cs | Resolves, orders, and merges resting heights. |
| src/Controls/src/Core/BottomSheet/BottomSheetDetentKind.cs | Defines supported detent kinds. |
| src/Controls/src/Core/BottomSheet/BottomSheetDetent.cs | Defines detent values, equality, and serialization. |
| src/Controls/src/Core/BottomSheet/BottomSheet.cs | Exposes sheet properties and support detection. |
| src/Controls/src/Core/Animations/ModalPageTransitions.iOS.cs | Preserves native sheet transitions. |
Review effort: Balanced
There was a problem hiding this comment.
Expert Review — 10 findings · ⚠️ 1 breaking change
Reviewed commit 12e80e5.
Warning
Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:
See inline comments for details.
Previously reported findings were not duplicated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 10 findings · ⚠️ 1 breaking change
Reviewed commit 12e80e5.
Warning
Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:
See inline comments for details.
…0755) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Fix the deterministic `PageTransitionsTests` failures on `main`, including the product defects exposed once the More controller actually runs the transition. #### Product fixes - **Programmatically selected overflow tabs never installed the More navigation delegate.** UIKit reports the selected section's own controller, not `MoreNavigationController`, even though it displays that section inside More. Both Shell implementations now install their existing delegate for overflow sections when there are more than five tabs. This enables the custom animator, completion tracking, and shared-element flights. - **The compatibility renderer popped the wrong native stack.** Its pop-to-root operation now targets the overflow section's root on the active More controller and completes through the same transition-aware path as a single pop. It also reads the active controller's top page when recording an unanimated push, so a later pop reverses `None` instead of the page's configured Fade. - **The managed transition-coordinator binding rejects a null animation callback.** Supply a no-op animation callback while registering completion. Once the missing More delegate was fixed, the original callback produced `ArgumentNullException: animate` from `UIViewControllerTransitionCoordinatorWrapper.AnimateAlongsideTransition`. Native/default More navigation still completes immediately; only custom page transitions wait for their animation. #### Corrections to provably invalid test setup - `WindowHandlerStub` presents a workspace inside the runner's window; it never replaces `UIWindow.RootViewController`. Root-replacement tests now use a separate real window with the production content mapper. Their snapshot probe checks UIKit's native replicant class instead of the CLR `UIView` wrapper name. - `Window.PropertyChanged` runs **before** native content mapping. Install the root's own animation after the assignment, assert that it exists, and finish the replacement without detaching the root. Detaching an outgoing root lets UIKit remove its animations independently of MAUI's cleanup, invalidating the original assertion. - The destination may not have a handler immediately after `PushAsync` starts. Wait for its content to load before reading native visibility, and use a short asynchronous delay when polling so the platform animation loop can run. The original Android test throws in `NativeShown` before it can inspect a flight. - More navigation intentionally completes immediately for an unanimated push. Wait for the pushed content to load before issuing the next push/pop-to-root; otherwise UIKit has not yet finished presenting that controller. #### Which landing introduced this? The faulty transition code and tests came from #40537 (`f7d3fc1c99`), not the storyboard landing #40536 (`c1f549fd52`). Comparing those commits for all six files changed here produces an **empty diff**. The tests do not use storyboard animation holds. #40537's recorded checks include `maui-pr` but no `maui-pr-devicetests` check, so its successful build was not evidence that these device tests passed. The supplied main-branch CI window was last green at [1699752](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1699752) (`eeda7f80ed`), with the failures present from [1699985](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1699985) (`c1f549fd52`) onward, including [1703407](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703407). Before implementation, searched open and recently merged PRs across all bases, including `release/*`, `inflight/*`, and `candidate/*`. Inspected #40658 (bottom-sheet/modal transitions), #40344 (tab reselection), #40656 (TabbedPage lifecycle), #40696 (queued animation cancellation), and #40710 (zero-length tweens); none contains these fixes. #### Local causal validation All counts below are **passed / failed**, read from fresh XHarness XML with exact-class isolation verified. Each platform was measured on original sources, with the correction, with the correction reverted, and with it restored. No physical devices were used. | Phase | iOS 27 simulator | Mac Catalyst | Android API 33 emulator | | --- | --- | --- | --- | | Original baseline | 18 / 6 | 18 / 6 | 12 / 1 | | Fixed | 24 / 0 | 24 / 0 | 13 / 0 | | Reverted | 18 / 6 | 18 / 6 | 12 / 1 | | Restored | 24 / 0 | 24 / 0 | 13 / 0 | The reverted Apple failures are the two root tests and both variants of the More navigation/shared-element tests. Android reproduces the destination-handler `NullReferenceException`. The Helix Mac Catalyst opacity timeout did **not** reproduce locally; that case passed locally before and after the correction. Final validation additionally passed **24 / 0 on an iOS 18.5 simulator**. Commands below were run from an isolated worktree based on `main` at `6d74c1c0d9`. `.dotnet` contains the SDK pinned by `global.json` (`12.0.100-alpha.1.26523.103`); Xcode is 27.2. ```bash export PATH="$PWD/.dotnet:$PATH" export DOTNET_ROOT="$PWD/.dotnet" export TMPDIR="$PWD/artifacts/transition-evidence/scratch" export DOTNET_CLI_USE_MSBUILD_SERVER=0 export MSBUILDDISABLENODEREUSE=1 export DOTNET_ROLL_FORWARD=Major export HEADLESS=true ``` Preparation — all succeeded: ```bash dotnet build src/DotNet/DotNet.csproj -p:InstallDotNet=false -p:TreatWarningsAsErrors=false -v:minimal dotnet workload install ios maccatalyst --skip-manifest-update --verbosity minimal dotnet build Microsoft.Maui.BuildTasks.slnf -p:TreatWarningsAsErrors=false --disable-build-servers -v:minimal dotnet tool restore ``` iOS causal runs — original/reverted failed **18/6**; fixed/restored passed **24/0**: ```bash pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -iOSVersion 27 -TestFilter 'Category=PageTransitions' -IncludeClasses Microsoft.Maui.DeviceTests.PageTransitionsTests -SkipXcodeVersionCheck -Timeout 00:10:00 -Rebuild ``` Mac Catalyst causal runs — original/reverted failed **18/6**; fixed/restored passed **24/0**: ```bash pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform maccatalyst -TestFilter 'Category=PageTransitions' -IncludeClasses Microsoft.Maui.DeviceTests.PageTransitionsTests -SkipXcodeVersionCheck -Timeout 00:10:00 -Rebuild ``` Android causal runs — original/reverted failed **12/1**; fixed/restored passed **13/0**: ```bash export EmbedAssembliesIntoApk=true pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter 'Category=PageTransitions' -IncludeClasses Microsoft.Maui.DeviceTests.PageTransitionsTests -Timeout 00:10:00 -Rebuild ``` The runner selected `emulator-5556` and passed `--instrumentation com.microsoft.maui.controls.devicetests.TestInstrumentation`. A separate read-only API 33 emulator was used after another emulator's unauthorized ADB transport prevented the initial attempt from running tests. iOS 18.5 final compatibility check — passed **24/0**: ```bash pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -iOSVersion 18.5 -TestFilter 'Category=PageTransitions' -IncludeClasses Microsoft.Maui.DeviceTests.PageTransitionsTests -SkipXcodeVersionCheck -Timeout 00:10:00 ``` Formatting/checks — passed, with workspace-loading warnings from the formatter: ```bash dotnet format whitespace Microsoft.Maui.sln --no-restore --include src/Controls/tests/DeviceTests/Elements/PageTransitions/PageTransitionsTests.cs src/Controls/tests/DeviceTests/Elements/PageTransitions/PageTransitionsTests.iOS.cs --verify-no-changes git diff --check ``` The full repository formatter was also attempted; it emitted unrelated analyzer edits and multi-target conflict markers. Those edits were discarded, and the surgical patch was rebuilt and retested. No unrun CI check is represented as passing. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Deterministic main-branch `maui-pr-devicetests` failures described above; tracked here by the linked failing builds rather than an unrelated issue number. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, the agent opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 2 findings · ⚠️ 1 breaking change
Reviewed commit a73664a.
Warning
Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:
See inline comments for details.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Expert Review — No more findings
Reviewed commit 0421111.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
MAUI Autopilot · round 8
The focused .NET 12 suite passed 55/55. A local analyzer probe reproduced CA1416 before the change and passed afterward; native compilation and execution still need CI. |
There was a problem hiding this comment.
Expert Review — No more findings
Reviewed commit 23bba0a.
Selected Tests🧪 Test selection — click to expand
🧪 UI tests —
|
| Platform | Categories |
|---|---|
| Android | Animation, Navigation, Page, Shell1, Shell2, Material3 |
| iOS | Animation, Navigation, Page, Shell1, Shell2 |
| MacCatalyst | Animation, Navigation, Page, Shell1, Shell2 |
| Windows | Navigation, Shell1, Shell2 |
📊 Results — succeeded: 25 passed, 0 failed of 25 jobs
🔗 All test results · Build logs
🧪 Device tests — Controls.Memory, Controls.Modal, Controls.NavigationPage, Controls.PageTransitions +1 on Android, iOS, MacCatalyst, Windows
❌ maui-pr-devicetests #1709494 failed — 4 tests failed on Unknown. See Failed tests below.
GPT-6.2 Sol: Run targeted Controls device tests for native sheets, Windows modal fallback, navigation, transitions, and handler cleanup.
MAI Code 2: Run focused modal, navigation, transition, and Shell device tests on Android, iOS, and Mac Catalyst for native bottom sheets.
🧪 Ran — 5 categories on Android, iOS, MacCatalyst, Windows
| Platform | Categories |
|---|---|
| Android | Controls.Memory, Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
| iOS | Controls.Memory, Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
| MacCatalyst | Controls.Memory, Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
| Windows | Controls.Memory, Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
📊 Results — failed: 2 passed, 3 failed of 5 jobs
❌ Failed tests (4)
| Test | Failed on | Error |
|---|---|---|
ModalHandlerTests.[Modal] [Handler] OutsideTapOnlyDismissesDismissibleSheet |
Unknown | Assertion timed out |
ModalHandlerTests.[Modal] [Handler] SheetRestoredWhileItsDismissalIsDeferredIsPresentedOnce |
Unknown | Assertion timed out |
ModalTests.[Modal] [Renderer] OutsideTapOnlyDismissesDismissibleSheet |
Unknown | Assertion timed out |
ModalTests.[Modal] [Renderer] SheetRestoredWhileItsDismissalIsDeferredIsPresentedOnce |
Unknown | Assertion timed out |
🔗 All test results · Build logs
⏭️ Skipped — what neither suite runs
UI tests — 71 categories, 0 platforms
Categories not run: Accessibility, ActionSheet, ActivityIndicator, AppLinks, Border, BoxView, Brush, Button, CarouselView, CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, Cells, CheckBox, ContextActions, CustomRenderers, DatePicker, Dispatcher, DisplayAlert, DisplayPrompt, DragAndDrop, Entry, Editor, Effects, Essentials, FlyoutPage, Focus, Fonts, Frame, Gestures, GraphicsView, Image, ImageButton, IndicatorView, InputTransparent, IsEnabled, IsVisible, Label, Layout, Lifecycle, ManualReview, Maps, Performance, Picker, ProgressBar, RadioButton, RefreshView, SafeAreaEdges, Shadow, ScrollView, SearchBar, Shape, Slider, SoftInput, Stepper, Switch, SwipeView, TabbedPage, TableView, TimePicker, TitleView, ToolbarItem, Triggers, ViewBaseTests, VisualStateManager, Window, WebView
Use /azp run maui-pr-uitests for the full suite.
Device tests — 100 categories, 0 platforms
Categories not run: Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.MenuFlyout, Controls.Page, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml, Core.ActivityIndicator, Core.Animation, Core.Application, Core.Border, Core.BoxView, Core.Button, Core.CheckBox, Core.ContentView, Core.DatePicker, Core.Dispatcher, Core.Editor, Core.Element, Core.Entry, Core.FlowDirection, Core.FlyoutView, Core.Fonts, Core.Formatting, Core.Graphics, Core.GraphicsView, Core.Image, Core.ImageButton, Core.ImageSource, Core.IndicatorView, Core.Label, Core.Layout, Core.Lifecycle, Core.MauiContext, Core.Memory, Core.NavigationPage, Core.Page, Core.Picker, Core.ProgressBar, Core.RadioButton, Core.RefreshView, Core.ScrollView, Core.SearchBar, Core.ShapeView, Core.Slider, Core.Stepper, Core.SwipeView, Core.Switch, Core.TimePicker, Core.View, Core.WebView, Core.Window, Core.WindowOverlay, Graphics, Essentials, BlazorWebView
Use /azp run maui-pr-devicetests for the full suite.
🤖 Why these tests — AI rationale (GPT-6.2 Sol + MAI Code 2)
UI tests
Each model chose independently; every test that runs was selected by at least one of them.
| Platform | GPT-6.2 Sol | MAI Code 2 |
|---|---|---|
| Android | Navigation, Shell1, Shell2, Material3 |
Animation, Navigation, Page, Shell1, Shell2 |
| iOS | Navigation, Shell1, Shell2 |
Animation, Navigation, Page, Shell1, Shell2 |
| MacCatalyst | Navigation, Shell1, Shell2 |
Animation, Navigation, Page, Shell1, Shell2 |
| Windows | Navigation, Shell1, Shell2 |
— |
GPT-6.2 Sol — Run Navigation and Shell UI tests on all four platforms, plus Material3 on Android, for native bottom sheets and shared modal routing changes.
- ModalNavigationManager and ShellSection change shared modal and route unwinding, including on Windows.
- Android sheets use a Material3 dialog theme; add the Android Material3 lane.
- No unrelated controls or shared UI infrastructure changed.
MAI Code 2 — Native bottom sheets for Android, iOS, and Mac Catalyst; run focused modal/navigation, page, shell, and animation UI coverage.
- Android modal navigation and Material bottom-sheet hosting can affect modal presentation and transitions; run Navigation, Page, and Animation on Android.
- iOS and Mac Catalyst sheet presentation changes can affect modal wrappers, page lifecycle, custom transitions, and Shell routing; run Page, Navigation, Shell, and Animation there.
- The shared Shell modal-route changes warrant Shell coverage because bottom-sheet pages can be presented as modal routes.
- Windows is omitted because it has no native bottom sheet and this change does not alter its normal UI-test presentation path; no full run is needed for this opt-in feature.
Device tests
Each model chose independently; every test that runs was selected by at least one of them.
| Platform | GPT-6.2 Sol | MAI Code 2 |
|---|---|---|
| Android | Controls.Modal, Controls.NavigationPage, Controls.Shell, Controls.PageTransitions, Controls.Memory |
Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
| iOS | Controls.Modal, Controls.NavigationPage, Controls.Shell, Controls.PageTransitions, Controls.Memory |
Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
| MacCatalyst | Controls.Modal, Controls.NavigationPage, Controls.Shell, Controls.PageTransitions, Controls.Memory |
Controls.Modal, Controls.NavigationPage, Controls.PageTransitions, Controls.Shell |
| Windows | Controls.Modal, Controls.NavigationPage, Controls.Shell, Controls.PageTransitions, Controls.Memory |
— |
GPT-6.2 Sol — Run targeted Controls device tests for native sheets, Windows modal fallback, navigation, transitions, and handler cleanup.
- ModalTests cover native sheets and Windows fallback.
- ShellSection changes Shell and nested NavigationPage unwinds.
- Modal transitions and handler release warrant PageTransitions and Memory.
- No Core handler or other test project changed.
MAI Code 2 — Run focused modal, navigation, transition, and Shell device tests on Android, iOS, and Mac Catalyst for native bottom sheets.
- Changed Modal tests cover native push/pop, user dismissal, lifecycle, and sheet properties: run Controls.Modal on Android, iOS, and Mac Catalyst.
- Bottom sheets may host NavigationPage stacks and the implementation changes navigation/back behavior: run Controls.NavigationPage.
- Native presentation bypasses or coordinates custom modal transitions and iOS transition tests changed: run Controls.PageTransitions.
- Bottom sheets are integrated with Shell modal routes and platform-dismissal state updates: run Controls.Shell.
- Windows is omitted because native sheet rendering is unsupported; unrelated Controls and Core categories are not needed.
Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification.
|
MAUI Autopilot · round 8 Incomplete: no changes published. The available CI report identifies the Android tests but omits the assertion locations and the first causal error for Catalyst, so this round cannot determine whether Catalyst was blocked by a build break.
|
This comment has been minimized.
This comment has been minimized.
MAUI Autopilot — Stopped@kubaflo ❌ The fix round could not complete. Review the blocker before restarting Autopilot. Run. WhyIncomplete: nothing published. The CI report gives only
|


Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
12e80e5b4d975f61272d668fb715db23036c2dbb↑ Modal device tests: iOS 27 250/250, Mac Catalyst 254/254, Android API 35 all 8 sheet tests pass, Windows 48/48 run (3 existing skips).
↑ Runtime validated and recorded on iPhone (portrait and landscape), iPad landscape, a physical Pixel 10 with Material 3 (portrait and landscape) and a Windows DevBox; also on the Android emulator and Mac Catalyst.
↑ The Mac Catalyst run found a stray grabber on the presenting window, fixed in db01fee.
↑ GPT-6.2, Gemini 4 and Sonnet 5.5 signed off after two review rounds; every regression test added for review findings was verified to fail without its fix.
↓ Real touch drags on the physical Pixel were cut short by a flaky USB connection; drags were validated on the emulator.
↑
BottomSheet.IsSupported(12e80e5): device-test helpers assert it matches the observed presentation; Mac Catalyst 254/254, Android API 35 129/131 (2 pre-existing failures), Windows 48 passed / 3 existing skips; Controls.Core builds for every TFM.↓ iOS device tests not rerun after the IsSupported change (iOS build passes; same helper change as Catalyst).
↓ CI not run yet.
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!
Target Branch
mainnet11, for reviewDescription of Change
A first-party bottom sheet that uses what the OS provides natively:
UISheetPresentationControlleron iOS/Mac Catalyst and Material'sBottomSheetDialogFragmenton Android.A sheet is a modal presentation of a page, so it reuses modal navigation, lifecycle, back handling and Shell routing:
Common API (attached properties on
BottomSheet)IsEnabled(false) – present the modal as a sheet.Detents– 1 to 3 ofMedium,Large,FitContent,Fraction(x)/"40%",Height(h)/"300". Three is Android's limit.SelectedDetent(two-way) – follows the user's drags;nullmeans the smallest stop.HasDragHandle(true),IsDismissible(true; only affects interactive dismissal, neverPopModalAsync),CornerRadius(-1 = platform default).BottomSheet.IsSupported(static) –trueon Android, iOS and Mac Catalyst,falseelsewhere, so apps can pick another presentation (for example a flyout) where there is no native sheet.BottomSheetPrefersEdgeAttachedInCompactHeight,BottomSheetPrefersScrollingExpandsWhenScrolledToEdge.Platforms
ModalInPresentation; user detent changes written back via the sheet delegate; FitContent measures the content; iOS 26+ keeps the Liquid Glass material when the page has no background. Mac Catalyst shows the page in a centered macOS window sheet: the OS ignores detents, the drag handle is not shown, and the sheet closes through the page (for example a Close button), not by clicking outside or pressing Escape.BottomSheetDialogFragment; detents map to peek height / half-expanded ratio / expanded offset. MAUI's back routing runs first (an innerNavigationPagepops before the sheet dismisses), predictive back is forwarded, outside taps honorIsDismissible, the content handles system insets and the keyboard, and the Material 3 drag handle also shows in Material 2 apps.BottomSheet.IsSupportedisfalseand the page shows as a normal modal; the sheet appearance and behavior properties are ignored. With Shell,IsEnabledstill presents the page modally, the same as on the other platforms. A WinUI surface (for example aContentDialog-style or anchored flyout presentation) could be explored separately.Modal stack sync: when the user dismisses a sheet natively (swipe, outside tap, back),
ModalNavigationManager.OnPlatformModalDismissedAsyncpops it like any other modal, including through Shell. IfModalPoppingcancels, the sheet is presented again with its inner navigation intact. If aShell.Navigatingdeferral is still pending, the dismissal is checked again when the deferral completes, so a modal pushed in the meantime is never popped by mistake. iOS's existing PageSheet swipe-to-dismiss uses the same path now.Related fix: Shell used to retry forever when a
ModalPoppinghandler canceled a route's modal pop (with a page pushed underneath). It now stops that navigation.Design and review: the API was debated over two rounds with GPT-6.2, Gemini 4 and Claude Sonnet 5.5 (non-modal sheets and typed results were deferred). The code then went through two multi-model review rounds, and all three signed off after the findings were fixed. Community libraries consulted for inspiration: The49.Maui.BottomSheet, Plugin.Maui.BottomSheet, react-native-screens' form sheet.
Known limitations: non-modal (persistent) sheets and returning typed results aren't included. On Mac Catalyst the OS ignores detents and the drag handle.
Validation
dotnet build src/Controls/src/Core/Controls.Core.csproj -c Release -p:PublicApiType=Validatefor android, ios, maccatalyst, net and netstandard: passed with no errors.dotnet test src/Controls/tests/Core.UnitTests --filter "BottomSheet|Modal|Shell|Navigation": 934 passed. In the full run,TwoWayBindingToNullableDoublePropertyWithEmptyStringBecomesNullandStoppingFromPropertyChangingDuringATakeoverRaisesOnePairOfNotificationsfail on this machine for an unrelated reason: the local culture uses a decimal comma ("3,14").dotnet test src/Controls/tests/Xaml.UnitTests --filter BottomSheet: 3/3 passed (Runtime, XamlC, SourceGen).Run-DeviceTests.ps1 -Project Controls -Platform ios -TestFilter Category=Modal: 250/250 passed (iPhone 18 Pro iOS 27.0, iPhone 11 Pro iOS 26.5).Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter Category=Modal(API 35 emulator,EmbedAssembliesIntoApk=true): 129/131. All 8 bottom sheet tests pass. The 2 failures are the existingModalWindowInheritsActivitySystemBarForegroundAppearance, which this PR doesn't touch:Window.StatusBarColorhas no effect on API 35.Run-DeviceTests.ps1 -Project Controls -Platform maccatalyst -TestFilter Category=Modal: 254/254 passed.Run-DeviceTests.ps1 -Project Controls -Platform windows -TestFilter Category=Modal(Windows DevBox): 48 passed, 0 failed, 3 skipped (existing tests marked "Fails on Windows"). The sheet testsBottomSheetPushAndPopKeepsModalStackInSync(with and without Shell) andRapidBottomSheetPushAndPopLeavesNoSheetBehindpass. Controls.Core builds for Windows with 0 errors.BottomSheet.IsSupportedpublic: Mac Catalyst Modal 254/254, Android API 35 Modal 129/131 (same 2 pre-existing failures), Windows Modal 48 passed / 3 existing skips, Controls.Core BottomSheet + ShellModal unit tests 95/95. The device-test helpers assertIsSupportedistruewhere a native sheet was observed andfalseon Windows.PageHandler), then pops, pushes again and pops, ending with an empty modal stack and no errors.SelectedDetent, content updates, NavigationPage push/back inside the sheet, and Close with no layout loop. This run found the stray grabber, now fixed.UseMaterial3=true), portrait and landscape: every scripted scenario below runs with the M3 surface, shape and drag handle; Material caps the sheet width in landscape. Real touch drags were cut short because the phone's USB connection kept dropping, so drags were validated on the emulator only.BottomSheetPrefersEdgeAttachedInCompactHeightis set.Screenshots
Recordings
Each recording plays the same script: Medium/Large selection, three detents with a fraction, FitContent growing, drag handle and corner radius, a sheet over a sheet, a NavigationPage push and pop inside a sheet, a form with the keyboard, a CollectionView, and (iOS-specific) an edge-attached sheet.
iPhone 18 Pro, iOS 27, portrait
iphone-portrait.mp4
iPhone 18 Pro, iOS 27, landscape
iphone-landscape.mp4
iPad Pro 11-inch, iOS 27, landscape
ipad-landscape.mp4
Pixel 10, Android 16, Material 3, portrait
android-m3-portrait.mp4
Pixel 10, Android 16, Material 3, landscape
android-m3-landscape.mp4
Windows (DevBox): no native sheet, so each page shows as a regular modal. The demo pushes a sheet page, a NavigationPage sheet with a detail push and pop, and a sheet over a sheet, and finishes with an empty modal stack and no errors.
windows-sheet-demo.mp4
Issues Fixed
Fixes #