Repository navigation
Shard Shell UI tests into two CI lanes on all platforms - #39359
Conversation
Updated [Microsoft.AspNetCore.Authentication.Facebook](https://github.com/dotnet/dotnet) from 10.0.0 to 10.0.10. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.Authentication.Facebook's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.AspNetCore.Authentication.Google](https://github.com/dotnet/dotnet) from 10.0.0 to 10.0.10. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.Authentication.Google's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.AspNetCore.Authentication.MicrosoftAccount](https://github.com/dotnet/dotnet) from 10.0.0 to 10.0.10. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.Authentication.MicrosoftAccount's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
<!-- 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! ### Description of Change Removes the private `DropCompletedEventArgs.DropResult` property. The property was never assigned or consumed and always held its default value. `DropCompletedEventArgs` remains useful through its public `PlatformArgs` property. This does not change the public API surface. ### Issues Fixed Fixes #2839
…ating project cards (#37385) <!-- 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! ### Issue Details The voice-over does not announce the project description when the focus moves to the border element within the item template of the CollectionView on the Mac platform. ### Root Cause SemanticProperties.Description was bound only to the project Name on the parent Border. Because the card is exposed as one accessible/selectable element, VoiceOver does not announce the child labels separately ### Description of Change Combined both Name and Description values into the Border semantic description. ### Issues Fixed Fixes #37142 **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/20884ac2-7f4c-4907-8d97-02326a093be2" Width="600" Height="400"/>| <video src="https://github.com/user-attachments/assets/c0f63c4e-4e12-4af4-976d-439970db7a67" Width="600" Height="400"/> |
…ist item (#37340) <!-- 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! ### Issue Details Issue Details When a VisualStateGroup is replaced through the VisualStateGroupList indexer, the existing implementation only updates the internal list: `visualStateGroups[index] = replacementGroup;` The replacement bypasses the lifecycle behavior used by Add, Insert, and Remove: * The old group remains subscribed to StatesChanged. * The replacement group is not subscribed to StatesChanged. * Group and state names are not revalidated. * State triggers are not updated for the replacement. * The associated VisualElement is not notified to reevaluate its visual state. ### Description of Change <!-- Enter description of the fix in this section --> * Updated the VisualStateGroupList indexer setter to correctly manage group replacement: * Reject null replacement values with ArgumentNullException. * Unsubscribe ValidateAndNotify from the replaced group. * Replace the group in the internal collection. * Subscribe ValidateAndNotify to the new group. * Explicitly call ValidateAndNotify(_internalList) after replacement. ### 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. --> Fixes #37171 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **Android**<br> <img src="https://github.com/user-attachments/assets/1e6c5337-afcc-4e55-bba2-6852316fdf6a" width="300" height="600"> | **Android**<br> <img src="https://github.com/user-attachments/assets/006f5544-3393-4f3a-9774-86ff6d966947" width="300" height="600"> |
…me instead of item content in Narrator (#37421) <!-- 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! ### Root Cause On Windows, `CollectionView`'s legacy handler (CV1), which is based on `ListView`, derives each item's screen reader name from the root element of the `DataTemplate`. When neither `AutomationProperties.Name` nor `SemanticProperties.Description` is set on that root element, WinUI falls back to calling `.ToString()` on the bound item. As a result, Narrator announces the internal type name: `Microsoft.Maui.Controls.Platform.ItemTemplateContext` instead of meaningful item content. This is native WinUI `ListView` behavior documented by Microsoft and is not specific to MAUI. ### Description of Change Set `SemanticProperties.Description` on the `DataTemplate` root, `TaskView`'s `Border`, and scope it to Windows only. This ensures Narrator announces the bound task title instead of the internal type name. Windows-only scoping is necessary because applying `SemanticProperties.Description` on iOS and Mac Catalyst causes the root element to become a single accessibility element, preventing VoiceOver from navigating to the inner `CheckBox`. ### Issues Fixed Fixes #36940 ### Platforms Tested - [x] iOS - [x] Android - [x] Windows - [x] Mac ### Screenshots | Before Fix | After Fix | |------------|-----------| | <video width="350" alt="withoutfix" src="https://github.com/user-attachments/assets/b35e24bc-0c59-4db1-8210-1be4fe5c2333" /> | <video width="350" alt="withfix" src="https://github.com/user-attachments/assets/89ad2456-5c9d-4060-8685-e108e9fe8c3e" /> |
<!-- 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! ### Description Fixes #29418. On Windows, `W2DGraphicsView` stored Win2D's callback-scoped `CanvasDrawingSession` on its persistent canvas. Win2D disposes that native session after the draw callback returns, but the stale managed reference remained available across repeated pointer-driven redraws and shutdown, leading to native access violations and heap corruption. This change clears the drawing session after canvas state has been reset. The nested cleanup guarantees the session and thread-local canvas owner are released even if state reset throws. @Kamalesh-Periyasamy, once the PR artifacts are available, could you please try them with your original application and let us know whether they resolve the crash? ### Tests - Added a Windows device test that performs an initial draw plus 100 explicit invalidation/draw cycles and verifies the drawing session is released after every callback. - Verified the test fails without the fix by observing the retained, already-disposed `CanvasDrawingSession`. - Core DeviceTests: 2,092 total, 1,981 passed, 111 skipped, 0 failed. - Ran the exact issue attachment twice for 120 seconds each with 3,848 presses and 38,480 pointer moves per run; both exited cleanly with code 0 and no correlated Windows application errors. - Also validated custom/default fonts, `ManipulationMode.All`/`None`, multiple views, redraw, resize, unload, and graceful shutdown. ### Video verification #### Before — original reported crash The issue author's original recording shows the attached app failing during pointer interaction: https://github.com/user-attachments/assets/eecd8e89-17c9-4764-b21e-9e6c15141fb4 #### After — fixed DLL under sustained pointer stress The exact attached application was rebuilt with an ABI-compatible fixed `Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll`, then exercised with real `SendInput` pointer presses and moves for 120 seconds: https://github.com/user-attachments/assets/41a3e68c-e048-4d09-b677-aec1a9bc3af7 This recorded run delivered 11,622 presses and 116,220 pointer moves, then closed normally with exit code `0`. No correlated `Application Error` or `.NET Runtime` event was recorded. The native crash is intermittent: fresh recording attempts against the original DLL did not fail during the capture session, so the before clip above is the reporter's genuine original failure rather than a clean run being mislabeled or a crash being staged. The deterministic regression evidence is the baseline test retaining an already-disposed `CanvasDrawingSession`; the same test passes after this change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01dac3d5-7cea-4af6-ba68-fdc87f9ceb54
…ains prior ShellContent instances (#37390) <!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Description of Change **Memory management and event subscription improvements:** * Adds a destructor (`~ShellContent`) to `ShellContent` that unsubscribes from property change notifications, preventing memory leaks when a shared `Page` is assigned to multiple transient `ShellContent` instances (`src/Controls/src/Core/Shell/ShellContent.cs`). * Refactored event subscription logic to use `WeakNotifyPropertyChangedProxy` and a cached handler, ensuring that event handlers do not prevent garbage collection of `ShellContent` instances (`src/Controls/src/Core/Shell/ShellContent.cs`). **Testing and regression coverage:** * Adds a unit test to verify that assigning the same long-lived `Page` to many transient `ShellContent` instances does not retain those instances in memory, addressing issue #37217 (`src/Controls/tests/Core.UnitTests/ShellTests.cs`). **Public API updates:** * Adds destructor signature for `ShellContent` to the platform-specific `PublicAPI.Unshipped.txt` files to document the new public API surface (`src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt`, `src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt`, `src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt`, `src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt`, `src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt`, `src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt`, `src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt`). [[1]](diffhunk://#diff-4731d7bdf78f0e9d2a7a64d6f56502e3d2095313d039e7f09c0e7d1552471f8eR25) [[2]](diffhunk://#diff-793476570313a2965972f9be2c01f3eaaf5eec16dfab1b6b7e34cd5473af4277R18) [[3]](diffhunk://#diff-b98fb401b945e281e04d9aabd0695677c639da1423ae935f1e521e88e8cae021R8) [[4]](diffhunk://#diff-923a9c83577000b182ef448083ba67a73bd622126eafbd11d265afe0e2387a68R10) <!-- Enter description of the fix in this section --> ### 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. --> Fixes #37217 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |---|---| | <video src="https://github.com/user-attachments/assets/c8166be4-b3b0-4706-8a38-ebfc6778f6ff"> | <video src="https://github.com/user-attachments/assets/c26f1915-2152-4c5e-b923-2659a5b13f3a"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
… to its condition by configuration/target (#37176) <!-- 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! ### Issue Details MauiXaml will generate source for every xaml file without respect to its condition by configuration/target ### Root Cause • Microsoft.Maui.Controls.Globs.props globs **\*.xaml into the MauiXaml item group unconditionally for every inner build/TFM. • Microsoft.Maui.Controls.SingleProject.targets correctly gates Compile ( .cs ) items under Platforms/<Platform>/ via %(Compile.ExcludeFromCurrentConfiguration) , but its XAML-removal logic only ever stripped Windows .xaml (WinUI markup) out of MauiXaml . It never removed non-active-platform .xaml under Platforms/Android , Platforms/iOS , Platforms/MacCatalyst , or Platforms/Tizen . • Consequence: the XAML SourceGen consumes MauiXaml as AdditionalFiles regardless of platform, so every platform's xaml leaked into every inner build — producing duplicate InitializeComponent /attribute/field declarations whenever multiple platforms reused the same class name (a standard, supported pattern). ### Description of Change src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.SingleProject.targets (shipped via buildTransitive in Microsoft.Maui.Controls.Build.Tasks → applies to every MAUI app) Extended the _MauiRemovePlatformCompileItems target's _MauiXamlToRemove computation (previously Windows-only) to also cover Android/iOS/MacCatalyst/Tizen: for each built-in platform folder, its .xaml files are queued for removal from MauiXaml / EmbeddedResource unless it matches the currently active $(TargetPlatformIdentifier) . The pre-existing unconditional Windows-folder removal (WinUI markup, not MAUI XAML) is left unchanged. ### Issues Fixed Fixes #36951 **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | <img src="https://github.com/user-attachments/assets/a0fd36d9-2094-4948-a645-c3c0d1bf0e4e" Width="600" Height="300" /> | <img width="600" height="300" alt="image" src="https://github.com/user-attachments/assets/510d9024-dacc-4447-821d-29e7129ed844" /> |
### Description of Change Captures the weak-reference fields in local variables before testing and dereferencing them. This closes the time-of-check/time-of-use race with `Unsubscribe()`, which clears the fields concurrently. The race has been observed as an unhandled Android `NullReferenceException` from both `TryGetSource` during binding finalization and `TryGetHandler` while processing property changes. ### Issues Fixed Fixes #32602 ### Validation - `dotnet build src/Controls/src/Core/Controls.Core.csproj --no-restore --verbosity minimal -p:TargetFramework=netstandard2.0` Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Description Keeps `VisualElement.IsVisible` as the locally assigned/bound value while making handler-facing `IView.Visibility` reflect cumulative visibility through the visual ancestor chain. Effective visibility changes are cached and propagated through the existing property-propagation pipeline. Unchanged branches are pruned, so descendant handlers and measure invalidation run only for actual effective visibility transitions. Reparenting and detaching are covered. Fixes #19139. ## Regression tests - Hidden and nested ancestors - Ancestor visibility changes without mutating child `IsVisible` - Reparenting and detaching - Non-layout visual children - Handler mapping and unchanged-branch pruning - Measure invalidation ## Validation - `VisualElementTests`: 29 passed - `Issue1549` XAML compatibility tests: 3 passed - iOS runtime: `IsVisible` remains `True`, `IView.Visibility` is `Collapsed`, and keyboard Next skips the hidden entry - Android runtime: `IsVisible` remains `True`, `IView.Visibility` is `Collapsed`, and IME Next skips the hidden entry ---------
…eak Device Test (#37310) <!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Device memory leak tests started failing in the Candidate branch after PR #35487, indicating regressions in memory leak validation across Windows, iOS, macOS, and Android. The affected Does Not Leak and Window Does Not Leak tests were failing on these platforms. ### Issue1: Window Does Not Leak ### Root cause The WindowDoesNotLeak test failed intermittently because window and page were declared as locals inside an async Task method ( WindowDoesNotLeak ) and were referenced across await boundaries (both directly and inside the lambda passed to CreateHandlerAndAddToWindow ). The C# compiler hoists such locals into fields of the generated async state machine, and those fields are not guaranteed to be cleared once the locals are no longer needed. As a result, window and page remained artificially rooted by the state machine instance for the entire duration of the subsequent WaitForGC call, producing a false-positive "still alive" leak report rather than reflecting an actual product defect. ### Solution description The fix extracts the window/page creation and handler invocation logic out of WindowDoesNotLeak into a new, non-inlineable helper method, CreateWindowLeakReferencesAsync , marked with [MethodImpl(MethodImplOptions.NoInlining)] . This helper creates window and page , drives the handler lifecycle, and returns only the collected WeakReference list. Since window and page now live in the helper's own async state machine — which is discarded once the helper returns — they are no longer reachable from WindowDoesNotLeak 's state machine during the subsequent WaitForGC call, eliminating the artificial rooting. The dead conditional compilation guard ( #if TEST_FAILS_ON_ANDROID && TESTS_FAILS_ON_WINDOWS && TESTS_FAILS_ON_IOS && TESTS_FAILS_ON_MACCATALYST ) that had disabled the test was also removed to re-enable it. ### Issue2: TabbedPageTests.DoesNotLeak ### Root cause The issue occurs because of two compounding factors. At the test level, the navPage local was captured by an async lambda and accessed again after an await , causing it to be hoisted into the compiler-generated closure and transitively keep the popped TabbedPage alive through its navigation stack. At the platform level on Android, MultiPageFragmentStateAdapter was constructed using the host Activity's long-lived Lifecycle , causing AndroidX to permanently register a lifecycle observer that was never released because the Activity's lifecycle never reached the destroyed state. This kept the adapter, and the TabbedPage it referenced, permanently rooted in memory, while AndroidX also failed to reclaim the associated child fragments. ### Solution description The fix involves nulling the navPage local before the WaitForGC call at the test level, combined with a production-level Android fix in MultiPageFragmentStateAdapter.cs that introduces a teardown routine to make AndroidX reclaim its fragments correctly and explicitly clears the adapter's page reference on disposal. Supporting changes in TabbedPageManager.cs and TabbedPage.Android.cs ensure the teardown routine executes before the adapter is detached and that manager references are cleared on disconnect. The resolution was verified through repeated on-device Android test runs, all passing successfully. ### Issue3: NavigationPageTests.DoesNotLeak ### Root Cause The issue occurs because of the `navPage` and `window` locals in `NavigationPageTests.DoesNotLeak` being referenced across an `await` boundary — both directly and inside the lambda passed to `CreateHandlerAndAddToWindow`. The C# compiler hoists such locals into fields of the generated async state machine for the test method, and those fields are not guaranteed to be cleared once the locals are no longer needed. As a result, `navPage` and `window` remained artificially rooted by the state machine instance for the duration of the subsequent `WaitForGC` call, producing a false-positive "still alive" leak report rather than reflecting an actual product defect. This issue was only replicated in Release mode, since Release-mode JIT/compiler optimizations affect how and when the hoisted state-machine fields are cleared, whereas Debug builds happened to clear or avoid rooting them, masking the problem locally. ### Solution Description The fix involves extracting the `navPage`/`window` creation and handler invocation logic out of `DoesNotLeak` into a new, non-inlineable helper method, `CreateNavigationPageLeakReferencesAsync`, marked with `[MethodImpl(MethodImplOptions.NoInlining)]`. This helper creates `navPage` and `window`, drives the handler lifecycle, and returns only the collected `WeakReference` list. Since `navPage` and `window` now live in the helper's own async state machine — which is discarded once the helper returns — they are no longer reachable from `DoesNotLeak`'s state machine during the subsequent `WaitForGC` call, eliminating the artificial rooting. Validated the behavior in the following platforms - [x] iOS - [x] Mac - [x] Android - [x] Windows ### Regression PR PR #35487 ### Issues Fixed Fixes #36613 ### Output Screenshot ### Issue1: Window Does Not Leak |Platform|Before|After| |--|--|--| |Android| <video src="https://github.com/user-attachments/assets/1d3986aa-5c5f-4d97-ab6e-96c586e53488" >| <video src="https://github.com/user-attachments/assets/3670bafa-6a75-47a8-8505-797901e7abeb">| |Mac|<video src="https://github.com/user-attachments/assets/461534f8-21dd-46ab-bb62-c10a5f8ac71a"> |<video src="https://github.com/user-attachments/assets/d862eb7f-c33f-4866-a553-5264b1cda411">| |iOS|<video src="https://github.com/user-attachments/assets/41b71c49-26ac-4dcc-9e01-87dce42d5000">|<video src="https://github.com/user-attachments/assets/9e03f7ca-d803-49b9-a159-4057320591a7">| |Windows|<video src="https://github.com/user-attachments/assets/73300a73-a9be-403b-b77e-2cc4418d10c9">|<video src="https://github.com/user-attachments/assets/173cf2e3-5bde-4383-b07a-0b6b8422d03b"> | ### Issue2: TabbedPageTests.DoesNotLeak |Platform|Before|After| |--|--|--| |Android| <video src="https://github.com/user-attachments/assets/604316e5-5849-4195-9e16-1c96d710c125" >| <video src="https://github.com/user-attachments/assets/50bc614c-814d-43d1-912b-446886086886">| ### Issue3: NavigationPageTests.DoesNotLeak |Platform|Before|After| |--|--|--| |Mac|<video src="https://github.com/user-attachments/assets/cd6831a8-e8f6-4954-baff-055a2575a576"> |<video src="https://github.com/user-attachments/assets/6198e780-82e9-4eec-b3f5-a805f79d0ddd">| |iOS|<video src="https://github.com/user-attachments/assets/47edefd0-a416-4245-bbce-3e54c80aefa0">|<video src="https://github.com/user-attachments/assets/84f2c31c-0d9d-4c3e-9f21-9a8f634e671f">|
<!-- 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! On Windows, propagate `InputTransparent` to a view's `WrapperView` as well as its inner platform view. This allows pointer input to pass through wrapped controls, including the default-template `Label` with a transparent background overlaying a `Button` from #21384. The fix preserves two important Windows behaviors: - `ILayoutHandler` continues using `LayoutPanel`'s specialized background-based input transparency, so transparent layouts do not disable their interactive child tree. - Reusing a disconnected handler preserves the existing wrapper and its visual-tree position while replacing its stale child with the newly created platform view. Framework reconnect creates and connects the replacement platform view unparented before mapper replay. The reconnect repair therefore only updates `WrapperView.Child`; it does not remove the platform view from arbitrary parent shapes or re-enter virtual `SetupContainer()` overrides that could duplicate subscriptions or one-time setup. Normal mapper replay restores Label/Image sizing and alignment after the child replacement. The default template's implicit `Label` style supplies a transparent background, which causes `LabelHandler` to create a Windows `WrapperView`. The existing mapper disabled hit testing only on the inner `TextBlock`; the effective wrapper remained hit-testable and intercepted pointer input. - Windows Label device tests: **42 total, 40 passed, 0 failed, 2 skipped**. Coverage includes initial state, runtime toggles, late wrapper creation, reconnect hit testing and mapped properties, the framework's unparented replacement-platform-view lifecycle, a wrapper moved to another attached `Panel`, and a detached wrapper. - Failure-first reconnect validation: temporarily removing the reconnect rebinding made all three reconnect-specific tests fail; restoring it made them pass. - Windows Layout device tests: **54/54 passed**, covering both `CascadeInputTransparent` modes and confirming that the wrapper remains hit-testable for child interaction. - Windows Core tests: **1,980 passed, 0 failed, 111 skipped**; the exact CI-reported Slider case and all 90 Slider tests passed locally. - Windows Appium test and HostApp builds completed with **0 warnings and 0 errors**, and both Issue21384 tests are discovered. The reporter-faithful Label pointer test is skipped on MacCatalyst because test remains cross-platform. - Local Appium execution remains blocked before interaction by WinAppDriver's invalid status response. The real Win32 `SendInput` harness below provides behavior-level evidence. Both recordings use the same `AbsoluteLayout` reproduction from #21384 and send five real Win32 mouse clicks to the overlaid button (`SendInput`, not UI Automation invoke). **Before — bug reproduced on parent commit `f377ff1c5e`:** all five clicks are sent, but the click handler receives none and the visible counter remains at 0. https://github.com/user-attachments/assets/d59d3346-355c-434f-b1ac-01c76c361ab1 **After — fixed behavior:** all five equivalent clicks reach the button and the visible counter advances from 0 to 5. The final production code was rerun with the same harness and again received **5/5** clicks. https://github.com/user-attachments/assets/610856db-c094-4657-b4ea-0985b96221dd - Do not update only the inner Windows platform view; a hit-testable `WrapperView` can still intercept input. - Do not disable the wrapper for `ILayoutHandler`; `LayoutPanel` intentionally preserves child interaction through its background-based mapper. - Do not re-enter virtual `SetupContainer()` during reconnect; derived handlers may repeat subscriptions or one-time side effects. - Do not add generalized parent-detachment logic for reconnect; the framework replacement platform view is unparented before mapper replay, and the surviving wrapper's parent must remain unchanged. Fixes #21384 @owaits, once the build artifacts are available, could you please try them with your original reproduction and let us know whether this resolves the issue for you? --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
… and callbacks alive (#37639) <!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details - Disposing `AnimationManager` did not release the manager, active animations, or callback-captured data when its `ITicker` remained alive. ### Root Cause of the Issue - `AnimationManager` assigns `OnFire` to `Ticker.Fire` and stores active animations in `_animations`. Its previous `Dispose()` implementation only disposed tickers implementing `IDisposable`; it did not remove `OnFire`, stop a normal `ITicker`, or clear `_animations`. Consequently, a long-lived ticker could retain the entire object graph. ### Description of Change <!-- Enter description of the fix in this section --> ### Improvements to resource management and disposal: * Refactored the `Dispose` method in `AnimationManager` to ensure it is idempotent, detaches event handlers, clears animations, and disposes of the ticker only when appropriate. This prevents multiple disposals and ensures resources are released correctly. ### New unit tests for disposal behavior: * Added `AnimationManagerTests` with tests to verify: - The ticker callback is released without disposing the animation. - Animation payloads are released when the ticker outlives the manager. - The owned callback is properly removed from multicast delegates. - Correct disposal and stop counts for the ticker. - No unintended side effects on animation callbacks after disposal. ### 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. --> Fixes #37228 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac ### Output | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/fe7e8c32-eb2c-4808-bc8b-599aa7055344"> | <img src="https://github.com/user-attachments/assets/83fe5ec1-6462-4942-a461-034f3d25407b"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- 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! Fixes #17523 Windows attached the Border's `CompositionGeometricClip` directly to the content visual while authoring the geometry in the parent `ContentPanel` coordinate space. Scale, rotation, and translation therefore transformed the clip together with the content instead of keeping the Border aperture stationary. - Place Border content inside a Border-only stationary native clip host and attach the geometric clip to that host. - Route cross-platform measure invalidation to both native layers while preserving WinUI's cached subtree measure on unrelated parent layout passes. - Avoid re-entering measure from arrange when a layout owner changes; the normal invalidated measure pass remains authoritative. - Preserve the cross-platform arranged size through the native clip host, including detached and reconnected layout-owner transitions. - Cache stable composition and rectangular bounds clip geometry, rebuilding only when geometry inputs change. - Tear down layout owners, hosted content, stroke references, and cached clip state when the handler disconnects, after derived handler disconnect hooks have observed the intact platform view. - Safely ignore late invalidation after handler disconnect and synchronize direct or reconnect-driven layout-owner changes with the clip host. - Preserve current cross-parent content reparenting while clearing stale clip-host ownership when content moves Border → Border, Border → generic `MauiPanel`, or back again. - Handle zero-by-infinite WinUI measure constraints without invoking cross-platform layout. - Keep layout invalidation flowing for initial asynchronous image loads and runtime content-size, `FontSize`, and `Padding` changes without requiring an outer window resize. - Preserve explicit Border sizing, stroke/shadow behavior, nested layout clipping, content replacement, custom handler activation and mapper customization, shape removal, and accessibility behavior. - Clamp stroke-inset geometry to nonnegative dimensions and preserve an explicitly empty aperture when the stroke consumes all available content space, including rounded shapes. - Clear stale clipping geometry whenever either arranged dimension is non-positive. - Remove the obsolete nested `LayoutPanel` clip exception because the XAML rectangular clip and Border composition clip now live on separate visuals. - Update the three affected WinUI Image AspectFill baselines for the stationary clip host's one-pixel antialiased inner edge; image content remains pixel-identical. This is an implementation-only Windows fix; it adds no public APIs. **Before — issue author's attached reproduction, minimally retargeted to the current Windows TFM:** transformed image content escapes the stationary ellipse, rounded rectangle, and triangle apertures as image scale changes. https://github.com/user-attachments/assets/7cf6b0fc-c101-44df-ba5b-841131014708 **After — final reviewed PR gallery build using the exact `BorderResizeContent` source scenario:** the same scale interaction changes the image while each Border aperture remains stationary and correctly clips its content. https://github.com/user-attachments/assets/97a4429a-c32c-4c9f-9252-957b8f2c5e8f Both recordings use a 1280×720 window. Pixel analysis of the recorded scale-4 frames detected transformed image pixels outside the three Border regions before the fix and **0 outside after the fix**. - Windows Border device tests: **38 passed, 0 failed, 0 skipped, 0 errors**. - Added coverage for scale, rotation, translation, combined transforms, shadows, nested layouts, initial asynchronous image rendering, runtime `FontSize` and `Padding`, explicit sizing, content replacement, shape removal, disconnect/reconnect, derived disconnect ordering, teardown cleanup, direct layout-owner changes, derived handlers, clip ownership, cross-host and generic-parent reparenting, composition and bounds clip reuse, zero-by-infinite constraints, stroke-consuming zero-interior geometry, rounded empty apertures, cross-platform arranged-size propagation, automation, and layout-cache reuse. - Exact final `BorderResizeContent.xaml` gallery proof ran without resizing the window: - Image scale 1 → 4 changed 14,673 pixels inside the Border shapes and 0 outside. - Font size 40 → 120 changed 11,584 pixels inside the Border shapes and 0 outside. - All images rendered on initial load. - The repository's production `MagickNetVisualComparer` passes all three updated WinUI Image AspectFill snapshots at the default 0.005 RMS threshold. The accepted delta is confined to the one-pixel Border edge with zero changed pixels in the image interior. - Multiple independent MAUI expert, adversarial, and layout/performance reviews completed with no remaining actionable findings. @jstedfast, could you please test the PR artifacts against the original `BorderResizeContent` reproduction and confirm that initial rendering, transformed clipping, runtime font-size changes, and resizing now behave correctly? Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…'s task (#37666) ### Description of Change Follow-up to #37409 (itself a follow-up to #37060), closing three holes of the same species in the deferred element-scroll machinery: **a request that ends without its task completing, or whose completion runs on the wrong stack.** Two are permanent hangs of `await ScrollToAsync(...)`; one is reachable by entirely ordinary code. 1. **A parked request displaced by any newer `ScrollToAsync` orphaned the first caller's task** — two calls in a row (say, both from `OnAppearing` before the first layout) and the first `await` never returns. Nothing else ever completes it: the superseding request creates a fresh completion source, and the `TaskStatus.Running` check in `CheckTaskCompletionSource` is dead code (a TCS-backed task reports `WaitingForActivation`, never `Running`, so the `TrySetCanceled` there is unreachable). This is the headline fix. 2. **Yielding the replay to a re-entrant `ScrollToRequested` subscriber abandoned the superseded caller's task** — same mechanism, narrower trigger (a legacy renderer issuing its own `ScrollToAsync` from inside the replayed event): permanent hang. 3. **The lifecycle-drop completion ran the caller's continuation from inside `Element.SetParent`**, before `OnPropertyChanged(nameof(Parent))` fires — caller code observing/mutating a half-propagated parent change. **One primitive fixes all three.** `CompleteWithoutScroll(completion)` captures the completion source **as a value** and posts `TrySetResult(true)` through the dispatcher: - **off the mutation stack** (fixes 3) — the continuation never runs inside `SetParent`/handler-change; - **bound by identity** (preserves the invariant from #37409's review rounds) — the post cannot read the field at fire time, so a newer request swapping `_scrollCompletionSource` in the window can never be released in the old request's place; - **applied at every point a request ends without its scroll** — the drop paths (detach, tree-removal, orphaned target), the yielded replay (fixes 2), and the supersede in `OnScrollToRequested` (fixes 1). The ordinary platform-callback completion (`SendScrollFinished` when a scroll actually happens) is untouched, so `await ScrollToAsync(...)` timing on the normal path is unchanged. Completing (rather than cancelling) a superseded task matches the existing drop semantics — no `await` in this API's history has thrown on supersede, and introducing `TaskCanceledException` would be a new public behavior. The contract comment now names all three exits from the park — replayed, superseded, dropped — so the stated contract and the code have no gap. No new public API. ### Issues Fixed Follow-up to #37409 / #37060 (fixes for #36801). ### Tests Every fix is pinned by a test **proven to fail with that fix reverted**: - `SupersedingAParkedRequestCompletesTheSupersededCallersTask` — both supersede shapes (direct send, and park-in-place) - `ReentrantRequestFromTheReplayedEventSupersedesTheReplay` — extended to assert the superseded caller is released - `DropCompletionIsPostedNotRunOnTheMutationStack` — dispatcher-capture harness: task pending after `Remove` returns, exactly one post queued, completes when it runs - `PostedDropCompletionReleasesOnlyTheDroppedTaskEvenIfANewRequestArrivesFirst` — the identity property: a new request arriving before the post runs is untouched; the dropped task completes (this test fails against a field-reading post, the bug shape from #37409's review) Verified on the merged `inflight/current` base: `ScrollViewUnitTests` 42/42 (10 consecutive runs), `Issue36801` + `Issue36801DeferredElement` + `ShellFlyoutHeaderScrollViewContent` iOS UI suites 12/12 on the simulator. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
… static event with WeakEventManager (#37382) <!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details VisualDiagnostics.VisualTreeChanged is a public static event used by XAML Hot Reload, live visual-tree inspectors, and diagnostic tools. Because it is a plain multicast event, every subscriber is held by a strong reference in the invocation list. Any page, view, or object that subscribes stays alive until it explicitly calls -=, silently leaking the entire visual subtree, bindings, and view models. ### Root Cause The event was a normal static event — .NET stores subscribers with strong references. Since it's static, the list lives for the app's lifetime, so every subscriber lives forever too. The only way to escape was to explicitly write -=, which most callers forget. ### Description of Change Backed the event with a WeakEventManager (MAUI's built-in weak-event helper), so subscribers are held weakly and can be GC'd. The public event signature is unchanged — callers don't need to change anything. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #37242 ### Fix reference : [maui/src/Controls/src/Core/Application/Application.cs at bf62313 · …](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/Application/Application.cs#L263) [maui/src/Controls/src/Core/Command.cs at bf62313 · dotnet/maui](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/Command.cs#L128) [maui/src/Controls/src/Core/ImageSource.cs at bf62313 · dotnet/maui](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/ImageSource.cs#L175) ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/8b1d453a-dedd-48d0-a01d-aae7c7523f82" >| <video src="https://github.com/user-attachments/assets/824df312-de3c-4c4e-b073-9239b7c9d5c9">|
<!-- 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! ### Description of Change On Windows, mouse-wheel scrolling could update `CarouselView.Position` from native `ScrollViewer` events and then feed that update back into an animated programmatic `ScrollTo`. Competing native and programmatic scroll paths could cause runaway scrolling or leave the selected item visibly off-center. This change: - suppresses only the exact `Position`/`CurrentItem` mapper callbacks produced by native scrolling and handler-originated collection reconciliation, while preserving application-driven nested updates and nesting the suppression state safely; - lets newer user/native input supersede active corrective recentering instead of swallowing it as part of the previous request; - treats a routed mouse-wheel event as immediate user intent, removing the timing window that could leave stale collection state active before `ViewChanging`; - uses the geometrically nearest visible item for both logical selection and terminal centering, with the native center index as a fallback while containers are realized; - defers terminal geometry until Windows has completed virtualized layout and versions queued work so newer input, application scrolling, collection updates, and disconnects invalidate stale callbacks; - recenters when Windows scrolling settles for centered `Mandatory` and `MandatorySingle` snap points and bounds corrective attempts when native coercion rejects a requested center; - preserves `KeepScrollOffset` reconciliation and synchronous application `Position` or `CurrentItem` overrides during collection updates, including reentrant `PositionChanged` updates; - validates native collection projection after layout, follows `Items.VectorChanged` progress without resetting the bounded retry budget, realizes offscreen override targets natively, and issues one final centered MAUI scroll; - reuses one retry timer within a handler connection, then stops, detaches, and releases it on disconnect so reconnect uses the new dispatcher; - makes repeated native `ScrollViewer` discovery idempotent and detaches routed/native handlers symmetrically on replacement and disconnect; - maps looped physical indexes to logical indexes, realizes looped targets in the central physical cycle, and keeps final centering in that high physical range without exposing `CenterMode` across asynchronous work; - resets all transient scroll, timer, pointer-input, initialization, loop-facade, and native collection subscription state across superseding input and handler disconnect/reconnect; - applies forward tie-breaking against the true minimum distance so the 1 px tolerance cannot compound; and - clamps target offsets at scroll boundaries. The fix is limited to the Windows CarouselView implementation. Native `None`, Start, and End snap behavior remains owned by WinUI. ### Validation Validated with the issue's linked reproduction at commit `cee7aee936214bbe7fa2a06ffec7d6d14876bb8c`, built against the final PR sources. Rapid forward wheel bursts, delayed tail input, and rapid reverse input each remained responsive and settled within 1 px of the viewport center. The Windows `CarouselView` device-test category now contains 45 tests. Added or strengthened coverage includes repeated `ScrollViewer` discovery, immediate wheel supersession, reentrant `PositionChanged` collection overrides, monotonic native-projection retry budgets, deterministic looped high-cycle realization/final centering, nested native-scroll attribution, retry-timer reuse, and disconnect/reconnect cleanup. - **controlled previous production handler:** 41 passed, 4 failed; the failures discriminate nested scroll attribution, retry-timer reuse, disconnect cleanup (including initialization and loop-facade state), and the redundant-layout collection path; - **test-first timer lifecycle check:** 44 passed, 1 failed before disconnect disposal; 45 passed, 0 failed after the fix; - **final local unpackaged Windows CarouselView suite:** 45 passed, 0 failed; - **final local real-packaged Windows CarouselView suite:** 45 passed, 0 failed; - **exact linked reproduction:** all three wheel scenarios settled within 1 px; and - **independent MAUI expert review:** found the cross-disconnect timer ownership issue above; re-review after its test-first fix was clean with no remaining findings. All test counts come from authoritative XML read after the test process exited. #### Before fix The card remains visibly displaced after scrolling (measured approximately 112 px from the viewport center). https://github.com/user-attachments/assets/ae6c8f6b-648e-4927-9591-4af9c27bd874 #### After fix The same interaction remains responsive and settles with the card centered (runtime validation tolerance was <=1 px). https://github.com/user-attachments/assets/1ea9a740-770c-4783-85c9-183e75cb9d96 ### Testing Requested @LaoR-UA, thank you for the reproduction and manual feedback. When CI publishes artifacts for this PR, could you please [try the resulting build](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) with your original project and let us know whether mouse-wheel scrolling now behaves correctly on your setup? ### Issues Fixed Fixes #35621 ---------
…e members (#36444) <!-- 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! ### Description of Change XAML Source Generation emitted direct member access for binding paths, so a `null` intermediate (for example, `{Binding A.B.C.Text}` where `A` or `B` is null at runtime) threw `NullReferenceException`. This diverged from runtime and XamlC bindings, which tolerate null intermediates. The root cause was that the generator based null-conditional access on nullable reference-type annotations. Those annotations are not enforced at runtime: a reference declared non-nullable can still be `null`. This change: - Uses runtime nullability for member, array-index, and indexer path parts, and propagates the resulting nullable type through generated getters, setters, handlers, and `TypedBinding<,>` arguments. - Keeps two-way bindings able to write `null` through null-tolerant paths. Reference-type endpoints assign with the null-forgiving operator to remain warning-free; non-nullable value types retain the existing null guard. - Handles value-type property and indexer intermediates with read-modify-write generation. The setter updates a captured copy and assigns it back through each property/indexer in reverse order, avoiding both CS1612 and silently dropped writes. - Identifies array elements from the receiver type. Array elements and value-type fields remain direct lvalues and are not captured. Getter output, before and after: ```csharp // A, B, and C are non-nullable-declared reference types getter: source => (source.A.B.C.Text, true), getter: source => (source.A?.B?.C?.Text, true), ``` The first hop remains non-conditional (`source.Foo`, not `source?.Foo`) because `TypedBinding.ApplyCore` invokes the getter only with a non-null source. Non-nullable value-type endpoints retain their `?? default` fallback so their binding property types do not change. ### Tests - Updated exact generated-code expectations for compiled bindings, indexers, and Maui13856. - Added coverage for non-nullable-declared reference intermediates. - Added coverage proving two-way paths still write `null`. - Added setter coverage for value-type properties, indexers, arrays, fields, and nested reverse-order copy-back. ### Issues Fixed Fixes #36313 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com> Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Simon Rozsival <simon@rozsival.com> Copilot-Session: 10f057bb-7603-49db-aaf3-707c0cf0ddff
…eservation Causing Phantom Scroll Range (#37765) > [!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! On iOS, a ScrollView configured with SafeAreaEdges="Container" incorrectly reserves the safe area twice, resulting in an additional phantom scroll range. When the content is smaller than the viewport, the ScrollView becomes unnecessarily scrollable. The extra scrollable area corresponds exactly to the combined safe-area insets (for example, 82 pt on an iPhone 11: 48 pt for the status bar and 34 pt for the home indicator). When the content is taller than the viewport, the same issue causes an unnecessary dead over-scroll space at the end of the content. The issue occurs because MauiScrollView.CrossPlatformArrange always pads the scroll content's measured size by the safe-area thickness when ContentInsetAdjustmentBehavior is not Automatic, without checking whether UIKit has already reserved the same space through AdjustedContentInset. As a result, when SafeAreaEdges="Container" is set and the native inset is active, the safe area is accounted for twice—once by UIKit and once by the manual padding. This inflates the content size beyond its actual bounds and produces a phantom scrollable range, even when the content should not be scrollable. The fix narrows the manual-padding condition so that it applies only when the native inset is genuinely inactive—that is, when SystemAdjustedContentInset is zero or ContentInsetAdjustmentBehavior is Never. In all other cases, UIKit's own inset is trusted to reserve the safe area, and the content size is left unchanged. This removes the double reservation for SafeAreaEdges="Container" while preserving the existing None and Automaticbehaviors. Tested the behavior in the following platforms. - [x] iOS - [x] Android - [ ] Mac - [ ] Windows Fixes #36800 |Before Fix|After Fix| |--|--| <video src="https://github.com/user-attachments/assets/19c064e4-4622-4d1d-992c-340a56fb948f"> |<video src="https://github.com/user-attachments/assets/57fa7cae-6e95-4573-885d-8f2979750f38">| --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…37648) <!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! This pull request addresses issues with the accuracy of the `CanGoBack` and `CanGoForward` properties in the Windows WebView handler, ensuring that navigation state is correctly reflected and not stale. It also adds a regression test to prevent future issues with navigation history. ### Description of Change **Fixes and improvements to WebView navigation state:** * Updated the logic in `WebViewHandler.Windows.cs` to check `CoreWebView2.CanGoBack` and `CoreWebView2.CanGoForward` instead of relying solely on the WebView2 control properties, which could become stale and cause incorrect navigation behavior. * Enhanced the `UpdateCanGoBackForward` extension method in `WebViewExtensions.cs` to prefer the `CoreWebView2` navigation state for `CanGoBack` and `CanGoForward`, falling back to the control's properties only when necessary. **Testing and regression prevention:** * Added a new test, `CanGoBackIsFalseAfterReturningToFirstPage`, to verify that `CanGoBack` is set to false after navigating back to the first page, preventing regressions related to navigation history. <!-- Enter description of the fix in this section --> ### 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. --> Fixes #37534 ### Tested the behavior in the following platforms - [x] Windows - [ ] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/c6c4e68b-21ac-49cd-ad96-3f628c889674"> | <video src="https://github.com/user-attachments/assets/1a0fcee7-32d4-42a6-8003-25b89087e580"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ---------
…est (#37267) <!-- 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! ### Issue Details - On iOS, an Image does not scale up on the unconstrained axis when only HeightRequest or WidthRequest is set—the unconstrained axis remains capped at its native size. This is most visible with HorizontalStackLayout + HeightRequest and VerticalStackLayout + WidthRequest. The reverse combinations can appear to work because the other axis is large enough to mask the same issue. On Android, the Image scales correctly with HeightRequest and WidthRequest in all cases. ### Root Cause - In SizeThatFitsImage (iOS), the scale factor for ScaleAspectFit images was calculated as Math.Min(imageWidth, widthConstraint) / imageWidth. This could never exceed 1 (since it always divides the image's own size by itself once the constraint is larger), so an image could shrink to fit a smaller space but could never grow beyond its native size, even when an explicit HeightRequest or WidthRequest requested a larger size, regardless of StackLayout orientation. ### Description of Change - Updated SizeThatFitsImage in ImageViewExtensions.cs to accept flags indicating whether width and height constraints are explicit, and to allow images to scale up to requested sizes when either is set, instead of capping at native size. - Modified GetDesiredSizeFromHandler in ViewHandlerExtensions.iOS.cs to pass explicitness flags to SizeThatFitsImage, ensuring correct sizing behavior for images with explicit size requests. ### Issues Fixed Fixes #12879 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Before | After | ----------|----------| | <img src="https://github.com/user-attachments/assets/c592756b-d87f-40dd-9073-0a4e03add828"> | <img src="https://github.com/user-attachments/assets/c884d1d2-a048-44ee-b1d9-ac59b9c29daf"> |
…37772) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> The issue was caused by a small view moved off-screen with TranslationY for a full-screen Shell navigation animation. This incorrectly preserved the top safe-area inset, creating the unwanted gap in the bottom sheet. https://github.com/dotnet/maui/blob/19a188896c0e518c0d201db181f67166c740724d/src/Core/src/Platform/Android/SafeAreaExtensions.cs#L175 On Android, moving a view outside the screen using TranslationY incorrectly adds top padding to the layout. <!-- Enter description of the fix in this section --> Updated Android vertical animation detection to treat only full-screen views as Shell navigation transitions. Smaller translated controls, are excluded so they no longer receive incorrect top safe-area padding. <!-- 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. --> Fixes #37418 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [ ] Windows - [x] iOS - [ ] Mac | Before | After | |---------|--------| | **Android**<br> <img src="https://github.com/user-attachments/assets/9a17e25d-4b59-4d33-9b22-014bb504e3a0" width="300" height="600"> | **Android**<br> <img src="https://github.com/user-attachments/assets/aef1bf14-dca6-411f-94e4-c473ac3b5d0c" width="300" height="600"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- 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! ### Description of Change On Windows, WinUI's initial focus routing can select the first focusable descendant of a `ScrollViewer`. When a page opens with an `Entry` inside a scrollable MAUI `ScrollView`, that can focus the `Entry` and raise its `Focused` event without user input. The Windows handler now makes the native `ScrollViewer` a **transient** tab stop from WinUI's `Loading` event, giving the load-time focus pass a non-content target. A queued callback restores the original native, styled, locally customized, or bound `IsTabStop` state after load, so the ScrollViewer does not become a permanent keyboard or Narrator stop. A low-priority fail-safe queued from `Loading` also restores the transient state if the ScrollViewer leaves the native visual tree before either `Loaded` or `Unloaded` fires. The normal `Loaded` callback supersedes that fail-safe through a generation guard and restores on the next dispatcher turn. The temporary value is represented by an owned binding: if an app or mapper writes the native property before restore, that write replaces the binding and wins. Generation plus platform-view identity checks prevent stale callbacks from mutating a disconnected or replaced handler. Cleanup and restoration intentionally happen before `base.DisconnectHandler`, while the platform view and handler ownership are still valid; all lifecycle events are unsubscribed before base teardown. The shared Windows unfocus path preserves the original binding/local/style/default ownership of `IsTabStop`, so an unfocus operation during the temporary window cannot convert the transient value into a permanent local tab stop. Bindings are detached before the temporary `false` write so TwoWay sources are not mutated, then the original binding object is reinstated. No public API is added or changed. ### What NOT to Do - Do not make the internal `ContentPanel` a tab stop: it creates an invisible, unannounced keyboard stop. - Do not leave `ScrollViewer.IsTabStop=true` permanently: that changes steady-state tab order and accessibility for every Windows ScrollView. - Do not set `AllowFocusOnInteraction=false`: empirical testing showed that it also prevents legitimate pointer focus of child Entries. - Do not restore a hardcoded `IsTabStop` value: doing so destroys style, binding, and custom handler/mapper ownership. - Do not write a temporary dependency-property value while a TwoWay binding is attached: that pushes the temporary value into the source. - Do not use a normal-priority fail-safe from `Loading`: it can run before WinUI reaches `Loaded`, restoring too early and reintroducing automatic Entry focus. The fail-safe must remain low priority. - Do not synchronously restore when the low-priority `Loading` enqueue fails: empirical testing showed that removing the transient target during `Loading` recreates automatic Entry focus. Dispatcher shutdown remains covered by synchronous handler disconnect cleanup. - Do not cancel `GettingFocus` to identify automatic focus: WinUI reports both automatic and legitimate app requests as programmatic focus, so that signal cannot distinguish them safely. ### Issues Fixed Fixes #31039 ### Validation - Windows Controls `ScrollView` device tests with the fix: **26 passed, 0 failed**. Coverage includes direct transient activation, lifecycle ordering through `Loaded`, negative startup focus with a preceding Button and two sibling ScrollViews, native/default/local/style/OneWay/TwoWay ownership, binding detachment, TwoWay source and binding identity, later native writes, unfocus during the transient window, explicit focus, disconnect/reconnect, unload/reload, stale callbacks, native focused-element state, rooted Tab and Shift+Tab navigation, and removal from the native visual tree during `Loading` before `Loaded`/`Unloaded`. - Controlled sensitivity with only production `Loading` activation disabled: **20 passed, 6 failed**. The discriminating failures are startup focus, preceding-control/two-ScrollView startup focus, navigation reload, transient ordering, reverse navigation from the startup ScrollViewer, and custom local-value restoration. - Windows Controls `Entry` device tests: **54 passed, 0 failed, 4 skipped**. A non-ScrollView regression test verifies that programmatic Unfocus preserves style ownership and tracks a later style replacement. - The issue author's exact attached sample was rebuilt against the unchanged production implementation represented by head `21d3526a1b` and automated with UI Automation plus real pointer/keyboard input: - startup focus is the native ScrollViewer UIA `Pane`, exposed as a control/content element; no Entry focus and no alert; - clicking a normal Entry focuses it; - Tab advances to the next Entry; - Shift+Tab returns to the previous Entry; - clicking an `InputTransparent` Entry does not raise the first Entry's focus alert. - Independent MAUI-specialist and adversarial lifecycle reviews found no remaining high-confidence defect after the added fail-safe and discriminating coverage. - Optional device build 1565839 contained one unrelated MacCatalyst CarouselView leak failure; its osx.26 Helix job passed. Optional UI build 1565837 had broad cross-platform baseline failures also present on adjacent main builds. Required main build 1565836 passed. ### Empirical Proof **Before — untouched attached sample (MAUI 9.0.14):** https://github.com/user-attachments/assets/fc1c44f3-e385-4808-9f00-9694b83e127f **After — exact sample rebuilt against the transient fix:** https://github.com/user-attachments/assets/af84a6c5-97e1-4ddd-a89f-3730748b8cf2 @Kamalesh-Periyasamy, once the updated PR artifacts are available, please try them with your original reproduction and let us know whether this resolves the issue for you. --------- Copilot-Session: bcd06486-88bb-4458-ad38-55bf1be162f5
…37111) This pull request makes several improvements to the Entry control test pages and their supporting view models, focusing on expanding test coverage, improving UI accessibility, and enhancing code maintainability. The most significant changes include adding new bindable properties (such as `BackgroundColor`, `Opacity`, and `WidthRequest`), updating event handler logic for better testability, and refining the ViewModel with new helpers and a reset method. Additionally, UI elements have been updated for consistency and accessibility. **Feature and UI enhancements:** * Added bindable properties `BackgroundColor`, `Opacity`, and `WidthRequest` to the Entry controls and ViewModel, allowing these properties to be set and tested from the UI (`EntryControlPage.xaml`, `Material3_EntryControlPage.xaml`, `EntryViewModel.cs`). [[1]](diffhunk://#diff-14e7f146267aafe278aab3e4cec14f9fc100e09ae21886569c33bffba87cff28R42-R44) [[2]](diffhunk://#diff-f5e3ee56e4135c8dfd05cfce9bf234d413b52c8b6ce864a4ba0fca1ad004cc75R42-R44) [[3]](diffhunk://#diff-3f677ed4c454a245e3e82416c1a86b24aa0ade96b3b809d4cbedd7bc75534536L28-R32) [[4]](diffhunk://#diff-3f677ed4c454a245e3e82416c1a86b24aa0ade96b3b809d4cbedd7bc75534536R180-R213) * Added new labels to display the current keyboard type and return type in the UI, and updated the ViewModel to provide these values (`EntryControlPage.xaml`, `EntryViewModel.cs`). [[1]](diffhunk://#diff-14e7f146267aafe278aab3e4cec14f9fc100e09ae21886569c33bffba87cff28L100-R131) [[2]](diffhunk://#diff-3f677ed4c454a245e3e82416c1a86b24aa0ade96b3b809d4cbedd7bc75534536L124-R136) [[3]](diffhunk://#diff-3f677ed4c454a245e3e82416c1a86b24aa0ade96b3b809d4cbedd7bc75534536R180-R213) **Event handler and logic improvements:** * Updated event handlers to use `TextChanged` events for properties like cursor position, selection length, max length, width request, opacity, and height request, improving testability and code clarity (`EntryControlPage.xaml.cs`, `EntryOptionsPage.xaml.cs`). [[1]](diffhunk://#diff-976ce0c4d44779d336f56a5b66c3d1d02d6b59783311ee99efb4f5d1eb58317fL39-L54) [[2]](diffhunk://#diff-07ad3578095d6b7e4ef419d6921a7d43b5319bfd2970f669cb006118d1677de7L124-R134) [[3]](diffhunk://#diff-07ad3578095d6b7e4ef419d6921a7d43b5319bfd2970f669cb006118d1677de7L259-R318) * Refactored color selection logic for text and placeholder colors to use `AutomationId` instead of background color, increasing reliability in UI tests (`EntryOptionsPage.xaml.cs`). [[1]](diffhunk://#diff-07ad3578095d6b7e4ef419d6921a7d43b5319bfd2970f669cb006118d1677de7L26-R31) [[2]](diffhunk://#diff-07ad3578095d6b7e4ef419d6921a7d43b5319bfd2970f669cb006118d1677de7L50-R60) * Added a new reset method to the ViewModel to restore all properties to their default values, and updated the navigation logic to call this method (`EntryViewModel.cs`, `EntryControlPage.xaml.cs`). [[1]](diffhunk://#diff-3f677ed4c454a245e3e82416c1a86b24aa0ade96b3b809d4cbedd7bc75534536R312-R348) [[2]](diffhunk://#diff-976ce0c4d44779d336f56a5b66c3d1d02d6b59783311ee99efb4f5d1eb58317fL39-L54) **UI and accessibility updates:** * Added `AutomationId` values to key UI elements for improved automated testing and accessibility (`EntryControlPage.xaml`, `Material3_EntryControlPage.xaml`). [[1]](diffhunk://#diff-14e7f146267aafe278aab3e4cec14f9fc100e09ae21886569c33bffba87cff28R10-L13) [[2]](diffhunk://#diff-f5e3ee56e4135c8dfd05cfce9bf234d413b52c8b6ce864a4ba0fca1ad004cc75L8-L20) * Adjusted font sizes for consistency and improved label clarity, and reorganized UI elements for better structure and accessibility (`EntryControlPage.xaml`). [[1]](diffhunk://#diff-14e7f146267aafe278aab3e4cec14f9fc100e09ae21886569c33bffba87cff28L70-R78) [[2]](diffhunk://#diff-14e7f146267aafe278aab3e4cec14f9fc100e09ae21886569c33bffba87cff28L100-R131) These changes collectively improve the testability, maintainability, and accessibility of the Entry control test pages. Issue Identified: - #34611 - #29805 --------- Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!-- 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! ## Description Enables `AllowDrop` on the Windows BlazorWebView's underlying WinUI `WebView2` so external files dragged from Explorer can reach HTML drop targets. This addresses the Windows external-file-drop portion of #2205. Native in-page HTML element and image dragging remains blocked by upstream WinUI/WebView2 behavior and is outside the scope of this change. A cross-host repro and compatibility matrix are available at https://github.com/danroth27/BlazorHybridDragDrop. ## Testing - Added a Windows device test that verifies the created platform WebView2 has `AllowDrop` enabled. - Windows BlazorWebView device tests: 18 passed, 4 skipped, 0 failed. Fixes #37903 Copilot-Session: 6ecbe107-8703-4352-a1c6-e4f722cb9b28
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details When ScrollView.Orientation="Horizontal" on Android, the content unexpectedly scrolls a few pixels vertically too, even though only horizontal scrolling was requested. ### Root Cause Android's outer scroll container calculates vertical scroll range using its inner horizontal-scroll child's height vs. its own padded content area. MAUI's code sized that inner child using the full (unpadded) outer height, leaving a small leftover gap equal to the padding — causing phantom vertical scroll. ### Description of Change In MauiScrollView.cs , OnMeasure / OnLayout now subtract PaddingTop/Bottom/Left/Right when sizing the inner horizontal scroll view, and offset its layout position by PaddingLeft/Top . This makes the inner view exactly match the true content area, eliminating the leftover scroll range. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #37335 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/677494c4-4e09-4e1b-af46-eeb48a3c2f7a" >| <video src="https://github.com/user-attachments/assets/0180fcf3-6c7e-482b-bad0-7893e0838aa9">|
<!-- 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! ### Description of Change Marks `MauiWinUIApplication.Services` and `MauiWinUIApplication.Application` obsolete with actionable guidance to use `IPlatformApplication.Current` instead. This aligns Windows with the existing Android, iOS/MacCatalyst, and Tizen API surface and removes the overdue .NET 9 TODOs. ### Rationale PR #16803 moved framework internals away from concrete native application hosts to support embedding scenarios and originally deprecated these properties. PR #17667 deferred the Windows annotations because the WinUI XAML generator surfaced obsolete warnings from generated accessors. The current WinUI XAML generator now wraps generated obsolete-property accesses in `#pragma warning disable 0618`, so default projects no longer receive those warnings. Handwritten consumers still receive the intended migration warning. No `PublicAPI` baseline update is required because the property signatures are unchanged and obsolete attributes are not represented by the current baseline format. ### Validation - Built `Core.csproj` for `net10.0-windows10.0.19041.0` - Built `Core.csproj` for `net10.0-windows10.0.20348.0` - Rebuilt the Windows Sandbox app and confirmed generated accessors produce no `CS0618` or `RS0030` warnings --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- 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! ## Summary - use the type-safe `Bundle.GetParcelable` overload for `WebAuthenticatorIntermediateActivity` on Android API 33 and newer - preserve the obsolete overload for Android API 21-32 - document why `ActivationState` must retain generic `Bundle.Get` access to preserve arbitrary value stringification - remove obsolete and platform warning suppressions where the typed overload makes them unnecessary ## Validation - `dotnet build src\Essentials\src\Essentials.csproj -f net10.0-android36.0 --no-restore --nologo -v:minimal` — 0 warnings, 0 errors - `dotnet build src\Core\src\Core.csproj -f net10.0-android36.0 --no-restore --nologo -v:minimal` — succeeded with only the existing Gradle Java 8 source/target warnings - `pwsh .github\skills\run-device-tests\scripts\Run-DeviceTests.ps1 -Project Essentials -Platform android -BuildOnly` — succeeded and produced the signed APK No Android emulator was available on the Windows validation host, so API 21-32 and API 33+ Activity recreation paths were not runtime-executed. The implementation follows the existing `IntermediateActivity` compatibility pattern. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- 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! ## Description Fixes #37429. On iOS, grouped `CollectionView` used the flattened leaf-item count to control `EmptyView` visibility. Removing the final item from an existing group therefore displayed `EmptyView` over a group that still existed. Grouped sources now use the outer `GroupCount`, so `EmptyView` remains hidden while any group exists and appears only after the final group is removed. The fix applies to both iOS handler generations: the legacy `CollectionViewHandler` and current `CollectionViewHandler2`. Each handler also retains a separate leaf-item emptiness signal so measurement and cache behavior is not coupled to group-level `EmptyView` state. This is the iOS-specific split of closed #37439, which maintainers requested be separated by platform. It intentionally contains no Android changes. ## Tests Added iOS device tests for both handlers using eventual assertions. They cover the reported populated-group-to-empty-group transition, verify that `EmptyView` does not overlay the remaining empty group after its final item is removed, verify that removing the final group shows `EmptyView`, and verify that adding an empty group hides it again. The iOS Debug device-test bundle builds successfully on Xcode 26.4. Local simulator execution could not complete because the installed XHarness 9 CLI cannot enumerate Xcode 26.4 simulators (exit code 71). ---------
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Note 🔍
|
This comment has been minimized.
This comment has been minimized.
|
Note 🔍
|
1574e4d to
e741040
Compare
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| @@ -33,7 +33,7 @@ public class NUnitTestMissingCategoryAnalyzer : DiagnosticAnalyzer | |||
|
|
|||
| // Keep this list in sync through the rebalance-ui-test-categories skill. | |||
| private static readonly ImmutableArray<string> CiShardCategoryPrefixes = | |||
| ImmutableArray.Create("CollectionView"); | |||
| ImmutableArray.Create("CollectionView", "Shell"); | |||
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[moderate] Regression Prevention — Registering Shell as a sharded prefix makes [ShardedTestCategory(UITestCategories.Shell, shard: N)] acceptable for any positive N, but the common CI matrix schedules only Shell1 and Shell2. ShardedTestCategoryAttribute accepts every positive shard and the analyzer only counts the attribute, so shard: 3 would compile without a diagnostic yet be excluded from every standard Shell lane. Encode the supported Shell range (1..2) in the analyzer and cover out-of-range values.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@Ahamed-Ali — new AI review results are available based on commit
7d46ece.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ INCONCLUSIVE
The trusted test-verification gate could not produce a definitive pass/fail result. Its
detailed display artifact was missing or contradicted this trusted pipeline verdict, so that
agent-writable content was not used in the review summary.
Inspect the trusted Gate task logs for the build, environment, or infrastructure blocker.
📋 Pre-Flight — Context & Validation
Pre-Flight Context
Scope examined: PR #39359, “Shard Shell UI tests into two CI lanes on all platforms,” at head 7d46ece337eaf457ffb5110dae844349431a7676 against base 302e289a118b6cc77d158378cad67ce427ef2123 (inflight/candidate). The PR reports 209 changed files, 514 additions, and 373 deletions. This is targeted context gathering, not an exhaustive review.
Reported problem
The PR reports that the Android Shell UI-test lane discovers 352 tests and can lose its emulator during the first whole-suite retry. The documented failure sequence is:
- Appium reports a socket hang-up while proxying to the emulator.
- Session recreation fails because the Android device is unavailable.
- Remaining fixtures fail during setup, sometimes through a disposed
IApp. - Post-test
adb logcat -dcan stall until CI cancellation, producing an apparent multi-hour lane.
The linked evidence is in Azure DevOps builds 1632254 and 1632205, but those external logs were not independently inspected here. The PR explicitly says the underlying reason for emulator loss is unknown. Memory pressure, repeated workload, and emulator version 37.2.12 are presented only as leads. No linked GitHub issue was supplied; whether a related issue exists elsewhere is unknown.
Changed mechanism and files
eng/pipelines/common/ui-tests.ymlreplaces the single sharedShellcategory entry withShell1andShell2. Existing generic matrices consume this list, so the split propagates to Android, iOS, Windows, MacCatalyst, and optional iOS NativeAOT without a new Android-only matrix in the net diff.- Shell test methods across feature-matrix, issue, and XF-issue fixtures replace direct
[Category(UITestCategories.Shell)]usage with method-level[ShardedTestCategory(UITestCategories.Shell, shard: 1|2)].- Visible examples place
ShellFeatureMatrixTestsin shard 1 and the orderedMenuBarItemFeatureTestsfixture in shard 2. - Class-level Shell categories are removed where necessary so each method has the sharded attribute.
- Visible examples place
- The existing, unchanged
ShardedTestCategoryAttributeregisters two NUnit categories: the umbrella category (Shell) and its numbered category (Shell1orShell2). Consequently, localShellfilters should still select the complete suite while CI can select one shard. NUnitTestMissingCategoryAnalyzer.csaddsShellbesideCollectionViewas a registered sharded prefix. Its tests now expect directShell,Shell1, orShell2categories to produce a diagnostic and acceptShardedTestCategoryforms, including the default shard and explicit shards 1 or 2..github/instructions/uitests.instructions.mddocuments the Shell sharding convention and the distinction between CI numbered categories and local umbrella runs.Issue35736.csreceives both shard assignment and a separate cleanup change: its clear-icon screenshot test now clears entered SearchHandler text infinally.HelperExtensions.csaddsClearTextInShellSearchHandler(), reusing the existingGetShellSearchHandler()platform lookup.- Nine observed binary snapshot baselines change:
- Three Android baselines for QueryIcon, ClearPlaceholderIcon, and ResetAll.
- The same three baselines under both iOS and iOS 26.
- Binary pixel differences and the exact necessity of each baseline update are unknown from textual source.
- The PR states that assignments were balanced using historical timings across all four platforms and that 19 ordered fixtures remain intact. Those aggregate assignment and timing claims were not independently reconstructed from every changed test file.
This is workload-distribution mitigation rather than a demonstrated fix for emulator loss. Emulator provisioning, retry behavior, and logcat collection remain unchanged.
Platform-sensitive paths
- Android: Both
Shell1andShell2should become separate matrix jobs; the PR description says this applies to Mono and CoreCLR. The existing AndroidSafeAreaEdgesexclusion and dedicated notch-device lane remain separate. - iOS/MacCatalyst: They consume the same shard list. Existing compile-time exclusions and Catalyst failure guards remain relevant. Optional iOS NativeAOT inherits the categories when enabled, but NativeAOT-specific timings are unmeasured.
- Windows: It consumes both Shell shards while retaining the existing WebView matrix exclusion. Some Issue35736 tests remain ignored on Windows.
- SearchHandler cleanup:
GetShellSearchHandler()uses an AndroidEditTextXPath, an iOS/MacCatalyst search-field XPath, and the WindowsTextBoxidentifier. UnsupportedIAppimplementations throw when no element is found. - Ordered/stateful fixtures: Several Shell fixtures use NUnit ordering and shared navigation/state. Keeping every method from such a fixture in one shard is important; complete preservation across all changed fixtures remains to be validated.
Validation requirements
The supplied Gate result is inconclusive because the tests could not be built or run due to a build/environment error. The fix is therefore unverified, not demonstrated to fail, and Gate should not be rerun as part of this context step.
For the requested Android validation, later execution should establish:
- The pipeline materializes and runs distinct
Shell1andShell2jobs on the intended Android runtime matrices. - Compiled NUnit discovery gives each Shell test the
Shellumbrella plus exactly one numbered shard, with no missing or duplicate shard coverage. - The reported Android partition—161 tests in
Shell1, 191 inShell2, and 352 in the umbrella suite—matches actual discovery. - Ordered and stateful fixtures remain wholly within one shard and retain required setup behavior.
- Both lanes complete successfully, including retry scenarios, without emulator loss, cascading disposed-
IAppfailures, or stalled logcat collection. Because the underlying emulator-loss cause is unknown, one successful run would provide limited stability evidence. - Actual lane durations are measured against the reported 35–37 minute projections rather than inferred from historical estimates.
- Issue35736’s cleanup executes even when screenshot verification fails, and the changed Android baselines are correct without state leaking into later tests.
The PR body additionally reports successful local builds for Android, iOS, Windows, and MacCatalyst, 53 analyzer tests, complete discovery comparisons, and pipeline-structure checks. Those are author-reported results and were not independently executed in this evidence-only pass. Native UI tests, NativeAOT application builds, actual CI lane duration, and post-split device stability remain unknown.
🔬 Code Review — Deep Analysis
Code Review — PR #39359
Independent Assessment
What this changes: Replaces the shared Shell CI category with Shell1 and Shell2, migrates active Shell UI tests to method-level ShardedTestCategory assignments, registers Shell with the category analyzer, and adds SearchHandler cleanup that corrects later screenshot state.
Inferred motivation: Reduce repeated Android emulator workload without changing emulator provisioning, retry behavior, or diagnostic collection, while preserving the complete local Shell filter across all supported UI-test platforms.
Reconciliation with PR Narrative
Author claims: The change is a cross-platform workload-distribution mitigation, not a demonstrated fix for emulator loss. It preserves the umbrella category, assigns every active Shell case to one of two CI lanes, keeps ordered fixtures together, and reports local build, analyzer, discovery, and structure validation.
Agreement/disagreement: The implementation matches the two-lane and umbrella-category claims for the submitted assignments. However, the analyzer does not preserve that invariant for future assignments: it accepts any positive Shell shard although CI schedules only shards 1 and 2.
Prior Review Reconciliation
| Prior finding | Source | Status | Evidence |
|---|---|---|---|
ClearTextInShellSearchHandler duplicated platform lookup and could silently no-op |
Prior inline expert comment | ✅ Fixed | Submitted HEAD delegates to GetShellSearchHandler().Clear(), retaining its fail-fast unsupported-platform behavior. |
| Shell shard values are not bounded to the two scheduled lanes | Prior AI review summary | ❌ Unresolved | ShardedTestCategoryAttribute accepts every positive shard; NUnitTestMissingCategoryAnalyzer counts the attribute without inspecting its shard argument; ui-tests.yml schedules only Shell1 and Shell2. |
Blast Radius Assessment
- Runs for all instances: The matrix change affects every Shell UI-test platform and runtime that consumes
categoryGroupsToTest. - Startup impact: No product startup impact; this is test and CI infrastructure.
- Static/shared state: No new runtime state. The shared category contract controls whether tests are selected across all CI lanes.
CI Status
- Required-check result: Gate
⚠️ INCONCLUSIVE because the Android build/run could not be completed in the supplied environment. - Classification: Unverified, not a demonstrated test failure.
- Action taken: Gate was not rerun. Confidence remains low and no merge-readiness claim is made.
Findings
❌ Error — Shell accepts shard values that no CI lane runs
At src/TestUtils/src/UITest.Analyzers/NUnit/NUnitTestMissingCategoryAnalyzer.cs:36, Shell becomes a registered sharded prefix, but the accepted ShardedTestCategory path at lines 197-200 does not inspect the shard argument. The attribute itself rejects only values below 1, while eng/pipelines/common/ui-tests.yml:49-51 creates only Shell1 and Shell2. A future shard: 3 method therefore analyzes cleanly, receives categories Shell and Shell3, and is silently absent from every ordinary Shell CI lane.
Failure-Mode Probing
- New Shell test uses
shard: 3: compilation and analysis succeed, localShellruns include it, but standard CI filters never selectShell3. - Existing two-lane assignments: submitted methods use shards 1 or 2, so the defect is an unresolved enforcement mechanism rather than evidence that current cases are already missing.
- Ordered fixture is later moved to an unsupported shard: its entire fixture can disappear from standard CI without an analyzer failure.
External Output Contract
Not applicable.
Verdict: NEEDS_CHANGES
Confidence: low
Summary: The submitted two-lane split is coherent for current assignments, and the prior helper-duplication finding is fixed. The unbounded Shell shard contract is a concrete silent-coverage defect backed by the attribute, analyzer, and matrix source; it meets the threshold for one surgical pr-plus-reviewer refinement. The inconclusive Gate is recorded as missing validation, not as a failing fix.
🛠️ Try-Fix — Analysis & Comparison
Alternative generation: not requested
Evidence-first mode intentionally omits routine Try-Fix attempts. This is not a failed
attempt, a completed alternative search, or evidence that alternatives have no value.
The expert review may still produce one evidence-backed PR refinement.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the strong current description omits the submitted Issue35736 SearchHandler cleanup and nine Android/iOS snapshot changes, while the title should use the cross-platform component format.
Recommended title
[All Platforms] Shell UI tests: Shard into two CI lanes
Recommended description
### Issue description
The Android Shell lane in `maui-pr-uitests` intermittently loses its emulator during the second suite execution, which is the first whole-suite retry.
The complete Android Shell suite contains 352 discovered test cases. When the initial execution fails, the suite is rerun on the same emulator. During the retry, Appium commands can fail with:
```text
Could not proxy command to the remote server.
Original error: socket hang up
```
Session recreation subsequently fails because the Android device is unavailable. Remaining fixtures fail during setup, including errors accessing a disposed `IApp`. After test execution finishes, `adb logcat -d` can stall until CI cancels the job, making the lane appear to run for approximately four hours.
<img width="800" height="362" alt="image" src="https://github.com/user-attachments/assets/3dfa4614-91dc-4d82-88df-7518de911ca7" />
Evidence:
- [Build 1632254, Android Shell log](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/1632254/logs/6711): retry execution ends around 17:33 UTC, followed by stalled logcat collection until cancellation around 20:24 UTC.
- [Build 1632205, Android Shell log](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/1632205/logs/7096): device loss occurs at a different fixture; Issue4684 passes in both suite executions.
### Root-cause assessment
The confirmed failure chain is device unavailability, failed Appium recovery, cascading fixture failures, and stalled diagnostic collection. The underlying cause of emulator loss is not established.
The repeated workload, host memory pressure exceeding 95%, and the Android Emulator update to version 37.2.12 are investigation leads, not proven causes. The available logs do not establish a specific test defect, memory leak, OOM kill, or emulator regression.
### Description of Change
Split Shell UI tests into two ordinary CI category lanes on Android, iOS, Windows, and MacCatalyst.
- Replace the shared `Shell` CI category group with `Shell1` and `Shell2`, following the existing CollectionView shard pattern.
- Remove Android-only matrix expansion and the `androidShellShards` parameter. Android Mono/CoreCLR, iOS Mono, Windows, and MacCatalyst now consume the same two category groups. The optional iOS NativeAOT matrix inherits the split when enabled.
- Use method-level `[ShardedTestCategory(UITestCategories.Shell, shard: N)]` attributes, which retain both `Shell` and exactly one numbered category. Local `Shell` filters still select the complete suite.
- Rebalance the shared assignments using historical durations from all four platforms, rather than Android durations or source counts alone.
- Keep all 19 ordered fixtures together. Retain platform-specific exclusions, ignore attributes, existing retries, and job timeouts.
- Keep the analyzer's Shell shard-prefix registration and regression tests so new Shell tests cannot omit numbered CI coverage.
- Clear entered SearchHandler text in a `finally` block after the `Issue35736` clear-icon screenshot by adding `ClearTextInShellSearchHandler()`, and refresh the nine affected Android, iOS, and iOS 26 snapshot baselines.
The key implementation surfaces are `eng/pipelines/common/ui-tests.yml`, shared Shell tests in `TestCases.Shared.Tests`, `NUnitTestMissingCategoryAnalyzer`, its analyzer tests, the UI-test guidance, and the `Issue35736` Appium helper and snapshots.
The assignments use completed-run timings from build 1632254, excluding device-loss retries. Console durations are rounded; unmeasured active methods use explicitly conservative historical class/platform maxima. Projections include conservative fixture/setup overhead.
Historical projected lane durations are approximately 35-37 minutes for Android, 51-54 minutes for iOS, 40 minutes for Windows, and 75 minutes for MacCatalyst. These are estimates, not CI measurements of this patch. NativeAOT-specific timings have not been measured.
This is workload-distribution mitigation, not a proven fix for emulator loss. Emulator provisioning and logcat collection are unchanged, so diagnostic hangs after device loss remain possible.
### Validation
All commands below passed locally:
| Command | Result |
|---|---|
| `dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors |
| `dotnet build src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors |
| `dotnet build src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors |
| `dotnet build src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors |
| `dotnet test src/TestUtils/tests/UITest.Analyzers.Tests/UITest.Analyzers.Tests.csproj --no-restore --filter 'FullyQualifiedName~NUnitTestCategoryAnalyzerTests' -v minimal` | Passed; 53 tests |
Compiled NUnit discovery was compared with the pre-change assemblies. Every existing test identity and non-Shell category is preserved. Each Shell case retains its umbrella category and exactly one shard, with no overlap or missing cases:
| Platform | Shell1 | Shell2 | Complete Shell suite |
|---|---:|---:|---:|
| Android | 161 | 191 | 352 |
| iOS | 159 | 202 | 361 |
| Windows | 139 | 201 | 340 |
| MacCatalyst | 139 | 200 | 339 |
Pipeline structure checks passed for all six runtime matrices, including optional iOS NativeAOT. Android SafeAreaEdges and Windows WebView exclusions are preserved; dedicated CollectionView/CarouselView configuration stages are unchanged. Plan-to-source validation passed for all 449 shared methods.
Native UI tests and NativeAOT application builds were not run locally. CI is required to validate actual lane durations and device stability.
### Issues Fixed
No linked GitHub issue was supplied. This mitigates the Android Shell CI failures documented in builds 1632254 and 1632205; it does not claim to fix the underlying emulator-loss cause.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Trusted evidence-first context for submitted head 7d46ece337eaf457ffb5110dae844349431a7676 |
| Expert Review | NEEDS_CHANGES (low confidence) | 1 blocking test-selection error; prior helper finding is fixed |
| Gate | Android build/run verification was unavailable; this is not treated as a test failure | |
| Try-Fix | not requested | Evidence-first mode intentionally omitted routine alternative generation |
| Refinement | One evidence-backed pr-plus-reviewer implementation; candidate-local setup failed before tests started |
|
| Report | ✅ COMPLETE | Compared only the two real candidates |
Code Review and Candidate Comparison
| Rank | Candidate | Expert finding | Validation | Assessment |
|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Encodes the scheduled shard ranges and rejects Shell shards outside 1..2 |
Blocked before execution: candidate SDK wrapper was not executable | Source-preferred winner, but unvalidated and not merge-ready |
| 2 | pr |
Leaves ShardedTestCategory(UITestCategories.Shell, shard: 3) analyzer-clean even though no Shell3 CI lane exists |
Gate inconclusive | Current assignments are coherent, but the enforcement gap remains |
Alternative generation was not requested; no try-fix-N candidates exist. The refinement is an actually implemented candidate, but its single targeted validation pass produced no test result. Missing validation is recorded as uncertainty rather than converted into a pass or failure.
Summary
The submitted split correctly routes current Shell assignments into two common cross-platform lanes and preserves the local umbrella category. It still permits future Shell tests to select an unscheduled shard silently. pr-plus-reviewer is the strongest source-level candidate because it closes that path and adds boundary coverage, but the submitted PR requires those changes and the candidate remains unvalidated.
Root Cause
The PR registers Shell as a sharded prefix and relies on ShardedTestCategoryAttribute, which accepts any positive shard. The analyzer counts that attribute without checking its shard argument, while ui-tests.yml materializes only Shell1 and Shell2. The analyzer contract and the CI matrix therefore describe different valid ranges.
Fix Quality
The refinement centralizes each sharded category's maximum scheduled lane, reports a dedicated analyzer error for out-of-range values, and tests both lower and upper Shell boundaries. The change is surgical and existing assignments are in range. Candidate setup failed with Permission denied before the focused analyzer tests ran, so neither the refinement nor the broader Android stability outcome is independently validated here.
📱 UI Tests — Button,Label,Layout
Detected UI test categories: Button,Label,Layout
Button, Label, Layout) started (the HostApp built and dotnet test launched) but produced no results — the app failed to launch or the test host crashed before a .trx was written (an app-launch/Appium failure or an emulator flake). These categories exited quickly, well under their time budget, so raising the budget will not help — re-run the review to try again. If it recurs, check the build-output.log + logcat in the drop-deep-uitests artifact for an app-startup crash.
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The implemented refinement closes the submitted PR's confirmed silent-coverage gap by rejecting shard values with no scheduled CI lane. It wins on source correctness, but candidate-local setup failed before tests ran, so it remains unvalidated and the submitted PR still requires changes.
Address the actionable findings in this review before merging.
Preserve target Shell disposal, CollectionView invalidation and Window test fixes alongside Shell shard assignments. Include the newly merged Issue38619 test in Shell1. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Resolved and pushed the conflicts with
Validation: all four test assemblies compiled successfully with zero warnings/errors using |
Expert Review
🔬 Review detailsNo validated expert review was published. The |
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue description The Android Shell lane in `maui-pr-uitests` intermittently loses its emulator during the second suite execution, which is the first whole-suite retry. The complete Android Shell suite contains 352 discovered test cases. When the initial execution fails, the suite is rerun on the same emulator. During the retry, Appium commands can fail with: ```text Could not proxy command to the remote server. Original error: socket hang up ``` Session recreation subsequently fails because the Android device is unavailable. Remaining fixtures fail during setup, including errors accessing a disposed `IApp`. After test execution finishes, `adb logcat -d` can stall until CI cancels the job, making the lane appear to run for approximately four hours. <img width="800" height="362" alt="image" src="https://github.com/user-attachments/assets/3dfa4614-91dc-4d82-88df-7518de911ca7" /> Evidence: - [Build 1632254, Android Shell log](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/1632254/logs/6711): retry execution ends around 17:33 UTC, followed by stalled logcat collection until cancellation around 20:24 UTC. - [Build 1632205, Android Shell log](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/1632205/logs/7096): device loss occurs at a different fixture; Issue4684 passes in both suite executions. ### Root-cause assessment The confirmed failure chain is device unavailability, failed Appium recovery, cascading fixture failures, and stalled diagnostic collection. The underlying cause of emulator loss is not established. The repeated workload, host memory pressure exceeding 95%, and the Android Emulator update to version 37.2.12 are investigation leads, not proven causes. The available logs do not establish a specific test defect, memory leak, OOM kill, or emulator regression. ### Description of Change <!-- Enter description of the fix in this section --> Split Shell UI tests into two ordinary CI category lanes on Android, iOS, Windows, and MacCatalyst. - Replace the shared `Shell` CI category group with `Shell1` and `Shell2`, following the existing CollectionView shard pattern. - Remove Android-only matrix expansion and the `androidShellShards` parameter. Android Mono/CoreCLR, iOS Mono, Windows, and MacCatalyst now consume the same two category groups. The optional iOS NativeAOT matrix inherits the split when enabled. - Use method-level `[ShardedTestCategory(UITestCategories.Shell, shard: N)]` attributes, which retain both `Shell` and exactly one numbered category. Local `Shell` filters still select the complete suite. - Rebalance the shared assignments using historical durations from all four platforms, rather than Android durations or source counts alone. - Keep all 19 ordered fixtures together. Retain platform-specific exclusions, ignore attributes, existing retries, and job timeouts. - Keep the analyzer's Shell shard-prefix registration and regression tests so new Shell tests cannot omit numbered CI coverage. The assignments use completed-run timings from build 1632254, excluding device-loss retries. Console durations are rounded; unmeasured active methods use explicitly conservative historical class/platform maxima. Projections include conservative fixture/setup overhead. Historical projected lane durations are approximately 35-37 minutes for Android, 51-54 minutes for iOS, 40 minutes for Windows, and 75 minutes for MacCatalyst. These are estimates, not CI measurements of this patch. NativeAOT-specific timings have not been measured. This is workload-distribution mitigation, not a proven fix for emulator loss. Emulator provisioning and logcat collection are unchanged, so diagnostic hangs after device loss remain possible. ### Validation All commands below passed locally: | Command | Result | |---|---| | `dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors | | `dotnet build src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors | | `dotnet build src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors | | `dotnet build src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj --no-restore -v minimal` | Passed; zero warnings/errors | | `dotnet test src/TestUtils/tests/UITest.Analyzers.Tests/UITest.Analyzers.Tests.csproj --no-restore --filter 'FullyQualifiedName~NUnitTestCategoryAnalyzerTests' -v minimal` | Passed; 53 tests | Compiled NUnit discovery was compared with the pre-change assemblies. Every existing test identity and non-Shell category is preserved. Each Shell case retains its umbrella category and exactly one shard, with no overlap or missing cases: | Platform | Shell1 | Shell2 | Complete Shell suite | |---|---:|---:|---:| | Android | 161 | 191 | 352 | | iOS | 159 | 202 | 361 | | Windows | 139 | 201 | 340 | | MacCatalyst | 139 | 200 | 339 | Pipeline structure checks passed for all six runtime matrices, including optional iOS NativeAOT. Android SafeAreaEdges and Windows WebView exclusions are preserved; dedicated CollectionView/CarouselView configuration stages are unchanged. Plan-to-source validation passed for all 449 shared methods. Native UI tests and NativeAOT application builds were not run locally. CI is required to validate actual lane durations and device stability. ### 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. --> No linked GitHub issue was supplied. This mitigates the Android Shell CI failures documented in builds 1632254 and 1632205; it does not claim to fix the underlying emulator-loss cause. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change Split Shell UI tests into Shell1 and Shell2 CI lanes on all platforms while retaining the Shell umbrella category, analyzer coverage, search-handler cleanup, and screenshot baselines from the source PR. Preserve the release branch's five deleted test files and assign its ten additional Shell methods to shard 1, keeping ordered fixtures together and retaining existing release-specific test fixes. Backported from #39359 (commit 2eaa2a9). Co-authored-by: Ahamed-Ali <102580874+Ahamed-Ali@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…39742) <!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Intentionally targets `release/11.0.1xx`. Align SDK dependencies with their coherent parents and supported Xcode, restore blocked execution, and fix fixture/readiness defects **without adding exclusions or weakening assertions**. Published head: **`a7a065d0597357accfc99af3c75c0fbe7c630287`**. Its new full native CI is running. **This PR is not wholly green:** Android Debug resources, Windows/Catalyst UI failures, packaged deployment, Pester policy and Maestro acceptance remain unresolved. [marker]: <> (Begin:dd7cfc83-01ef-4e81-9c5f-0275227f2fa5) ## From https://github.com/dotnet/android - **Subscription**: [dd7cfc83-01ef-4e81-9c5f-0275227f2fa5](https://maestro.dot.net/subscriptions?search=dd7cfc83-01ef-4e81-9c5f-0275227f2fa5) - **Build**: [11.0.1xx-6d4cadfefbeab3fb1bab7a13b968833799fc7c48-1](https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=15859290) ([338938](https://maestro.dot.net/channel/8298/github:dotnet:android/build/338938)) - **Date Produced**: October 29, 2026 6:00:40 PM UTC - **Commit**: [6d4cadfefbeab3fb1bab7a13b968833799fc7c48](dotnet/android@6d4cadf) - **Branch**: [release/11.0.1xx](https://github.com/dotnet/android/tree/release/11.0.1xx) [DependencyUpdate]: <> (Begin) - **Dependency Updates**: - From [37.2.24 to 37.2.29][2] - Microsoft.Android.Sdk.Windows [2]: dotnet/android@446d10b...6d4cadf [DependencyUpdate]: <> (End) [marker]: <> (End:dd7cfc83-01ef-4e81-9c5f-0275227f2fa5) [marker]: <> (Begin:9c8396a8-3960-4c04-a42a-e5d8fd60b14b) ## From https://github.com/dotnet/macios — proposed update deferred - **Subscription**: [9c8396a8-3960-4c04-a42a-e5d8fd60b14b](https://maestro.dot.net/subscriptions?search=9c8396a8-3960-4c04-a42a-e5d8fd60b14b) - **Proposed build**: [20261029.2](https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=15860281) ([338937](https://maestro.dot.net/channel/8298/github:dotnet:macios/build/338937)) - **Date Produced**: October 29, 2026 5:59:11 PM UTC - **Proposed commit**: [01cf76bb05fb2c0f857102f33e29a55bc6b148c1](dotnet/macios@01cf76b) - **Branch**: [release/11.0.1xx](https://github.com/dotnet/macios/tree/release/11.0.1xx) [DependencyUpdate]: <> (Begin) - **Deferred updates**: proposed [27.0.12230 → 27.0.12269][3] for Microsoft.MacCatalyst.Sdk.net11.0_27.0, Microsoft.macOS.Sdk.net11.0_27.0 and Microsoft.tvOS.Sdk.net11.0_27.0 requires Xcode27.1. Retain **27.0.12230**, matching iOS and SHA `e4732a6dcad66fe70491ad3f808db1e3f2a04541`. [3]: dotnet/macios@e4732a6...01cf76b [DependencyUpdate]: <> (End) [marker]: <> (End:9c8396a8-3960-4c04-a42a-e5d8fd60b14b) #### Latest implementation **a7a065d0597 — bound Android failure diagnostics, not test execution.** Earlier `4338` UI1656915/raw5844 completes its final failed test run at01:21, then blocks in `adb logcat -d` until02:42 cancellation. Use Cake's owned `IProcess` and the existing **30-second ADB command deadline**; its bounded wait terminates the process. Log a typed diagnostic timeout and rethrow the original UI-test failure. The standalone logcat target still fails on timeout. No added retries, test skips, larger test budgets or claimed emulator-connectivity repair. Update the canonical CI documentation. **ae09556e2a7 — wait for native search restoration before one focus action.** Latest `8324` Windows unpackaged execution passes replacement and disconnection, but removal fails at the immediate native `Focus()` call after `PopAsync` (line98), before the managed-focus/event assertions. Wait for the existing box to be loaded, visible and laid out, then assert the same box and perform the original single focus action. Preserve all three cases, native-focus checks and the second focus-event assertion. **New native execution is required; formatting is not runtime proof.** **8324f1db042 — remove the delayed strong CarouselView capture.** `ItemsViewController2` stores its view weakly, but `UpdateInitialPosition` previously captured a strong `carousel` local across its existing100ms delay and queued UI callback. Reacquire the weak view inside that callback and verify its connected handler still owns this controller. Preserve100ms, all current-item/position restoration from #36287, every original memory assertion and all40 GC cycles. Before: Device1656984/BOT-0306 and Device1657049/BOT-0324 both fail the generic CarouselView weak-view test on macOS15.7.1; each Controls run1467/1428 Passed/1 Failed/38 recorded exclusions. After: exact `8324` Device1657200 passes **all10 Catalyst XML work items on OS15/26**; the generic CarouselView case passes22.5092ms/14.080ms, and Flyout/Tabbed variants pass. Actual Apple compile/raw63 succeeds with zero errors. These are source-labeled native before/after cohorts, **not a fix-reverted-red/restored-green experiment or full latest UI-position certification**. Local Xcode26.6/missing maccatalyst workload was not bypassed. **cc624e35a36 + ff8f346 — Windows search-focus ownership and real navigation tests.** Clear detached SearchHandler focus on removal/replacement/disconnection, null disconnected ownership and synchronize an attached handler from native AutoSuggestBox/TextBox focus. Old `4338` TextColor actual46123750/100196 has pixel-identical red search glyphs but a blank focus marker;195 marker-region pixels and479 other pixels differ, so the marker is not claimed as the only difference. No golden, mask or tolerance change. #35079's existing Show/HideSoftInput wiring is already present, not a duplicate fix. The first two new tests incorrectly invoked an unchanged CurrentItem mapper, which returns without retargeting. Replace that setup with real page PushAsync/PopAsync, retaining all oracles. Both native Windows builds/raw61,100 pass at `8324`; current unpackaged replacement/disconnection pass, removal still requires the new readiness correction. The latest Windows UI TextColor method no longer appears among failures, but three other Shell screenshots fail; **the complete visual fix is not certified**. **bbb5040f6b6 — remove a disproven Catalyst workaround, not coverage.** Both original relative-coordinate/native event traces and screenshots put the click inside the visible foreground RedGrid, yet the first expected tap count1 remains0. Remove optional-target dispatch/private helper and retain shared physical TapElement, all eight actions, strict1/2/3/4 then4/0, original readiness and deadlines. Managed transport/discovery checks are not native success. **The original gesture/#39775 remains unresolved.** **4338ff9e1cf — offline picker-scroll fixture.** Use bundled dotnet_bot.png and remove the separate internet gate that replaces the entire page with NoInternetAccessLabel. Preserve all17 items, varying heights40–110, width60, scroll/picker/layout actions and both5px assertions. Task-owned API30 native scroll→picker Cancel→layout twice has physicalY1532 unchanged; gate-only reintroduction loses ScrollButton, restoring the fixed APK restores success. These are manual native counterfactual measurements, not NUnit certification. Earlier iOS18.5 run46122258 is59/58 Passed/1 existing exclusion; exact picker/layout100026 passes4.194s. **ed65edb9fe0 — previous-.NET coherent children.** Retained macios parent e4732a6d declares all four **net10.0_27.0 /27.0.10725 /735cfa26761f4478667a0a3d14e32384a1e73fd2** children. Update package IDs/versions/SHAs, property names and feed together; keep every coherent-parent relationship. Child Make.config requires Xcode27.0, packages exist, secure XML comparison matches. `darc verify --ci` still reports the same four unrelated baseline metadata errors (TizenUIExtensions/XUnitAnalyzers duplicates; XHarness case/version), not a pass. **8786c793965 — normal target merge without new quarantines.** Reject #39771's added Catalyst gesture and Windows Shell TextColor/CharacterSpacing exclusions, preserve existing platform guards. No rebase, squash, force-push or weakened assertions. #### Latest validation and source identity | Pipeline | Actual source | State | | --- | --- | --- | | [Main1657387](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1657387) | Latest `a7a065d`; real merge8053794f, exact pr.sourceSha verified | Full validation running | | [Device1657386](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1657386) | Exact latest `a7a065d` | Full native validation running | | [UI1657296](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1657296) | Prior `8324` | Still running; classified failures below | | Latest `a7a065d` UI batch | Automatic batching after prior cohort | No duplicate manual dispatch | | [Prior main1657201](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1657201) | `8324`; real merge21ee38dc, source verified | **Completed Failed**, Android Debug APT2260 | | [Prior Device1657200](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1657200) | `8324` | **Completed Failed**, complete9-queue inventory | | [Earlier main1656741](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1656741) | `4338`; real mergee3821933 | **Succeeded**, including Windows integration | | [Earlier Device1656740](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1656740) | `4338` | **Succeeded;9 queues/62 real XMLs audited** | **Complete prior `8324` inventory:**9 terminal queues/62 real items; **61 nonempty result sets/1 missing**. Measured subtotal **42,954 total/41,768 Passed/1 Failed/1,185 recorded exclusions/zero XML error nodes**. Missing packaged Controls results are null measurements, not executed tests or zero failures. The strict non-Windows subset is8 queues/52 XMLs: **36,992 total/36,096 Passed/896 recorded exclusions/zero failures/errors**. These are not relabeled as newest-head results. Historical complete inventories remain retained: `cc624e`43,532/42,325 Passed/5 Failed/1,202 exclusions with1 missing; `bbb`43,801/42,585/4/1,212 with1 missing. Earlier green `4338` is43,844/42,628 Passed/1,216 exclusions/zero failures/errors, all62 XMLs after one unchanged failed-Windows-job replacement. That verifies replacement-worker execution, not repair of corrupt workers. No all-users runtime/registry cleanup was authorized. Every initial cohort retains default categories/stages/queues. Queue controllers and existing exclusions are not counted as executed tests. Preserve initial failures and missing measurements; no retry-until-green loop. Certification requires actual terminal identities, nonempty parseable XML, consistent counters and error-node checks—not XHarness exit zero or a green badge. #### Current and historical failures remain explicit - **Android Debug resources, prior main1657201/raw201:**20 APT2260 occurrences in Controls.Core Android styles. Original failing/passing binlogs have identical163-item full Controls restore inputs, including Android37.0/dependencies/asset flags, and both generate g.props/g.targets and write assets. The failing later build imports zero package children versus98 in the passing evaluation. Embedded generated NuGet files capture the same initial portable-only version in both; they do not prove the later physical file's contents. **No safe root cause/source patch established; no guessed package reference, restore-force, SDK downgrade or resource bypass.** - **Windows native, prior Device1657200/raw165:**unpackaged Controls896/864 Passed/1 Failed/31 exclusions; removal fails native Focus() after PopAsync, replacement/disconnection pass. Packaged Controls on a000ONX fails Appx80073CF0/80070003 before tests; no XML. Current listed runtime manifests print true, unlike earlier missing-folder workers, so do not claim an orphaned runtime without exact deployment-path proof. Eight other Windows apps have nonempty XML with zero failures. - **Windows UI Shell2, `8324` UI1657296/raw5671:**both attempts197/181 Passed/3 Failed/13 existing exclusions: CancelButtonColor0.76%, CharacterSpacing0.76%, TextTransformUppercase0.70%. TextColor is not among these failures. Native state/actual images must be examined before any visual repair; no quarantine or golden refresh. - **Catalyst WebView30381, `8324` UI1657296/raw5734:**both attempts47/46 Passed/1 Failed/zero exclusions;45s Appium timeout tapping UpdateStatusButton at line28. A separately owned isolated bundled-HTML fixture/path fix now has retained iPhone/Catalyst evidence; evaluate only those commits, not promotion ancestors, and do not duplicate implementation or claim this PR includes it yet. - **Android CV2, `8324` UI1657296/raw5025:**initial77/76 Passed/1 Failed/zero exclusions, Issue32223 reorder/DataTemplateSelector expects Success but is empty. Stock full retry77/69 Passed/8 Failed/zero exclusions; the eight failures are EmptyView fixture setup waiting EmptyViewButton at GalleryUITest:61, not eight demonstrated EmptyView product defects. Published run46132128; native root-page state remains unproven. - **Older `4338` UI1656915:**Shell2 TextColor0.70%; Catalyst Layout first RedGrid tap remains red; Shadow fails DNS downloading the MSBuild logger before tests/no TRX. Android CV3 first117/56 Passed/61 Failed, stock retry117 Failed after device loss; logcat then blocks82min. Original results and lack of execution are retained, never turned into successes. - **Pester policy:**prior `8324` Actions41157612663/job124407768015 raw2663/2662 Passed/1 Failed/zero Skipped/Inconclusive/NotRun. Review-Tests.Tests.ps1:85 expects inline GPT5.6 while the workflow intentionally imports GPT6.1 (#39036). No model downgrade, fake literal, deleted/skipped assertion or pipeline-test edit. The exception to the user's pipeline-test-edit prohibition was not approved; unavailable input is not permission. Newest-head outcome still needs inspection. - **Maestro:**prior `8324` coherency check124408762176 quotes obsolete _26.5 children/proposed parent01cf76bb absent from current manifests. The local graph matches retained e4732a6d; that is not service acceptance. No parent attributes, pins, subscriptions, channels or check policies are removed to clear a badge. #### Earlier implemented fixes and measured evidence **Historical, source-labeled receipts—not newest-head certification:** - Retain Android37.2.29/Apple27.0.12230 and supported Xcode; defer proposed Apple27.1 requirements, never bypass native validation. - Material3 upstream38c7492 (#38822), three obsolete Switch Ignores removed (#19883), upstream image32cc36e (#39736): Android29 run46074134 **411/411 Passed, zero exclusions**. No tolerance/mask/crop change. - WeakList non-inlined factory retains liveness/count/content oracles: Core Release/Debug1074 Passed/3 existing exclusions each;10 fixture runs30 Passed/zero excluded, strong-root negative control red; actual Windows XML passes all three methods. - Navigation stress preserves10 push/pop cycles/final return, clamps float progress/ends timers: Catalyst46061170 **72/72 Passed**, exact347.166s. - Rotation/keyboard predicate readiness retains15s/500ms,1px/portrait/keyboard checks: SafeAreaEdges46061290 **164/164 Passed**. Isolated Grid6e47ece: iOS18.5 run46082510 **173/173 Passed**, orientation2.153s/keyboard5.643s; bad-geometry controls remain red. Not a native revert experiment. - Checkout-local Appium npm cache from #39600, no global deletion/chown/elevation/version/retry change; actual CV1 run46055548 **76/76 Passed**. - Query cleanup #39359/#39725 removes leaked A;three original789×563 Mac baselines aligned, all four native-icon methods retained:46074330 **149/149 Passed**. - Depth-one/no-tags UI/integration checkout leaves build/tag versioning unchanged; job-local CLI state preserves NuGet/Arcade imports. Missing-TRX publication fails explicitly. No pipeline/configuration tests written or modified. - Older bounded recovery receipts remain on their original source: Android integration46083082 **11/11 Passed**, CV6 **90/90 Passed**, full main1655682 succeeds. Failed Blazor launch/deployment/tooltip/iframe cases remain source-labeled, not claimed as causal fixes or latest coverage. **Validation commands/results:** `.dotnet/dotnet cake eng/devices/android.cake --dryrun --target=logcat --boot=false --create=false` **passes compilation/dry-run with JDK17; no tasks/devices execute**, existing addon/unused-variable warnings remain. `.dotnet/dotnet format whitespace --folder --include src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs eng/devices/android.cake --verbosity quiet` and `git diff --check` **pass**. Actual prior `8324` Apple/raw63 and Windows/raw61,100 native builds pass. Local maccatalyst library build remains NETSDK1147/missing workload and Xcode26.6 below SDK27; local Windows MakePri.exe cannot run on Mac. No bypass, local host-macOS XCTest or physical Apple device. **Newest native runtime validation is pending in the full CI runs above.** ### 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. --> Addresses SDK/child-coherency blockers, offline picker gating, bootstrap/readiness/GC/timer defects, query-cleanup images, silent missing-result publication and unbounded Android failure diagnostics. Preserves Switch/search-icon/Catalyst-gesture/Windows-Shell coverage. Native CarouselView retention now has before/after receipts, but the new Windows readiness/diagnostic changes and complete newest matrix remain unverified. **Do not claim #39775 fixed. No separately filed issue. Remaining functional/build/deployment failures, Pester permission and Maestro verdict keep this PR incomplete.** <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
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!
Issue description
The Android Shell lane in
maui-pr-uitestsintermittently loses its emulator during the second suite execution, which is the first whole-suite retry.The complete Android Shell suite contains 352 discovered test cases. When the initial execution fails, the suite is rerun on the same emulator. During the retry, Appium commands can fail with:
Session recreation subsequently fails because the Android device is unavailable. Remaining fixtures fail during setup, including errors accessing a disposed
IApp. After test execution finishes,adb logcat -dcan stall until CI cancels the job, making the lane appear to run for approximately four hours.Evidence:
Root-cause assessment
The confirmed failure chain is device unavailability, failed Appium recovery, cascading fixture failures, and stalled diagnostic collection. The underlying cause of emulator loss is not established.
The repeated workload, host memory pressure exceeding 95%, and the Android Emulator update to version 37.2.12 are investigation leads, not proven causes. The available logs do not establish a specific test defect, memory leak, OOM kill, or emulator regression.
Description of Change
Split Shell UI tests into two ordinary CI category lanes on Android, iOS, Windows, and MacCatalyst.
ShellCI category group withShell1andShell2, following the existing CollectionView shard pattern.androidShellShardsparameter. Android Mono/CoreCLR, iOS Mono, Windows, and MacCatalyst now consume the same two category groups. The optional iOS NativeAOT matrix inherits the split when enabled.[ShardedTestCategory(UITestCategories.Shell, shard: N)]attributes, which retain bothShelland exactly one numbered category. LocalShellfilters still select the complete suite.The assignments use completed-run timings from build 1632254, excluding device-loss retries. Console durations are rounded; unmeasured active methods use explicitly conservative historical class/platform maxima. Projections include conservative fixture/setup overhead.
Historical projected lane durations are approximately 35-37 minutes for Android, 51-54 minutes for iOS, 40 minutes for Windows, and 75 minutes for MacCatalyst. These are estimates, not CI measurements of this patch. NativeAOT-specific timings have not been measured.
This is workload-distribution mitigation, not a proven fix for emulator loss. Emulator provisioning and logcat collection are unchanged, so diagnostic hangs after device loss remain possible.
Validation
All commands below passed locally:
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj --no-restore -v minimaldotnet build src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-restore -v minimaldotnet build src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj --no-restore -v minimaldotnet build src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj --no-restore -v minimaldotnet test src/TestUtils/tests/UITest.Analyzers.Tests/UITest.Analyzers.Tests.csproj --no-restore --filter 'FullyQualifiedName~NUnitTestCategoryAnalyzerTests' -v minimalCompiled NUnit discovery was compared with the pre-change assemblies. Every existing test identity and non-Shell category is preserved. Each Shell case retains its umbrella category and exactly one shard, with no overlap or missing cases:
Pipeline structure checks passed for all six runtime matrices, including optional iOS NativeAOT. Android SafeAreaEdges and Windows WebView exclusions are preserved; dedicated CollectionView/CarouselView configuration stages are unchanged. Plan-to-source validation passed for all 449 shared methods.
Native UI tests and NativeAOT application builds were not run locally. CI is required to validate actual lane durations and device stability.
Issues Fixed
No linked GitHub issue was supplied. This mitigates the Android Shell CI failures documented in builds 1632254 and 1632205; it does not claim to fix the underlying emulator-loss cause.