diff --git a/src/components/admin/npc-dialogue/NpcDialogueEditor.tsx b/src/components/admin/npc-dialogue/NpcDialogueEditor.tsx index 6793a133..8ab2eda6 100644 --- a/src/components/admin/npc-dialogue/NpcDialogueEditor.tsx +++ b/src/components/admin/npc-dialogue/NpcDialogueEditor.tsx @@ -200,6 +200,9 @@ function FlowEditor() { const onCanvasDoubleClick = useCallback( (e: ReactMouseEvent) => { const target = e.target as HTMLElement; + // Node double-clicks open the edit dialog (onNodeDoubleClick); they + // must never also spawn a new node. + if (target.closest?.(".react-flow__node")) return; if (!target.closest?.(".react-flow__pane")) return; const pos = rf.screenToFlowPosition({ x: e.clientX, y: e.clientY }); addNode("dialogue", pos); @@ -452,7 +455,8 @@ function FlowEditor() { applyConnection(sourceId, targetId, connectionState.fromHandle?.id); }} isValidConnection={isValidConnection} - onNodeClick={(_e, node) => setEditingNodeId(node.id)} + // Single click selects (React Flow default); double-click edits. + onNodeDoubleClick={(_e, node) => setEditingNodeId(node.id)} onNodeContextMenu={onNodeContextMenu} onPaneClick={onPaneClick} onPaneContextMenu={onPaneContextMenu} @@ -473,9 +477,10 @@ function FlowEditor() {

- Click a node to edit. Select and press Del (or right-click) to delete. Double-click the - canvas for a new dialogue node; right-click it for any type. Drag a row's dot to wire - that exact choice or branch. Use Expand to fill the screen (Esc to shrink). + Click a node to select it, double-click to edit. Select and press Del (or right-click) to + delete. Double-click the canvas for a new dialogue node; right-click it for any type. Drag + a row's dot to wire that exact choice or branch. Use Expand to fill the screen (Esc to + shrink).

{contextMenu && (