fix(duplicate): unlock all blocks when duplicating workflow

- Server-side workflow duplication now sets locked: false for all blocks
- regenerateWorkflowStateIds also unlocks blocks for templates
- Client-side regenerateBlockIds already handled this (for paste/import)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
waleed
2026-01-31 18:42:06 -08:00
parent 63eba0f6fb
commit c19263e25f
2 changed files with 3 additions and 1 deletions

View File

@@ -189,6 +189,7 @@ export async function duplicateWorkflow(
parentId: newParentId,
extent: newExtent,
data: updatedData,
locked: false, // Duplicated blocks should always be unlocked
createdAt: now,
updatedAt: now,
}

View File

@@ -629,7 +629,8 @@ export function regenerateWorkflowStateIds(state: RegenerateStateInput): Regener
// Regenerate blocks with updated references
Object.entries(state.blocks || {}).forEach(([oldId, block]) => {
const newId = blockIdMapping.get(oldId)!
const newBlock: BlockState = { ...block, id: newId }
// Duplicated blocks are always unlocked so users can edit them
const newBlock: BlockState = { ...block, id: newId, locked: false }
// Update parentId reference if it exists
if (newBlock.data?.parentId) {