Skip to content

[Net11][iOS][Test Failure] Fix missing Shell top tab after navigation appearance reset - #39752

Merged
kubaflo merged 4 commits into
dotnet:net11.0from
Shalini-Ashokan:fix-shell-CI-failures
Oct 29, 2026
Merged

kubaflo merged 4 commits into
dotnet:net11.0from
Shalini-Ashokan:fix-shell-CI-failures

Conversation

@Shalini-Ashokan

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!

Issue Details

On iOS, ShellColorsResetOnNavigation fails because the Page2 top tab is not visible after navigation.

Regression PR: dotnet/maui#37137 — Render gradient backgrounds on bottom tab bars.

Root Cause

The PR added restoration of the navigation bar’s original translucency during appearance reset:
navBar.Translucent = _defaultTranslucent;

Translucent controls whether content can show through the navigation bar. On iOS, it can also affect how content is positioned underneath the bar.

In the failing scenario, restoring this setting changes the tab row’s position and exposes a layout-refresh problem. Page2 still exists, but it falls outside the visible tab row.

Description of Change

Removes the saved _defaultTranslucent field, its capture, and its restoration during reset.
Keeps the existing restoration of navigation-bar colors and native appearances.

Validated the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

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

Or

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

@azure-pipelines

This comment has been minimized.

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

Copy link
Copy Markdown
Contributor

Hey there @@Shalini-Ashokan! 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 dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 29, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review October 29, 2026 10:47
Copilot AI balanced review requested due to automatic review settings October 29, 2026 10:47
@sheiksyedm
sheiksyedm requested a review from kubaflo October 29, 2026 10:47
@github-actions github-actions Bot added area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/ios labels Oct 29, 2026
@vishnumenon2684

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI 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.

🟡 Changes recommended

Both reset-test cases still expect translucency to return to true, but brush-only appearances set it to false and reset now leaves it unchanged.

1 open issue
What changed in this PR

This PR addresses the missing Shell top tab after navigation by stopping navigation-bar appearance reset from restoring translucency, reversing that part of #37137.

Changes:

  • Removes the saved translucency field, its capture, and its restoration.
  • Preserves existing color and native-appearance restoration.
File Description
src/​Controls/​src/​Core/​Compatibility/​Handlers/​Shell/​iOS/​ShellNavBarAppearanceTracker.cs Leaves translucency unchanged when resetting the Shell navigation-bar appearance.

Review effort: Balanced

@@ -33,7 +32,6 @@ public void ResetAppearance(UINavigationController controller)
navBar.BarTintColor = _defaultBarTint;
navBar.TintColor = _defaultTint;
navBar.TitleTextAttributes = _defaultTitleAttributes;
kubaflo added a commit that referenced this pull request Oct 29, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

I have added the correct base/resave images and removed the diff image
that was accidentally committed.


**Shell flyout selection background not applied**
The PR #35491 introduced Shell.BackgroundProperty, causing the
Shell-derived test page’s unqualified BackgroundProperty to target the
Shell background instead of the flyout item’s background. Explicitly
using VisualElement.BackgroundProperty in both visual states restores
the intended selection colors

Changed the CollectionView's HorizontalOptions from Center to Fill in
the **Issue38443** test page so the selected item's outline spans the
available row width with CV2 on Windows.

- The appearance differs because CV1 and CV2 measure item content
differently. CV1's ItemContentControl.MeasureOverride returns at least
the available finite width, expanding the item even when its content is
small. CV2's ElementWrapper normally returns the measured content size
without that unconditional width inflation.
- With HorizontalOptions set to Center, the CollectionView can therefore
size to its content in CV2. Since the Selected visual state sets the
template Border's stroke to black, the outline follows that narrower
Border rather than spanning the available width. The selected visual
state is still applied; the difference is in layout bounds.
- Using Fill makes the intended full-width layout explicit instead of
relying on CV1's measurement behavior. This keeps
SelectedItemSetDuringShellNavigationUpdatesVisualState focused on
verifying that the cyan item's selected visual state is applied during
Shell navigation.

The **ResetRestoresNativeAppearanceAfterGradientAndSolid** test fails
because #39752 intentionally stops restoring the navigation
bar’s original translucency to prevent Shell’s top tabs from becoming
hidden. The test starts with Translucent = true, but applying gradient
and solid backgrounds changes it to false. Reset now leaves it false, so
updating Assert.True(...) to Assert.False(...) matches the intended
behavior and guards against reintroducing the issue.

---------

Co-authored-by: Shalini-Ashokan <102292178+Shalini-Ashokan@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: NafeelaNazhir <nafeela.nazhirhussain@syncfusion.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — c504f879 Deployed Oct 29, 2026 by Shalini-Ashokan via conclusion #2575
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios test-failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants