feat(web): flow canvas editing — palette, connect, validate, save (NF-UI-3) #351
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!351
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/333-nfui3-canvas-editing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Upgrades the NF-UI-2 read-only
FlowCanvasinto a proper editor.apps/web/src/features/flows/Palette.tsx) —Qhotkey + right-click opens a searchable, keyboard-navigable list of registry node types. Enter / click spawns the node at the cursor.apps/web/src/features/flows/nodeRegistry.ts) — hardcoded catalog of 35 node types acrosssource/forge/agent/router/template/util, matching the server-sideforge-nodes.ts+agent-nodes.ts+registry.tssurface. Temporary until NF-7 landsGET /flows/registry; explicitly called out in the file's doc comment.apps/web/src/features/flows/FlowCanvas.tsx) — React Flow v12isValidConnectionrefuses mismatched port types + cycles (BFS forward from target);onBeforeDeleterefuses thesourcenode and lets the rest through with an error toast.Ctrl/Cmd+Ssaves.mutex_groupviaflowsApi.list()), enabled checkbox, dirty dot next to the flow name, save button disabled until dirty.beforeunloadprompt on navigation while dirty.apps/web/src/features/flows/flowsApi.ts) —updateFlowruns a client-sidevalidateGraph(unknown types, duplicate ids, port-type compatibility, cycle detection) then bumpsversion+ persists to the in-memory store. A typedFlowValidationErrorcarries{ nodes, edges, global }so the UI highlights offending nodes (red outline viadata.invalid) and toasts the summary.Palette-UX decision
Treated unnamed edges (
port_from/port_toboth absent) as pure control-flow ordering rather than typed data edges — the NF-UI-2 seed fixtures use{from: "src", to: "fetch_pr"}to express "runs after", with the actual data dependency living in the target'sinputsmap. Validating those strictly against the registry's declared port types would flag every existing seed graph as invalid; the docstring onvalidateGraphcalls this out explicitly.Test plan
bun x vitest run src/features/flows/— 39 tests pass (13 registry + 18 editing + 8 pre-existing canvas tests adapted to the editor surface)bun x turbo run typecheck— cleanbun x biome check— cleanOut of scope
argswidgets — NF-UI-4.PATCH /flows/:idendpoint — NF-7 (the mock keeps the shape stable; swapping is a one-file change).Closes #333
🤖 Generated with Claude Code