Skip to content

fix: Also re-measure a node's handles when its class changes - #100

Merged
philippjfr merged 3 commits into
mainfrom
fix/remeasure-handles-on-class
Nov 20, 2026
Merged

philippjfr merged 3 commits into
mainfrom
fix/remeasure-handles-on-class

Conversation

@philippjfr

@philippjfr philippjfr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

#99 re-measures a node's handles when its style changes. Two cases were still left out: a handle's top can read a CSS variable that the node's className sets through a stylesheet, and a group's handles come from its data.inputs and data.outputs, so adding a handle to a collapsed group that does not grow left its edges where they were. Each node also called updateNodeInternals on its own, so collapsing a group or restyling many nodes sent one re-measure per node.

  • Regular and group nodes now re-measure their handles when the node's style, className, data.inputs or data.outputs changes.
  • Re-measures are collected per flow and sent as one updateNodeInternals([...ids]) call per animation frame. Tests can record the batches by setting window.__panelReactflowRemeasures to 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.py and tests/ui/test_groups.py: 117 passed, with one timing-sensitive connection validation test failing once and passing on two reruns. FlowDash main's test_ui_groups.py and test_ui_connect_restricted_input.py pass against this branch (8 passed).

@philippjfr
philippjfr marked this pull request as ready for review November 20, 2026 16:08
@philippjfr
philippjfr merged commit aa719ef into main Nov 20, 2026
17 checks passed
@philippjfr
philippjfr deleted the fix/remeasure-handles-on-class branch November 20, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant