Repository navigation
fix: Also re-measure a node's handles when its class changes - #100
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#99 re-measures a node's handles when its
stylechanges. Two cases were still left out: a handle'stopcan read a CSS variable that the node'sclassNamesets through a stylesheet, and a group's handles come from itsdata.inputsanddata.outputs, so adding a handle to a collapsed group that does not grow left its edges where they were. Each node also calledupdateNodeInternalson its own, so collapsing a group or restyling many nodes sent one re-measure per node.style,className,data.inputsordata.outputschanges.updateNodeInternals([...ids])call per animation frame. Tests can record the batches by settingwindow.__panelReactflowRemeasuresto an array.I added UI tests for a class change, a handle added to a collapsed group of unchanged size, and twelve nodes restyled at once, which asserts a single batch holding all twelve ids (it saw twelve single-id batches before batching worked).
Test runs
Unit tests: 387 passed, 1 skipped.
tests/ui/test_ui.pyandtests/ui/test_groups.py: 117 passed, with one timing-sensitive connection validation test failing once and passing on two reruns. FlowDash main'stest_ui_groups.pyandtest_ui_connect_restricted_input.pypass against this branch (8 passed).