Description
The devtools visualizer fails to render a valid, usable machine chart when ELK produces only label-route-overlap validation issues.
The UI reports:
The chart could not be laid out
ELK did not produce a safe layout for ReplicationConnection after 5 deterministic attempts: spacious-relaxed: label-route-overlap (8); label-route-overlap:Connecting:transition:3:branch:0:Connecting:transition:4:branch:0, label-route-overlap:IdentifyingSource:transition:3:branch:0:IdentifyingSource:transition:4:branch:0, label-route-overlap:ReadingServerInfo:transition:4:branch:0:ReadingServerInfo:transition:5:branch:0
Expected behavior
The visualizer should display the best available chart when the only remaining validation issue is a transition label crossing another route. This is a cosmetic issue and the chart remains readable and interactive.
Actual behavior
All five deterministic layouts are rejected, leaving no chart visible.
Reproduction characteristics
The machine is a flat workflow with 13 states. Most active states have:
- a normal success transition;
SessionUnavailable and StopRequested transitions;
- an Effect invocation with
done and failure outcome edges.
This creates several routes from each state to shared terminal states.
Devtools version: @typeonce/effect-machine-devtools@0.27.1
Core version: @typeonce/effect-machine@0.27.1
Confirmed workaround
Changing the validation result in chart-layout.ts from:
valid: issues.length === 0
to:
valid: issues.every((issue) => issue.code === \"label-route-overlap\")
allows the chart to render. The resulting chart is usable; only some labels cross route lines. Other layout issue types remain fatal under this workaround.
A preferable upstream solution may be to treat label-route-overlap as a warning/fallback condition after all deterministic attempts fail, while continuing to reject node crossings, route overlaps, detached labels, and other structural failures.
Description
The devtools visualizer fails to render a valid, usable machine chart when ELK produces only
label-route-overlapvalidation issues.The UI reports:
Expected behavior
The visualizer should display the best available chart when the only remaining validation issue is a transition label crossing another route. This is a cosmetic issue and the chart remains readable and interactive.
Actual behavior
All five deterministic layouts are rejected, leaving no chart visible.
Reproduction characteristics
The machine is a flat workflow with 13 states. Most active states have:
SessionUnavailableandStopRequestedtransitions;doneandfailureoutcome edges.This creates several routes from each state to shared terminal states.
Devtools version:
@typeonce/effect-machine-devtools@0.27.1Core version:
@typeonce/effect-machine@0.27.1Confirmed workaround
Changing the validation result in
chart-layout.tsfrom:to:
allows the chart to render. The resulting chart is usable; only some labels cross route lines. Other layout issue types remain fatal under this workaround.
A preferable upstream solution may be to treat
label-route-overlapas a warning/fallback condition after all deterministic attempts fail, while continuing to reject node crossings, route overlaps, detached labels, and other structural failures.