Jelajahi Sumber

Merge branch 'fix-dropped-data-edges'

fszontagh 1 bulan lalu
induk
melakukan
632562d9d2
1 mengubah file dengan 11 tambahan dan 2 penghapusan
  1. 11 2
      webui/src/components/workflow/WorkflowNode.tsx

+ 11 - 2
webui/src/components/workflow/WorkflowNode.tsx

@@ -126,13 +126,22 @@ export function WorkflowNode({ data, selected }: NodeProps) {
       style={getStatusStyle()}
     >
       {/* Input handles at top (not for triggers). A node that names more than
-          one input gets a handle each, spread the way outputs are. */}
+          one input gets a handle each, spread the way outputs are.
+
+          Every data handle carries its name as an id, even when there is only
+          one of them. It used to be left undefined in the single-input case,
+          which worked while that was a node's only target handle: an edge
+          stored as targetInput "data" had nowhere else to land. Adding the
+          config handle on the left made that ambiguous - two target handles,
+          one of them anonymous - and on reload the stored "data" matched
+          neither, so the edge was silently dropped and the save wrote the
+          workflow back without it. */}
       {!isTrigger && !isConfigurator && inputs.map((input, idx) => (
         <Handle
           key={input.name}
           type="target"
           position={Position.Top}
-          id={inputs.length > 1 ? input.name : undefined}
+          id={input.name}
           className="!w-3 !h-3 !bg-gray-400 dark:!bg-gray-500 !border-2 !border-white dark:!border-slate-800"
           style={inputs.length > 1 ? { left: `${calculateHandlePosition(idx, inputs.length)}%` } : undefined}
         />