Skip to content

Deflake UI regression tests instead of quarantining them - #38822

Closed
kubaflo wants to merge 43 commits into
mainfrom
kubaflo-reliable-quarantined-tests
Closed

kubaflo wants to merge 43 commits into
mainfrom
kubaflo-reliable-quarantined-tests

Conversation

@kubaflo

@kubaflo kubaflo commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Alternative to the test quarantines in #38777. This branch starts from main, does not apply that PR's quarantine patch, and keeps its 126 targeted method/platform pairs enabled wherever they were enabled on main.

Original quarantine scope Pairs
Android 26
iOS 14
MacCatalyst 73
Windows 13

Replace incidental screenshot checks with native geometry, visible content, ordering, navigation, and enabled-state assertions where those directly express the regression. Keep visual assertions and existing goldens where they are needed. Apple Shell search-icon correctness is instead covered by native device tests; Mac CollectionView selection retains rendered-color assertions without comparing an entire window.

The shared causes addressed here are:

  • Fullscreen state leaking across Mac fixtures. The original failing captures contained an actual fullscreen native window, not a screenshot-cropping error. Fullscreen tests restore the original native window size in unconditional cleanup, reacquire native windows across transitions, and move the pointer away from the green window control so its fullscreen/tiling hover menu cannot contaminate subsequent captures.
  • NUnit retaining failed polling assertions. Catching an assertion exception did not remove the failed assertion from the enclosing NUnit result. Polling attempts use isolated NUnit contexts, retain final failures, and retry only assertion/stale-element/missing-element failures. Four direct NUnit tests cover transient success, persistent failure, multiple assertions, and nontransient exceptions.
  • Unrelated Android tests loading Google Maps at startup. Original logcat evidence showed maps_dynamite module updates killing the host during CollectionView tests. The test host registers the real map handlers but initializes the Maps SDK only when a map is actually created; activity bundle handling and map-navigation coverage remain intact.
  • Explicit Android device selection being ignored. The runner set Udid in its configuration but did not forward it to Appium. It now passes the requested device capability, matching the iOS runner, rather than allowing another connected emulator and stale host to be selected.
  • Google Search opening external update UI over HostApp. Second-iteration Android Shell screenshots, native hierarchies and launching UIDs identify Google Search opening a Play Services/Play Store update before the tests' first interaction. Preparation disables only Google Search for user 0 on the disposable emulator created by a CI UI-test run. It verifies the serial and exact AVD name, checks package-manager output and independently reads back the state. Play Services, Play Store, Maps and Google API providers remain enabled; local/attached-device runs are not automatically changed.
  • Races and shared fixture state. Wait for actual native layout, scrolling, picker, keyboard, and navigation conditions; initialize independent scenarios explicitly; reacquire elements across rotation; avoid duplicate native identifiers and keyboard-corrupted sample text. Numeric fixture input uses invariant parsing. Follow-up fixes use native toolbar/tab identifiers, whitespace-free grouped-item IDs, text-aware scrolling, and a real detail page for native Back-command coverage.

Additional coverage includes eight native iOS/MacCatalyst Shell search-handler cases. WebView history exercises real navigation between bundled documents while retaining its initial HtmlWebViewSource, without depending on an external website. MacCatalyst supplies the actual bundle resource directory for relative navigation; iOS retains its default-base coverage.

The CI-driven correction batches also address these observed failures:

  • Windows Issue32223: retain the original W3C touch gesture, which raised ReorderCompleted in CI, but drop in the target cell's leading quarter instead of on its insertion boundary. W3C mouse is unsupported, and the intermediate native windows: clickAndDrag attempt was accepted without starting a reorder; neither is retained. Both the event and final item order remain required.
  • Android Issue32223: use the same once-only W3C touch sequence and drop one quarter of the target label's width left of its center. AndroidX ItemTouchHelper.chooseDropTarget requires strictly crossing the target's left edge for this leftward swap; equal-sized center-to-center cells land exactly on that boundary. The original actual NUnit test reproduces Waiting instead of Success on API30. The correction passes twice on API30 and once on API36, retaining both the completion event and David-before-Charlie geometry checks, with no gesture or whole-test retry. Windows and Apple behavior are unchanged by this follow-up.
  • Issue29588: use overlapping 0.8-viewport gestures on Windows and Mac, and bound traversal by thirty gestures (the fixture contains at most thirty items), not native-driver round-trip time. A later Mac run still exhausted the original fifteen-second budget with only Items10-17 visible; its successful retry needed four gestures and many native queries. Inspect the final permitted gesture and retain full native visibility, the actual threshold command, and newly loaded content as required assertions. Missing or permanently clipped targets still fail.
  • Mac Issue20062: verify native selection and rendered blue fill/red stroke/white normal state for every item, instead of a whole-window golden. Selecting Item0 and Item2 must affect both selected items while leaving the other two normal.
  • Apple Issue35736: iOS26's mismatch was solely the blinking insertion caret. All four original UI methods remain enabled as interaction/query smoke tests. Actual icon identity, dimensions, template mode, control states, cached clear-button replacement, and reset are checked by the native device cases; query text alone is not claimed as icon correctness.
  • Windows Shell RTL: WinAppDriver /location returns mirrored window coordinates, while its native accessibility source contains physical screen bounds. Assert visible, positive-sized, non-overlapping button and tab bounds from one native source snapshot before and after RTL, rather than using the mirrored coordinates.
  • Windows FlyoutPage title: start this scenario with fresh native controls rather than reusing controls transformed by the preceding RTL test. Keep its title actions, golden and tolerance unchanged; do not reset unrelated ordered scenarios that intentionally share navigation state.
  • iOS Issue9088: remove the inherited iOS26 runtime ignore after repeated simulator passes. All twelve swipe/count/closing-position checks remain.
  • Mac Shell transitions: reacquire native tabs when navigation replaces an element between lookup and its visibility query, using the existing bounded, isolated assertion polling. A stale reference never counts as proof that a tab is hidden. Locate the native back arrow inside the navigation bar by the previous page label; the failed CI hierarchy exposes Home, not a Back identifier, and also contains a separate Home tab.
  • Script validation gates: synchronize the trusted Retina patch context with the screenshot helper's protected visibility, without changing its patch operations. Correct two stale model-pin assertions to the existing GPT-6 Astra local-reviewer configuration; the configured model, no-override checks and long-context checks are unchanged.
  • Android ActivityStateManager regression fixtures: register callbacks, dispatch the synthetic event, assert, and dispose the test manager in one synchronous UI-thread turn. Real application lifecycle events cannot interleave with the exactly-one-event measurement, and both repeated-Init tests now unregister their callbacks. Keep listener-identity and event-count assertions unchanged.
  • Issue6994: dispatch the fixture's collection clear onto the UI thread rather than racing native ListView layout. Retain the intentional worker-thread label-color updates and Label removal/disposal stress from the original regression.
  • Issue2951: observe native button-count and complete text transitions between one-time clicks before inspecting the next item. CI8 exposed a distinct stale reference before the first click on Mac, so the follow-up gives A/B/C stable button identifiers and reacquires B/B/C immediately before each once-only tap, instead of holding a positional list of native elements. Retain the original counts, text/removal checks, background-color screenshot, golden and tolerance; neither actions nor whole tests are retried. The final version passes Android and iOS locally; CI10 subsequently confirms all five observed configurations, including the first Mac execution.
  • ScrollViewNoContent: wait for the existing Success label, which is set only after the empty ScrollView changes to non-null content and back to null. The old absence assertion returned prematurely or failed when the scenario had actually finished; the failed Mac hierarchy contains the visible Success label. The host transitions are unchanged.
  • Issue24996: measure each translation independently, excluding initial layout and updates to the diagnostic labels from its ancestor counters. Wait for a unique completed-step marker before requiring Lvl1[0/0], instead of accepting a stale zero or polling until the desired value appears. Preserve all four translations and the original measurement interval.
  • Issue26598 native regression coverage: isolate navigation from the hidden Home root to the visible InnerTab page, asserting native content, navigation-stack state, tab geometry and actual hit testing, with hidden/alpha/frame/window diagnostics. An additional Mac-only full routed case uses the production WindowHandler and its WindowViewController containment rather than the modal device-test stub. It verifies the hidden page, pop, Recent/Home selection and return to the hidden root, restoring the original native root and scene title before disconnecting test handlers. The original all-Apple first-transition case and end-to-end UI test remain enabled. The legacy UIKit root cause and product correction are described below.
  • Android Material3 Issue35119: wait for the prompt keyboard, send ESC once, and observe that it finishes hiding without closing the prompt. Appium's HideKeyboard can send a fallback BACK after a short keyboard-state wait, dismissing the dialog when the IME transition is slow. Require the prompt and Cancel to remain present and verify all three dialog responses. All three original styling screenshots, tolerances and comparison timeouts remain unchanged.
  • Windows Issue18896: the first-failure teardown hierarchy reports a 10-pixel residual ListView offset, despite the intended down/up round trip. Require native scroll progress, then use at most three upward gestures to reach an observed zero offset before the unchanged screenshot comparison. The first-failure comparison image itself was unavailable; the measured offset is from its preserved teardown hierarchy, not an inferred screenshot-cropping defect.
  • Windows Issue30536: move the physical mouse outside and then into the border using the supported windows: click extension, rather than relying on element invocation to raise pointer events. Observe the unchanged exact enter/exit counts (1/0), without repeating input, and close the secondary window in finally even when assertions fail. The initial correction used the shared W3C mouse helper; a follow-up normal commit replaced it because WinAppDriver supports pen/touch W3C actions, not mouse. The latest correction adds the live application-window origin to WinAppDriver's window-relative element bounds because windows: click takes screen-absolute coordinates. The host reports actual Created/Minimized state instead of treating a permanently present minimize button as readiness. No shared gesture implementation or downstream golden is changed.
  • GC assertion final verdict: extract the existing collector assertions into a platform-neutral partial, then check all references' current liveness after their existing waits. Previously, an early retained-reference verdict remained false even if a later collection released that object, producing a failure with no living-reference details. Eight source-linked unit cases cover deterministic late collection, strongly held targets in each array position, already-collected targets and invalid input. Collection order, budget and scheduling are unchanged; no JVM or bridge collection is added, and genuinely retained objects still fail.
  • Android recreation cleanup: finish any remaining current activity, dispose/unregister the test manager and reset fixture state together on the UI thread in all three recreation-test finally blocks. CI's original Mono crash identifies activation of a disposed lifecycle listener during OnActivityPrePaused. This does not establish the cause of the separate CoreCLR ART crash; both original failures remain recorded until verified on the corrected head.
  • Windows Flyout RTL isolation: initialize this independent RTL scenario with fresh fixture state, consistent with the existing title isolation. CI8's mismatch contains genuinely mirrored glyphs, not just perimeter drift. The original screenshot and tolerance remain. CI9's first Windows executions pass both this scenario and Issue30536.
  • Windows Map completion and result integrity: port the coordinated Map/runner corrections from [net11] Fix Helix payload and device-test failures #38827. Await native Map scripts before assertions/cleanup, retain the required System import for WinRT await extensions, and reject empty or malformed category results and abnormal process exits. Keep the packaged launcher's process handle until exit-code retrieval. CI9's supposedly successful unpackaged Controls run had a zero-byte Map result, two missing Map tests and an actual native crash dump; its readable aggregate was not proof of completeness.
  • Android SwipeItem drawable ownership: call Mutate() before changing the icon's bounds or tint. Resource drawables can share their constant-state paint: tinting a SwipeItem black contaminated later Images using the same packaged resource. At the reproduced failure the underlying bitmap was red, but the drawable carried a black filter and both the real screen and direct native draws were black. A native regression checks that tinting the real SwipeItem leaves resource drawables loaded before and afterward untinted. The original undefined-size/background Image regression is unchanged. After independently reproducing and fixing this, branch comparison confirmed that [NET 11] SwipeItem: Add explicit IconColor and TextColor #36884 already isolates tint state on net11/RC2 as part of the new IconColor/TextColor API; this minimal main-branch correction does not backport that public API or change main's tint policy.
  • SafeArea Grid orientation observation: observe the requested orientation, current screen axes, insets and all required edge positions together through the existing NUnit-isolated assertion polling helper. An orientation-command acknowledgment does not mean the safe-area layout has settled. Rotate once outside each observation and restore portrait in finally. Every original position/roundtrip assertion and the one-pixel tolerance remain.
  • Mac Issue26598 diagnostics: capture read-only native tab-bar state for the existing HostApp UI failure, preserve the capture before fixture teardown and restore logging configuration. CI10 establishes an actual native visibility reversal on macOS14.8.7: the bar is visible at Navigated, then hidden 500ms later despite ShowTabs=true and the top controller's HidesBottomBarWhenPushed=false. The Mac15/26 native passes do not exercise this pre-18 UIKit branch. The next diagnostic observes changes to the tab layer's hidden state and records native/managed caller stacks plus every navigation controller's flag; it is disposed on Shell unload. Neither diagnostic changes native visibility or test assertions.
  • Legacy UIKit Shell tab bar (Issue26598 product fix): CI11's caller-stack diagnostic shows the hidden Home root setting the root ShellSectionRootRenderer.HidesBottomBarWhenPushed=True; MAUI unhides the tab bar for the pushed InnerTab page, then UIKit re-hides it with no managed MAUI frame on the stack. Before iOS/Mac Catalyst 18, ShellPageRendererTracker hides tabs through HidesBottomBarWhenPushed, and legacy UIKit hides the bottom bar after a push when any controller in the resulting stack requests it. ShellSectionRenderer.PushPage now clears those stale requests from the current stack (or the More navigation stack) before pushing a page that wants the tab bar visible, on pre-18 only. Pops still hide tabs for hidden targets because Shell sends Appearing, which re-applies the target's flag, before native pops. iOS18+/Catalyst18+ are unchanged. A local iOS18.5 run with the legacy branch forced on did not reproduce the Mac failure, so legacy Mac CI is the validation lane.
  • Android emulator ADB identity: CI11's Material3 bootstrap rotated the host ADB identity every 60 boot iterations and attempted a device push before launch, producing unauthorized emulators. Keys are now prepared once on the host without rotating the private identity, adb pubkey restores a missing public key, the private key is used as the vendor key, and setup errors propagate. Eleven isolated Pester cases cover the behavior. This does not claim to fix the separate CoreCLR Entry job that had no attached emulator.
  • Issue32983 sheet fixture lifetime: keep the managed sheet content alive while its native controller is presented. The native controller and legacy CollectionView hold weak managed references; the unretained fixture reproduced an ItemsViewController NullReferenceException and native abort on iOS26.5. The measure-before-mount scenario and screenshot oracle are unchanged.
  • Bugzilla30353: after the final portrait rotation, wait for DetailToggle before its once-only tap. The CoreCLR request log shows rotation returning before both button queries returned empty. All IsPresentedChanged assertions and wait budgets are unchanged.
  • Appium log retention across retries: archive the previous server log before a retry starts another Appium process, so category retries no longer overwrite the first failure's request log.
  • Binlog fixture failure diagnostics: retain captured child-process output when fixture creation returns an unexpected exit code. CI9's Windows timeout previously reported only 1 != -1, discarding that output. The sixty-second timeout and expected exit code remain unchanged. This does not claim to fix the still-unexplained child-process timeout.

No new quarantines, blanket test retries, tolerance increases, or resized replacement baselines are introduced. Existing platform exclusions are not broadened.

Validation

Draft: the CI-to-green loop is still in progress. The latest correction batch still requires complete current-head CI confirmation; this PR is not verified green. Local UI validation uses isolated iOS simulators and explicitly selected Android emulators only. MacCatalyst and Windows runtime validation is CI-only.

CI12 published (f988de7621, merge 2320d99689): adds the legacy UIKit Shell tab-bar correction, Android ADB identity, Issue32983 fixture lifetime, Bugzilla30353 wait and Appium log retention. All three pipelines are triggered; no current-head outcome is claimed yet.

Completed CI11 (900b6f544c, merge 8447dc3ddd): main1611982 and native1611987 succeeded (native: all 46 payloads, 29,394 passes, 1,038 existing skips, no failures; main Build integration passed 93/93 on both macOS and Windows). UI1611986 finished failed. Its two terminal published failures are iOS-latest CV1 Issue32983 (missing sheet items; lifetime corrected in CI12) and API30 CoreCLR Bugzilla30353 (first execution passed, category retry failed its post-rotation tap; wait corrected in CI12). The legacy Mac Shell first attempt completed 336 tests with 322 passes, 13 unrelated skips and one failure, Issue26598; the category retry then hit the job limit. All 67 original-scope pairs in that job are MacCatalyst: 66 passed first execution and Issue26598 failed; its diagnostic identified the root cause fixed in CI12. At least 60 first-attempt failure occurrences are retained from job logs even where retries passed: 48 of 49 Windows occurrences have exact same-method/same-condition failures on main, while Windows CV5 VerifyGroupHeaderAndFooterTemplate_WithObservableCollection, Android Issue11214 (different phase from main), Mac Issue17389 input transparency and Mac Bugzilla59172 remain unmatched and unresolved; no speculative changes are made for them.

Completed CI10 (666d00b8a5, merge a526ee7bee): all three pipelines finished failed. Main1611811 published 18,046 passes and 140 not-executed results. Windows Build integration passed all 93 cases, including the four binlog utility facts; macOS Build lost agent AcesShared61 and its result/log publishers were abandoned, leaving those 93 cases unverified. There is no established source fix or proven cause for the agent loss.

Native1611812 has all 46 readable latest payloads: 29,393 passes, 1,038 existing skips and one failure, MemoryTests.BindableLayoutDoesNotLeak on iOS18.1, retaining one Ellipse. The exact latest-main1608679 iOS18.1 case passes. The unchanged test passes locally on iOS18.5 in the Memory class, the complete 618-case General context, and five fresh Memory processes; this does not reproduce or explain the CI18.1 failure. Both Android Swipe/Image suites, both Essentials payloads and both Windows Map configurations now have actual passing results. The original Mono Controls attempt's DEVICE_NOT_FOUND81 setup failure is retained despite its later pass.

UI1611813's 151 published result sets contain 17,911 passes, 295 unrelated not-executed results and two failures: API30 Issue32223 and Mac Issue26598. Original scope is 124 passing pairs, one failed Mac pair and one mixed Android pair; expanded coverage is 146/148 passing configurations, two failures, none missing. The Android failure reproduces locally and is corrected in CI11. Mac Shell failed both first execution and retry; the complete first result set is 322 passes, 13 unrelated not-executed and one failure, while the retry hit the three-hour job limit. Native logs demonstrate actual tab re-hiding on macOS14.8.7, not merely a stale accessibility locator. The new caller-stack diagnostic is intended to identify that still-unproven cause.

Issue2951 passes all five observed CI10 configurations, including the first Mac execution. The corrected SafeArea roundtrip passes its published iOS-latest and dedicated AndroidAPI36 configurations. Mac Issue17389's functional and visual cases and Issue16918's unchanged golden pass first execution; their historical failures remain recorded and are not claimed causally fixed. The available UI logs retain 59 job-level failure occurrences, including first attempts and category retries, after deduplicating task-log copies; later published passes do not erase these failures.

CI9 (244f001d8a, merge f46610fb39): main1611690 finished failed: Windows BuildWarningsUtilitiesTests.RejectsTruncationAfterBuildFinished(False) timed out creating its tiny fixture binlog; the other 92 cases in that integration leg passed. The timeout's cause is not established. Native1611700 finished failed: all 46 latest aggregates contain 29,389 passes, 1,038 skips and one Android Image failure, but the Windows Map category is incomplete. Its two absent tests, zero-byte XML and native crash remain failures despite the enclosing runner's success exit. All 46 native consoles/artifact inventories were audited, not merely the aggregate counts.

The same Windows binlog-fixture exit-code signature occurred before this correction in unrelated inflight/current PR #38614: build1604992/log1025, September 21, expected exit 1 versus actual -1. This was verified in the raw log, not inferred from another review. The latest completed main build1608677 has actual passing results for all four binlog utility cases (Windows run44477112). The historical occurrence does not establish the child timeout's cause or make the current failure green.

UI1611699 finished failed. Its 151 published result sets contain 17,909 passes, 295 unrelated not-executed results and four terminal failures. Original scope: 125/126 observed passes; expanded configurations: 147/148 observed passes, with no missing scoped pairs/configurations. Mac Issue26598 remains the one failing original-scope pair; both attempts failed the initial visible-tab assertion. The other terminal failures are the iOS SafeArea roundtrip, Mac Issue17389's pre-toggle tap-count timeout and its separate background-color screenshot mismatch. Mac Layout and Shell retries hit the three-hour job limit; their complete first-execution results were recovered, not mistaken for complete retries. All 26 Android and 13 Windows original-scope pairs passed. The Mac Image category recovered on its task retry, but the first Issue16918 snapshot failure remains recorded: the actual capture contains a full-width separator and icon-rendering differences, not merely window-border noise. No replacement golden or speculative correction was made.

Local evidence for the follow-up batch: the new SwipeItem ownership test fails inside the post-tint assertion on both API30 and API36 before the product correction (20 passed/1 failed per focused run), then all 21 cases pass on each with Mutate(). Broader native context passes on both devices: 858 passed, 11 existing skips, zero failures/fixture errors out of 869 cases. API36 executes SwipeView before Image, explicitly covering the order associated with the original failure; all eleven original Image cases pass unchanged.

The unmodified SafeArea roundtrip fails on iOS18.5 while observing transitional landscape geometry. The correction passes twice there, alongside all four assertion-polling guard tests; the target and three neighboring Grid edge cases also pass on iOS26.5 and Android API30. The stable-identity Issue2951 correction passes two Android runs and one iOS run. The Windows runner port passes sixteen actual old/new XML checks; the exact WinRT await expression reproduces CS4036 without System and compiles with it. A full Windows project build is blocked by MakePri.exe on macOS and is not reported as successful validation. The binlog utility's four existing tests pass before and after its diagnostic-only edit using the installed .NET10 SDK.

Completed CI8 (94a72b791a): main1611454 succeeded. UI1611456 finished failed with 149 published result sets: 17,728 passes, 295 unrelated not-executed results and three terminal failures. Original scope: 125/126 pairs passed, one Mac Issue26598 failure, zero missing pairs or scoped skips. Expanded configurations: 146/148 passed, one Mac failure and one unexecuted CoreCLR/API30 Kiwi configuration. The three terminal named failures are Windows Issue30536, Windows Flyout RTL and Mac Issue26598. Mac26598 failed both executions at the initial visible-tab assertion and its Shell job hit the three-hour limit; current screenshot and native hierarchy confirm that the bar is physically absent. Mac Issue2951 additionally failed its first execution before the first click with a stale native reference; the existing task retry passed, which does not erase that failure. Mac Layout's complete first execution passed 189 cases with four unrelated skips, including Issue24996; Search/Shape/Slider passed 172.

Two CI8 UI jobs never executed tests: CoreCLR/API30 CollectionView3 failed package installation with exit78 after a broken pipe/device-offline sequence, and iOS CV1 CollectionView4 failed downloading the SDK releases index with TLS EPROTO/internal-alert80. Build Analysis did not match these failures. They are not counted as passing or asserted to be proven infrastructure problems. The missing expanded-scope case is the CoreCLR/API30 ByIndex/End/horizontal Kiwi case; its Mono counterpart passed.

CI8 native1611455 finished failed. All 46 latest XML payloads were read: 29,391 passes, 1,038 skips and one named CoreCLR ScrollView failure, with no fixture/count-integrity errors. That failure has empty living-reference details and matches unchanged-main1605580. Original Essentials Mono and CoreCLR crashes still count despite passing later attempts. Both Mac full native Issue26598 cases and all four Apple initial-transition cases passed; the native tests replace the root in an existing window and do not establish correctness of HostApp's initial-window UI flow. GitHub Actions run36067589906 passed 2,268/2,268 with no skips.

Local evidence for the five-commit 244f001d8a batch: the GC unit proof changes from 6 passed/2 failed before to 8/8 after, and the adjacent selected suite passes25/25. Recreation fixtures pass 36/36 across API30/API36 on the final APK; baseline also passed, so the CI crash is not claimed reproduced locally. The Windows client compiles with zero warnings/errors. No desktop application was executed locally.

The final GC helper also preserves real native-retention failures: normal Mono/API36 passes33/33, but Mono/API30 and CoreCLR JIT/API36 each fail DoesNotLeak with three genuinely retained objects. An exact old-helper Mono/API30 control produces the same failure types and geometry; only per-process native identity tokens differ. A post-failure CoreCLR heap shows strong native GC handles to MauiScrollView and handler retention through native content/listener objects. This is distinct from the empty-diagnostic verdict bug, remains unresolved, and does not justify the rejected JVM/bridge collector proposal or a speculative product fix. Local JIT/ARM64 is not CI ReadyToRun/x64 equivalence.

The preceding ff9459cbde UI run published 56 complete result sets: 6,969 passes, 107 unrelated not-executed results and ten Windows failures. Within the original scope, 35/126 pairs passed and 91 were unpublished (35/148 expected configurations observed). All 13 Windows pairs and 22 Android pairs passed; Apple and remaining Mono configurations were blocked by a one-hour Mono sample-build timeout. Windows Issue18896 and Material3 Issue35119 each passed their first execution with unchanged screenshots. The Windows multi-window pointer assertion failed on the category retry; its failure skipped secondary-window cleanup. Nine following screenshot mismatches were almost entirely native window edges (seven had zero differing interior pixels beyond a five-pixel perimeter; two had four and nine). This correlation does not by itself prove causality. The earlier Editor autosize comparison failure remains recorded; only its teardown screenshot survived.

That head's native build timed out during Mono BuildTasks. The 15 available payloads contained 10,602 passes, 408 skips and no named, fixture or count-integrity failures; 31 expected payloads, including Apple coverage, were unpublished. All seven CoreCLR gesture variants passed first attempt without any collector/product change. Essentials CoreCLR passed attempt two; its earlier XML was unavailable. Main's Mac pack reported an unmatched MSB4166 child-node failure and Release BuildTasks remained stuck until the next push canceled the build. Same-head native retry1611437 also became superseded before publishing Helix jobs. These are not passing evidence or proven infrastructure attribution. GitHub Actions run36043714050 passed 2,268/2,268 with no skips.

The Windows pointer correction compiles with zero warnings/errors and passes targeted formatting checks. The native driver's documented command and implementation explicitly move the cursor before clicking; the coordinate-space correction is described above. No Windows application was executed locally; actual pointer behavior and cleanup require CI evidence.

The completed 5293fcaf73 iteration observed 125/126 original method/platform pairs passing, one Mac Issue26598 failure, zero scoped skips and zero missing pairs. Across the 148 expected configurations this was 147 passes and one failure. Main succeeded. Device XML contained 29,383 passes, 1,038 skips and seven failures: six CoreCLR gesture-memory cases and the baseline-matched Mono Image failure tracked by #38740. All 46 native payloads were checked, with no fixture/count-integrity errors. The new first-transition case passed in all four Apple lanes; that does not prove the full UI flow.

Mac Issue24996 passed first execution in run44547244/result100063 (10.78 seconds; its Layout run had 189 passes and four unrelated skips). Mac Shell's first execution had 322 passes, the Issue26598 failure and 13 unrelated skips; its retry repeated that failure before the three-hour job limit. A separate Mac SearchBar/Shape/Slider job was canceled after discovering 172 cases and published no TRX; its cause is unproven and that lane is not counted as passing. Retry-hidden non-scoped failures remain recorded, including the Material3 prompt cancellation and Windows Issue18896 comparison addressed in this batch. GitHub Actions run36003200959 passed 2,268/2,268 with no skips.

Local evidence for ff9459cbde:

  • Material3 Issue35119 passes three independent first-attempt full NUnit executions, each retaining all three original styling comparisons. On the exact final APK, the old keyboard command prematurely cancels the prompt under a controlled slow-IME transition, while the single-ESC sequence retains it until explicit Cancel in five corresponding trials. Emulator animation settings were restored. Local Appium/architecture differ from CI; its subsequent first-attempt CI pass is recorded above.
  • The Windows UI test assembly compiles with zero warnings/errors. Its scroll assertions read the native UIA source, fail on missing state and retain the original golden. Its subsequent first-attempt Windows CI pass is recorded above.
  • The final existing Shell suite passes 227/227 on each of iOS18.5 and iOS26.5, with no skips or fixture errors. The full native-root helper was separately exercised through a temporary iOS18.5 entry point and passed; that temporary entry point is not shipped. The new Mac-specific case compiled with zero warnings/errors and subsequently passed both Mac CI8 lanes. A broader iOS26.5 probe still reports a later hidden-page mismatch (TabBarHidden=true while the bar remains hittable); it is not claimed fixed, and no existing iOS test is excluded.
  • Four bounded, unprofiled memory experiments rejected the proposed JVM/CLR GC-oracle correction: it did not produce clean CoreCLR positives. A strong-held/released control passed on both runtimes, but ordinary realized-label cases still failed CoreCLR. All experimental collector/product edits were restored; no speculative collector or product fix is included. The later final-liveness verdict correction is separately described and verified above. Local CoreCLR JIT/ARM64 is not the CI ReadyToRun/x64 configuration.

Earlier local evidence includes 226/226 native Shell tests on iOS26.5, 15/15 AbsoluteLayout tests on iOS18.5, 15 AndroidAPI30 Shell UI cases, AndroidAPI36 CollectionView/navigation scenarios, and focused iOS18.5 Issue20855/26598/29588/7045/30771 cases. Original applicable goldens remain unchanged. Runs accidentally selecting a stale host on another Android emulator were discarded and rerun with explicit device logs verified; missing baselines were not fabricated.

For the preceding correction batches:

  • Issue35736's four original UI cases pass first attempt on each of iOS18.5 and iOS26.5: 8/8.
  • After Google Search isolation, the five affected Android Shell cases pass first attempt on the verified owned API30 emulator with freshly rebuilt/deployed APK hashes. Search stays disabled after reboot and cannot autostart; Play Services/Store/Maps remain enabled. Ten script safety/error cases and Cake compilation pass. The exact CI version-triggered redirect was not reproduced locally; the identified producer was demonstrably blocked. Both Android Shell CI lanes subsequently passed on 8e026640a8.
  • Headless assertion checks exercise the actual compiled Windows RTL helper against real CI XML and negative geometry variants (7 checks), the actual compiled Mac selection/color helper (8 checks), and source-linked scroll boundary/mobile-extent cases (7 checks). These do not substitute for desktop CI execution.
  • Issue9088 passes in five fresh iOS26.5 sessions and one iOS18.5 session with no skips.
  • Eight headless checks exercise the compiled Shell transition helpers: reproduce the old stale-reference failure, require a fresh visible element, reject false absence and persistent wrong state, preserve unexpected errors, and match the actual CI back arrow rather than the same-name tab.
  • The new Shell helper batch passes 7/7 focused iOS26.5 cases on the explicitly selected simulator, with no failures, skips or test retries: Issue26598, all four Issue32994 visibility cases, and both animated/nonanimated presentation cases.
  • All 112/112 tests in the three affected script-gate fixtures pass locally after reproducing the three CI failures. Reversing and reapplying the trusted screenshot patch reproduces the current harness byte-for-byte. The full GitHub Actions run35975315118 on 51df615d9e passed 2,268/2,268, with no skips.
  • The lifecycle correction passes all six ActivityStateManager/recreation cases in four fresh AndroidAPI30 launches: 24/24, no failures/skips/fixture errors. The first API36 invocation failed before tests because XHarness's default instrumentation user was rejected; it is not counted as a pass.
  • Issue6994 and Issue2951 pass in three fresh CoreCLR JIT sessions and one normal Mono session on AndroidAPI30: 8/8, with actual runtime libraries verified. Local CoreCLR ReadyToRun failed before tests because the installed crossgen tool rejects Android; only the local validation process disabled ReadyToRun. CI's normal configuration is unchanged and still required.
  • Eleven source-linked scroll checks reproduce the old premature deadline failure and exercise slow progressing traversal, exact final-gesture success, over-limit/missing/clipped failures, and unchanged mobile/desktop extents. The actual Issue29588 AndroidAPI30 UI test passes; Mac/Windows test assemblies compile. These headless checks are not desktop runtime validation.
  • The corrected ScrollViewNoContent completion assertion passes on the owned AndroidAPI30 emulator and iOS26.5 simulator, with no skips or retries. Desktop runtime confirmation remains CI-only.
  • Issue24996 passes all four original translation positions on iOS26.5 and AndroidAPI30. A temporary forced ancestor width change fails the iOS assertion with Step 1: Lvl1[1/1]; that injected change is not included in the patch.
  • The focused native Issue26598 case passes within 227/227 Shell tests on each of iOS26.5 and iOS18.5, with zero skips or fixture errors. It targets the currently failing first transition on Mac; the existing full UI scenario remains enabled. An earlier broader native probe found a separate later iOS hidden-page mismatch (TabBarHidden=true while the native bar remained hittable); that is not claimed fixed by this first-transition case.

CI progression:

Head Main Device UI
fbbdd4449b 1609439: passed 1609440: failed 1609438: failed
ec017da74d 1609951: passed 1609953: passed 1609954: five failed jobs; remaining jobs superseded by push
8e026640a8 1610175: passed 1610176: two baseline-matched Android Image failures 1610177: failed; later same-head restart superseded by push
d4815b6101 1610304: superseded 1610305: superseded 1610306: superseded by script-gate correction
51df615d9e 1610340: passed 1610341: lifecycle fixture failed 1610342: Android Button job failed; Mac Shell/Layout retries hit the three-hour job limit
5293fcaf73 1610649: passed 1610656: six CoreCLR gesture failures and one baseline-matched Image failure 1610657: canceled; Mac Issue26598 failed
ff9459cbde 1611219: pack child-node failure; later superseded 1611221: Mono build timeout; 15/46 payloads published 1611222: Mono build timeout and Windows failures
94a72b791a 1611454: passed 1611455: failed; ScrollView and original Essentials crashes 1611456: failed; Windows pointer/RTL, Mac26598 and two unexecuted jobs
244f001d8a 1611690: failed 1611700: failed/incomplete 1611699: failed
666d00b8a5 1611811: failed; macOS integration results missing 1611812: failed; iOS18.1 BindableLayout 1611813: failed; Android32223 and Mac26598
900b6f544c 1611982: queued/running 1611987: queued/running 1611986: queued/running

On 51df615d9e, Windows Issue32223, Issue29588 and FlyoutPage title have actual passing results. iOS9088 executed and passed on iOS26.5 rather than being skipped. The complete original-scope inventory is 125/126 pass-observed, one Mac Issue26598 failure, no scoped skips and no unpublished pairs; it is not green. Mac Shell's complete first execution contains 322 passes, one failure and 13 unrelated skips. Both presentation-mode cases passed. Its partial retry repeats the Issue26598 failure and leaves 142 cases unobserved before the job timeout; the first execution's results were recovered rather than treating that incomplete retry as coverage. All 46 latest native XML payloads were read: 29,385 passes, 1,038 skips, one lifecycle-fixture failure, with no fixture errors/count mismatches and 32/32 new Apple Shell cases passing. CoreCLR's earlier attempt failed before testing with DEVICE_NOT_FOUND; Windows packaged attempt1 remains unavailable while attempt2 passed.

Additional failures on that head were the exactly-one-event native assertion, Issue6994's ListProxy/ListViewAdapter index crash during layout, Issue2951's expected-two/actual-three button observation, and Mac Issue29588's traversal timeout recovered by an existing task retry. The corrections above address those observed fixture/synchronization defects without changing product code. Recent exact baseline samples passed these native/Button cases; #36979 documents the historical Issue2951 assertion, but that is not proof of the present cause. No baseline attribution or retry recovery is presented as a clean first execution.

Later Mac results also exposed ScrollViewNoContent's inverted completion assertion; it failed first execution and passed retry. Five recent main executions passed, but absence-based passes do not prove the scenario completed. Two unchanged Mac CollectionView spacing snapshots recovered on retry; both first-failure screenshots contain an external Finder alert saying WindowManagerShowDesktop-Education is not responding. No spacing, screenshot algorithm, golden or tolerance changes are made for that overlay. No exact known issue was found for it.

Mac Layout's complete first execution on that head contained 188 passes, one Issue24996 failure and four skips. Its partial retry timed out before reaching that case. The failure hierarchy showed the first translation at X40/Y80 with cumulative Lvl1[2/5]; three of the five sampled main runs also failed the same assertion. The fixture correction separates translation measurements from initial/diagnostic layout and requires a fresh result. Local iOS validation deliberately forced an ancestor width change and failed with Step 1: Lvl1[1/1]; removing that injected change passed all four original translation positions. The subsequent 5293fcaf73 Mac first-execution pass is recorded above.

The second iteration's native evidence includes all 32/32 new Apple Shell cases across four configurations, including 16/16 Issue35736 image/reset cases. All seven Helix jobs finished. Reading 46 result XML payloads found no named failures or fixture errors; Windows Graphics attempt1 XML was unavailable, while attempt2 passed. A green XHarness exit code was not used as the sole evidence.

For 8e026640a8, every original scoped pair has actual results: 122/126 pass-observed, three Mac Shell failures, one iOS9088 runtime skip. The three failures are Issue26598's stale tab reference and the two presentation-mode back locators corrected above. This is not a claim of 126 first-attempt passes. Additional failures outside those pairs include Windows Issue32223 and FlyoutPage title, also corrected above; Mac SafeAreaEdges checkout failed and Mac CollectionView3 lost its agent, so those incomplete categories are not counted as passing.

The third iteration's 46 native result payloads contain 29,382 passes, 1,038 skips and two Android Image failures; all 32/32 new Apple Shell executions passed again. The CoreCLR Image failure matches main build1605027/run44338780/result100881. The Mono failure matches main build1600801/run44201018/result100693, including the identical black PNG. Both are tracked by #38740. This was baseline attribution, not a green device build; no speculative Image change was included in that iteration. The later reproduced shared-tint root fix is described above. A fresh owned CoreCLR emulator run passed all 11 Image tests.

Both original Android Label goldens passed in API30 run44515496 (log3511). A separate formatted-to-plain styling issue reproduced in a local source-built framework did not reproduce in this CI product build; its candidate framework fix stays outside this PR. Issue32941 also has a named second-iteration pass. Previous-head passes are not substituted for new-head coverage.

Retry-hidden failures remain recorded separately. The third iteration's 40 Windows gallery setup timeouts match the exact base; Bugzilla51825's separate test-body timeout also matches 1608678/log6414. Two unchanged iOS Issue22306_1 RotateButton timeouts and one unchanged Mac Issue28416 DropResult timeout recovered on retry, but exact current-stack baseline attribution remains incomplete. Historical #33220/#33245 mention the Mac test, without accessible exact-stack confirmation. Earlier Mac Carousel Issue16020 evidence is retained. None of these retry passes erases its initial failure, and no unfinished or canceled category is counted as passing.

Issues Fixed

Addresses flaky test coverage identified in #38777 without adopting its exclusions. Most changes affect test fixtures and infrastructure rather than the framework regressions named by those tests. The focused Android SwipeItem change additionally fixes the empirically reproduced shared-resource tint contamination described above; unrelated unresolved product behavior is not claimed fixed.

Approaches deliberately avoided

  • Do not resize fullscreen captures to make old goldens pass; restore leaked native window state.
  • Do not catch NUnit assertion exceptions without isolating their recorded result.
  • Do not replace native rendering assertions with labels echoing MAUI properties.
  • Do not disable Google Play Services or remove Google APIs to prevent an unrelated Search popup.
  • Do not call all platforms verified based on a passing simulator run or pipeline check color alone.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

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

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

Or

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

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

2 similar comments
@azure-pipelines

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

1 similar comment
@azure-pipelines

This comment has been minimized.

@kubaflo

kubaflo commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

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

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

kubaflo added a commit that referenced this pull request Nov 16, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo closed this Nov 17, 2026
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for #40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR #38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from #38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to #40116, #38822, and #35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate #40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by #39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open #38822 does not modify this source
file.

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

Relates to #40116. Fixes the Windows compilation regression introduced
by #39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with #40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After #40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to #40116 and #40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in #38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is explicitly coordinated candidate-validation work for dotnet#40116,
targeting `candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Carry the narrowly scoped NUnit assertion-polling repair proposed in the
open main-branch PR dotnet#38822 into the candidate validation lane. This is a
candidate integration of that proposal, not a competing replacement for
its broader changes.

NUnit 4 records a failed assertion before throwing. Catching that
exception in the framework-agnostic `App.RetryAssert` does not remove
the recorded failure: a managed probe returned normally after its second
successful observation, but NUnit still reported the test as failed.

Add a NUnit-aware extension in the existing test-layer `UtilExtensions`.
Each observation uses an isolated NUnit result; persistent and
multiple-assertion failures still propagate, unexpected fixture
exceptions are not retried, and warnings are retained. Keep the existing
framework-agnostic helper API unchanged.

The original Shell rotation case also sampled transient geometry and
could leave a later run in landscape after an early failure. Establish
portrait input, replace the existing presence waits with positive/stable
portrait and expanded-landscape geometry queries, capture those observed
widths directly, and restore portrait in `finally`.

All three original width assertions and their messages remain: landscape
differs by more than 50, landscape is wider, and restored portrait
matches within 5. The existing 15-second waits and 500-ms
assertion-polling defaults are unchanged. No cases, platforms,
categories, skips, screenshot tolerances, or CI retry budgets are
removed or relaxed.

Six focused polling guards cover transient single and multiple
assertions, persistent failures, unexpected exceptions, and warning
behavior.

**Differences from dotnet#38822:** only the assertion-polling and directly
dependent rotation fixture work is carried here. The generic helper
remains available; no new HostApp automation ID is required. The broader
production, quarantine, pipeline, and GC-helper changes are excluded.

#### Validation

- Exact candidate SDK reports `11.0.101`; source build-task
prerequisites succeeded with 0 warnings/errors.
- The original managed helper probe was red despite returning after two
attempts. Removing the transient trigger made the unchanged helper
green.
- The unchanged original rotation fixture reproduced the CI failure on a
task-owned iPhone 11 Pro CoreSimulator, iOS 18.5: expected portrait
width 343, observed 18.
- Helper-only repair passed; removing it restored the transient-polling
and unexpected-exception failures. Original native replay controls also
exposed early-landscape and unstable-initial-portrait input, so those
directly coupled fixture defects are addressed here rather than claiming
helper-only repair was sufficient.
- Before the review follow-up below, native rotation plus the original
five polling guards passed **6/6 on each of three runs: 18/18, 0
failures, 0 skips**.

The final runner command below omits only diagnostic log and TRX output
paths:

```bash
DEVICE_UDID=2D2E5AAB-78A5-4917-AB1A-CD3A51ACBA03 HEADLESS=true \
  NODE_BINARY_PATH=/usr/local/bin/node \
  APPIUM_BINARY_PATH="$(npm root -g)/appium/build/lib/main.js" \
  ./.dotnet/dotnet test \
  src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj \
  -c Release --no-restore \
  -p:SkipInitInternalTooling=true \
  -p:IncludeAndroidTargetFrameworks=false \
  -p:IncludeIosTargetFrameworks=false \
  -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false \
  -p:IncludeWindowsTargetFrameworks=false \
  --filter 'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.Issues.Issue35844|FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'
```

Historical pre-follow-up result: 6 passed on each of three runs.
Subsequent runs used `--no-build`. The current source adds a sixth
guard, so this same filter now selects seven cases. TRX files and full
raw logs are retained in the investigation.

The native app was the retained, byte-verified CI app from source
`ebaaa367`; its rotation scene, original test, and relevant iOS
tracker/renderer sources are unchanged through the validated `54ba8fd8`
input. Simulator transport required locally re-signing its native
components: **all 247 managed DLL hashes remained identical; native
signing bytes are not claimed identical**. Temporary task-only
Appium/WDA ports and diagnostic source changes were restored before this
commit.

Android, Catalyst, and WinUI UI-client **compilation** succeeded with 0
warnings/errors using the portable target switches above. No host-macOS
XCTest, physical Apple device, or native Android/Windows execution is
claimed.

The candidate advanced to `dc1660bf` during validation with Android
modal-inset and SourceGen-expression changes. Those are outside this fix
and its relevant iOS scene. This evidence is not whole-tip candidate
certification; CI must validate the final PR merge.

#### Expert-review follow-up (`5a9ecd846b`)

Both rotation predicates now return an empty observation when
`TitleViewGrid` is temporarily absent instead of dereferencing null. An
absent portrait observation also clears its previous-rectangle sample,
preserving the requirement for consecutive stable observations.

The new `TransientMultipleAssertionsDoNotFailTheTest` fails both
assertions on its first observation, succeeds on its second, and checks
exactly two attempts and no failures retained in the enclosing NUnit
result. Removing only `MultipleAssertException` from the retry filter
makes this new test fail; restoring it passes.

All six guards pass in each of the actual iOS, Android, Mac and WinUI
managed clients: **24/24**, with no native Android, Windows or host-Mac
execution implied. The portable `dotnet test` switches above were used
with `--filter
'FullyQualifiedName~Microsoft.Maui.TestCases.Tests.AssertionPollingTests'`.

The original native rotation oracle was also exercised on the task-owned
iOS 18.5 simulator with a temporary client-only missing-lookup fault,
not a change to the app or geometry. Each old predicate fails on its
respective single missing lookup; removing the trigger passes. Both
guards pass with both missing observations; removing only the portrait
guard restores the failure; restoring it passes again, as does the
unmodified native interaction. All three original width assertions,
deadlines and tolerances remain unchanged.

After the normal push, the committed managed guards passed **6/6**, and
the retained diagnostic native client passed **7/7 with both missing
observations and 7/7 without injection**. Its test-source hashes match
the committed files; only the explicitly temporary transport/fault
instrumentation differs. All diagnostic source changes are restored and
excluded from the PR. Current-head CI remains a separate requirement;
earlier green CI is not certification of this new head.

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

Relates to dotnet#40116, dotnet#38822, and dotnet#35844. This fixes candidate validation
bookkeeping and fixture input; it does not claim to close a production
UIKit issue.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is the explicitly coordinated repair of candidate dotnet#40116, targeting
`candidate/11.0.1xx-sr2`.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix two Windows compilation errors introduced by dotnet#39917 in
`GesturePlatformManager.Windows.cs`:

- `OnTap` receives `RoutedEventArgs`, which has no `Handled` property
(`CS1061`). Use the existing `SetHandled(true)` extension, as the same
method already does for other handled gestures. It dispatches to the
right-, single-, and double-tap event argument types.
- The visual-tree traversal's unqualified `ItemsView` binds to the MAUI
control, not the native WinUI control (`CS8121`). Explicitly name
`Microsoft.UI.Xaml.Controls.ItemsView`.

The diff is one file and two lines. It preserves the CollectionView
bubbling logic and changes no tests, assertions, skips, tolerances,
deadlines, SDK/package versions, or pipeline configuration.

**Validation**

The unchanged candidate reproduces both compiler errors in native build
[1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504)
and both UI sample builds in
[1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501),
including their in-job retries.

The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was
validated by the existing full `maui-pr` pipeline
[1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565).
Both completed Windows build jobs report **Build succeeded / 0 errors**,
and their raw logs contain the Controls outputs for **both**
`net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`.

Exact CI commands, both passed:

```text
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true
```

These are the pipeline's existing commands and warning policy, not
changed by this PR. Raw build logs: [Debug
139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1),
[Release
209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1).

Local file-specific formatting check passed:

```text
.dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet
```

**Not an all-green CI claim:** the same validation run separately aborts
its Windows Release Controls.Core unit-test host in unchanged
`ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks
call `TaskCompletionSource.SetResult` twice. That scope writes no result
XML. The timer sources are identical on the candidate and this branch;
no timer workaround is included here. Runtime/UI gesture behavior was
not newly exercised by this compilation repair.

Upstream open/recently merged exact-mechanism searches found no
competing correction. The broad open dotnet#38822 does not modify this source
file.

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

Relates to dotnet#40116. Fixes the Windows compilation regression introduced
by dotnet#39917; no separate issue was filed.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
dotnet#40340)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated candidate-validation repair for
`candidate/11.0.1xx-sr2`, associated with dotnet#40116.

### Description of Change

<!-- Enter description of the fix in this section -->

Opt the **Issue2266 test fixture's flyout menu** into
`SafeAreaRegions.Container`. This is a one-line fixture correction, not
a change to the production FlyoutPage or navigation handlers.

`ContentPage` defaults to edge-to-edge content. After dotnet#40311 re-enabled
this case on Android, the first menu item's text occupied
`[3,29][909,86]` on API30: its center was underneath the visible status
bar. The original `Page 1` tap left the flyout open, so the subsequent
`START` lookup threw before testing toolbar re-entry. Both the original
CI attempt and its retry failed this way. The same row bounds and
line-24 failure reproduced locally with the fixture restored to the
unchanged candidate version.

The original UI test is byte-identical: its first-item selection, all
three toolbar/MainPage re-entry paths, assertions, category, platform
coverage, and timeouts are preserved. No waits, alternate rows,
coordinate taps, retries, skips, or screenshot expectations were added
or changed.

**Native validation:** pinned SDK 11.0.101, Android workload 37.2.32,
CoreCLR HostApp, separate owned API30 and API36 emulators. The test
client assembly was unchanged throughout.

| Native runtime | Actual original-case sequence, with original visible
system bars |
| --- | --- |
| API30 | Baseline APK: failed at line 24; fixed APK: passed; reinstall
baseline APK: same failure; restore fixed APK: passed again |
| API36 | Baseline APK: failed at line 24; fixed APK: passed after push;
unchanged fixed APK: passed again after push |

The prescribed verification wrapper reported **INCONCLUSIVE**, not
passed: the first filter did not match the parameterized fixture, and a
subsequent fixed-phase deployment lost the emulator transport. A guard
refused the runner's shared-ADB restart. After a normal reconnect to the
owned emulator, direct runs of the original compiled NUnit case against
the preserved APKs established the results above. No authorization
bypass or shared-server reset was used. A requested immersive-status
diagnostic did not actually hide the status bar; it was restored and is
not counted as a trigger-removed control.

Final post-push command, with the pinned SDK selected and `DEVICE_UDID`
identifying the owned API36 emulator:

```bash
dotnet test artifacts/bin/Controls.TestCases.Android.Tests/Debug/net11.0/Controls.TestCases.Android.Tests.dll --filter 'FullyQualifiedName~Issue2266' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=issue2266-postpush.trx' --results-directory CustomAgentLogsTmp/Issue2266PostPush
```

Result: **1 passed, 0 failed**. The Release Android HostApp build
completed with **0 warnings, 0 errors**; scoped repository formatting
also passed. Other platforms and the complete candidate matrix are not
claimed green by this focused repair.

### 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 `Issue2266(Android).SwapMainPageWithFlyoutPages` in [candidate UI
build 1685512, run 47042068, result
100092](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685512&view=ms.vss-test-web.build-test-results-tab&runId=47042068&resultId=100092).

Relates to dotnet#40116 and dotnet#40311. Existing open and recently merged
Issue2266/flyout repairs, including the files in dotnet#38822, were checked;
no duplicate menu-inset correction was found.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests platform/android platform/ios platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants