Skip to content
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

Fix unwanted group expansions #4899

Merged
merged 3 commits into from
Oct 28, 2020
Merged

Fix unwanted group expansions #4899

merged 3 commits into from
Oct 28, 2020

Conversation

daniel-wer
Copy link
Member

This fixes a bug which was introduced in #4897.

The finishSearchCallback is not only called if the parent groups of the found node are expanded, but also when the tree data changes (where the parent groups of the found node are not expanded). I implemented a fix for that by checking for each element on the path whether it was actually expanded, but that was rather complicated. Therefore, I solved this issue in a more general way by updating the expandedGroupIds list whenever the onChange handler of the sortable-tree is called because the tree data changed. This way the two structures are always in sync. I think this solution is much less error-prone and the performance impact should be negligible.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • The bug could be triggered as follows. Create a tracing with this structure:

    • groupA
      • tree1
    • groupB
      • tree2
  • Activate tree1 and then collapse groupA. Now change the visibility of groupB or tree2.

  • On master this would expand groupA again, which should no longer happen on this branch.

  • Also check whether group expansion, toggling of all sub groups works as before.


@daniel-wer daniel-wer added the bug label Oct 27, 2020
@daniel-wer daniel-wer self-assigned this Oct 27, 2020
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Works for me and looks a lot cleaner :) Let's hope the performance also turns out to be alright.

@bulldozer-boy bulldozer-boy bot merged commit bc6b71d into master Oct 28, 2020
@bulldozer-boy bulldozer-boy bot deleted the fix-group-expansion branch October 28, 2020 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants