Repository navigation
fix(maui): make RoutedViewHost match the router stack after a reset - #4569
Merged
Merged
Conversation
- Remove pages beneath the current page that the router no longer holds. - Build missing pages in router order instead of duplicating the root. - Add tests for NavigateAndReset and for syncing a three-page stack.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4569 +/- ##
==========================================
- Coverage 94.93% 94.93% -0.01%
==========================================
Files 184 184
Lines 6086 6085 -1
Branches 728 729 +1
==========================================
- Hits 5778 5777 -1
Misses 308 308 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
The MAUI
RoutedViewHostnow makes its page stack matchRouter.NavigationStackexactly.NavigateAndReset, the pages beneath the new page are removed, so no back button appears.Why
SyncNavigationStacksAsyncalways keptNavigationStack[0]as its root. AfterNavigateAndResetfrom a login page, the router held only the home view model, but the page stack stayed[Login, Home]. The sync also inserted pages forRouter[0..n-2]before a root page that was alreadyRouter[0].Refs #4220 (discussion)
Breaking changes
None
How this was verified
NavigateAndReset_RemovesThePagesBeneathTheNewPageandSyncNavigationStacks_EmptyPageStack_BuildsPagesInRouterOrder. Both fail onmainand pass with this change.dotnet testforReactiveUI.Maui.Testspasses on net10.0 and net11.0 (416 tests).Checklist