Skip to content

Commit 30348d3

Browse files
committed
Simplify workflow code
1 parent 0429636 commit 30348d3

File tree

1 file changed

+4
-15
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]

1 file changed

+4
-15
lines changed

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,22 +1300,10 @@ const WorkflowContent = React.memo(() => {
13001300
const isActive = activeBlockIds.has(block.id)
13011301
const isPending = isDebugging && pendingBlocks.includes(block.id)
13021302

1303-
const measuredWidth =
1304-
typeof block.layout?.measuredWidth === 'number' ? block.layout.measuredWidth : undefined
1305-
const measuredHeight =
1306-
typeof block.layout?.measuredHeight === 'number' ? block.layout.measuredHeight : undefined
1307-
1303+
// Both note blocks and workflow blocks use deterministic dimensions
13081304
const nodeType = block.type === 'note' ? 'noteBlock' : 'workflowBlock'
13091305
const dragHandle = block.type === 'note' ? '.note-drag-handle' : '.workflow-drag-handle'
13101306

1311-
const defaultWidth =
1312-
block.type === 'note' ? Math.max(measuredWidth ?? block.data?.width ?? 260, 200) : 250
1313-
1314-
const defaultHeight =
1315-
block.type === 'note'
1316-
? Math.max(measuredHeight ?? block.height ?? 160, 120)
1317-
: Math.max(block.height || 100, 100)
1318-
13191307
// Create stable node object - React Flow will handle shallow comparison
13201308
nodeArray.push({
13211309
id: block.id,
@@ -1350,8 +1338,9 @@ const WorkflowContent = React.memo(() => {
13501338
isPending,
13511339
},
13521340
// Include dynamic dimensions for container resizing calculations (must match rendered size)
1353-
width: defaultWidth,
1354-
height: defaultHeight,
1341+
// Both note and workflow blocks calculate dimensions deterministically via useBlockDimensions
1342+
width: 250, // Standard width for both block types
1343+
height: Math.max(block.height || 100, 100), // Use calculated height with minimum
13551344
})
13561345
})
13571346

0 commit comments

Comments
 (0)