setIsExpanded(!isExpanded)}
@@ -199,20 +225,10 @@ function ExecutionDataSection({
<>
{isEmpty ? (
- No data
+ {emptyMessage}
) : (
-
-
-
+ children
)}
>
)}
@@ -261,9 +277,12 @@ function ConnectionsSection({
const [expandedVariables, setExpandedVariables] = useState(true)
const [expandedEnvVars, setExpandedEnvVars] = useState(true)
+ /** Stable string of connection IDs to prevent effect from running on every render */
+ const connectionIds = useMemo(() => connections.map((c) => c.blockId).join(','), [connections])
+
useEffect(() => {
- setExpandedBlocks(new Set(connections.map((c) => c.blockId)))
- }, [connections])
+ setExpandedBlocks(new Set(connectionIds.split(',').filter(Boolean)))
+ }, [connectionIds])
const hasContent = connections.length > 0 || workflowVars.length > 0 || envVars.length > 0
@@ -549,27 +568,22 @@ function SubflowConfigDisplay({ block, loop, parallel }: SubflowConfigDisplayPro
const isLoop = block.type === 'loop'
const config = isLoop ? SUBFLOW_CONFIG.loop : SUBFLOW_CONFIG.parallel
- // Determine current type
const currentType = isLoop
? loop?.loopType || (block.data?.loopType as string) || 'for'
: parallel?.parallelType || (block.data?.parallelType as string) || 'count'
- // Build type options for combobox - matches SubflowEditor
const typeOptions = Object.entries(config.typeLabels).map(([value, label]) => ({
value,
label,
}))
- // Determine mode
const isCountMode = currentType === 'for' || currentType === 'count'
const isConditionMode = currentType === 'while' || currentType === 'doWhile'
- // Get iterations value
const iterations = isLoop
? (loop?.iterations ?? (block.data?.count as number) ?? 5)
: (parallel?.count ?? (block.data?.count as number) ?? 1)
- // Get collection/condition value
const getEditorValue = (): string => {
if (isConditionMode && isLoop) {
if (currentType === 'while') {
@@ -589,7 +603,6 @@ function SubflowConfigDisplay({ block, loop, parallel }: SubflowConfigDisplayPro
const editorValue = getEditorValue()
- // Get label for configuration field - matches SubflowEditor exactly
const getConfigLabel = (): string => {
if (isCountMode) {
return `${isLoop ? 'Loop' : 'Parallel'} Iterations`
@@ -601,7 +614,7 @@ function SubflowConfigDisplay({ block, loop, parallel }: SubflowConfigDisplayPro
}
return (
-
+
{/* Type Selection - matches SubflowEditor */}