-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix restart ballistic animation while child size change #96512
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Piinks
left a comment
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.
This looks like a great PR, thank you for taking a crack at solving these issues! I should be able to give it a thorough review next week, in the meantime, can you take a look at the failing tests? Is this intended to be a breaking change?
I am tring to fix the test case. |
…tion # Conflicts: # packages/flutter/lib/src/widgets/scroll_simulation.dart
Piinks
left a comment
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.
Thanks for working on this @MxSoul, it is not a trivial thing to do as a first-time contributor! (Welcome too! 🎉)
As it currently stands, I am not sure if this implementation will work. Although, I may not be following it fully. Have you considered writing a design document? We usually write up large scale changes in a document so that we can review and give feedback on the concept. It also helps in discussing potential breaks, migration and testing plans, the template is available here: https://docs.google.com/document/d/1SFRO8U2toOlAaZ38dsuEU7Wm5fn41wvBCWKiwADqfmw/edit?usp=sharing
If this is a breaking change, the process is documented in our wiki: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
2. change another way to get scrollPosition
687817f to
cea05c0
Compare
@Piinks Thanks for your review. |
|
@Piinks Hi~ I write a doc. Please take a look when you have time. |
|
Hi @Hixie & @nt4f04uNd , (*Piinks is out of office right now.) |
|
@goderbauer Looking forward to your review |
goderbauer
left a comment
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.
| delegate.goBallistic(velocity); | ||
| final ScrollPosition position = delegate.scrollPosition; | ||
| final dynamic simulation = _simulation; | ||
| if (position != null && simulation is ScrollSimulationMixin){ |
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.
nit: space between ) and {
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 is ScrollSimulationMixin is also iffy as was already called out in the previous review, I think?
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.
This has not been addressed yet, and cannot be accepted in its current state.
|
@MxSoul would you like to continue working on this change? |
Hi, @Piinks. Welcome back. Maybe We could discuss the implementation first. Is there anything in the design document that is still unclear? I can add some explanation. (By the way, this patch is use in our app's(Xianyu) search result page and over 7 million user used it every day. So far, everything seems to be fine. No one has reported any bugs.) |
|
It looks like some of the comments in previous code reviews are unaddressed. |
|
Also, your design document is not open for commenting. Can you update the permissions to allow feedback? |
OK~ I update the permissions. |
This is probably because I fixed some of the issues mentioned in the comments and some of the code was removed |
|
Gold has detected about 24 new digest(s) on patchset 13. |
|
Gold has detected about 30 new digest(s) on patchset 14. |
|
Gold has detected about 32 new digest(s) on patchset 15. |
|
I addressed comments and add test. But it make some test break. I will fix it tomorrow |
Piinks
left a comment
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.
Thanks for the update, here are just some thoughts for when you return to this. There are still a lot of test failures and analysis issues to resolve before we can review further.
607c5fc to
3dbd8ea
Compare
|
Hi @Piinks, We may all have some questions to ask each other, because of the time zone, the use of issue communication is a bit inefficient. Could you create a subsection in discord and we use it to communicate. My discord id is MxSoul#7735 If this time is not suitable, you can leave a message and tell me a time when you are free. (I am at GMT+8). |
…tion # Conflicts: # packages/flutter/lib/src/widgets/scroll_simulation.dart
|
Hey @MxSoul please do feel free to share your questions. I can answer them asynchronously if we are not online at the same time. The #hackers-framework channel is probably a good place to chat, you can start a thread there if you like. :) |
|
(Triage) closing this one in favor of #100133. |
Hi, @Piinks
If child size change, performLayout will be call. And goBallistic will be called during performLayout. It will restart ballistic animation. Restarting the animation will cause the ballistic to be inconsistent with the expected curve.
I don't think the animation should be restarted during a ballistic even if its boundaries change. Maybe we should update related variables instead.
【I already do some test. I will post these data later】
Fix #11599 & #24715
This issue #83632 is also caused by it.
So maybe I will reland the #77497 after this PR merge.
cc @knopp @nt4f04uNd
The solution is referenced knopp's comment. #24715 (comment)
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.