Skip to content

Conversation

@StephaneDelcroix
Copy link
Contributor

Summary

Adds unit tests to complement PR #25663 which fixes issues #13537 and #28453.

Tests Added

  • TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
  • TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
  • FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
  • NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
  • PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
  • ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.

Related PRs

Issues Fixed

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive unit tests to validate that IQueryAttributable.ApplyQueryAttributes is invoked correctly for all Shell navigation scenarios, complementing the fix implementation in PR #25663.

The PR introduces:

  • UI test infrastructure with a Shell-based test page (Issue13537) demonstrating TabBar navigation and query attribute handling
  • Three UI test cases covering push/pop navigation and tab switching with query parameters
  • Six xUnit test cases validating QueryAttributesProperty behavior for different Shell navigation patterns

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13537.cs Adds UI tests for ApplyQueryAttributes behavior with push/pop navigation and tab switching
src/Controls/tests/TestCases.HostApp/Issues/Issue13537.xaml.cs Implements test pages with IQueryAttributable support for demonstrating Shell navigation scenarios
src/Controls/tests/TestCases.HostApp/Issues/Issue13537.xaml Defines Shell TabBar structure for UI tests
src/Controls/tests/Core.UnitTests/ShellParameterPassingTests.cs Adds unit tests validating QueryAttributesProperty behavior for TabBar, FlyoutItem, and ShellSection navigation
src/Controls/src/Core/Shell/ShellNavigationManager.cs Updates ApplyQueryAttributes to set QueryAttributesProperty on ShellContent during pop navigation
src/Controls/src/Core/Shell/ShellItem.cs Sets QueryAttributesProperty when switching between TabBar items
src/Controls/src/Core/Shell/Shell.cs Sets QueryAttributesProperty when navigating between FlyoutItems or ShellGroupItems

var viewModel = new Issue13537ViewModel<Issue13537HomePage>();
this.BindingContext = viewModel;

var Label = new Label
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Variable name should follow C# naming conventions. Local variables should be in camelCase, not PascalCase. Change Label to label.

Copilot uses AI. Check for mistakes.
Text = "Navigate using PushAsync",
AutomationId = "PushAsyncButton",
HorizontalOptions =LayoutOptions.Center,
VerticalOptions=LayoutOptions.Center
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Missing space after =. Should be VerticalOptions = LayoutOptions.Center for consistency with the rest of the codebase.

Suggested change
VerticalOptions=LayoutOptions.Center
VerticalOptions = LayoutOptions.Center

Copilot uses AI. Check for mistakes.
Comment on lines 90 to 95
var Parameter = new Dictionary<string, object>
{
{ $"Parameter From {Shell.Current.CurrentPage.Title} Page", $"to New Page" },

};
Shell.Current.GoToAsync("NewPage",parameters:Parameter);
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Variable name should follow C# naming conventions. Local variables should be in camelCase, not PascalCase. Change Parameter to parameter.

Suggested change
var Parameter = new Dictionary<string, object>
{
{ $"Parameter From {Shell.Current.CurrentPage.Title} Page", $"to New Page" },
};
Shell.Current.GoToAsync("NewPage",parameters:Parameter);
var parameter = new Dictionary<string, object>
{
{ $"Parameter From {Shell.Current.CurrentPage.Title} Page", $"to New Page" },
};
Shell.Current.GoToAsync("NewPage", parameters: parameter);

Copilot uses AI. Check for mistakes.
shell.UpdateCurrentState(ShellNavigationSource.ShellSectionChanged);
}

//For TabBarItems itemchanged will fall in ShellItem class , we need to set the QueryAttributesProperty here
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The comment "For TabBarItems itemchanged will fall in ShellItem class" has a grammatical issue. Should be: "For TabBar items, the item changed event will fall into the ShellItem class" or "For TabBar items, item changes are handled in the ShellItem class".

Suggested change
//For TabBarItems itemchanged will fall in ShellItem class , we need to set the QueryAttributesProperty here
// For TabBar items, the item changed event will fall into the ShellItem class, so we need to set the QueryAttributesProperty here.

Copilot uses AI. Check for mistakes.
}

#if TEST_FAILS_ON_CATALYST
//App.TapBackArrow doesnot actually tab the back arrow button instead it taps the first tab element on the screen as both have the same access identifier.
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The typo "tab" should be "tap" in the comment. "Doesnot" should be two words: "does not".

Suggested change
//App.TapBackArrow doesnot actually tab the back arrow button instead it taps the first tab element on the screen as both have the same access identifier.
//App.TapBackArrow does not actually tap the back arrow button; instead, it taps the first tab element on the screen as both have the same access identifier.

Copilot uses AI. Check for mistakes.
var viewModel = new Issue13537ViewModel<Issue13537FavoritePage>();
this.BindingContext = viewModel;

var Label = new Label
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Variable name should follow C# naming conventions. Local variables should be in camelCase, not PascalCase. Change Label to label.

Copilot uses AI. Check for mistakes.
{ $"Parameter From {Shell.Current.CurrentPage.Title} Page", $"to New Page" },

};
Shell.Current.GoToAsync("NewPage",parameters:Parameter);
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Missing space after parameters:. Should be parameters: Parameter for consistency with C# formatting conventions.

Suggested change
Shell.Current.GoToAsync("NewPage",parameters:Parameter);
Shell.Current.GoToAsync("NewPage", parameters: Parameter);

Copilot uses AI. Check for mistakes.
{
var mergedData = MergeData(element, filteredQuery, isPopping);

//if we are pop or navigating back, we need to apply the query attributes to the ShellContent
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The comment on line 315 says "if we are pop or navigating back", but the condition on line 316 only checks isPopping. The comment should be more precise: "if we are popping, we need to apply the query attributes to the ShellContent" or the condition should be updated if it's intended to handle other navigation-back scenarios.

Suggested change
//if we are pop or navigating back, we need to apply the query attributes to the ShellContent
//if we are popping, we need to apply the query attributes to the ShellContent

Copilot uses AI. Check for mistakes.
return;
}

if( query.Count > 0)
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation: this line has extra leading spaces. Should align with the surrounding code using consistent tab indentation.

Suggested change
if( query.Count > 0)
if( query.Count > 0)

Copilot uses AI. Check for mistakes.
return;
}

if( query.Count > 0)
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Missing space after if keyword. Should be if (query.Count > 0) for consistency with C# formatting conventions.

Suggested change
if( query.Count > 0)
if (query.Count > 0)

Copilot uses AI. Check for mistakes.
@PureWeen PureWeen changed the base branch from main to inflight/current December 4, 2025 16:08
@PureWeen
Copy link
Member

PureWeen commented Dec 4, 2025

/rebase

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
@PureWeen PureWeen merged commit 3d43ce9 into inflight/current Dec 4, 2025
5 checks passed
@PureWeen PureWeen deleted the pr-25663 branch December 4, 2025 16:15
github-actions bot pushed a commit that referenced this pull request Dec 5, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
PureWeen pushed a commit that referenced this pull request Dec 8, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
PureWeen pushed a commit that referenced this pull request Dec 10, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
PureWeen pushed a commit that referenced this pull request Dec 16, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
github-actions bot pushed a commit that referenced this pull request Dec 22, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
PureWeen pushed a commit that referenced this pull request Dec 22, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
github-actions bot pushed a commit that referenced this pull request Dec 24, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
PureWeen pushed a commit that referenced this pull request Dec 26, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
github-actions bot pushed a commit that referenced this pull request Dec 27, 2025
…tes (#33006)

Added unit tests to validate the fix for issues #13537 and #28453:

- TabBarNavigationSetsQueryAttributesProperty: Verifies QueryAttributesProperty is set when switching tabs
- TabBarNavigationWithGoToAsyncSetsQueryAttributesProperty: Verifies GoToAsync navigation sets property
- FlyoutItemNavigationSetsQueryAttributesProperty: Verifies FlyoutItem navigation triggers ApplyQueryAttributes
- NavigatingBackToTabSetsQueryAttributesProperty: Verifies navigating back to a tab sets property
- PopNavigationTriggersApplyQueryAttributes: Verifies pop navigation restores parameters
- ShellSectionChangedSetsQueryAttributesProperty: Verifies ShellSection changes trigger ApplyQueryAttributes

These tests ensure IQueryAttributable.ApplyQueryAttributes is called for all Shell navigation types.
PureWeen added a commit that referenced this pull request Dec 29, 2025
## CollectionView
- Fixed the NRE in CarouselViewController on iOS 15.5 & 16.4 by
@Ahamed-Ali in #30838
  <details>
  <summary>🔧 Fixes</summary>

- [NRE in CarouselViewController on iOS 15.5 &
16.4](#28557)
  </details>

- [iOS, macOS] Fixed CollectionView group header size changes with
ItemSizingStrategy by @NanthiniMahalingam in
#33161
  <details>
  <summary>🔧 Fixes</summary>

- [[NET 10] I6_Grouping - Grouping_with_variable_sized_items changing
the 'ItemSizingStrategy' also changes the header
size.](#33130)
  </details>

## Flyout
- Add unit tests for TabBar and FlyoutItem navigation
ApplyQueryAttributes (#25663) by @StephaneDelcroix in
#33006

## Flyoutpage
- Fixed the FlyoutPage.Flyout Disappearing When Maximizing the Window on
Mac Platform by @NanthiniMahalingam in
#26701
  <details>
  <summary>🔧 Fixes</summary>

- [FlyoutPage.Flyout - navigation corrupted when running om mac , on
window ok](#22719)
  </details>

## Mediapicker
- [Windows] Fix for PickPhotosAsync throws exception if image is
modified by @HarishwaranVijayakumar in
#32952
  <details>
  <summary>🔧 Fixes</summary>

- [PickPhotosAsync throws exception if image is
modified.](#32408)
  </details>

## Navigation
- Fix for TabBar Navigation does not invoke its
IQueryAttributable.ApplyQueryAttributes(query) by @SuthiYuvaraj in
#25663
  <details>
  <summary>🔧 Fixes</summary>

- [Tabs defined in AppShell.xaml does not invoke its view model's
IQueryAttributable.ApplyQueryAttributes(query)
implementaion](#13537)
- [`ShellContent` routes do not call
`ApplyQueryAttributes`](#28453)
  </details>

## ScrollView
- Fix ScrollToPosition.Center behavior in ScrollView on iOS and
MacCatalyst by @devanathan-vaithiyanathan in
#26825
  <details>
  <summary>🔧 Fixes</summary>

- [ScrollToPosition.Center Centers the First Item too in iOS and
Catalyst](#26760)
- [On iOS - ScrollView.ScrollToAsync Element,
ScrollToPosition.MakeVisible shifts view to the right, instead of just
scrolling vertically](#28965)
  </details>

## Searchbar
- [iOS, Mac, Windows] Fixed CharacterSpacing for SearchBar text and
placeholder text by @Dhivya-SF4094 in
#30407
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Mac, Windows] SearchBar CharacterSpacing property is not
working as expected](#30366)
  </details>

## Shell
- Update logic for large title display mode on iOS - shell by @kubaflo
in #33039

## TitleView
- [iOS] Fixed memory leak with PopToRootAsync when using TitleView by
@Vignesh-SF3580 in #28547
  <details>
  <summary>🔧 Fixes</summary>

- [NavigationPage.TitleView causes memory leak with
PopToRootAsync](#28201)
  </details>

## Xaml
- [C] Fix binding to interface-inherited properties like
IReadOnlyList<T>.Count by @StephaneDelcroix in
#32912
  <details>
  <summary>🔧 Fixes</summary>

- [Compiled Binding to Array.Count provides no
result](#13872)
  </details>

- Fix #31939: CommandParameter TemplateBinding lost during reparenting
by @StephaneDelcroix in #32961
  <details>
  <summary>🔧 Fixes</summary>

- [CommandParameter TemplateBinding Lost During ControlTemplate
Reparenting](#31939)
  </details>


<details>
<summary>🧪 Testing (4)</summary>

- [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate
by @TamilarasanSF4853 in #33257
- [Testing] Re-saved ShouldFlyoutBeVisibleAfterMaximizingWindow test
case images in PR 33185 - [12/22/2025] Candidate by @TamilarasanSF4853
in #33271
- [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate
- 2 by @TamilarasanSF4853 in #33299
- [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate
- 3 by @TamilarasanSF4853 in #33311

</details>

<details>
<summary>📦 Other (2)</summary>

- [XSG][BindingSourceGen] Add support for RelayCommand to compiled
bindings by @simonrozsival via @Copilot in
#32954
  <details>
  <summary>🔧 Fixes</summary>

  - [Issue #25818](#25818)
  </details>
- Revert "Update logic for large title display mode on iOS - shell
(#33039)" in cff7f35

</details>
**Full Changelog**:
main...inflight/candidate
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants