-
Notifications
You must be signed in to change notification settings - Fork 354
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
Use objectAt to fetch rowValues (cause meta alloc) #727
Conversation
88b1fe3
to
ea624c6
Compare
Although the `selection` set contains raw values only, some other code (like the summing of selected counts for group selection state in `collapse-tree.js`) expect that all items in the `selection` set have a meta allocated. The non-meta-allocated rows were added where the bare `children` property of a rowValue was being iterated. Instead with this change the `tree` is referenced for pulling out the children, meaning the meta cache system is exercised and metas allocated for any selected row.
ea624c6
to
a22c73e
Compare
This looks good to me. I am working up a failing test case that we can use to ensure this fixes the specific scenario I described in #726 (comment)
I believe this is still covered, but it's worth keeping in mind that, in addition to a user interactively selecting rows, part of the ET API is that the |
@bantic what I mean is that the actual variable, the |
Added a failing test in #731 and I've confirmed that rebasing it onto this branch fixes that test. I'm also going to take a stab at a test to cover this behavior that we think was buggy before:
|
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.
Looks good! @mixonic and I reviewed carefully in person and we believe this fixes the known issue.
@bantic and I reviewed each of the checked off items above to solidify our understanding here. As followup he intends to:
There is also low-hanging performance work that could be done after this change. Our goal in this patch was just to make it work, but the implementation is a bit naive. |
A WIP to solve #726
Although the
selection
set contains raw values only, some other code (like the summing of selected counts for group selection state incollapse-tree.js
) expect that all items in theselection
set have a meta allocated.The non-meta-allocated rows were added where the bare
children
property of a rowValue was being iterated. Instead with this change thetree
is referenced for pulling out the children, meaning the meta cache system is exercised and metas allocated for any selected row.Open questions:
{ name: 0, children: [{ name: 1, children: [{ name: 2 }, { name: 3 }] }, { name: 4, children: [{ name: 5 }] }] }
,0
is selected, and you toggle2
then5
will never be explicitly selected.isSelected
node in the parent tree, then walk tree nodes until the depth becomes>=
the depth of that parent. That would then include all children of children.selection
the Set is actually internal, and there is no reason we can't store an array in that with the meta for each value (or have a maintained-in-parallel Set), and that would avoid the several hits to the meta cache in this function.