You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2ff39d5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(workflows): scope the canonical sub-block index to the active surface
A block that is both an action and a trigger holds one `subBlocks` array — its
own fields plus its trigger's, spread in after them. The two sets routinely
share a `canonicalParamId` under different ids, so indexing them together
collapses a trigger field into an action pair whose `basicId` it can never be.
Every group-relative question about that field then answers for the dormant
surface.
The serializer was never affected: `shouldSerializeSubBlock` drops the inactive
surface before the canonical collapse reads it, so it resolves against a value
map the dormant surface cannot appear in. Every other caller resolves against
the block's full value map, so the scoping has to live in the index.
- add `getCanonicalSubBlocksForSurface` / `buildCanonicalIndexForSurface`, and
move the three sites that already had the filter inline onto them
- `getCardSubBlocks` derives its own index instead of accepting one; it already
took `triggerMode`, and accepting an index is what let all three callers pass
one built for the other surface
- scope the remaining consumers that resolve against a full value map: the
canvas card, autolayout, both preview surfaces, the dependsOn gate, the
canonical value hook, reactive conditions, and the copilot selector lint
- keep a canonical group with no advanced member out of the legacy
`advancedMode` path, which deleted its basic member and republished nothing
- merge legacy type-scoped tool modes as a baseline under index-scoped ones, so
the first re-toggle stops reverting the ids the user has not touched
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-canonical-sub-block-value.ts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-depends-on-gate.ts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/hooks/use-editor-subblock-layout.ts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ import {
28
28
resolveWorkflowSelectionLabel,
29
29
}from'@/lib/workflows/subblocks/display'
30
30
import{
31
-
buildCanonicalIndex,
31
+
buildCanonicalIndexForSurface,
32
32
evaluateSubBlockCondition,
33
33
isSubBlockFeatureEnabled,
34
34
isSubBlockVisibleForMode,
@@ -237,10 +237,11 @@ function WorkflowPreviewBlockInner({ data }: NodeProps<WorkflowPreviewBlockData>
0 commit comments