-
Notifications
You must be signed in to change notification settings - Fork 24
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
Make merger mode work for all skeleton modifications #4669
Conversation
…x some related bugs
@daniel-wer I just gave it a quick test and seems to work very well :-) Nice! |
I'll try to review this when I got time. Currently, #4663 has a higher priority |
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 go to me! ready to ship
…sos into better-merger-mode
I have noticed one more bug that I would like to fix. If the user sets a node outside of a segment, the node is removed automatically while displaying a toast with an explanation. However, this leads to an infinite loop when using undo. If you press undo afterwards, the just automatically removed node is created again, but immediately automatically removed again by the merger mode script. However, by removing the node a new entry is added to the undo stack, so we're in the beginning again... |
Merger mode only worked for basic node/tree creation/deletion cases (see #4655 for an explanation), but didn't work for undo/redo or when merging/splitting trees.
By switching from overwriting specific redux actions to acting on the result of our tree differ, all of these cases are now handled. The resulting code is even easier as the merger mode only needs to react to two diffing actions:
createNode
anddeleteNode
. Complex redux actions like mergeTree, result in low-level diffing actions:deleteNode
actions for each node of the tree that was deleted as part of the mergecreateNode
actions for all of the same nodes, but in the tree that "survived" the mergedeleteTree
action that merger mode doesn't care about, similar anupdateTree
action which only modifies tree propertiesSimilar for undo/redo/tree merging/splitting. This is actually an advantage of the "primitive" low-level diffing we do.
I fixed a couple of other bugs while I was at it (not all of them have issues):
URL of deployed dev instance (used for testing):
Steps to test:
webknossos.apiReady(3).then(api => api.data.setMapping("segmentation", {1: 2, 3: 4}))
. The ID Mapping toggle in the segmentation tab should become activated.Issues: