Skip to content

Re-enable the Issue2266 UI test on Android and cover FlyoutPage toolbar re-entry - #40311

Merged
kubaflo merged 2 commits into
dotnet:candidate/11.0.1xx-sr2from
MykhailoDav:fix-26330-android-flyout-toolbar-reentry
Nov 17, 2026
Merged

kubaflo merged 2 commits into
dotnet:candidate/11.0.1xx-sr2from
MykhailoDav:fix-26330-android-flyout-toolbar-reentry

Conversation

@MykhailoDav

Copy link
Copy Markdown
Contributor

Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes the window's page again) no longer reproduces on net11. This PR re-enables the UI test that was disabled for it on Android and adds a device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a Window.Page swap the FlyoutPage's Parent is cleared before the detail NavigationPage hears about the window change, so the old guard flyoutPage.Parent is IWindow in NavigationPage.OnWindowChanged(null) was false and flyoutPage.Toolbar = null never ran. The disconnected NavigationPageToolbar stayed on the reused FlyoutPage, and on re-entry FindMyToolbar() found it instead of building a live one, so the title and toolbar items stayed frozen at the previous page's values. 9.0 started disconnecting the old page's handlers in Window.OnPageChanged, which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the Issue2266 HostApp page code copied into a sandbox app: the first visit and three re-entries (same detail, then two different ones) all show START and the right title. With #34839's guard put back, re-entries show the previous page's title over the new page's content.

Changes

  • Issue2266.cs (UI test): removed the #if TEST_FAILS_ON_ANDROID that pointed at [Android] ToolbarItem Not Displaying for FlyoutPage Navigation #26330.
  • FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot (Android device test, FlyoutPage category): sets a NavigationPage detail with a toolbar item, swaps Window.Page away until the FlyoutPage's handler disconnects, sets the same FlyoutPage back and reselects the detail, then repeats with a different detail. After each step it asserts the native toolbar is shown and its menu holds exactly the current page's item. The UI test alone wouldn't catch a regression here, because every page in it names its item START and a stale toolbar also shows one.
With #34839's guard put back Current net11
New device test Fails: expected "Page 2 Item", actual "Page 1 Item" Passes
FlyoutPage category, API 37 emulator 17 of 18 (only the new test) 18 of 18

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver for Appium here), so CI's API 30 run will be its first. One thing I noticed: on the API 37 emulator the flyout's first row is drawn under the status bar and doesn't receive taps, which may need a look if the test taps "Page 1" there, but CI runs Android UI tests on API 30.

Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the test)

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

Or

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

@azure-pipelines

This comment has been minimized.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Nov 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @MykhailoDav! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@kubaflo

kubaflo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

/rebase

@github-actions
github-actions Bot force-pushed the fix-26330-android-flyout-toolbar-reentry branch from 3fadad0 to 70a559d Compare November 16, 2026 21:46
@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 16, 2026
@MauiBot

MauiBot commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@MykhailoDav — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 0 findings

Reviewed commit 70a559d.

@kubaflo

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Tests Failure Analysis

@MykhailoDav — test-failure analysis for commit 70a559d.

Scope CI failures Commit 70a559d


🧪 CI Analysis — click to expand
📊 maui-pr

No failures found.


🧪 maui-pr-devicetests
  • 🟢 Likely unrelated — Windows provisioning: NuGet metadata retrieval failed with TLS connection resets before compilation; test-only changes cannot explain this. Missing artifact directories are downstream.
  • Insufficient data — Android/iOS/MacCatalyst Helix: zero failed work items, but item-level test outcomes are absent.

🧪 maui-pr-uitests

All five target samples are truncated; absent matches do not establish regressions.


🧭 Follow-up — actions and refresh

Next action: Retry infrastructure-blocked legs; restore item-level Helix outcomes and same-OS/handler target evidence; inspect unmatched navigation failures and screenshots.

Maintainers: comment /review tests to refresh this report.

@kubaflo
kubaflo changed the base branch from net11 to candidate/11.0.1xx-sr2 November 17, 2026 11:12
@kubaflo
kubaflo merged commit 89237e2 into dotnet:candidate/11.0.1xx-sr2 Nov 17, 2026
135 of 178 checks passed
kubaflo added a commit that referenced this pull request Nov 17, 2026
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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 added a commit that referenced this pull request Nov 18, 2026
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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
…ar re-entry (#40311)

### Description of Change

#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is #34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. #34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With #34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at #26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With #34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes #26330 (fixed by #34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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>
@kubaflo kubaflo added this to the .NET 11 SR2 milestone Nov 24, 2026
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
…ar re-entry (dotnet#40311)

### Description of Change

dotnet#26330 (toolbar items missing after the same FlyoutPage instance becomes
the window's page again) no longer reproduces on `net11`. This PR
re-enables the UI test that was disabled for it on Android and adds a
device test that pins the actual regression.

What fixed it is dotnet#34839 (merged in April, on main and net11). During a
`Window.Page` swap the FlyoutPage's `Parent` is cleared before the
detail NavigationPage hears about the window change, so the old guard
`flyoutPage.Parent is IWindow` in `NavigationPage.OnWindowChanged(null)`
was false and `flyoutPage.Toolbar = null` never ran. The disconnected
`NavigationPageToolbar` stayed on the reused FlyoutPage, and on re-entry
`FindMyToolbar()` found it instead of building a live one, so the title
and toolbar items stayed frozen at the previous page's values. 9.0
started disconnecting the old page's handlers in `Window.OnPageChanged`,
which is where the regression showed up. dotnet#34839 removed that guard.

I checked this on an Android API 37 emulator with the `Issue2266`
HostApp page code copied into a sandbox app: the first visit and three
re-entries (same detail, then two different ones) all show START and the
right title. With dotnet#34839's guard put back, re-entries show the previous
page's title over the new page's content.

**Changes**

- `Issue2266.cs` (UI test): removed the `#if TEST_FAILS_ON_ANDROID` that
pointed at dotnet#26330.
-
`FlyoutPageTests.ToolbarItemsShowWhenSameFlyoutPageReturnsAsWindowRoot`
(Android device test, FlyoutPage category): sets a NavigationPage detail
with a toolbar item, swaps `Window.Page` away until the FlyoutPage's
handler disconnects, sets the same FlyoutPage back and reselects the
detail, then repeats with a different detail. After each step it asserts
the native toolbar is shown and its menu holds exactly the current
page's item. The UI test alone wouldn't catch a regression here, because
every page in it names its item START and a stale toolbar also shows
one.

| | With dotnet#34839's guard put back | Current net11 |
|---|---|---|
| New device test | Fails: expected "Page 2 Item", actual "Page 1 Item"
| Passes |
| FlyoutPage category, API 37 emulator | 17 of 18 (only the new test) |
18 of 18 |

I couldn't run the re-enabled UI test locally (no UIAutomator2 driver
for Appium here), so CI's API 30 run will be its first. One thing I
noticed: on the API 37 emulator the flyout's first row is drawn under
the status bar and doesn't receive taps, which may need a look if the
test taps "Page 1" there, but CI runs Android UI tests on API 30.

### Issues Fixed

Fixes dotnet#26330 (fixed by dotnet#34839; this adds the coverage and re-enables the
test)

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.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

community ✨ Community Contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants