-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Allows page removal that contains Localhistoryentry #134757
Conversation
@@ -1832,14 +1832,6 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T | |||
]; | |||
} | |||
|
|||
@override |
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.
looking at the code, it looks like popscope/willpopscope are going through Navigator.maybePop mechanism and are still allowed to be popped through Navigator.pop. So it is not handle pop internally.
@@ -3268,6 +3272,20 @@ class _RouteEntry extends RouteTransitionRecord { | |||
'This route cannot be marked for pop. Either a decision has already been ' | |||
'made or it does not require an explicit decision on how to transition out.', | |||
); | |||
// Remove state that prevents a pop, e.g. LocalHistoryEntry[s]. | |||
int attempt = 0; | |||
while (route.willHandlePopInternally) { |
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.
All the other solutions I can think of would require adding new API and break other people, or messing with Navigator/Route class.
}(), | ||
'Attempted to pop $route $kDebugPopAttemptLimit times, but still failed', | ||
); | ||
final bool popResult = route.didPop(result); |
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.
Wondering why we do this in the markForPop
and not in the actual handlePop
where the route is actually popped?
Also, should we be asserting somewhere that handlePop
must actually return true if we're removing a page? This change basically disallows that a page-based route can veto its return, right?
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.
Wondering if this can lead to strange animations: It will basically run route-internal pop animations (e.g. to close drawers) while the regular route pop-animation runs, no?
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.
Would it make sense to actually add new API to the route for this to tell it: "Hey, you have to go away, if you want to do some internal pops, do them, but after that you have to go away". This would basically leave the decision if it wants to pop drawers in an animated way while the whole route is popped to the route itself.
I would image that in most case where you remove a page with an open drawer you don't really want to run the drawer close animation while the page goes away?
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.
handlePop
handlePop can be called as a result of various reason, either a navigator.pop or page update. If we handle it there, I would need to add a flag and drill it down from markForPop to handlePop which is not trivial.
should we be asserting somewhere that handlePop must actually return true
It is possible the handlePop is a result of Navigator.pop on a page-based route. so we can't assert it return true.
It will basically run route-internal pop animations (e.g. to close drawers) while the regular route pop-animation runs.
I don't have a counter argument to this, but if they want to do something special (if they really care) they should do it before they update the Navigator.pages.
Would it make sense to actually add new API to the route for this to tell it: "Hey, you have to go away, if you want to do some internal pops, do them, but after that you have to go away"
I have thought about adding something like void cleanUpInternalPopHandler()
and asserts willHandlePopInternally to return false after that, but I figure this will be another breaking change to people and will increase complexity of Route class which is already very confusing with all the canpop, popDisposition, willhandlePop...etc.
I figure the current solution is a good enough solution that will likely solve most if not all use cases. Prior to this change, the page update will just be broken. So this will only be an improvement.
If they really want to customize how route is forced to be removed, we can always add the new API later and remove this while loop didPop.
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.
LGTM
flutter/flutter@58ba6c2...72b69f9 2023-09-15 polinach@google.com Date picker dialog state should dispose members. (flutter/flutter#134804) 2023-09-15 engine-flutter-autoroll@skia.org Roll Packages from 275b76c to bc8c2f2 (7 revisions) (flutter/flutter#134823) 2023-09-15 leroux_bruno@yahoo.fr Fix navigation rail hover misplaced when direction is RTL and extended is true (flutter/flutter#134815) 2023-09-15 k_hayashi@yumemi.co.jp Applied the logo to the Discord badge. (flutter/flutter#134339) 2023-09-15 sokolovskyi.konstantin@gmail.com Fix memory leak in ListWheelScrollView (flutter/flutter#134732) 2023-09-15 zanderso@users.noreply.github.com Move two tests on Pixel 7 from staging to prod (flutter/flutter#134784) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 683bca53d4d7 to 45bc4307cda3 (2 revisions) (flutter/flutter#134789) 2023-09-14 pavel.mazhnik@gmail.com [web] provide serviceWorkerVersion to the getNewServiceWorker function (flutter/flutter#131240) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3a3a2807c3b6 to 683bca53d4d7 (3 revisions) (flutter/flutter#134778) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 035932d64017 to 3a3a2807c3b6 (5 revisions) (flutter/flutter#134769) 2023-09-14 47866232+chunhtai@users.noreply.github.com Allows page removal that contains Localhistoryentry (flutter/flutter#134757) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from e0b5b6c4eb76 to 035932d64017 (2 revisions) (flutter/flutter#134763) 2023-09-14 sokolovskyi.konstantin@gmail.com Cover more test/widgets tests with leak tracking #3 (flutter/flutter#134576) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2cd34d23c1a2 to e0b5b6c4eb76 (2 revisions) (flutter/flutter#134755) 2023-09-14 15619084+vashworth@users.noreply.github.com Set xcode version to older compatible version for microbenchmarks_ios_xcode_debug test (flutter/flutter#134693) 2023-09-14 82763757+NobodyForNothing@users.noreply.github.com Cover some Services tests with leak tracing (flutter/flutter#134381) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4160ebacdae2 to 2cd34d23c1a2 (18 revisions) (flutter/flutter#134749) 2023-09-14 github@alexv525.com � Setup color tween for `RefreshIndicator` in a better way (flutter/flutter#134492) 2023-09-14 leroux_bruno@yahoo.fr Fix NavigationRail hover misplaced when using large icons (flutter/flutter#134719) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from cd90cc8469fb to 4160ebacdae2 (5 revisions) (flutter/flutter#134695) 2023-09-14 30870216+gaaclarke@users.noreply.github.com Added a devicelab test for vulkan validation layers (flutter/flutter#134685) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/flutter@58ba6c2...72b69f9 2023-09-15 polinach@google.com Date picker dialog state should dispose members. (flutter/flutter#134804) 2023-09-15 engine-flutter-autoroll@skia.org Roll Packages from 275b76c to bc8c2f2 (7 revisions) (flutter/flutter#134823) 2023-09-15 leroux_bruno@yahoo.fr Fix navigation rail hover misplaced when direction is RTL and extended is true (flutter/flutter#134815) 2023-09-15 k_hayashi@yumemi.co.jp Applied the logo to the Discord badge. (flutter/flutter#134339) 2023-09-15 sokolovskyi.konstantin@gmail.com Fix memory leak in ListWheelScrollView (flutter/flutter#134732) 2023-09-15 zanderso@users.noreply.github.com Move two tests on Pixel 7 from staging to prod (flutter/flutter#134784) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 683bca53d4d7 to 45bc4307cda3 (2 revisions) (flutter/flutter#134789) 2023-09-14 pavel.mazhnik@gmail.com [web] provide serviceWorkerVersion to the getNewServiceWorker function (flutter/flutter#131240) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3a3a2807c3b6 to 683bca53d4d7 (3 revisions) (flutter/flutter#134778) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 035932d64017 to 3a3a2807c3b6 (5 revisions) (flutter/flutter#134769) 2023-09-14 47866232+chunhtai@users.noreply.github.com Allows page removal that contains Localhistoryentry (flutter/flutter#134757) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from e0b5b6c4eb76 to 035932d64017 (2 revisions) (flutter/flutter#134763) 2023-09-14 sokolovskyi.konstantin@gmail.com Cover more test/widgets tests with leak tracking flutter#3 (flutter/flutter#134576) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2cd34d23c1a2 to e0b5b6c4eb76 (2 revisions) (flutter/flutter#134755) 2023-09-14 15619084+vashworth@users.noreply.github.com Set xcode version to older compatible version for microbenchmarks_ios_xcode_debug test (flutter/flutter#134693) 2023-09-14 82763757+NobodyForNothing@users.noreply.github.com Cover some Services tests with leak tracing (flutter/flutter#134381) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4160ebacdae2 to 2cd34d23c1a2 (18 revisions) (flutter/flutter#134749) 2023-09-14 github@alexv525.com � Setup color tween for `RefreshIndicator` in a better way (flutter/flutter#134492) 2023-09-14 leroux_bruno@yahoo.fr Fix NavigationRail hover misplaced when using large icons (flutter/flutter#134719) 2023-09-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from cd90cc8469fb to 4160ebacdae2 (5 revisions) (flutter/flutter#134695) 2023-09-14 30870216+gaaclarke@users.noreply.github.com Added a devicelab test for vulkan validation layers (flutter/flutter#134685) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
fixes #97836
fixes #134752
fixes #118645
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.