diff --git a/src/components/WorkflowCanvas.tsx b/src/components/WorkflowCanvas.tsx index 5cac779a..47286220 100644 --- a/src/components/WorkflowCanvas.tsx +++ b/src/components/WorkflowCanvas.tsx @@ -606,6 +606,11 @@ export function WorkflowCanvas() { } } + // ConditionalSwitch output handles have dynamic IDs (rule-xxx, default) — always text type + if (!fromHandleType && connectionState.fromNode.type === "conditionalSwitch") { + fromHandleType = "text"; + } + // Helper to find a compatible handle on a node by type const findCompatibleHandle = ( node: Node, diff --git a/src/components/nodes/ConditionalSwitchNode.tsx b/src/components/nodes/ConditionalSwitchNode.tsx index a748618e..c7f0d7ca 100644 --- a/src/components/nodes/ConditionalSwitchNode.tsx +++ b/src/components/nodes/ConditionalSwitchNode.tsx @@ -82,13 +82,14 @@ export const ConditionalSwitchNode = memo(({ id, data, selected }: NodeProps { @@ -205,14 +206,14 @@ export const ConditionalSwitchNode = memo(({ id, data, selected }: NodeProps - {/* Input handle (left) - text only */} + {/* Input handle (left) - text only, aligned with header */} {/* Body content */} -
- {/* Text preview */} -
+
+ {/* Text preview — fixed height, above the handle-aligned area */} +
{incomingText ? ( <>Input: "{incomingText.slice(0, 50)}{incomingText.length > 50 ? "..." : ""}" ) : ( @@ -231,18 +232,16 @@ export const ConditionalSwitchNode = memo(({ id, data, selected }: NodeProps - {/* Rule rows */} + {/* Rule rows — each 32px tall to align with output handles */} {nodeData.rules.map((rule, index) => ( -
+
{/* Match status indicator */}
{rule.isMatched ? ( - // Green checkmark ) : ( - // Gray dot
)}
@@ -333,34 +332,31 @@ export const ConditionalSwitchNode = memo(({ id, data, selected }: NodeProps ))} - {/* Add rule button */} - - - {/* Default output row */} -
- {/* Match status indicator */} + {/* Default output row — 32px tall, immediately after rules to align with handle */} +
{defaultMatched ? ( - // Green checkmark ) : ( - // Gray dot
)}
Default
+ + {/* Add rule button — after Default so it doesn't displace handle alignment */} +
{/* Output handles (right) - one per rule + default */}