[DS 2.0] Use the measured source-node height for self-loop edges - #121
Draft
librowski wants to merge 1 commit into
Draft
[DS 2.0] Use the measured source-node height for self-loop edges#121librowski wants to merge 1 commit into
librowski wants to merge 1 commit into
Conversation
librowski
requested review from
lukasz-jazwa,
piotrblaszczyk and
szymon-t-sc
as code owners
September 7, 2026 12:05
librowski
marked this pull request as draft
September 7, 2026 12:07
…and label LabelEdge subscribes to the source node's height in the React Flow store (measured.height, then height, then 0) instead of reading a getNode() snapshot, so the loop path and its label follow every remeasurement - xyflow 12 writes ResizeObserver results to measured.height only. The same value is passed to SelfConnectingEdge, whose nodeHeight prop previously defaulted to 0.
librowski
force-pushed
the
ds2-canvas-edges
branch
from
September 9, 2026 16:49
d6920b9 to
a62b3a9
Compare
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.
Problem
LabelEdgecomputed a source-node height to place the label of a self-connecting edge but did not pass it toSelfConnectingEdge, whosenodeHeightprop defaulted to0: the loop was drawn as if the node had no height while the label was positioned as if it had. The height itself was read fromsourceNode.height, which xyflow 12 sets only when a change explicitly requests attributes - normal ResizeObserver updates writemeasured.height.A first version read the height through
getNode(); a browser check (review of 8.09) showed that a snapshot read does not follow a later remeasurement: after adding a branch to a Decision node the loop and label stayed at the old height until an unrelated rerender.Change
LabelEdgesubscribes to the source node's height in the React Flow store (useStore, aliased to keep it distinct from the SDK store):measured.height ?? height ?? 0,0for non-self edges. The value drives both the loop path (SelfConnectingEdge.nodeHeight) and the label Y.height, and an unknown node (zero) through the store selector.@workflowbuilder/sdkpatch (LabelEdgeandSelfConnectingEdgeare public exports).Not covered by an automated test: the live remeasurement itself (the spec exercises the selector with a mocked store; a real React Flow harness would be a new test layer).
Out of scope, to settle with design
Edge corner radius has three values today: 16px in code (
EDGE_CURVE_RADIUS), 2px in the token export (canvas-edge-corner-radius), 18px in the Figma vectors. Adopting the export would visibly straighten every corner; not changed here.