-
Notifications
You must be signed in to change notification settings - Fork 28.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update collapsible when children change
- Loading branch information
1 parent
9b83eb6
commit a8dd7f6
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a8dd7f6
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.
@connor4312 With this change, the index tree started making decisions about the collapsible state, given the number of children an element may have. But an element might still want to be collapsible and just have zero children... This is the cause for the twistie to disappear in #199441 (comment).
Do you still remember what made you make this change here deep down? I'd love to revert but keep whatever behavior you intended in the first place, probably around the test tree.
a8dd7f6
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.
I believe this was because the parent of a tree element is generally, with the diffIdentityProvider, no longer re-rendered when its children are updated, so my guess is it was leaving twisties where they should no longer have been left.
...but I also don't observe any negative effects when commenting out this line of code in the test explorer which uses the diffIdentityProvider heavily 🤷 Feel free to revert, we have two months to find any resulting issues
a8dd7f6
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.
I've reverted it: #201789
Related to: #199441 (comment)
Let's keep an eye on the test explorer. 👌
a8dd7f6
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.
Ah, this caused #204805. Will try for a fix...
a8dd7f6
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.
I think the fix for that is just to have the test code update the collapsible state of parent items when they add children. This is a weird case and it seems like trees should 'just handle' that case but I see the argument that the responsibility of collapsibility should lie solely with the consumer