Browse Source

fix: preserve audio handle type in GenerateAudioNode dynamic inputs

The input schema mapping was forcing all non-image inputs to "text",
misclassifying audio inputs. Now correctly maps audio type so handles
get the right data-handletype, CSS dot color, and label color.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 3 months ago
parent
commit
23b7ef0092
  1. 10
      src/components/nodes/GenerateAudioNode.tsx

10
src/components/nodes/GenerateAudioNode.tsx

@ -229,8 +229,9 @@ export function GenerateAudioNode({ id, data, selected }: NodeProps<GenerateAudi
if (!nodeData.inputSchema || nodeData.inputSchema.length === 0) return null; if (!nodeData.inputSchema || nodeData.inputSchema.length === 0) return null;
return nodeData.inputSchema.map((input, index) => { return nodeData.inputSchema.map((input, index) => {
const handleType = input.type === "image" ? "image" : "text"; const handleType = input.type === "image" ? "image" : input.type === "audio" ? "audio" : "text";
const topPx = 50 + (index - nodeData.inputSchema!.length / 2 + 0.5) * 20; const topPx = 50 + (index - nodeData.inputSchema!.length / 2 + 0.5) * 20;
const handleColor = handleType === "image" ? "var(--handle-color-image)" : handleType === "audio" ? "var(--handle-color-audio)" : "var(--handle-color-text)";
return ( return (
<React.Fragment key={input.name}> <React.Fragment key={input.name}>
<Handle <Handle
@ -238,13 +239,10 @@ export function GenerateAudioNode({ id, data, selected }: NodeProps<GenerateAudi
position={Position.Left} position={Position.Left}
id={input.name} id={input.name}
data-handletype={handleType} data-handletype={handleType}
style={{ style={{ top: `${topPx}px` }}
background: handleType === "image" ? "rgb(34, 197, 94)" : "rgb(251, 191, 36)",
top: `${topPx}px`,
}}
title={input.label} title={input.label}
/> />
<HandleLabel label={input.label} side="target" color={handleType === "image" ? "var(--handle-color-image)" : "var(--handle-color-text)"} top={`${topPx - 18}px`} visible={showLabels} /> <HandleLabel label={input.label} side="target" color={handleColor} top={`${topPx - 18}px`} visible={showLabels} />
</React.Fragment> </React.Fragment>
); );
}); });

Loading…
Cancel
Save