Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Workflows Builder UX Overhaul — implementation plan
Spec / source: .ai/specs/2026-07-31-workflows-builder-ux-overhaul.md
Rough notes: .ai/plans/automation/pending-changes.md
Branch: feat/automation
Progress
- Task 1: Remove HMAC signing from the webhook action and its tests
- Task 2: Remove
webhookSecretfrom the ERP service, create route and form - Task 3: Delete the webhook-secret migration and correct the three docs
- Task 4: Regenerate database types — BLOCKED on the user resetting the local DB
- Task 5: Show the workflow name in the breadcrumb
- Task 6: Add
expandedto the node schema - Task 7: Carry
expandedthrough the builder, and flip node auto-placement - Task 8: Drop the per-kind accent colours from
NODE_KIND_META - Task 9: Rewrite
NodeCard— left/right handles, new handle styling, two states - Task 10: Add the per-node
NodeMenu(Minimize, Batch mode, Delete) - Task 11: Rewrite
WorkflowNodeCard— render the config form inline, drop LOD - Task 12: Delete the config panel and go to a two-panel layout
- Task 13: Remove the batch Switch from
ActionForm - Task 14: Redesign
NodePalette - Task 15: End-to-end verification
Dependencies
Track A (webhook secret) 1 ─┐
2 ─┼─► 3 ─► 4 (blocked on user)
Track B (breadcrumb) 5 (independent of everything)
Track C (builder) 6 ─► 7 ─┐
8 ───► 9 ─┐
10 ─┼─► 11 ─► 12 ─► 14 ─► 15
13 (independent, any time after 12)
- Tasks 1, 2, 5, 6, 8 are independent of one another and may run as parallel subagents.
- Task 3 must land after 1 and 2 (it removes the docs describing what they delete).
- Task 4 cannot run until the user resets their local database — see its note.
- Task 9 needs 7 (the
expandedflag) and 8 (accent gone). - Task 11 needs 9 and 10. Task 12 needs 11. Task 14 needs 8.
- Task 15 is last and needs everything.
Commands used in this plan (all verified present)
| Purpose | Command |
|---|---|
| Typecheck ERP | pnpm exec turbo run typecheck --filter=erp |
| Typecheck workflows | pnpm exec turbo run typecheck --filter=@carbon/workflows |
| Typecheck jobs | pnpm exec turbo run typecheck --filter=@carbon/jobs |
| Test a package | pnpm --filter @carbon/workflows test / pnpm --filter @carbon/jobs test |
Test ERP (no test script — run vitest directly, from apps/erp) |
npx vitest run <path> |
| Lint | pnpm exec biome check |
| Regenerate DB types | pnpm run generate:types |
apps/erphas notestscript, sopnpm run test(which isturbo run test) does not rungraph.test.ts. ERP tests only run vianpx vitest run …executed from theapps/erpdirectory. Verified: that command currently runsgraph.test.tsgreen at 12 tests.
Never run a whole-repo typecheck.
pnpm run typecheckruns every package and OOMs. Always scope with--filter. The ERP package is namederp, not@carbon/erp— a wrong filter silently matches nothing and reports success.
Task 1: Remove HMAC signing from the webhook action and its tests
Depends on: none
Files:
- Modify:
packages/jobs/src/workflows/actions/webhook.ts— delete the secret read, the HMAC, and the two signing headers - Modify:
packages/jobs/src/workflows/actions/webhook.test.ts— delete the signature test, the no-secret test, and the secret plumbing in the fake client
Steps:
In
webhook.ts, delete theimport { createHmac } from "node:crypto";line (line 1) and theconst NO_SECRET = "This workflow has no signing secret.";line.Delete this whole block (the workflow row read and the signature computation):
const workflow = await client .from("workflow") .select("webhookSecret") .eq("id", workflowId) .eq("companyId", companyId) .single(); const secret = workflow.data?.webhookSecret; if (workflow.error !== null || !secret) { return { ok: false, error: NO_SECRET }; } // Signed over the exact bytes sent, so the receiver can verify what it got. const rawBody = asText(inputs.body) ?? ""; const timestamp = Math.floor(Date.now() / 1000); const signature = createHmac("sha256", secret) .update(`v1:${timestamp}:${rawBody}`) .digest("hex");and replace it with just the body read:
const rawBody = asText(inputs.body) ?? "";In the
fetchcall, delete the two signing headers soheadersbecomes exactly:headers: { "Content-Type": "application/json" },client,companyIdandworkflowIdare now unused inside the function body but stay in theparamstype and the destructure —services.tspasses them positionally by object key and the signature is shared with the other action runners. Iftsgoreports them as unused errors (not warnings), prefix the destructured names with_rather than removing them from the type. If removing them from the type appears necessary, STOP and report — that changes a shared call signature.In
webhook.test.ts: delete theimport { createHmac } from "node:crypto";line; changefunction fakeClient(webhookSecret: string | null)tofunction fakeClient()and remove the branch that returns{ data: { webhookSecret }, error: null }— the helper no longer needs to stub a workflow row read at all, so return whatever shape the remaining tests need for a client that is never queried. Update everyfakeClient(...)call site tofakeClient().Delete the test that asserts the signature (the one reading
headers["Carbon-Timestamp"]and assertingheaders["Carbon-Signature"]) and the test named"refuses when the workflow has no signing secret". Delete any now-unusedSECRETconstant.Add one new test asserting the absence of signing, in the file's existing style:
it("sends no signing headers", async () => { // ...drive a successful call the way the neighbouring success test does... expect(headers["Carbon-Signature"]).toBeUndefined(); expect(headers["Carbon-Timestamp"]).toBeUndefined(); });
Verify:
pnpm --filter @carbon/jobs test
# Expected: all tests pass; webhook.test.ts reports no failures.
pnpm exec turbo run typecheck --filter=@carbon/jobs
# Expected: exits 0, no errors.
grep -n "createHmac\|Carbon-Signature\|Carbon-Timestamp\|webhookSecret" packages/jobs/src/workflows/actions/webhook.ts packages/jobs/src/workflows/actions/webhook.test.ts
# Expected: matches ONLY inside the new "sends no signing headers" test.
Out of scope: url-guard.ts and every SSRF/https/redirect/timeout test — they
are unrelated to signing and must keep passing unchanged. Do not touch
redactForLog in engine/ledger.ts (its /signature|secret|token/ redaction list
protects other columns). Do not touch the event-system WEBHOOK handler at
packages/jobs/src/inngest/functions/events/webhook.ts.
Task 2: Remove webhookSecret from the ERP service, create route and form
Depends on: none
Files:
- Modify:
apps/erp/app/modules/workflows/workflows.service.ts—insertWorkflowstops selecting the secret - Modify:
apps/erp/app/routes/x+/workflows+/new.tsx— stop returning the secret - Modify:
apps/erp/app/modules/workflows/ui/WorkflowForm.tsx— delete the reveal screen
Steps:
In
workflows.service.ts, delete the two-line comment aboveinsertWorkflowthat reads:// Insert and update are separate rather than one `upsert*` because only the insert // may ever select `webhookSecret` back — it is shown once, at creation.and change
.select("id, webhookSecret")to.select("id"). LeaveinsertWorkflowandupdateWorkflowas two separate functions.In
new.tsx, replace the trailing return and its comment:// The webhook secret is returned once, for the create modal's success state. // There is no reveal-later route. return data( { id: created.data.id, webhookSecret: created.data.webhookSecret }, { status: 201 } );with:
return data({ id: created.data.id }, { status: 201 });In
WorkflowForm.tsx:Delete the
type CreatedWorkflow = { id: string; webhookSecret: string };declaration and change the fetcher touseFetcher<{ id: string } | { success: false }>().Delete the
dismissedSecretstate and thecreatedcomputation.Delete the entire
created ? ( … ) : (branch — the whole "Workflow created" header, the secret<code>block, the Copy button and the "Open workflow" footer — leaving only theValidatedFormthat was in theelsearm, no longer wrapped in a ternary.Remove the now-unused imports:
copyToClipboard,toast,LuCopy, andHStack/VStack/useStateonly if nothing in the remaining JSX still uses them. Check each before deleting;HStackis used by the form's footer.Navigation after a successful create must still reach the new workflow.
useNavigateis already imported andpath.to.workflow(id)is the target. Add auseEffectthat fires whenfetcher.datahas anid:useEffect(() => { if (fetcher.data && "id" in fetcher.data) { navigate(path.to.workflow(fetcher.data.id)); } }, [fetcher.data, navigate]);If the surrounding list route already navigates on create, prefer that and skip this effect — check
apps/erp/app/routes/x+/workflows+/_index.tsxandWorkflowsTable.tsxfor an existingonClose/navigate path before adding a second one. If both would navigate, STOP and report rather than leaving a double navigation.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: exits 0, no errors.
grep -rn "webhookSecret" apps/erp/
# Expected: no matches.
Out of scope: updateWorkflow keeps its current shape. Do not touch
apps/erp/app/routes/api+/webhook.xero.ts — its XERO_WEBHOOK_SECRET is an
unrelated inbound integration key.
Task 3: Delete the webhook-secret migration and correct the three docs
Depends on: Tasks 1, 2
Files:
- Delete:
packages/database/supabase/migrations/20260731025358_workflows-webhook-secret.sql - Modify:
.claude/rules/workflow-actions.md— the signing section and the comparison table - Modify:
packages/jobs/AGENTS.md— line ~113, thewebhook.tstable row - Modify:
apps/erp/app/modules/workflows/AGENTS.md— lines ~9 and ~65
Steps:
Confirm the migration is not on
mainbefore deleting:git cat-file -e main:packages/database/supabase/migrations/20260731025358_workflows-webhook-secret.sql 2>&1This must report that the path does not exist in
main. If it DOES exist onmain, STOP and report — the column then reached production and needs a drop migration instead, which is a different change.Delete the migration file.
In
.claude/rules/workflow-actions.md, rewrite the "The webhook action" section: remove the secret/gen_random_bytesparagraph, the signed-string code block, theCarbon-Timestamp/Carbon-Signatureheader block, the RLS caveat and the"This workflow has no signing secret."refusal. Keep everything aboutredirect: "manual", the 10s timeout, the non-2xx handling, thestatusoutput, the 2048-byte excerpt, and the whole "The SSRF guard" subsection. In the three-webhook comparison table, change the workflow-action row's description from "Outbound, per-workflow HMAC, SSRF-guarded, https-only" to "Outbound, SSRF-guarded, https-only".In
packages/jobs/AGENTS.md, change thewebhook.tsrow to describerunWebhookActionwithout the HMAC clause — keepredirect: "manual", the 10s timeout and the 2 KB excerpt.In
apps/erp/app/modules/workflows/AGENTS.md:- Line ~9: remove
and a webhookSecretfrom the Workflow entity description. Keep the rest of the sentence aboutownerId,activeandactiveVersionId. - Line ~65: the bullet currently reads "
insertWorkflow/updateWorkflow— separate rather than oneupsert*, because only the insert may selectwebhookSecretback". That reason is now false. Replace it with a bullet that still documents both functions but states no secret-based reason.
- Line ~9: remove
Verify:
grep -rn "webhookSecret" apps packages .claude
# Expected: no matches.
grep -rni "Carbon-Signature\|signing secret" apps packages .claude
# Expected: no matches.
grep -rn "WEBHOOK_SECRET" packages/env/src/index.ts | wc -l
# Expected: 6 — the Stripe/Xero/QuickBooks integration keys are untouched.
Out of scope: every other migration file. Do not create a new migration.
Task 4: Regenerate database types — BLOCKED on the user resetting the local DB
Depends on: Task 3, and an explicit go-ahead from the user
⚠️ Do not start this task on your own initiative.
pnpm run generate:typesreads the live local database, not the migration files. The user's local database already has thewebhookSecretcolumn applied, so running the generator before that database is reset would regenerate the column straight back in and silently undo Task 3's intent.
AGENTS.mdis explicit: never rebuild the database to test changes — wait for the user. Ask, then wait. Do not run any reset command yourself.
Files:
- Modify (generated — never hand-edit):
packages/database/src/types.ts - Modify (generated):
packages/database/src/swagger-docs-schema.ts - Modify (generated):
packages/database/supabase/functions/lib/types.ts
Steps:
- Ask the user to reset their local database so the deleted migration stops being applied. Wait for them to confirm it is done.
- Run
pnpm run generate:types. - Confirm the three generated files no longer mention
webhookSecret. Do not hand-edit them under any circumstances — if the column is still present, the database was not reset; STOP and report.
Verify:
grep -rn "webhookSecret" packages/database/
# Expected: no matches.
pnpm exec turbo run typecheck --filter=erp --filter=@carbon/jobs
# Expected: exits 0, no errors.
Out of scope: every other generated artifact. Do not run
pnpm run generate:workflow-catalog — the webhook action's declared inputs and
outputs are unchanged, so the catalog does not move.
Task 5: Show the workflow name in the breadcrumb
Depends on: none
Files:
- Modify:
apps/erp/app/routes/x+/workflow+/$id.tsx— add ahandleexport - Copy from (precedent):
apps/erp/app/routes/x+/job+/$jobId.tsxlines 67–73
Steps:
The route currently has no
handleexport. Add one directly above theloader, matching the job-detail precedent exactly:export const handle: Handle = { breadcrumb: detailBreadcrumb( { breadcrumb: msg`Workflows`, to: path.to.workflows }, (data) => data?.workflow?.name ), module: "workflows" };Add the imports this needs, matching how
$jobId.tsximports them:import { msg } from "@lingui/core/macro";,import type { Handle } from "~/utils/handle";andimport { detailBreadcrumb } from "~/utils/handle";.pathis already imported in this file.Use
msgfrom@lingui/core/macro, nevert—tthrows outside a locale provider, and a routehandleis evaluated outside one. This is a documented repo rule.Confirm
module: "workflows"is the right value by checking whatapps/erp/app/routes/x+/workflow+/_layout.tsxsets on its ownhandle. If the layout uses a different module string, match the layout.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: exits 0, no errors.
Then manually: open any workflow and confirm the breadcrumb reads
Workflows / {that workflow's name}, and that clicking Workflows returns to the
list.
Out of scope: _layout.tsx keeps its own Workflows breadcrumb — the helper
composes the two, so do not remove it.
Task 6: Add expanded to the node schema
Depends on: none
Files:
- Modify:
packages/workflows/src/definition/schema.ts— add the field tonodeBase
Steps:
Add one field to
nodeBase, besideposition:const nodeBase = { id: z.string().min(1), /** Customer-given name. Optional, so every stored definition still parses. */ title: z.string().optional(), position: z.object({ x: z.number(), y: z.number() }), /** Presentation only. Default true, so every stored definition still parses. */ expanded: z.boolean().default(true) };Leave
CURRENT_DEFINITION_FORMAT_VERSIONat2. The field has a default, so every already-stored definition parses unchanged and reads as expanded. Do not bump it.Run the package's tests. If any test asserts an exact parsed node object, it will now see an extra
expanded: truekey — update those expectations to include it. If a test fails for any other reason, STOP and report.
Verify:
pnpm --filter @carbon/workflows test
# Expected: all tests pass.
pnpm exec turbo run typecheck --filter=@carbon/workflows
# Expected: exits 0, no errors.
Out of scope: the runtime (src/runtime/**), the catalog, sync.ts, and the
engine in packages/jobs. expanded is presentation-only and nothing outside the
builder may read it.
Task 7: Carry expanded through the builder, and flip node auto-placement
Depends on: Task 6
Files:
- Modify:
apps/erp/app/modules/workflows/types.ts— addexpandedtoBuilderNode - Modify:
apps/erp/app/modules/workflows/ui/Builder/graph.ts— carry the flag; flipnextNodePosition - Modify:
apps/erp/app/modules/workflows/ui/Builder/store.ts— addsetNodeExpanded - Modify:
apps/erp/app/modules/workflows/ui/Builder/graph.test.ts— cover both changes
Steps:
In
types.ts, addexpandedbesidetitle:export type BuilderNode = Node< Record<string, unknown>, WorkflowNode["type"] > & { title?: string; expanded?: boolean; };In
graph.ts→toBuilderNode, carry the flag through, defaulting to expanded:return { id: node.id, type: node.type, position: node.position, ...(node.title !== undefined ? { title: node.title } : {}), expanded: node.expanded ?? true, data: node.data as Record<string, unknown> };In
graph.ts→fromReactFlow, include it in the serialized node, right afterposition:expanded: node.expanded ?? true,In
graph.ts→createNode, every one of the sixcasearms returns an object literal. Addexpanded: trueto each. (Six edits —trigger,condition,entity,lookup,filter,action.)In
graph.ts, change the layout constant and invertnextNodePosition.NODE_WIDTHbecomes440to match the expanded card:const NODE_WIDTH = 440;and the placement rule flips from "below, nudge right" to "right, nudge down":
const start = anchor ? { x: anchor.position.x + NODE_WIDTH + GAP_X, y: anchor.position.y } : { ...TRIGGER_POSITION }; // ...collides() is unchanged... const position = { ...start }; while (collides(position)) { position.y += NODE_HEIGHT + GAP_Y; }Also change the anchor fallback: it currently picks the node with the greatest
position.y(the lowest). With a horizontal layout it must pick the greatestposition.x(the rightmost):nodes.reduce<BuilderNode | undefined>( (rightmost, node) => !rightmost || node.position.x > rightmost.position.x ? node : rightmost, undefined )Update the function's leading comment, which currently says "Below
from(or below the lowest node), nudged right until nothing collides."In
store.ts, add asetNodeExpandedmutation. Put its signature in the store type besiderenameNode, and implement it in the same shape asrenameNode(which writes a sibling field, notdata):setNodeExpanded: (id: string, expanded: boolean) => void;setNodeExpanded: (id, expanded) => set(({ nodes }) => ({ nodes: nodes.map((n) => (n.id === id ? { ...n, expanded } : n)) })),Do not add an
isReadOnlyguard here — read-only mode hides the menu entirely (Task 10), and letting a viewer collapse a node locally would be harmless anyway. If the surrounding mutations all guard onisReadOnlyand consistency matters more, match them.In
graph.test.ts, add tests for both behaviours:- A definition round-trips through
toReactFlow→fromReactFlowpreservingexpanded: falseon a node that had it. - A node parsed from a definition without
expandedreads astrue. nextNodePositionwith one anchor returns a position to its right (samey, greaterx).nextNodePositionnudges down when the position to the right is occupied.
- A definition round-trips through
Verify:
cd apps/erp && npx vitest run app/modules/workflows/ui/Builder/graph.test.ts
# Expected: all tests pass, including the 4 new ones (was 12 tests before).
pnpm exec turbo run typecheck --filter=erp
# Expected: exits 0, no errors.
Out of scope: Autosave.tsx — it diffs the serialized definition, so it picks
up expanded automatically once fromReactFlow emits it. Do not modify it.
Task 8: Drop the per-kind accent colours from NODE_KIND_META
Depends on: none
Files:
- Modify:
apps/erp/app/modules/workflows/ui/Builder/nodes/meta.ts— removeaccent
Steps:
- Remove
accent: string;from theNodeKindMetatype. - Remove the
accent: "#…"line from all six entries (trigger#f59e0b,condition#2563eb,action#059669,entity#7c3aed,lookup#0891b2,filter#db2777). - Change nothing else in the file.
Icon,name,description,defaultTitle,hasTarget,catalogId,title,summaryandNODE_KIND_ORDERall stay exactly as they are — the icons and descriptions are what the redesign reads.
This will break NodeCard.tsx, WorkflowNodeCard.tsx and NodePalette.tsx,
which pass or read accent. Those are Tasks 9, 11 and 14. Typecheck will fail
until then; that is expected and is why this task's Verify is a grep, not a
typecheck.
Verify:
grep -rn "accent" apps/erp/app/modules/workflows/ui/Builder/nodes/meta.ts
# Expected: no matches.
grep -rn "#f59e0b\|#2563eb\|#059669\|#7c3aed\|#0891b2\|#db2777" apps/erp/app/modules/workflows/
# Expected: no matches.
Out of scope: do not introduce a replacement colour map. The theme's
--primary variable is the only accent from here on.
Task 9: Rewrite NodeCard — left/right handles, new handle styling, two states
Depends on: Tasks 7, 8
Files:
- Modify:
apps/erp/app/modules/workflows/ui/Builder/NodeCard.tsx— full rewrite - Copy from (precedent): the current
NodeCard.tsxfor its structure and theBadge/cnimport style;packages/react/src/for any component you add
Steps:
Change the props: remove
accent: string, removeisCollapsed?: boolean, addisExpanded?: boolean(defaulttrue) andmenu?: ReactNode(the Task 10 dropdown, rendered in the header's top-right corner).Card shell — width switches on state, height is always intrinsic:
<div className={cn( "rounded-lg border bg-card shadow-sm transition-shadow", isExpanded ? "w-[440px]" : "w-[260px]", isSelected && "border-primary ring-2 ring-primary/20", hasIssues && "border-destructive ring-2 ring-destructive/20" )} >Selection now uses
ring-primary, notring-foreground.Icon chip — theme colour, no inline
style:<div className="flex size-6 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground"> {icon} </div>Delete the
style={{ backgroundColor: accent }}attribute entirely.Header row: keep the kind label, the title and the issue
Badgeas they are. Render{menu}at the right end of that row, so the header becomesicon | (kind + title + badge) | menu. When minimized the header also shows thesummaryone-liner; when expanded it showsdescription— this is the existing conditional, withisCollapsedreplaced by!isExpanded.Body: render
childrenonly whenisExpanded, inside a region that does not fight the canvas:{isExpanded && children && ( <div className="nodrag border-t px-2.5 py-2">{children}</div> )}The
nodragclass is required — without it, dragging inside a text field moves the node instead of selecting text.Target handle moves to the left edge, vertically centred:
{hasTarget && ( <Handle type="target" position={Position.Left} id="in" className={HANDLE_CLASS} /> )}Source handles move to the right edge, one labelled row each. Replace the whole bottom
<div className="relative flex gap-1.5 px-2.5">block with a vertical stack, each row right-aligned with its handle pinned to that row:<div className={cn("flex flex-col", isExpanded ? "border-t py-1.5" : "pb-1")}> {ports.map((port) => ( <div key={port.id} className="relative flex items-center justify-end px-2.5 py-1"> {isExpanded && ( <span className="text-[9.5px] text-muted-foreground">{port.label}</span> )} <Handle type="source" position={Position.Right} id={port.id} className={HANDLE_CLASS} style={{ top: "50%", right: -6 }} /> </div> ))} </div>Each
<Handle>isposition: absolute(ReactFlow's own style) inside itsrelativerow, sotop: "50%"centres it on that row — which is what makes a label sit beside the handle it names.Define the shared handle class once, above the component:
const HANDLE_CLASS = "!size-3 !border-2 !border-card !bg-primary transition-transform " + "hover:!scale-135 hover:!shadow-[0_0_0_4px_hsl(var(--primary)/0.18)]";The
!prefixes are required —@xyflow/react/dist/style.cssships its own.react-flow__handlerules and would otherwise win. If Tailwind rejectshover:!scale-135, usehover:!scale-[1.35].Keep the
NodePorttype export unchanged —WorkflowNodeCardimports it.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: still fails, but ONLY in WorkflowNodeCard.tsx and NodePalette.tsx
# (Tasks 11 and 14). NodeCard.tsx itself must report no errors.
pnpm exec biome check apps/erp/app/modules/workflows/ui/Builder/NodeCard.tsx
# Expected: no error-severity findings.
Out of scope: edges/WorkflowEdge.tsx — getSmoothStepPath derives its
geometry from the Position values it is handed and needs no change. Do not
touch getNodeHandles in @carbon/workflows; handle ids are unchanged and
are shared with the validator.
Task 10: Add the per-node NodeMenu (Minimize, Batch mode, Delete)
Depends on: Task 7
Files:
- Create:
apps/erp/app/modules/workflows/ui/Builder/nodes/NodeMenu.tsx - Copy from (precedent):
apps/erp/app/modules/workflows/ui/Builder/VersionMenu.tsx— an existing dropdown in this exact folder; match itsDropdownMenuimports and structure
Steps:
Read
VersionMenu.tsxfirst and mirror its import list and component shape. TheDropdownMenu*primitives come from@carbon/react.Props:
{ node: BuilderNode }. The component reads what it needs from the builder store itself (useBuilderStore), matching how other builder components do it.Render nothing at all when read-only:
const isReadOnly = useBuilderStore((s) => s.isReadOnly); if (isReadOnly) return null;Trigger: a ghost
IconButtonwithLuEllipsisVerticalfromreact-icons/lu,size="sm",aria-labelfromt`Step options`(useconst { t } = useLingui();from@lingui/react/macro— this is a component, souseLinguiis correct and baretfrom@lingui/core/macrois not).Stop the trigger's pointer events reaching the canvas, or opening the menu will also select/drag the node. Put
className="nodrag nopan"on the trigger and callevent.stopPropagation()in itsonClick.Menu items, in this order:
Minimize / Expand — always present. Label is
t`Minimize`whennode.expanded !== false, elset`Expand`. CallssetNodeExpanded(node.id, !(node.expanded ?? true)).Batch mode — only when
node.type === "action"and the node's configured action is batchable. Resolve that from the catalog the same wayActionForm.tsxdoes — read how it obtainsactionDefand itsactionDef.batchableflag and reuse that exact lookup; do not invent a new one. Render it as a checked item reflectingnode.data.batch === true, callingupdateNodeData(node.id, { batch: !currentBatch }). Label:t`Run once for each item in the list`. When the action id is empty or not batchable, omit the item entirely.Delete — present for every kind except
trigger. Gate onnode.type !== "trigger", matching the existingcanDeleterule the oldConfigPanelused and theremoveNodeguard instore.ts. Destructive styling,LuTrash2icon. OpensDeleteNodeDialog— do not callremoveNodedirectly; the dialog is the existing confirm step.
Hold the dialog's open state locally and render it exactly as
ConfigPanel.tsxdid:{deleteOpen && ( <DeleteNodeDialog nodeId={node.id} onClose={() => setDeleteOpen(false)} /> )}
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: NodeMenu.tsx itself reports no errors (other files may still fail
# pending Tasks 11 and 14).
pnpm exec biome check apps/erp/app/modules/workflows/ui/Builder/nodes/NodeMenu.tsx
# Expected: no error-severity findings.
Out of scope: do not add Duplicate — it was explicitly cut. Do not modify
DeleteNodeDialog.tsx.
Task 11: Rewrite WorkflowNodeCard — render the config form inline, drop LOD
Depends on: Tasks 9, 10
Files:
- Modify:
apps/erp/app/modules/workflows/ui/Builder/nodes/WorkflowNodeCard.tsx - Modify:
apps/erp/app/modules/workflows/ui/Builder/constants.ts— deleteLOD_ZOOM
Steps:
Delete the LOD logic entirely: remove
const isCollapsed = useStore((state) => state.transform[2] < LOD_ZOOM);, theimport { useStore } from "@xyflow/react";(only ifuseStoreis now unused), and theimport { LOD_ZOOM } from "../constants";.In
constants.ts, delete theLOD_ZOOMexport and its comment. KeepNODE_DRAG_TYPE.Read the node's own flag and pass it down:
const builderNode = useBuilderStore((state) => state.nodes.find((n) => n.id === id) ); const isExpanded = builderNode?.expanded ?? true;Pass
isExpanded={isExpanded}andmenu={<NodeMenu node={builderNode} />}toNodeCard, and delete theaccent={meta.accent}andisCollapsed={…}props. Guard the menu onbuilderNodebeing defined.Render the real configuration form as the card's children when expanded. Import the form map — at this point it is still at its original path:
import { NODE_FORMS } from "../panel/forms/index"; import { NodeNameField } from "../panel/NodeNameField";(Task 12 moves that directory and updates these two imports.)
Replace the current children — the summary
<p>and the "Not configured yet"<p>— with the name field plus the form, keeping the failure-handle warning:{isExpanded && builderNode && ( <div className="space-y-3"> <NodeNameField key={node.id} node={node} /> <Form key={node.id} node={node} issues={nodeIssues} /> </div> )} {hasFailureHandle && !hasFailureEdge && ( <p className="mt-1 flex items-center gap-1 text-[10.5px] text-amber-600 dark:text-amber-400"> <LuTriangleAlert className="size-3 shrink-0" /> <Trans>Nothing happens if this fails</Trans> </p> )}where
const Form = NODE_FORMS[node.type];andnodeIssuesis the per-node issue list —ConfigPanel.tsxcomputed it asissues.filter((i) => i.nodeId === node.id). The existingissueCountselector in this file already reads the same store slice; derive both from one selector rather than subscribing twice.Keep
summary— it still feedsNodeCard's minimized state via the existingsummaryprop.The component is wrapped in
memo. It now subscribes to the node list, so confirm it still re-renders when its own node's data changes. Ifmemoplus the store selector causes a stale card, prefer a narrower selector over removingmemo. If you cannot make it update without removingmemo, STOP and report — every node renders through this component and dropping memoization affects canvas performance.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: only NodePalette.tsx still fails (Task 14).
grep -rn "LOD_ZOOM" apps/erp/
# Expected: no matches.
Out of scope: the six form components' internals. They already take
{ node, issues } and write through updateNodeData; nothing about them assumed
a drawer.
Task 12: Delete the config panel and go to a two-panel layout
Depends on: Task 11
Files:
- Delete:
apps/erp/app/modules/workflows/ui/Builder/panel/ConfigPanel.tsx - Rename:
apps/erp/app/modules/workflows/ui/Builder/panel/→apps/erp/app/modules/workflows/ui/Builder/config/ - Modify:
apps/erp/app/modules/workflows/ui/Builder/WorkflowBuilder.tsx— two panels - Modify:
apps/erp/app/modules/workflows/ui/Builder/nodes/WorkflowNodeCard.tsx— fix the two moved imports
Steps:
Delete
panel/ConfigPanel.tsx.Move the directory with git so history is preserved:
git mv apps/erp/app/modules/workflows/ui/Builder/panel apps/erp/app/modules/workflows/ui/Builder/configNodeNameField.tsx,ClauseRow.tsxandforms/move unchanged.Update every import that referenced the old path. Find them first:
grep -rn "Builder/panel\|\.\./panel\|\./panel" apps/erp/app/modules/workflows/and rewrite each
panel/segment toconfig/. Task 11's two imports inWorkflowNodeCard.tsxare among them.In
WorkflowBuilder.tsx:- Delete
import { ConfigPanel } from "./panel/ConfigPanel";. - Delete the third
<ResizablePanel id="config" …>block and the<ResizableHandle withHandle />that precedes it. - Change the canvas panel's
defaultSizefrom62to82. - Change the palette panel to
defaultSize={18} minSize={14} maxSize={26}(rows now carry two lines of text — Task 14). - Change
autoSaveId="workflow-builder"toautoSaveId="workflow-builder-v2". A stored three-panel layout under the old id would try to restore the panel that no longer exists.
- Delete
Leave
setSelected/selectedNodeIdin place. Selection still drives the card'sisSelectedring; it simply no longer drives a panel.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: only NodePalette.tsx still fails (Task 14).
grep -rn "ConfigPanel\|Builder/panel" apps/erp/
# Expected: no matches.
Out of scope: IssuesPanel.tsx is a separate slide-over and stays. Do not
remove selectedNodeId from the store.
Task 13: Remove the batch Switch from ActionForm
Depends on: Task 12 (ordering only — the file moved in Task 12)
Files:
- Modify:
apps/erp/app/modules/workflows/ui/Builder/config/forms/ActionForm.tsx
Steps:
Delete only the
{actionDef.batchable && ( … )}block containing the<Switch>and the "Run once for each item in the list" text (around line 491 before the move). That control now lives in the node menu.Keep the block immediately above it — the amber
{!isBatch && listMismatches.length > 0 && ( … )}callout with the "Run once per item" button. It is a one-way contextual hint driven by the node's wired inputs, not a duplicate of the toggle.Remove the
Switchimport if nothing else in the file uses it. Check first —isBatchandlistMismatchesare still used by the retained callout, so do not remove those.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: only NodePalette.tsx still fails (Task 14).
grep -n "Switch\|isBatch\|listMismatches" apps/erp/app/modules/workflows/ui/Builder/config/forms/ActionForm.tsx
# Expected: isBatch and listMismatches still present (the callout);
# no <Switch> usage remains.
Out of scope: the other five forms.
Task 14: Redesign NodePalette
Depends on: Task 8
Files:
- Modify:
apps/erp/app/modules/workflows/ui/Builder/NodePalette.tsx— full rewrite
Steps:
Fix the resize bug. The root
<aside>is currentlyclassName="flex w-[118px] shrink-0 flex-col gap-1 border-r bg-background p-2". The fixed width andshrink-0are why the contents ignore the panel's size, and theborder-ris the stray border that floats away from the panel edge. It becomes:<aside className="flex h-full w-full flex-col gap-0.5 overflow-y-auto bg-background p-2">Keep the heading, but give it room:
<Trans>Add a step</Trans>with the existing muted-uppercase classes.Each entry becomes an icon + name + description row, reading
meta.Iconandmeta.description(both already inNODE_KIND_META):<button type="button" key={type} disabled={disabled} draggable={!disabled} onDragStart={(event) => { event.dataTransfer.setData(NODE_DRAG_TYPE, type); event.dataTransfer.effectAllowed = "move"; }} onClick={() => addNode(type)} className={cn( "flex w-full items-start gap-2.5 rounded-md p-2 text-left transition-colors", disabled ? "cursor-not-allowed opacity-40" : "hover:bg-accent active:scale-[0.98]" )} > <span className="flex size-6 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground"> <meta.Icon className="size-3.5" /> </span> <span className="min-w-0 flex-1"> <span className="block text-xs font-medium">{meta.name}</span> <span className="block text-[10.5px] leading-snug text-muted-foreground"> {meta.description} </span> </span> </button>Note
w-fullandmin-w-0— those are what let the row track the panel width instead of overflowing. There is no colour swatch and no inlinestyle; the icon chip uses the theme primary.Preserve the existing trigger rule exactly: when a trigger already exists, the Trigger entry is
disabledand wrapped in theTooltip/TooltipTrigger/TooltipContentwith<Trans>A workflow can only have one trigger</Trans>. Keep the<span>wrapper around the button insideTooltipTrigger asChild— a disabled button fires no pointer events, so the tooltip needs the wrapper.Keep
NODE_KIND_ORDERas the iteration source andNODE_DRAG_TYPEon dragstart —WorkflowBuilder.onDropreads that exact key.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: exits 0, no errors — this is the last file that was failing.
pnpm exec biome check apps/erp/app/modules/workflows/
# Expected: no error-severity findings.
Out of scope: the palette stays hidden in read-only mode via the existing
{!isReadOnly && …} guard in WorkflowBuilder.tsx — do not move that logic into
this component.
Task 15: End-to-end verification
Depends on: all previous tasks (Task 4 may still be pending on the user)
Steps:
Full scoped checks:
pnpm exec turbo run typecheck --filter=erp --filter=@carbon/workflows --filter=@carbon/jobs pnpm exec biome check pnpm --filter @carbon/workflows test pnpm --filter @carbon/jobs test cd apps/erp && npx vitest run app/modules/workflows/ && cd ../..Expected: every command exits 0. For
biome check, compare against the pre-existing warning count — only error-severity findings block. This repo carries roughly 419 pre-existing warnings; do not try to fix them.Confirm the removal is complete and the unrelated keys survived:
grep -rn "webhookSecret" apps packages .claude # expect: no matches grep -rn "WEBHOOK_SECRET" packages/env/src/index.ts | wc -l # expect: 6Drive the real app and check each acceptance criterion from the spec's "Builder" section (numbers 9–22). Use the
runskill to start the app and theauth/testskills to drive it, with the user's permission. At minimum:- Create a workflow → no secret is shown, you land in the builder.
- Breadcrumb reads
Workflows / {name}. - Only two panels; no config drawer in the DOM.
- Configure an action node inside the card; reload; the values persisted.
- Zoom 0.25 → 2.0 changes no node's state.
- Minimize a node; reload; it is still minimized.
- The ⋮ menu shows Batch mode on a batchable action node and not on a condition; shows no Delete on the trigger.
- Handles are on the left/right edges, are easy to grab, and ring on hover.
- A condition node's three outputs each sit beside their own label.
- Typing in a node field does not drag it; scrolling a combobox does not zoom.
- Palette rows show icon + name + description and resize with the divider.
- Switching the company theme recolours nodes and palette icons.
- Open the published (read-only) version: no palette, no ⋮, no dragging.
Load a workflow that was saved before this change and confirm every node comes back expanded with no new validation issues.
Report results honestly. If a criterion fails, say which one and show the output — do not describe the work as complete with a known failure outstanding.
Out of scope: committing. Do not commit or push; the user commits on explicit request.