Skip to content

[Android] Fix SearchHandler toolbar icon tint when Shell.ForegroundColor is set on a TabBar, Tab, or ShellContent - #39346

Merged
kubaflo merged 1 commit into
dotnet:inflight/currentfrom
edgiardina:fix/android-searchhandler-icon-tint
Oct 16, 2026
Merged

kubaflo merged 1 commit into
dotnet:inflight/currentfrom
edgiardina:fix/android-searchhandler-icon-tint

Conversation

@edgiardina

Copy link
Copy Markdown
Contributor

Description of Change

On Android, the toolbar icon of a collapsible SearchHandler and the back arrow of the expanded search view ignore Shell.ForegroundColor when the property is set on a TabBar, Tab, FlyoutItem, or ShellContent. The icons are white.

#36016 made ShellToolbarTracker.GetSearchHandlerTintColor read Shell.ForegroundColor from the page and from the Shell. It does not read the elements between the two. The other toolbar colors come from Shell.GetAppearanceForPivot, which reads all of them.

This change does the following:

  • GetSearchHandlerTintColor gets the color from Shell.GetAppearanceForPivot(page). The order is now: ShellToolbarTracker.TintColor, the resolved appearance of the page, Shell.ForegroundColor of the Shell, white.
  • Shell.GetAppearanceForPivot changes from private to internal. There is no public API change.
  • OnToolbarPropertyChanged updates the menu item tint when Toolbar.IconColor changes. A color change on a parent element does not cause a property change on the page or on the Shell, thus the icon did not update at runtime.
  • A new device test, CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement, sets the color on a TabBar, examines the icon color, changes the color, and examines the icon again.

Test results

Android 14 (API 34) emulator, Controls.DeviceTests, Category=Shell:

Build Result
With this change 73 passed, 0 failed
Test only, without the change in ShellToolbarTracker 72 passed, 1 failed (the new test)

Manual test with the reproduction from the issue. Icon color in the toolbar:

Shell.ForegroundColor set on 10.0.110 This change
TabBar (red) White Red
ShellContent (green) White Green
Page (blue) Blue Blue
TabBar (red), back arrow of the expanded search view White Red

I did not run the tests on iOS, MacCatalyst, or Windows. The change in ShellToolbarTracker is Android-only.

Issues Fixed

Fixes #16309

🤖 Generated with Claude Code

…olbar icons

The collapsible SearchHandler icon and the back arrow of the search view
read Shell.ForegroundColor from the page and from the Shell only. A value
set on a TabBar, Tab, FlyoutItem, or ShellContent was ignored, and the
icons were white.

Get the color from Shell.GetAppearanceForPivot, which the other toolbar
colors use. Update the menu item tint when Toolbar.IconColor changes.

Fixes dotnet#16309

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

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

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

Or

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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Oct 13, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

github-actions[bot]

This comment was marked as outdated.

@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 Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review gate started

AzDO build 15668453 is running for android.

The s/agent-review-in-progress label stays on this PR while existing PR tests are verified. The final gate report contains test evidence only: no expert review, alternative fixes, or Deep UI sweep runs.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot added s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) and removed s/agent-review-in-progress AI review is currently running for this PR labels Oct 13, 2026
@kubaflo

kubaflo commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

github-actions[bot]

This comment was marked as outdated.

@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 Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15682290 is running for android.

The s/agent-review-in-progress label stays on this PR through the full pipeline. The final AI Summary and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

github-actions[bot]

This comment was marked as outdated.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI Review Summary

@edgiardina — new AI review results are available based on commit 77f2e44.

Gate Passed Confidence Low Platform Android


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ✅ PASSED

Platform: ANDROID · Base: main · Merge base: f16eb798

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 ShellTests (CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement) Category=Shell ✅ FAIL — 517s ✅ PASS — 501s
🔴 Without fix — 📱 ShellTests (CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement): FAIL ✅ · 517s

(no coded error found; showing last 1200 chars)

moryBytes": 8322998272
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.controls.devicetests'..
info: Successfully uninstalled com.microsoft.maui.controls.devicetests
XHarness exit code: 1 (TESTS_FAILED)
  Passed: 0
  Failed: 1
  Skipped: 0
  Total: 1
  Tests completed with exit code: 1
🟢 With fix — 📱 ShellTests (CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement): PASS ✅ · 501s

(no coded error found; showing last 1200 chars)

            "totalMemoryBytes": 8322998272
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.controls.devicetests'..
info: Successfully uninstalled com.microsoft.maui.controls.devicetests
XHarness exit code: 0
  Passed: 1
  Failed: 0
  Skipped: 0
  Total: 1
  Tests completed successfully
📁 Fix files reverted (2 files)
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs
  • src/Controls/src/Core/Shell/Shell.cs

📋 Pre-Flight — Context & Validation

Pre-Flight Context

Scope snapshot: PR #39346 is an open, single-commit Android fix at head 77f2e447de9595fff4df96a4c08f6542c72c3880. The immutable submitted diff changes three files (+57/-2). This is context gathering only, not an exhaustive review or implementation recommendation.

Reported problem

  • #16309 reports that Android Shell’s collapsed SearchHandler spyglass and the expanded search view’s back arrow remain white, potentially becoming invisible on a light toolbar, when Shell.ForegroundColor is configured on an intermediate Shell element.
  • The original reproduction sets the color on a TabBar. A later retest reports the behavior still present in .NET MAUI 10.0.110 on Android 14/API 34:
    • TabBar or ShellContent: expected configured color, observed white.
    • Page: configured color works.
  • #36016 previously changed the SearchHandler tint lookup to prefer ShellToolbarTracker.TintColor, then the page’s attached Shell.ForegroundColor, then the Shell’s value, with white applied by the Android conversion call sites as the final fallback. That covers values set directly on the page or Shell but not values set between them, such as ShellContent, Tab, TabBar, or FlyoutItem.

Changed files and mechanism

File Submitted change
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs Resolves SearchHandler tint through _shell.GetAppearanceForPivot(page)?.ForegroundColor instead of reading only Shell.GetForegroundColor(page). Also re-tints the SearchHandler menu icon when the root Toolbar.IconColor changes.
src/Controls/src/Core/Shell/Shell.cs Changes GetAppearanceForPivot(Element) from private to internal, exposing it only within the Controls assembly; no public API signature is added.
src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs Adds an Android device test for a collapsible SearchHandler whose foreground is set on a TabBar, including a live red-to-lime update.

The relevant source flow is:

  1. Shell.GetAppearanceForPivot(page) walks to the active page and then upward through the Shell hierarchy. ShellAppearance.Ingest only fills values not already resolved, so the nearest explicitly set foreground wins. The algorithm has special handling to include the active ShellContent when a pushed page is attached through a ShellSection.
  2. GetSearchHandlerTintColor now returns explicit tracker TintColor, otherwise the resolved appearance foreground, otherwise Shell.GetForegroundColor(_shell). Android call sites still use white when converting a null result.
  3. Initial creation of the collapsible menu icon and attachment of its expanded action-view back button both call this helper.
  4. Android’s ShellToolbarAppearanceTracker writes the effective appearance foreground into the root Shell toolbar’s IconColor. ShellToolbarTracker already observes that toolbar and copies changes to the platform-specific toolbar; the new property-name check additionally invokes UpdateToolbarItemsTintColors.
  5. That re-tint method locates the collapsible placeholder menu item and applies an Android drawable color filter. This addresses the event gap where changing an intermediate element does not directly raise ForegroundColor changes on either the current page or the Shell.

Platform-sensitive paths

  • Functional rendering changes are in the Android compatibility Shell renderer, using AppCompat/Material toolbar menu items, drawables, and color filters.
  • The new test is in the Android partial ShellTests class and inspects rendered drawable pixels from a MaterialToolbar.
  • Shell.cs is shared cross-platform code, but the submitted functional caller is Android-only. Its accessibility change is assembly-internal and therefore does not itself create public API surface.
  • No iOS, Mac Catalyst, or Windows implementation files are changed. The PR description explicitly reports those platforms as untested.

Validation evidence and later requirements

  • Gate evidence supplied for this exact head: the new Android device test failed against baseline f16eb798 and passed against head 77f2e447, on an Android 11/API 30 x86-64 emulator. The gate is already passed and must not be rerun.

  • Author-reported evidence, not independently established here: 73 Android Shell device tests passed on an Android 14/API 34 emulator, plus manual checks for TabBar, ShellContent, page-level color, and the expanded-search back arrow.

  • Mandatory candidate regression test: after a candidate’s primary Android test succeeds, run exactly:

    dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --filter "ShellToolbarTests"
    

    A candidate that fails this regression test is required to be marked Fail.

  • The cross-reference comes from #36673, which also modified shared Shell.cs and added ShellToolbarTests coverage. That prior fix preserves the distinction between user-supplied Shell title state and renderer-mirrored title state, preventing leakage into native window titles and associated macOS/Windows Shell layout behavior.

Remaining uncertainties

  • The submitted automated test covers only SearchBoxVisibility.Collapsible, a TabBar parent, and a runtime foreground change. It does not directly automate the expanded-search back-arrow path.
  • ShellContent, Tab, and FlyoutItem inheritance scenarios are described or manually reported but are not individually exercised by the new test.
  • UpdateToolbarItemsTintColors directly re-tints only the collapsible placeholder menu item. Whether an already-expanded action-view back button updates correctly after a parent color changes remains unproven by the submitted test.
  • An unresolved inline PR comment calls out the missing expanded-search automation; this records a coverage gap rather than establishing a defect.
  • The latest retrieved PR discussion says three Azure pipelines and a broader Android review pipeline were started, but their final outcomes were unavailable in the gathered context and are therefore unknown.
  • No tests or commands were run for this context pass, and no conclusion is made about overall correctness or merge readiness.

🔬 Code Review — Deep Analysis

Expert PR Evaluation

Verdict: NEEDS_DISCUSSION
Confidence: low
Inline findings: 0

Independent Assessment

The submitted Android fix changes SearchHandler tint lookup to use the resolved Shell appearance for the current page, and re-applies the collapsible menu icon tint when the effective toolbar icon color changes. The shared GetAppearanceForPivot accessibility change remains assembly-internal, and the submitted Android device test covers a TabBar foreground plus a live color update.

Findings

No concrete correctness defect was identified on an added or modified line. The expert reviewer wrote an empty JSON array to inline-findings.json.

Blast Radius and Failure Modes

  • The runtime behavior change is localized to the Android Compatibility Shell toolbar path; there is no new startup path or static/shared state.
  • Parent-level Shell.ForegroundColor now follows the existing Shell appearance-resolution semantics.
  • The runtime recolor path is triggered through the observed Toolbar.IconColor property change.
  • No subscription or disconnect/reconnect asymmetry is introduced by the submitted diff.
  • External-output and trim/AOT contract checks are not applicable.

Evidence Gaps and Prior Review Reconciliation

  • A prior inline review comment asks for automated coverage of the expanded SearchHandler back-arrow path. The submitted test exercises the collapsed icon and a live parent-color update, so the expanded path remains a coverage gap rather than a demonstrated defect.
  • The trusted Gate passed for the exact submitted head: the new Android device test failed without the fix and passed with it.
  • The expert pass could not retrieve the PR's required-check state because authenticated and anonymous GitHub status retrieval were unavailable. Required CI is therefore undetermined in this review evidence, which prevents an LGTM verdict and caps confidence at low.

Refinement Threshold

No pr-plus-reviewer refinement is warranted. The expert review identified neither a concrete actionable defect nor an unresolved behavioral mechanism backed by source or test evidence; adding a speculative patch solely to populate the comparison would violate evidence-first policy.


🛠️ Try-Fix — Analysis & Comparison

Alternative generation: not requested

Evidence-first mode intentionally omits routine Try-Fix attempts. This is not a failed
attempt, a completed alternative search, or evidence that alternatives have no value.
The expert review may still produce one evidence-backed PR refinement.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Trusted evidence-first context consumed for submitted head 77f2e447
Code Review NEEDS_DISCUSSION (low) 0 errors, 0 warnings, 0 inline findings; required-check status is undetermined
Gate ✅ PASSED Android device test failed without the fix and passed with it
Regression ✅ PASSED ShellToolbarTests: 1 passed, 0 failed, 0 skipped
Try-Fix Not requested Evidence-first mode intentionally omitted alternative generation
Refinement NOT GENERATED No concrete defect or evidence-backed unresolved mechanism met the refinement threshold
Report ✅ COMPLETE Raw pr is the sole real candidate

Code Review and Candidate Comparison

The raw pr candidate is the only implemented candidate. It fixes the tested parent-level foreground-color scenario, passes the trusted Gate, and passes the required regression test. The expert review found no actionable defect on a changed line, so evidence-first policy does not permit inventing a pr-plus-reviewer candidate.

The raw PR therefore wins the candidate comparison. Approval is nevertheless blocked by the expert review's NEEDS_DISCUSSION verdict: the submitted test does not directly exercise the expanded SearchHandler back-arrow path, and the required-check state could not be established from the available GitHub evidence. This report does not treat missing CI evidence as a pass or claim that the submitted candidate is merge-ready.

Summary

The submitted change is technically coherent and empirically fixes the tested Android regression. No better evidence-backed refinement was produced or warranted. Request changes pending resolution of the expert evidence gap, principally confirmation of required CI and disposition of the expanded-search coverage concern.

Root Cause

Android SearchHandler toolbar icons previously resolved Shell.ForegroundColor only from the page and root Shell. Values set on intermediate Shell elements such as ShellContent, Tab, TabBar, or FlyoutItem were skipped. Runtime changes on those elements also did not raise the page or Shell property changes used by the existing tint update path.

Fix Quality

The fix reuses Shell.GetAppearanceForPivot(page) so SearchHandler tint follows the same nearest-value appearance resolution as other Shell toolbar colors. It also re-tints the collapsible menu item when the effective Toolbar.IconColor changes. The accessibility change to GetAppearanceForPivot is assembly-internal, the Android device test proves the collapsed TabBar case and a live red-to-lime update, and the overlapping ShellToolbarTests regression suite passes. The expanded action-view back-arrow update remains unproven by submitted automation, and broader required CI evidence is unavailable.


🔗 Regression Cross-Reference

🔍 Regression Cross-Reference

⚠ Overlaps with prior bug-fix PRs — same files modified, but no exact line revert detected.

File Fix PR Fixed issue(s)
src/Controls/src/Core/Shell/Shell.cs #36673 #36562
src/Controls/src/Core/Shell/Shell.cs #35896 #35249

🧪 Regression Tests to Verify

These tests were added by the overlapping fix PRs. Running them to verify no side-effect regressions:

Fix PR Type Test Filter
#36673 UnitTest ShellToolbarTests ShellToolbarTests

🧪 Regression Test Results

✅ PASSED — 1 passed, 0 failed, 0 skipped

Fix PR Test Type Result
#36673 ShellToolbarTests UnitTest ✅ PASSED

📱 UI Tests — Shell

Detected UI test categories: Shell

[!WARNING]
No UI test results were produced for the detected categories. The PR build itself was
fine — the deep UI stage was skipped or interrupted on infrastructure (the
merge-for-testing step, emulator/simulator boot, or an Appium hang), not by this PR's code.
This is usually transient; the review re-runs on new commits (a maintainer can also re-run it).


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@MauiBot MauiBot added s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Oct 14, 2026
github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

@kubaflo

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Tests Failure Analysis

@edgiardina — test-failure analysis for commit 77f2e44.

Scope CI failures Commit 77f2e44


🧪 CI Analysis — click to expand
📊 maui-pr

No failures found.


🧪 maui-pr-devicetests

No failures found.


🧪 maui-pr-uitests

🧭 Follow-up — actions and refresh

Next action: Restore complete UI evidence; compare unresolved tests individually on base/head with identical setup.

Maintainers: comment /review tests to refresh this report.

@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

@edgiardina — new AI review results are available based on commit 77f2e44.

Scope: Full PR (all commits) Expert review: Incomplete

⚠️ Merge recommendation: NO. Review incomplete: Dimension 6 did not persist an independent result. Dimension 12 did not persist an independent result. Dimension 16 did not persist an independent result. Dimension 25 did not persist an independent result. The reviewer did not complete finding validation.

🔬 Review details

Coverage: 1/5 dimensions; finding validation incomplete.

Dimensions:

  • ✅ 5. Logic and Correctness Verification
  • ⚠️ 6. Regression Prevention and Test Coverage (no result)
  • ⚠️ 12. Backward Compatibility and Migration (no result)
  • ⚠️ 16. Complexity Reduction (no result)
  • ⚠️ 25. Navigation & Shell (no result)

AI source/history review only; no builds or tests run. Required CI and human approval still apply.

@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 77f2e44.

See inline comments for details.


// IconColor follows the effective Shell.ForegroundColor, including values set on a parent
// ShellItem/ShellSection/ShellContent that do not raise a property change on the page or the Shell.
if (e.PropertyName == nameof(Toolbar.IconColor))

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] Navigation & Shell - Refresh the search tint when a retained tab becomes current, not only when the shared IconColor changes. Visit bottom Tab A with a red parent foreground and a collapsible SearchHandler, switch to lime Tab B, change A's parent foreground to lime while B is selected, then return directly to A. A's retained tracker skips the refresh while B is current, and returning leaves the root IconColor unchanged at lime, so Toolbar.SetProperty suppresses this notification. The Page setter also skips the unchanged page, while OnShellNavigated and OnHiddenChanged refresh only the navigation/title state. A's search icon consequently remains red instead of lime. The added test changes color only on the selected tab and does not exercise this path.

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

MauiBot commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@edgiardina — existing-test verification for commit 77f2e447.

Result PASSED Platform Android Commit 77f2e447


🧪 Gate analysis — click to expand

✅ Passed. The selected verification satisfied the gate's passing conditions. Unmatched, skipped, or inconclusive groups are not passing evidence.

📱 Device tests
Test group Without fix With fix
ShellTests (CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement) ✅ Failed as expected (475s) ✅ Passed (477s)
Execution log excerpts

Without fix ShellTests (CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement)

moryBytes": 8322998272
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.controls.devicetests'..
info: Successfully uninstalled com.microsoft.maui.controls.devicetests
XHarness exit code: 1 (TESTS_FAILED)
  Passed: 0
  Failed: 1
  Skipped: 0
  Total: 1
  Tests completed with exit code: 1

With fix ShellTests (CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement)

            "totalMemoryBytes": 8322998272
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.controls.devicetests'..
info: Successfully uninstalled com.microsoft.maui.controls.devicetests
XHarness exit code: 0
  Passed: 1
  Failed: 0
  Skipped: 0
  Total: 1
  Tests completed successfully

PR head: 77f2e447.

Without-fix baseline: 18542507.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Oct 15, 2026
@kubaflo
kubaflo changed the base branch from main to inflight/current October 16, 2026 17:07
@kubaflo
kubaflo merged commit d5d81df into dotnet:inflight/current Oct 16, 2026
201 of 209 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Oct 16, 2026
kubaflo pushed a commit that referenced this pull request Oct 18, 2026
…lor is set on a TabBar, Tab, or ShellContent (#39346)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

On Android, the toolbar icon of a collapsible `SearchHandler` and the
back arrow of the expanded search view ignore `Shell.ForegroundColor`
when the property is set on a `TabBar`, `Tab`, `FlyoutItem`, or
`ShellContent`. The icons are white.

#36016 made `ShellToolbarTracker.GetSearchHandlerTintColor` read
`Shell.ForegroundColor` from the page and from the `Shell`. It does not
read the elements between the two. The other toolbar colors come from
`Shell.GetAppearanceForPivot`, which reads all of them.

This change does the following:

- `GetSearchHandlerTintColor` gets the color from
`Shell.GetAppearanceForPivot(page)`. The order is now:
`ShellToolbarTracker.TintColor`, the resolved appearance of the page,
`Shell.ForegroundColor` of the Shell, white.
- `Shell.GetAppearanceForPivot` changes from `private` to `internal`.
There is no public API change.
- `OnToolbarPropertyChanged` updates the menu item tint when
`Toolbar.IconColor` changes. A color change on a parent element does not
cause a property change on the page or on the Shell, thus the icon did
not update at runtime.
- A new device test,
`CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement`,
sets the color on a `TabBar`, examines the icon color, changes the
color, and examines the icon again.

### Test results

Android 14 (API 34) emulator, `Controls.DeviceTests`, `Category=Shell`:

| Build | Result |
|---|---|
| With this change | 73 passed, 0 failed |
| Test only, without the change in `ShellToolbarTracker` | 72 passed, 1
failed (the new test) |

Manual test with the reproduction from the issue. Icon color in the
toolbar:

| `Shell.ForegroundColor` set on | 10.0.110 | This change |
|---|---|---|
| `TabBar` (red) | White | Red |
| `ShellContent` (green) | White | Green |
| Page (blue) | Blue | Blue |
| `TabBar` (red), back arrow of the expanded search view | White | Red |

I did not run the tests on iOS, MacCatalyst, or Windows. The change in
`ShellToolbarTracker` is Android-only.

### Issues Fixed

Fixes #16309
kubaflo pushed a commit that referenced this pull request Oct 21, 2026
…lor is set on a TabBar, Tab, or ShellContent (#39346)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

On Android, the toolbar icon of a collapsible `SearchHandler` and the
back arrow of the expanded search view ignore `Shell.ForegroundColor`
when the property is set on a `TabBar`, `Tab`, `FlyoutItem`, or
`ShellContent`. The icons are white.

#36016 made `ShellToolbarTracker.GetSearchHandlerTintColor` read
`Shell.ForegroundColor` from the page and from the `Shell`. It does not
read the elements between the two. The other toolbar colors come from
`Shell.GetAppearanceForPivot`, which reads all of them.

This change does the following:

- `GetSearchHandlerTintColor` gets the color from
`Shell.GetAppearanceForPivot(page)`. The order is now:
`ShellToolbarTracker.TintColor`, the resolved appearance of the page,
`Shell.ForegroundColor` of the Shell, white.
- `Shell.GetAppearanceForPivot` changes from `private` to `internal`.
There is no public API change.
- `OnToolbarPropertyChanged` updates the menu item tint when
`Toolbar.IconColor` changes. A color change on a parent element does not
cause a property change on the page or on the Shell, thus the icon did
not update at runtime.
- A new device test,
`CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement`,
sets the color on a `TabBar`, examines the icon color, changes the
color, and examines the icon again.

### Test results

Android 14 (API 34) emulator, `Controls.DeviceTests`, `Category=Shell`:

| Build | Result |
|---|---|
| With this change | 73 passed, 0 failed |
| Test only, without the change in `ShellToolbarTracker` | 72 passed, 1
failed (the new test) |

Manual test with the reproduction from the issue. Icon color in the
toolbar:

| `Shell.ForegroundColor` set on | 10.0.110 | This change |
|---|---|---|
| `TabBar` (red) | White | Red |
| `ShellContent` (green) | White | Green |
| Page (blue) | Blue | Blue |
| `TabBar` (red), back arrow of the expanded search view | White | Red |

I did not run the tests on iOS, MacCatalyst, or Windows. The change in
`ShellToolbarTracker` is Android-only.

### Issues Fixed

Fixes #16309
kubaflo pushed a commit that referenced this pull request Oct 25, 2026
…lor is set on a TabBar, Tab, or ShellContent (#39346)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

On Android, the toolbar icon of a collapsible `SearchHandler` and the
back arrow of the expanded search view ignore `Shell.ForegroundColor`
when the property is set on a `TabBar`, `Tab`, `FlyoutItem`, or
`ShellContent`. The icons are white.

#36016 made `ShellToolbarTracker.GetSearchHandlerTintColor` read
`Shell.ForegroundColor` from the page and from the `Shell`. It does not
read the elements between the two. The other toolbar colors come from
`Shell.GetAppearanceForPivot`, which reads all of them.

This change does the following:

- `GetSearchHandlerTintColor` gets the color from
`Shell.GetAppearanceForPivot(page)`. The order is now:
`ShellToolbarTracker.TintColor`, the resolved appearance of the page,
`Shell.ForegroundColor` of the Shell, white.
- `Shell.GetAppearanceForPivot` changes from `private` to `internal`.
There is no public API change.
- `OnToolbarPropertyChanged` updates the menu item tint when
`Toolbar.IconColor` changes. A color change on a parent element does not
cause a property change on the page or on the Shell, thus the icon did
not update at runtime.
- A new device test,
`CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement`,
sets the color on a `TabBar`, examines the icon color, changes the
color, and examines the icon again.

### Test results

Android 14 (API 34) emulator, `Controls.DeviceTests`, `Category=Shell`:

| Build | Result |
|---|---|
| With this change | 73 passed, 0 failed |
| Test only, without the change in `ShellToolbarTracker` | 72 passed, 1
failed (the new test) |

Manual test with the reproduction from the issue. Icon color in the
toolbar:

| `Shell.ForegroundColor` set on | 10.0.110 | This change |
|---|---|---|
| `TabBar` (red) | White | Red |
| `ShellContent` (green) | White | Green |
| Page (blue) | Blue | Blue |
| `TabBar` (red), back arrow of the expanded search view | White | Red |

I did not run the tests on iOS, MacCatalyst, or Windows. The change in
`ShellToolbarTracker` is Android-only.

### Issues Fixed

Fixes #16309
kubaflo pushed a commit that referenced this pull request Oct 26, 2026
…lor is set on a TabBar, Tab, or ShellContent (#39346)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

On Android, the toolbar icon of a collapsible `SearchHandler` and the
back arrow of the expanded search view ignore `Shell.ForegroundColor`
when the property is set on a `TabBar`, `Tab`, `FlyoutItem`, or
`ShellContent`. The icons are white.

#36016 made `ShellToolbarTracker.GetSearchHandlerTintColor` read
`Shell.ForegroundColor` from the page and from the `Shell`. It does not
read the elements between the two. The other toolbar colors come from
`Shell.GetAppearanceForPivot`, which reads all of them.

This change does the following:

- `GetSearchHandlerTintColor` gets the color from
`Shell.GetAppearanceForPivot(page)`. The order is now:
`ShellToolbarTracker.TintColor`, the resolved appearance of the page,
`Shell.ForegroundColor` of the Shell, white.
- `Shell.GetAppearanceForPivot` changes from `private` to `internal`.
There is no public API change.
- `OnToolbarPropertyChanged` updates the menu item tint when
`Toolbar.IconColor` changes. A color change on a parent element does not
cause a property change on the page or on the Shell, thus the icon did
not update at runtime.
- A new device test,
`CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement`,
sets the color on a `TabBar`, examines the icon color, changes the
color, and examines the icon again.

### Test results

Android 14 (API 34) emulator, `Controls.DeviceTests`, `Category=Shell`:

| Build | Result |
|---|---|
| With this change | 73 passed, 0 failed |
| Test only, without the change in `ShellToolbarTracker` | 72 passed, 1
failed (the new test) |

Manual test with the reproduction from the issue. Icon color in the
toolbar:

| `Shell.ForegroundColor` set on | 10.0.110 | This change |
|---|---|---|
| `TabBar` (red) | White | Red |
| `ShellContent` (green) | White | Green |
| Page (blue) | Blue | Blue |
| `TabBar` (red), back arrow of the expanded search view | White | Red |

I did not run the tests on iOS, MacCatalyst, or Windows. The change in
`ShellToolbarTracker` is Android-only.

### Issues Fixed

Fixes #16309
github-actions Bot pushed a commit that referenced this pull request Oct 28, 2026
…lor is set on a TabBar, Tab, or ShellContent (#39346)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

On Android, the toolbar icon of a collapsible `SearchHandler` and the
back arrow of the expanded search view ignore `Shell.ForegroundColor`
when the property is set on a `TabBar`, `Tab`, `FlyoutItem`, or
`ShellContent`. The icons are white.

#36016 made `ShellToolbarTracker.GetSearchHandlerTintColor` read
`Shell.ForegroundColor` from the page and from the `Shell`. It does not
read the elements between the two. The other toolbar colors come from
`Shell.GetAppearanceForPivot`, which reads all of them.

This change does the following:

- `GetSearchHandlerTintColor` gets the color from
`Shell.GetAppearanceForPivot(page)`. The order is now:
`ShellToolbarTracker.TintColor`, the resolved appearance of the page,
`Shell.ForegroundColor` of the Shell, white.
- `Shell.GetAppearanceForPivot` changes from `private` to `internal`.
There is no public API change.
- `OnToolbarPropertyChanged` updates the menu item tint when
`Toolbar.IconColor` changes. A color change on a parent element does not
cause a property change on the page or on the Shell, thus the icon did
not update at runtime.
- A new device test,
`CollapsibleSearchHandlerIconUsesForegroundColorSetOnParentShellElement`,
sets the color on a `TabBar`, examines the icon color, changes the
color, and examines the icon again.

### Test results

Android 14 (API 34) emulator, `Controls.DeviceTests`, `Category=Shell`:

| Build | Result |
|---|---|
| With this change | 73 passed, 0 failed |
| Test only, without the change in `ShellToolbarTracker` | 72 passed, 1
failed (the new test) |

Manual test with the reproduction from the issue. Icon color in the
toolbar:

| `Shell.ForegroundColor` set on | 10.0.110 | This change |
|---|---|---|
| `TabBar` (red) | White | Red |
| `ShellContent` (green) | White | Green |
| Page (blue) | Blue | Blue |
| `TabBar` (red), back arrow of the expanded search view | White | Red |

I did not run the tests on iOS, MacCatalyst, or Windows. The change in
`ShellToolbarTracker` is Android-only.

### Issues Fixed

Fixes #16309
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 77f2e447 Deployed Oct 13, 2026 by edgiardina via conclusion #2327
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SearchHandler for Android does not respect Shell Foreground color for Spyglass icon

3 participants