From ecb1c3a69a5e2be10ecf065c730b7d72788b3c16 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 12 Mar 2026 13:16:22 -0700 Subject: [PATCH] fix(blocks): clarify condition ID suffix slicing for readability Use explicit hyphen separator instead of relying on slice offset to implicitly include the hyphen in the suffix, making the intent clearer. Co-Authored-By: Claude Opus 4.6 --- apps/sim/lib/workflows/condition-ids.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/sim/lib/workflows/condition-ids.ts b/apps/sim/lib/workflows/condition-ids.ts index 054975d880d..d5df2cdc3a3 100644 --- a/apps/sim/lib/workflows/condition-ids.ts +++ b/apps/sim/lib/workflows/condition-ids.ts @@ -19,8 +19,8 @@ export function remapConditionBlockIds( const prefix = `${oldBlockId}-` for (const condition of conditions) { if (typeof condition.id === 'string' && condition.id.startsWith(prefix)) { - const suffix = condition.id.slice(oldBlockId.length) - condition.id = `${newBlockId}${suffix}` + const suffix = condition.id.slice(prefix.length) + condition.id = `${newBlockId}-${suffix}` changed = true } } @@ -49,8 +49,8 @@ export function remapConditionEdgeHandle( const innerId = sourceHandle.slice(handlePrefix.length) if (!innerId.startsWith(`${oldBlockId}-`)) continue - const suffix = innerId.slice(oldBlockId.length) - return `${handlePrefix}${newBlockId}${suffix}` + const suffix = innerId.slice(oldBlockId.length + 1) + return `${handlePrefix}${newBlockId}-${suffix}` } return sourceHandle