Skip to content

[inflight regression] Fix Shell UI tests are failing in Candidate PR - #36673

Merged
kubaflo merged 4 commits into
dotnet:inflight/candidatefrom
Dhivya-SF4094:fix-36562
Jul 20, 2026
Merged

[inflight regression] Fix Shell UI tests are failing in Candidate PR#36673
kubaflo merged 4 commits into
dotnet:inflight/candidatefrom
Dhivya-SF4094:fix-36562

Conversation

@Dhivya-SF4094

Copy link
Copy Markdown
Contributor

Root Cause

  • PR Fix Shell.Title binding in TitleView #35800 fixed issue Shell.Title evaluates to null, preventing binding inside Shell.TitleView #35761, where Shell.Title returned null inside a custom Shell.TitleView, causing bindings such as {Binding Title, Source={x:Reference Shell}} to fail. The fix updated ShellToolbar.UpdateTitle() to mirror the current page's title into Shell.Title using SetValueFromRenderer whenever the user had not explicitly set Shell.Title.
  • The regression occurred because Window.cs implements ITitledElement.Title as: string? ITitledElement.Title => Title ?? (Page as Shell)?.Title;
  • Before PR Fix Shell.Title binding in TitleView #35800, Shell.Title remained null (or String.Empty) when a TitleView was active unless the user explicitly assigned a value. After the change, Shell.Title contained the renderer-mirrored page title. Although this mirrored value was intended only to support TitleView bindings, it was also consumed by Window.cs as the native window title fallback on macOS and Windows.
  • As a result, the renderer-generated value unintentionally influenced native window title and layout behavior, causing several existing Shell UI tests (such as TitleViewHeightIsNotZero, VerifyShellFlyout_*, FlyoutContentOffsetsCorrectly, and GitHubIssue9440) to fail on macOS and Windows.

Description of Change

The fix ensures a clear distinction between user-defined Shell.Title values and renderer-mirrored values while preserving the behavior introduced in PR #35800.

  1. Shell.cs
  • Added internal bool IsTitleSetByUser() to determine whether Shell.Title was explicitly set by the application (by checking bindings and SetterSpecificity, excluding DefaultValue and FromHandler).
  • Added internal string? GetUserSetTitle() to return the title only when it was explicitly provided by the user; otherwise, it returns null.
  1. ShellToolbar.cs
    Retained the existing mirroring behavior, but made the intent explicit by mirroring the current page title only when !IsTitleSetByUser().

  2. Window.cs
    Updated ITitledElement.Title to use GetUserSetTitle() instead of directly accessing Shell.Title. This prevents renderer-mirrored values from being used as the native window title while continuing to honor explicitly assigned Shell.Title values.

This approach resolves the regression at the point where it affects native window behavior (Window.cs) without changing the TitleView binding functionality introduced in PR #35800.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed:

Fixes #36562

Screenshots

Before  After 
     

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 20, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

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

@azure-pipelines

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

@vishnumenon2684 vishnumenon2684 added the community ✨ Community Contribution label Jul 20, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [WIP] [inflight regression] Fix Shell UI tests are failing in Candidate PR [inflight regression] Fix Shell UI tests are failing in Candidate PR Jul 20, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review July 20, 2026 14:27
@sheiksyedm
sheiksyedm requested a review from kubaflo July 20, 2026 14:27
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants