Skip to content

[Windows] Fix candidate Shell flyout automation ID collisions - #40202

Merged
kubaflo merged 1 commit into
candidate/11.0.1xx-sr2from
kubaflo-candidate-shell-automation
Nov 13, 2026
Merged

kubaflo merged 1 commit into
candidate/11.0.1xx-sr2from
kubaflo-candidate-shell-automation

Conversation

@kubaflo

@kubaflo kubaflo commented Nov 12, 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!

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

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 stabilization of candidate/11.0.1xx-sr2 for #40116, correcting a regression introduced directly on that candidate by #39406.

Description of Change

Make the Windows ShellItemHandler automation mapper explicitly clear the content navigation view's ID for non-TabBar Shell items. Previously, ConnectHandler assigned every Shell item's ID to that content root, but MapAutomationId did nothing for FlyoutItems. The root could therefore share an ID with the actual flyout navigation item, and retain the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows Issue8308 failure, the native tree exposes a visible, 1008-by-680 content root with AutomationId="Page 1" while Page 2's Instructions2 label is displayed. The existing flyout helper can target that content root instead of the flyout item, leaving the app on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears the ID otherwise. The existing SetAutomationProperties call is retained, preserving accessibility properties, including IsInAccessibleTree; ShellContent/tab IDs are unchanged. No selectors, test IDs, timeouts, retries, or pipeline configuration are changed.

Validation

  • dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs --verbosity quiet - passed.
  • git diff --check - passed.
  • Native Windows validation on head 2f6557d5574aa5d20a290d7f31ba6e937f08cee4: build 1678537, using the existing maui-pr-uitests Windows and Windows CV1 build/test stages. Both native builds succeeded; the regression and preservation tests below passed on their initial attempts. No pipeline files or filters were changed.
Test Configuration Exact run/result Result
NavigatingBackToCollectionViewShouldNotCrash Windows CV1 46790596/100042 Passed, 4550 ms
NavigatingBackToCollectionViewShouldNotCrash Windows CV2 46790610/100032 Passed, 4436 ms
Issue39055TabBarAutomationIdShouldBeSet Windows 46791298/100002 Passed, 2237 ms

Raw Azure logs retrieved with az confirm these passes: CV1 log 967, CV2 log 983, and Shell1 log 1213. Shell1 finished with 154 passed and 2 skipped. The CV2 grouping-gallery fixture needed the existing retry after a setup timeout; the regression test itself was not retried.

  • Before the correction, candidate build 1678469 failed NavigatingBackToCollectionViewShouldNotCrash initially and on retry in both Windows handler configurations, at the final WaitForElement("Instructions"). Exact CV2 result: run 46787104, result 100048; CV1 raw log 1073 has the same failure.
  • The unchanged test passed on the net11 baseline: build 1676275, run 46717494, result 100044.

The validation build is not globally green: two existing candidate visual regressions remain, Issue21202Test (4.45%) and ButtonLayoutAndSpacingTests / Issue22433_Default (2.23%). They repeat on retry in raw log 1231, exactly matching the unmodified candidate in builds 1678469 (log 1243) and 1678143 (log 993). They are being investigated separately; this PR does not change their snapshots or tolerances or claim the candidate is ready to merge.

Issues Fixed

Relates to #40116, #39406, and #8308.

Keep the content navigation view AutomationId scoped to visible TabBars so flyout automation resolves the actual navigation item. Preserve the existing accessibility property setup and ShellContent tab IDs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 12, 2026 23:05 — with GitHub Actions Inactive
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

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

kubaflo commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

/rebase

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@MauiBot

MauiBot commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@kubaflo — 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 13, 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 — 1 finding

Reviewed commit 2f6557d.

See inline comments for details.

navigationView.SetAutomationPropertiesAutomationId(
shellItem is TabBar && ((IShellItemController)shellItem).ShowTabs
? shellItem.AutomationId
: null);

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.

[moderate] Accessibility - Restore the automation ID when a hidden TabBar becomes visible. For a TabBar with an AutomationId and multiple tabs whose initial page sets Shell.TabBarIsVisible=false, this new null branch clears the ID assigned by ConnectHandler. Setting TabBarIsVisible=true later only invokes MapTabBarIsVisible, which changes the pane display mode without remapping AutomationId, so the now-visible TabBar cannot be found by its configured ID. Previously the hidden-tab no-op preserved that ID. Refresh this dependency through UpdateValue(nameof(Element.AutomationId)) when visibility changes, and cover the initially-hidden-to-visible transition; Issue39055 only checks initially visible tabs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed. #40202 had already merged, so the correction is in #40208, based on the current candidate. MapTabBarIsVisible now refreshes Element.AutomationId through UpdateValue, while keeping non-TabBar content-root IDs cleared.

The existing Windows visibility device test now starts both hidden and visible and checks the native ID and pane state through repeated transitions. With only the test change, both cases fail in packaged and unpackaged Windows execution (build 1678821). With the mapper refresh, both pass in both modes, and the complete Shell category passes 86/86 in each (build 1678822). The unchanged Issue8308 CV1/CV2 and Issue39055 UI scenarios also pass on their initial attempts in build 1678820, which is green. Exact source SHAs, native XML locations, and run/result IDs are recorded in #40208.

The device pipeline still has a separate Core Switch HighContrastBlack resource-test failure; I’m not claiming that pipeline is globally green.

Auto-replied by the GitHub Copilot app

@kubaflo
kubaflo merged commit 53f7830 into candidate/11.0.1xx-sr2 Nov 13, 2026
16 of 66 checks passed
@kubaflo
kubaflo deleted the kubaflo-candidate-shell-automation branch November 13, 2026 00:41
@kubaflo kubaflo mentioned this pull request Nov 13, 2026
1 task
kubaflo added a commit that referenced this pull request Nov 13, 2026
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 13, 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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 13, 2026
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, correcting a regression introduced directly on that
candidate by #39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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, #39406, and #8308.

<!--
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
…es (#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, following the review finding on already-merged #40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: #40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
#40202](#40202 (comment)).

Relates to #40116, #39406, and #8308.

<!--
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
…#40202)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for dotnet#40116, correcting a regression introduced directly on that
candidate by dotnet#39406.

### Description of Change

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

Make the Windows `ShellItemHandler` automation mapper explicitly clear
the content navigation view's ID for non-TabBar Shell items. Previously,
`ConnectHandler` assigned every Shell item's ID to that content root,
but `MapAutomationId` did nothing for FlyoutItems. The root could
therefore share an ID with the actual flyout navigation item, and retain
the previous FlyoutItem's ID when the handler was reused.

In the candidate's Windows `Issue8308` failure, the native tree exposes
a visible, 1008-by-680 content root with `AutomationId="Page 1"` while
Page 2's `Instructions2` label is displayed. The existing flyout helper
can target that content root instead of the flyout item, leaving the app
on Page 2.

The mapper now assigns IDs only to TabBars with visible tabs and clears
the ID otherwise. The existing `SetAutomationProperties` call is
retained, preserving accessibility properties, including
`IsInAccessibleTree`; ShellContent/tab IDs are unchanged. No selectors,
test IDs, timeouts, retries, or pipeline configuration are changed.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check` - passed.
- Native Windows validation on head
`2f6557d5574aa5d20a290d7f31ba6e937f08cee4`: [build
1678537](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678537),
using the existing `maui-pr-uitests` Windows and Windows CV1 build/test
stages. Both native builds succeeded; the regression and preservation
tests below passed on their initial attempts. No pipeline files or
filters were changed.

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46790596/100042` | Passed, 4550 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46790610/100032` | Passed, 4436 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46791298/100002` | Passed, 2237 ms |

Raw Azure logs retrieved with `az` confirm these passes: CV1 log `967`,
CV2 log `983`, and Shell1 log `1213`. Shell1 finished with 154 passed
and 2 skipped. The CV2 grouping-gallery fixture needed the existing
retry after a setup timeout; the regression test itself was not retried.

- Before the correction, [candidate build
1678469](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678469)
failed `NavigatingBackToCollectionViewShouldNotCrash` initially and on
retry in both Windows handler configurations, at the final
`WaitForElement("Instructions")`. Exact CV2 result: run `46787104`,
result `100048`; CV1 raw log `1073` has the same failure.
- The unchanged test passed on the `net11` baseline: [build
1676275](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1676275),
run `46717494`, result `100044`.

The validation build is **not globally green**: two existing candidate
visual regressions remain, `Issue21202Test` (4.45%) and
`ButtonLayoutAndSpacingTests` / `Issue22433_Default` (2.23%). They
repeat on retry in raw log `1231`, exactly matching the unmodified
candidate in builds `1678469` (log `1243`) and `1678143` (log `993`).
They are being investigated separately; this PR does not change their
snapshots or tolerances or claim the candidate is ready to merge.

### 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#39406, and dotnet#8308.

<!--
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
…es (dotnet#40208)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for dotnet#40116, following the review finding on already-merged dotnet#40202. The
feature branch starts at candidate commit
`53f7830c8ac75da171c9c890f29fddc5870cd0e5`.

### Description of Change

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

Refresh `Element.AutomationId` through `Handler.UpdateValue` whenever
the Windows Shell TabBar visibility mapping runs. The automation mapper
depends on `IShellItemController.ShowTabs`: dotnet#40202 correctly cleared IDs
for hidden TabBars and non-TabBar content roots, but changing visibility
did not remap that dependent property. An initially hidden TabBar
therefore stayed unfindable by its configured ID after being shown.

The one-line production change keeps the non-TabBar collision correction
and all accessibility-property setup intact. Hidden TabBars have no
content-root automation ID; visible TabBars regain their configured ID,
including across repeated transitions. The refresh goes through the
property mapper so application mapper customizations are respected.

Extend the existing Windows `ShellTabBarVisibilityToggleWorks` device
test to start both hidden and visible, toggle repeatedly, and assert the
native pane mode, visible pane state, and automation ID at each step.
The existing Issue8308 and Issue39055 UI scenarios are unchanged.

**Validation**

- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs
--verbosity quiet` - passed.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include
src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
--verbosity quiet` - passed.
- `git diff --check 53f7830 HEAD` -
passed.
- Regression-only native device baseline:
[1678821](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678821),
exact head `2a9fc02a7d66d6c1fcefde547afafa9041c7516e` - **both new cases
failed as expected**, in packaged and unpackaged Windows execution.
Initially hidden: expected `tab_bar` after showing, but got an empty ID.
Initially visible: expected an empty ID after hiding, but retained
`tab_bar`. The Shell category had 84 passed and these 2 assertion
failures in each mode.
- Fixed native device validation:
[1678822](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678822),
exact head `022ee17d85dad38298154813190b9faa3f3f9dcd` - **both cases
passed in both modes**, with the entire Shell category passing **86/86**
in each mode. Both Controls device-test work items passed.
- Unchanged Windows UI preservation:
[1678820](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678820),
the same fixed head, using existing Windows CV1/CV2 stages -
**succeeded**. All three focal tests passed on their initial attempts:

| Test | Configuration | Exact run/result | Result |
| --- | --- | --- | --- |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV2 |
`46799542/100019` | Passed, 4507 ms |
| `NavigatingBackToCollectionViewShouldNotCrash` | Windows CV1 |
`46799724/100009` | Passed, 4636 ms |
| `Issue39055TabBarAutomationIdShouldBeSet` | Windows |
`46800134/100001` | Passed, 2360 ms |

Raw Azure logs retrieved with `az` confirm the passes: CV2 log `967`,
CV1 log `1107`, and Shell1 log `1217`. Both CollectionView7 shards
passed 49/49; Shell1 passed 154 with 2 skipped.

The native device assertion evidence is in
`TestResults-com_microsoft_maui_controls_devicetests_Shell.xml`, under
both `Controls.DeviceTests-packaged` and
`Controls.DeviceTests-unpackaged`: [baseline Helix
job](https://helix.dot.net/api/jobs/92f8bd22-5482-419a-8329-0dbf320a4af8/details)
and [fixed Helix
job](https://helix.dot.net/api/jobs/4899e6e1-41db-4da3-836c-475a2bd0b7b2/details).
Raw Azure submission logs `82` and `87` tie those jobs to the pinned
source builds.

The fixed device pipeline is **not globally green**: its Windows leg
still fails `Core.DeviceTests-unpackaged` on
`SwitchHandlerTests.CustomOnColorRestoresConfiguredHoverResource(theme:
"HighContrastBlack")`, where `Assert.Single` found two resource
dictionaries. This is separate from the Controls Shell change and is
being investigated independently. The native Shell assertions and both
Controls work items pass; this PR does not claim release readiness.

No pipeline files, selectors, timeouts, snapshots, or tolerances are
changed.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Addresses the hidden-to-visible [review finding on
dotnet#40202](dotnet#40202 (comment)).

Relates to dotnet#40116, dotnet#39406, and dotnet#8308.

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

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 2f6557d5 Deployed Nov 12, 2026 by kubaflo via conclusion #2925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants