Repository navigation
Conversation
|
Adding |
|
Is #97166 (comment) really blocking us from landing this PR? Seems pretty harmless |
|
It isn't a severe API break, it only breaks some tests, so should I really go through all the process outlined in the breaking change policy? https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes This seems a bit excessive, given that there's nothing to actually migrate here, after an opt-in is removed. |
ac85d98 to
b292d0c
Compare
b292d0c to
fdc6bc0
Compare
How will folks know to migrate without guidance? :) There is a lot here I'd like to look at closely, I don't recall the specific failures that caused it to be reverted before. I'll be able to take a close look at this tomorrow. Nice to see you back! |
Piinks
left a comment
There was a problem hiding this comment.
I refreshed my memory on this. At the time, the customers affected looked like simple fixes, but reading through this I am not really sure how to migrate them. Can you advise?
|
|
||
| // TODO(nt4f04uNd): remove this test, because it is artificial, in favor of a real one. | ||
| // Scroll simulations surely should be allowed to modify the speed they receive in whatever way they want. | ||
| // The proper fix for the original bug https://github.com/flutter/flutter/issues/24715 |
There was a problem hiding this comment.
This issue is closed, is it not actually fixed based on this comment?
| // Changing velocity for time 0 may cause a sudden, unwanted damping/speedup effect | ||
| expect(bounce.createBallisticSimulation(position, 1000)!.dx(0), moreOrLessEquals(1000)); | ||
| expect(clamp.createBallisticSimulation(position, 1000)!.dx(0), moreOrLessEquals(1000)); | ||
| expect(page.createBallisticSimulation(position, 1000)!.dx(0), moreOrLessEquals(1000)); |
There was a problem hiding this comment.
I still do not understand these changes, why are bouncing and clamping scroll physics affected by this change?
Why can we not validate the page physics here anymore? What happens in this case with this change in page physics? What will the experience be for a user if this ballistic simulation is created?
| // velocity depends on a ratio of velocity / pageDelta, and because they are not affected by | ||
| // https://github.com/flutter/flutter/issues/11599 | ||
|
|
||
| // TODO(nt4f04uNd): remove this test, because it is artificial, in favor of a real one. |
There was a problem hiding this comment.
I don't follow this TODO, what is the action item or issue that needs to be revisited here?
| this.physics, | ||
| this.pageSnappingPhysics, |
There was a problem hiding this comment.
What happens if someone provides physics?
|
|
||
| /// Controls how pages should snap to view boundaries. | ||
| /// | ||
| /// Prior being used, ombined with other scroll physics |
There was a problem hiding this comment.
Isn't this something the user could provide to physics?
| /// | ||
| /// Enabling this will use scroll physics which are more close to native | ||
| /// Android and iOS implementations. | ||
| final bool useNewPhysics; |
There was a problem hiding this comment.
How should customers migrate? Do they need to provide a custom scroll physics to every Tab or Page view? How do we migrate them off of it?
| /// * [ScrollPhysics], the base class which defines the API for scrolling | ||
| /// physics. | ||
| /// * [PageView.physics], which can override the physics used by a page view. | ||
| /// * [PageScrollSimulation], which implements Android page view scroll physics, and |
There was a problem hiding this comment.
Flutter does not just run on Android. Does this adapt to the platform?
| return super.createBallisticSimulation(position, velocity); | ||
| } | ||
| final Tolerance tolerance = this.tolerance; | ||
| final double target = getTargetPixels(position, tolerance, velocity); |
There was a problem hiding this comment.
I can see this is why this method has been made public, but I am not sure what the motivation is since it is just in a test.
|
Thank you for your review, this is a very valueable feedback! |
No worries at all @nt4f04uNd. I am going to close this for now so it is off our review queue. When you are ready to work on it again, please feel free to reopen it. I'll be here ready to review it. :) |
|
@nt4f04uNd |
Fixes #38357
So, this is a new reland for a #95423
Previous reland #97166
Old physics
before.mp4
ios_old.mov
New physics
after.mp4
ios_new.mov
Opt-in
This change has been proven to be breaking for the customer tests.
To opt in, users should provide
pageSnappingPhysics: const PageScrollPhysics(useNewPhysics: true)If tests are broken, this is likely because of the change in
minFlingVelocityorminFlingDistance.Previous values are respectively
50.0and18.0.New values are
400.0and25.0.To migrate the tests, one should change the drag velocity/distance to match the new minimum values.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.