self-loops: the connection is delivered but the trailing node click erases it #97

Closed
opened 2026-10-25 19:44:03 -05:00 by yuuhikaze · 0 comments
Owner

Self-loops are meant to work: TerminalEdge.svelte already renders a dedicated arc for source === target, xyflow validates the drag (connectingto valid mid-drag), and onconnect fires. But the editor never opens.

Root cause (reproduced with instrumented playwright): after a self-connection drop, the trailing click event lands on the node body (DIV.state, same state). onnodeclick → selectState → clearSelection() → wipes the pendingConnection that onconnect just set. Cross-node drops survive because their trailing click lands on the nodes layer, not the node (verified: SELF click target = DIV.state node=q0; CROSS click target = DIV.svelte-flow__nodes).

Fix: in FaCanvas.svelte onnodeclick, ignore the click when a pendingConnection is open (the pending transition editor is committed via ADD or dismissed via DISCARD / pane click). Deterministic, no timers, keeps two-state behavior unchanged.

Acceptance: playwright drag right handle → left handle of the same state must open the NEW TRANSITION editor; committing a symbol renders the self-loop arc; two-state connection still works; screenshots for both.

Self-loops are meant to work: `TerminalEdge.svelte` already renders a dedicated arc for `source === target`, xyflow validates the drag (`connectingto valid` mid-drag), and `onconnect` fires. But the editor never opens. **Root cause (reproduced with instrumented playwright):** after a self-connection drop, the trailing `click` event lands on the node body (`DIV.state`, same state). `onnodeclick` → `selectState` → `clearSelection()` → wipes the `pendingConnection` that `onconnect` just set. Cross-node drops survive because their trailing click lands on the nodes *layer*, not the node (verified: SELF click target = `DIV.state node=q0`; CROSS click target = `DIV.svelte-flow__nodes`). **Fix:** in `FaCanvas.svelte` `onnodeclick`, ignore the click when a `pendingConnection` is open (the pending transition editor is committed via ADD or dismissed via DISCARD / pane click). Deterministic, no timers, keeps two-state behavior unchanged. **Acceptance:** playwright drag right handle → left handle of the same state must open the NEW TRANSITION editor; committing a symbol renders the self-loop arc; two-state connection still works; screenshots for both.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
k8s-services/rgxr#97
No description provided.