@ -2107,6 +2107,23 @@ export function WorkflowCanvas() {
< / button >
< / button >
) : undefined ;
) : undefined ;
// Optional toggle for input nodes
const isInputNode = node . type === "imageInput" || node . type === "audioInput" || node . type === "prompt" ;
const isOptional = ! ! ( node . data as any ) ? . isOptional ;
const optionalToggle = isInputNode ? (
< button
onClick = { ( ) = > updateNodeData ( node . id , { isOptional : ! isOptional } ) }
className = { ` nodrag nopan text-[10px] py-0.5 px-1.5 rounded transition-colors ${
isOptional
? "bg-amber-600/80 hover:bg-amber-500/80 text-white border border-amber-500/50"
: "bg-neutral-700 hover:bg-neutral-600 border border-neutral-600 text-neutral-400"
} ` }
title = { isOptional ? "This input is optional — empty inputs will be skipped" : "Mark as optional — empty inputs will skip this branch" }
>
{ isOptional ? "Optional" : "Required" }
< / button >
) : undefined ;
return (
return (
< FloatingNodeHeader
< FloatingNodeHeader
key = { ` header- ${ node . id } ` }
key = { ` header- ${ node . id } ` }
@ -2123,6 +2140,7 @@ export function WorkflowCanvas() {
comment = { node . data ? . comment }
comment = { node . data ? . comment }
provider = { ( node . data as any ) ? . selectedModel ? . provider }
provider = { ( node . data as any ) ? . selectedModel ? . provider }
headerAction = { browseAction }
headerAction = { browseAction }
headerButtons = { optionalToggle }
onCustomTitleChange = { handleCustomTitleChange }
onCustomTitleChange = { handleCustomTitleChange }
onCommentChange = { handleCommentChange }
onCommentChange = { handleCommentChange }
onRunNode = { handleRunNode }
onRunNode = { handleRunNode }