Skip to content

Commit 12d529d

Browse files
authored
fix: terminal spacing, subflow disabled in preview (#3055)
* fix: terminal spacing, subflow disabled in preview * addressed comments
1 parent 57f0837 commit 12d529d

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/terminal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ const ExecutionGroupRow = memo(function ExecutionGroupRow({
411411
return (
412412
<div className='flex flex-col px-[6px]'>
413413
{/* Separator between executions */}
414-
{showSeparator && <div className='mx-[4px] my-[4px] border-[var(--border)] border-t' />}
414+
{showSeparator && <div className='mx-[4px] mb-[6px] border-[var(--border)] border-t' />}
415415

416416
{/* Entry tree */}
417-
<div className='ml-[4px] flex flex-col gap-[2px] pb-[4px]'>
417+
<div className='ml-[4px] flex flex-col gap-[2px] pb-[6px]'>
418418
{group.entryTree.map((node) => (
419419
<EntryNodeRow
420420
key={node.entry.id}

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/subflow/subflow.tsx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import { memo } from 'react'
44
import { RepeatIcon, SplitIcon } from 'lucide-react'
55
import { Handle, type NodeProps, Position } from 'reactflow'
6+
import { Badge } from '@/components/emcn'
7+
import { cn } from '@/lib/core/utils/cn'
68
import { HANDLE_POSITIONS } from '@/lib/workflows/blocks/block-dimensions'
79

810
/** Execution status for subflows in preview mode */
@@ -13,6 +15,8 @@ interface WorkflowPreviewSubflowData {
1315
width?: number
1416
height?: number
1517
kind: 'loop' | 'parallel'
18+
/** Whether this subflow is enabled */
19+
enabled?: boolean
1620
/** Whether this subflow is selected in preview mode */
1721
isPreviewSelected?: boolean
1822
/** Execution status for highlighting the subflow container */
@@ -27,7 +31,15 @@ interface WorkflowPreviewSubflowData {
2731
* or interactive features.
2832
*/
2933
function WorkflowPreviewSubflowInner({ data }: NodeProps<WorkflowPreviewSubflowData>) {
30-
const { name, width = 500, height = 300, kind, isPreviewSelected = false, executionStatus } = data
34+
const {
35+
name,
36+
width = 500,
37+
height = 300,
38+
kind,
39+
enabled = true,
40+
isPreviewSelected = false,
41+
executionStatus,
42+
} = data
3143

3244
const isLoop = kind === 'loop'
3345
const BlockIcon = isLoop ? RepeatIcon : SplitIcon
@@ -84,14 +96,21 @@ function WorkflowPreviewSubflowInner({ data }: NodeProps<WorkflowPreviewSubflowD
8496
<div className='flex min-w-0 flex-1 items-center gap-[10px]'>
8597
<div
8698
className='flex h-[24px] w-[24px] flex-shrink-0 items-center justify-center rounded-[6px]'
87-
style={{ backgroundColor: blockIconBg }}
99+
style={{ backgroundColor: enabled ? blockIconBg : 'var(--surface-4)' }}
88100
>
89101
<BlockIcon className='h-[16px] w-[16px] text-white' />
90102
</div>
91-
<span className='font-medium text-[16px]' title={blockName}>
103+
<span
104+
className={cn(
105+
'truncate font-medium text-[16px]',
106+
!enabled && 'text-[var(--text-muted)]'
107+
)}
108+
title={blockName}
109+
>
92110
{blockName}
93111
</span>
94112
</div>
113+
{!enabled && <Badge variant='gray-secondary'>disabled</Badge>}
95114
</div>
96115

97116
{/* Content area - matches workflow structure */}

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/preview-workflow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export function PreviewWorkflow({
361361
width: dimensions.width,
362362
height: dimensions.height,
363363
kind: block.type as 'loop' | 'parallel',
364+
enabled: block.enabled ?? true,
364365
isPreviewSelected: isSelected,
365366
executionStatus: subflowExecutionStatus,
366367
lightweight,

0 commit comments

Comments
 (0)