From 503f6769106c8c30e87706ed3c8c6cfdc2a67ad9 Mon Sep 17 00:00:00 2001 From: waleed Date: Tue, 27 Jan 2026 13:24:11 -0800 Subject: [PATCH] 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. --- apps/sim/stores/workflows/workflow/store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/sim/stores/workflows/workflow/store.ts b/apps/sim/stores/workflows/workflow/store.ts index 74a82ba3e..06025b885 100644 --- a/apps/sim/stores/workflows/workflow/store.ts +++ b/apps/sim/stores/workflows/workflow/store.ts @@ -466,10 +466,11 @@ export const useWorkflowStore = create()( 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, } } })