You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
diagram: straight stock-to-stock flows cannot be offset (no Z-shape support) #819
A straight 2-point flow between two stocks cannot be visually offset in the editor at all. Both existing reroute mechanisms exclude this case:
Perpendicular valve-drag reroute (UpdateFlow in src/diagram/drawing/Flow.tsx) only converts a straight flow to an L-shape when at least one endpoint is a cloud (the segments.length === 1 && clouds.length > 0 guard). With stocks on both ends, dragging the valve perpendicular to the flow does nothing to the route.
Segment dragging requires an interior segment: findClickedSegment refuses segments with attached endpoints, and a 2-point flow's only segment has both endpoints attached to the stocks.
So the user has no way to move the flow line off the direct stock-to-stock axis, e.g. to route around another element or reduce label overlap.
Why it matters
This is a UX capability gap (not a bug). Other SD tools (Stella, Vensim) support offsetting a stock-to-stock flow into a Z-shape: two corners so the middle segment runs parallel to the original axis but displaced. Users coming from those tools expect it, and diagrams with parallel flows between the same stocks are impossible to disambiguate without it.
Extend the valve-drag reroute: when both endpoints are attached stocks and the drag is perpendicular to a straight flow, insert two corner points to form a Z-shape instead of bailing out. Once the Z exists, the middle segment is interior, so the existing moveSegment / normalizeFlowPoints machinery already makes it draggable and keeps it orthogonal.
Context
Identified during the June 2026 flow-editing audit; listed in the "Deferred" section of docs/dev/flow-editing-audit-2026-06.md.
Related: #51 is the original broad "multi-part flows" request from before any bend support existed; this issue tracks the specific remaining gap now that L-shape reroute (cloud endpoints) and interior-segment dragging exist.
Activity