-
Notifications
You must be signed in to change notification settings - Fork 1.9k
December 1st, Inflight Candidate #32841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
376e6ea
[iOS] Add size update for Shell Popup Overlay after rotation (#15866)
cat0363 e267c6d
Remove OnDestroy override from ShellFragmentContainer (#32647)
kubaflo b2298c8
[iOS] RTL column mirroring in UICollectionView - fix (#32372)
kubaflo 7c3b087
Change TimeSelected event to handle nullable TimeSpan
breyed daa150e
Return stub IAlertManagerSubscription (#32646)
drasticactions 73c5fa9
[iOS] Fix for Shell Navigation Bar Remaining Visible After Navigating…
SyedAbdulAzeemSF4852 e2784e5
Fix for Page OnAppearing triggered twice when navigating via ShellIte…
SyedAbdulAzeemSF4852 67d89ef
moved PR-698 sample changes to MAUI
Vignesh-SF3580 6a31fc4
added base image from CI
LogishaSelvarajSF4525 e5f0b5f
added test fail on android attributes
LogishaSelvarajSF4525 5dfe561
update the sample from CV1 to CV2
LogishaSelvarajSF4525 54413c3
remove the snapshot from mac
LogishaSelvarajSF4525 b93b21a
added snapshot from CI
LogishaSelvarajSF4525 f3b6078
[Testing] Fixed Test case failure in PR 32841 - [12/01/2025] Candidat…
sheiksyedm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| #nullable enable | ||
| ~override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.ViewWillTransitionToSize(CoreGraphics.CGSize toSize, UIKit.IUIViewControllerTransitionCoordinator coordinator) -> void |
1 change: 1 addition & 0 deletions
1
src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| #nullable enable | ||
| ~override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.ViewWillTransitionToSize(CoreGraphics.CGSize toSize, UIKit.IUIViewControllerTransitionCoordinator coordinator) -> void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
src/Controls/tests/Core.UnitTests/ShellModalAppearingTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| using System.Threading.Tasks; | ||
| using Microsoft.Maui.Controls.Internals; | ||
| using Xunit; | ||
|
|
||
| namespace Microsoft.Maui.Controls.Core.UnitTests | ||
| { | ||
| public class ShellModalAppearingTests : ShellTestBase | ||
| { | ||
| [Fact] | ||
| public async Task ModalPageOnAppearingTriggeredOnceWithShellItemChangeToModal() | ||
| { | ||
| // Test the exact scenario from the issue: navigating from one ShellItem to another with a modal page | ||
| TestShell shell = new TestShell(); | ||
|
|
||
| Routing.RegisterRoute("ModalPage", typeof(ModalPage31584)); | ||
|
|
||
| var mainItem = CreateShellItem(shellItemRoute: "MainPage", shellSectionRoute: "MainSection", shellContentRoute: "MainContent"); | ||
| var homeItem = CreateShellItem(shellItemRoute: "Home", shellSectionRoute: "HomeSection", shellContentRoute: "HomeContent"); | ||
|
|
||
| shell.Items.Add(mainItem); | ||
| shell.Items.Add(homeItem); | ||
|
|
||
| // Start on MainPage | ||
| Assert.Equal(mainItem, shell.CurrentItem); | ||
|
|
||
| // Navigate to //Home/ModalPage (changes ShellItem AND pushes modal) | ||
| await shell.GoToAsync("//Home/ModalPage"); | ||
|
|
||
| // Verify we switched to Home ShellItem | ||
| Assert.Equal(homeItem, shell.CurrentItem); | ||
|
|
||
| // Get the modal page from the Home ShellItem's section | ||
| var homeSection = homeItem.Items[0]; | ||
| var modalPage = (homeSection as IShellSectionController).PresentedPage as ModalPage31584; | ||
|
|
||
| Assert.NotNull(modalPage); | ||
|
|
||
| // The bug would cause OnAppearing to be called twice: | ||
| // 1. When the modal is pushed to the new ShellItem | ||
| // 2. When the old ShellItem's section tries to send disappearing to it | ||
| // The fix ensures OnAppearing is only called once | ||
| Assert.Equal(1, modalPage.AppearingCount); | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task ModalPageDisappearingNotCalledByOldShellItemDuringSwitch() | ||
| { | ||
| // This test verifies the core fix: when switching ShellItems with a modal page, | ||
| // the old ShellItem's section should NOT call SendDisappearing on the modal page | ||
| // because the modal belongs to the new ShellItem, not the old one | ||
| TestShell shell = new TestShell(); | ||
|
|
||
| Routing.RegisterRoute("ModalPage", typeof(ModalPage31584)); | ||
|
|
||
| var mainItem = CreateShellItem(shellItemRoute: "MainPage", shellSectionRoute: "MainSection", shellContentRoute: "MainContent"); | ||
| var homeItem = CreateShellItem(shellItemRoute: "Home", shellSectionRoute: "HomeSection", shellContentRoute: "HomeContent"); | ||
|
|
||
| shell.Items.Add(mainItem); | ||
| shell.Items.Add(homeItem); | ||
|
|
||
| // Navigate to //Home/ModalPage | ||
| await shell.GoToAsync("//Home/ModalPage"); | ||
|
|
||
| var homeSection = homeItem.Items[0]; | ||
| var modalPage = (homeSection as IShellSectionController).PresentedPage as ModalPage31584; | ||
|
|
||
| Assert.NotNull(modalPage); | ||
|
|
||
| // The modal should have appeared once | ||
| Assert.Equal(1, modalPage.AppearingCount); | ||
|
|
||
| // And should not have disappeared (because it's still visible) | ||
| Assert.Equal(0, modalPage.DisappearingCount); | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task ModalPageLifecycleCorrectWithNormalModalPush() | ||
| { | ||
| // Verify that normal modal push/pop still works correctly after the fix | ||
| TestShell shell = new TestShell(); | ||
|
|
||
| Routing.RegisterRoute("ModalPage", typeof(ModalPage31584)); | ||
|
|
||
| shell.Items.Add(CreateShellItem(shellItemRoute: "MainPage", shellSectionRoute: "MainSection", shellContentRoute: "MainContent")); | ||
|
|
||
| // Normal modal navigation (no ShellItem change) | ||
| await shell.GoToAsync("ModalPage"); | ||
|
|
||
| var mainSection = shell.Items[0].Items[0]; | ||
| var modalPage = (mainSection as IShellSectionController).PresentedPage as ModalPage31584; | ||
|
|
||
| Assert.NotNull(modalPage); | ||
| Assert.Equal(1, modalPage.AppearingCount); | ||
| Assert.Equal(0, modalPage.DisappearingCount); | ||
|
|
||
| // Pop the modal | ||
| await shell.GoToAsync(".."); | ||
|
|
||
| // Modal should have disappeared once | ||
| Assert.Equal(1, modalPage.AppearingCount); | ||
| Assert.Equal(1, modalPage.DisappearingCount); | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task RapidShellItemSwitchingWithModal() | ||
| { | ||
| // Test rapidly switching between ShellItems with modals to ensure lifecycle stays correct | ||
| TestShell shell = new TestShell(); | ||
|
|
||
| Routing.RegisterRoute("ModalPage1", typeof(ModalPage31584)); | ||
| Routing.RegisterRoute("ModalPage2", typeof(ModalPage31584)); | ||
|
|
||
| shell.Items.Add(CreateShellItem(shellItemRoute: "Item1", shellSectionRoute: "Section1", shellContentRoute: "Content1")); | ||
| shell.Items.Add(CreateShellItem(shellItemRoute: "Item2", shellSectionRoute: "Section2", shellContentRoute: "Content2")); | ||
| shell.Items.Add(CreateShellItem(shellItemRoute: "Item3", shellSectionRoute: "Section3", shellContentRoute: "Content3")); | ||
|
|
||
| // Navigate to modal on Item2 | ||
| await shell.GoToAsync("//Item2/ModalPage1"); | ||
| var section2 = shell.Items[1].Items[0]; | ||
| var modal1 = (section2 as IShellSectionController).PresentedPage as ModalPage31584; | ||
|
|
||
| Assert.NotNull(modal1); | ||
| Assert.Equal(1, modal1.AppearingCount); | ||
|
|
||
| // Switch to Item3 with another modal | ||
| await shell.GoToAsync("//Item3/ModalPage2"); | ||
| var section3 = shell.Items[2].Items[0]; | ||
| var modal2 = (section3 as IShellSectionController).PresentedPage as ModalPage31584; | ||
|
|
||
| Assert.NotNull(modal2); | ||
| // Second modal should have appeared exactly once (the bug would cause it to appear twice) | ||
| Assert.Equal(1, modal2.AppearingCount); | ||
| Assert.Equal(0, modal2.DisappearingCount); | ||
| } | ||
|
|
||
| public class ModalPage31584 : ContentPage | ||
| { | ||
| public int AppearingCount { get; private set; } | ||
| public int DisappearingCount { get; private set; } | ||
|
|
||
| public ModalPage31584() | ||
| { | ||
| Shell.SetPresentationMode(this, PresentationMode.Modal); | ||
| } | ||
|
|
||
| protected override void OnAppearing() | ||
| { | ||
| base.OnAppearing(); | ||
| AppearingCount++; | ||
| } | ||
|
|
||
| protected override void OnDisappearing() | ||
| { | ||
| base.OnDisappearing(); | ||
| DisappearingCount++; | ||
| } | ||
| } | ||
|
|
||
| public ShellModalAppearingTests() | ||
| { | ||
| // Routes are already registered in the test methods as needed | ||
| } | ||
| } | ||
| } |
Binary file added
BIN
+36.8 KB
....Tests/snapshots/android/NavigationBarShouldRemainHiddenAfterNavigatingBack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.4 KB
....Tests/snapshots/android/VerticalGridCollectionViewLTRToRTLToggleShouldWork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.4 KB
...ts/snapshots/android/VerticalGridCollectionViewRTLColumnMirroringShouldWork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 105 additions & 0 deletions
105
src/Controls/tests/TestCases.HostApp/Issues/Issue15173.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 15173, "Shell Flyout overlay does not resize on device rotation", PlatformAffected.iOS)] | ||
| public class Issue15173 : TestShell | ||
| { | ||
| protected override void Init() | ||
| { | ||
| FlyoutBehavior = FlyoutBehavior.Flyout; | ||
| FlyoutBackgroundColor = Colors.White; | ||
| FlyoutBackdrop = new SolidColorBrush(Colors.Orange); | ||
|
|
||
| // Create flyout content | ||
| var flyoutContent = new VerticalStackLayout | ||
| { | ||
| Padding = new Thickness(20), | ||
| Spacing = 10, | ||
| BackgroundColor = Colors.LightGray, | ||
| Children = | ||
| { | ||
| new Label | ||
| { | ||
| Text = "Flyout Menu", | ||
| FontSize = 24, | ||
| FontAttributes = FontAttributes.Bold, | ||
| Margin = new Thickness(0, 20, 0, 10) | ||
| }, | ||
| new Button | ||
| { | ||
| Text = "Menu Item 1", | ||
| BackgroundColor = Colors.White, | ||
| TextColor = Colors.Black, | ||
| AutomationId = "MenuItem1" | ||
| }, | ||
| new Button | ||
| { | ||
| Text = "Menu Item 2", | ||
| BackgroundColor = Colors.White, | ||
| TextColor = Colors.Black, | ||
| AutomationId = "MenuItem2" | ||
| }, | ||
| new Button | ||
| { | ||
| Text = "Menu Item 3", | ||
| BackgroundColor = Colors.White, | ||
| TextColor = Colors.Black, | ||
| AutomationId = "MenuItem3" | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| // Set the flyout content using the property | ||
| FlyoutContentTemplate = new DataTemplate(() => flyoutContent); | ||
|
|
||
| // Create main content page | ||
| var mainPage = new ContentPage | ||
| { | ||
| BackgroundColor = Colors.White, | ||
| Content = new VerticalStackLayout | ||
| { | ||
| Padding = new Thickness(30), | ||
| Spacing = 20, | ||
| Children = | ||
| { | ||
| new Label | ||
| { | ||
| Text = "Shell Flyout Rotation Test", | ||
| FontSize = 24, | ||
| FontAttributes = FontAttributes.Bold, | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| TextColor = Colors.Black, | ||
| AutomationId = "PageTitle" | ||
| }, | ||
| new Label | ||
| { | ||
| Text = "Instructions:", | ||
| FontSize = 18, | ||
| FontAttributes = FontAttributes.Bold, | ||
| TextColor = Colors.Black, | ||
| Margin = new Thickness(0, 20, 0, 0) | ||
| }, | ||
| new Label | ||
| { | ||
| Text = "1. Open the flyout (hamburger menu)", | ||
| FontSize = 16, | ||
| TextColor = Colors.Black | ||
| }, | ||
| new Label | ||
| { | ||
| Text = "2. Rotate the device from portrait to landscape", | ||
| FontSize = 16, | ||
| TextColor = Colors.Black | ||
| }, | ||
| new Label | ||
| { | ||
| Text = "3. The overlay should cover the entire landscape screen", | ||
| FontSize = 16, | ||
| TextColor = Colors.Black | ||
| } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| AddContentPage(mainPage, "Home"); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
FlyoutContentTemplateproperty expects aDataTemplatethat returns aView, but this code returns the sameflyoutContentinstance each time the template is invoked. This creates a shared instance issue where the same view instance could be reused, potentially causing unexpected behavior.Consider using a lambda that creates a new instance:
FlyoutContentTemplate = new DataTemplate(() => new VerticalStackLayout { ... });