-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Fabric LA] Fix maybeDropAncestors
condition.
#6663
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
[Fabric LA] Fix maybeDropAncestors
condition.
#6663
Conversation
maybeDropAncestors
condition.
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.
Smart 👍
Just to be sure if I understand correctly - We can simply rely on checking the count of children since they are detached before the parent, correct?
@piaskowyk We maintain the children count by observing mutations. We can remove the node only if there are no children left, as that means that all animations in the subtree have finished. The previous version was using the |
## Summary In the `maybeDropAncestors` function we can remove the view if it has no remaining animating views. Let's say we have nested exiting animations: ```mermaid flowchart TD A((A: EXITING)) B((B: EXITING)) C((C: WAITING)) D((D: WAITING)) E((E: WAITING)) A --> B A --> C A --> D A --> E ``` In the current implementation in this case if the animation in `B` ended before `A`, we would visit `A` in `maybeDropAncestors` and decided to remove `A`, even though it still has some waiting children. Then `A` would be added to the view recycling pool while still having children. This would cause us to see some zombie views when the view is reused. I changed the `maybeDropAncestors` condition to check the size of the `children` list. I also removed `node->animatedChildren` as I think it is no longer necessary. Fixes #6644 ## Test plan Chceck `[LA] View recycling` example, if there are no zombie views in the `WheelPicker` component.
## Summary In the `maybeDropAncestors` function we can remove the view if it has no remaining animating views. Let's say we have nested exiting animations: ```mermaid flowchart TD A((A: EXITING)) B((B: EXITING)) C((C: WAITING)) D((D: WAITING)) E((E: WAITING)) A --> B A --> C A --> D A --> E ``` In the current implementation in this case if the animation in `B` ended before `A`, we would visit `A` in `maybeDropAncestors` and decided to remove `A`, even though it still has some waiting children. Then `A` would be added to the view recycling pool while still having children. This would cause us to see some zombie views when the view is reused. I changed the `maybeDropAncestors` condition to check the size of the `children` list. I also removed `node->animatedChildren` as I think it is no longer necessary. Fixes #6644 ## Test plan Chceck `[LA] View recycling` example, if there are no zombie views in the `WheelPicker` component.
Summary
In the
maybeDropAncestors
function we can remove the view if it has no remaining animating views. Let's say we have nested exiting animations:In the current implementation in this case if the animation in
B
ended beforeA
, we would visitA
inmaybeDropAncestors
and decided to removeA
, even though it still has some waiting children. ThenA
would be added to the view recycling pool while still having children. This would cause us to see some zombie views when the view is reused.I changed the
maybeDropAncestors
condition to check the size of thechildren
list. I also removednode->animatedChildren
as I think it is no longer necessary.Fixes #6644
Test plan
Chceck
[LA] View recycling
example, if there are no zombie views in theWheelPicker
component.