Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes two corner cases introduced by the coloring set algorithm that can cause the state of active filters and color to get way out of whack. (There is undefined and hard-to-interpret behavior whenever an incorrect action is dispatched for toggling filters, or for updating the coloring sets, as these two aspects of the state are tightly coupled.)
The
getFilterSiblings
function was always returning an empty array for meta filters (implicit filters that exist as parents infilter_paths
, but not as associations in the sheet). This is because the function was only checking theid
s of assocations, and not recursing/reducing up thefilter_path
array to find implicit filters.getFilterSiblings
now delegates togetMetaFilterSiblings
when the filter key passed is not an association, and returns the appropriate siblings. This was causing havoc in terms of appropriately toggling off grandparents when parent sets had been toggled off after toggling on a grandparent.Similarly, the control flow that toggles off a paren when its last child is toggled off was not seeking further up the family tree, and appropriately toggling off grandparents as well if necessary. This also caused coloring havoc- now fixed.