fix(store): clear extent property when orphaning blocks

When a block's parent is removed, properly clear both parentId and extent
properties from block.data, matching the pattern used in batchUpdateBlocksWithParent.
This commit is contained in:
waleed
2026-01-27 13:24:11 -08:00
parent f2ca90ae6f
commit 503f676910

View File

@@ -466,10 +466,11 @@ export const useWorkflowStore = create<WorkflowStore>()(
currentParentId = parent.data?.parentId
}
const { parentId: _removed, extent: _removedExtent, ...restData } = block.data || {}
newBlocks[blockId] = {
...block,
position: { x: absoluteX, y: absoluteY },
data: { ...block.data, parentId: undefined },
data: Object.keys(restData).length > 0 ? restData : undefined,
}
}
})