diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/action-bar/action-bar.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/action-bar/action-bar.tsx
index d7daf5fbb..a0e17dc16 100644
--- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/action-bar/action-bar.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/action-bar/action-bar.tsx
@@ -225,17 +225,24 @@ export const ActionBar = memo(
variant='ghost'
onClick={(e) => {
e.stopPropagation()
- if (!disabled) {
+ // Can't unlock a block if its parent container is locked
+ if (!disabled && !(isLocked && isParentLocked)) {
collaborativeBatchToggleLocked([blockId])
}
}}
className={ACTION_BUTTON_STYLES}
- disabled={disabled}
+ disabled={disabled || (isLocked && isParentLocked)}
>
{isLocked ? : }
- {isLocked ? 'Unlock Block' : 'Lock Block'}
+
+ {isLocked && isParentLocked
+ ? 'Parent container is locked'
+ : isLocked
+ ? 'Unlock Block'
+ : 'Lock Block'}
+
)}
diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx
index a5b769dfd..40e45cb87 100644
--- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx
@@ -368,11 +368,11 @@ export function Editor() {
)}
- {/* Locked indicator - clickable to unlock if user has admin permissions and block itself is locked */}
+ {/* Locked indicator - clickable to unlock if user has admin permissions, block is locked, and parent is not locked */}
{isLocked && currentBlock && (
- {userPermissions.canAdmin && currentBlock.locked ? (
+ {userPermissions.canAdmin && currentBlock.locked && !isParentLocked ? (
- {userPermissions.canAdmin && currentBlock.locked
- ? 'Unlock block'
- : isParentLocked
- ? 'Parent container is locked'
+ {isParentLocked
+ ? 'Parent container is locked'
+ : userPermissions.canAdmin && currentBlock.locked
+ ? 'Unlock block'
: 'Block is locked'}