Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

When popping multiple pages remove middle pages first #12331

Merged
merged 7 commits into from
Oct 9, 2020

Conversation

PureWeen
Copy link
Contributor

@PureWeen PureWeen commented Oct 1, 2020

Description of Change

This PR adds a number of optimization for interpreting a new route and trying to minimize the amount of operations that happen

  • When popping multiple pages on Shell via GotoAsync("../..") just remove the middle pages before popping the currently visible page. This way OnAppearing won't fire on pages being removed and they won't appear and then disappear
  • If you're at /page1/page2' and then you want to navigate to /page1/page3' it will now first push page3 and then remove page2 so that you never see page 1
  • If you're at /page1/page2/page3 and you navigate to `/page1/page3' it'll just remove page2

Platforms Affected

  • Core/XAML (all platforms)
  • iOS
  • Android
  • UWP

Behavioral/Visual Changes

Users will no longer see the middle when the user is requesting that multiple pages pop. The middle pages will no longer throw "OnAppearing" and then "OnDisappearing" as they are popped

Testing Procedure

  • unit test included

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@PureWeen PureWeen removed the request for review from StephaneDelcroix October 2, 2020 21:33
Copy link
Contributor

@pictos pictos left a comment

Choose a reason for hiding this comment

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

Test on my side and the last commit fixed the UWP issues❣

@samhouts samhouts added the p/UWP label Oct 7, 2020
@PureWeen
Copy link
Contributor Author

PureWeen commented Oct 9, 2020

Test failures unrelated


// populate global routes and build modal stacks

// If the currentNavStack is larger than _navStack then we have modal pages
bool weveGoneTotalModal = currentNavStack.Count > _navStack.Count;
Copy link
Contributor

Choose a reason for hiding this comment

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

😂

@rachelkang rachelkang merged commit a695fab into 5.0.0 Oct 9, 2020
@rachelkang rachelkang deleted the remove_middle_pages_before_pop branch October 9, 2020 20:49
@samhouts samhouts added this to the 5.0.0 milestone Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants