From a826b9785d697243ffe198d27efd3a41228eac9e Mon Sep 17 00:00:00 2001 From: waleed Date: Sat, 31 Jan 2026 21:15:33 -0800 Subject: [PATCH] refactor(workflow): use pre-computed lock state from contextMenuBlocks contextMenuBlocks already has locked and isParentLocked properties computed in use-canvas-context-menu.ts, so there's no need to look up blocks again via hasProtectedBlocks. Co-Authored-By: Claude Opus 4.5 --- .../app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx index 07bb0c143..78d132770 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx @@ -57,7 +57,6 @@ import { estimateBlockDimensions, filterProtectedBlocks, getClampedPositionForNode, - hasProtectedBlocks, isBlockProtected, isEdgeProtected, isInEditableElement, @@ -3606,10 +3605,7 @@ const WorkflowContent = React.memo(() => { canRunFromBlock={runFromBlockState.canRun} disableEdit={ !effectivePermissions.canEdit || - hasProtectedBlocks( - contextMenuBlocks.map((b) => b.id), - blocks - ) + contextMenuBlocks.some((b) => b.locked || b.isParentLocked) } userCanEdit={effectivePermissions.canEdit} isExecuting={isExecuting}