feat(web): flow assistant — multi-proposal + list-page surface #391
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!391
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/flow-assistant-relocate-multi"
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
Moves the flow assistant from the canvas-only side-drawer onto the
/flowslist page as a primary-surface drawer, and extends it to propose multiple flows in one turn for complex workflows.Operator can now type
"a flow that opens a PR, requests review, and merges on approval"and get N proposed flows surfaced as separate cards — each with its own Apply / Discard / Edit buttons + a bulk "Apply all".Server (single prompt change)
flow-assistant-routes.ts— system prompt relaxes the "ONE fenced```json```block per reply" rule. Encourages multiple blocks for multi-trigger workflows. The fenced-block extractor +tool_useSSE event already supported N blocks; only the prompt needed to change.Client
FlowAssistantPanelreworked:mode: "create" | "canvas"propproposalfield →proposals: Proposal[](tool_use APPENDS instead of overwrites)mode=create: POST /flows;mode=canvas: replace canvas statesessionStorage, navigate to/flows/new(which reads + pre-loads the canvas)mode=createflows.index.tsx— assistant lives in a 440px right-side drawer toggled by ✨ Assistant button. On close, invalidates["flows"]query so newly-created flows appear in the list.flows.new.tsx— readssessionStorage["flow-assistant-prefill"]on mount and seeds the canvas with the proposal.FlowCanvas.tsx— passesmode="canvas"to its mounted panel (unchanged behaviour, just the new prop).Test plan
FlowAssistantPanel.test.tsx:tool_useevents accumulate as N cardsmode="canvas"→ 13/13 passflow-assistant-routes.test.ts10/10 pass/flows, click ✨ Assistant, type "a workflow with 3 steps…", verify 3 cards🤖 Generated with Claude Code
Moves the flow assistant from the canvas-only side-drawer onto the `/flows` list page as a primary-surface drawer, and extends it to propose MULTIPLE flows in one turn for complex workflows. ## Server `flow-assistant-routes.ts` system-prompt relaxes the "ONE fenced \`\`\`json\`\`\` block per reply" rule — encourages multiple blocks when the operator describes a workflow that naturally spans several triggers. The fenced-block extractor + tool_use SSE event already supported N blocks; only the prompt needed to change. ## Client `FlowAssistantPanel` reworked: - `mode: "create" | "canvas"` prop selects mounting context - Per-message `proposal` field becomes `proposals: Proposal[]` — tool_use events APPEND instead of overwriting - Each proposal renders its own preview card with per-card status (valid / invalid / applied / discarded) - Per-card actions: - Apply — `mode=create`: POST /flows via `createFlow`; `mode=canvas`: replace canvas state via `onApply` - Discard — local-only opt-out - Edit — `mode=create` only: stash proposal in sessionStorage, navigate to `/flows/new` (the new-flow route reads it on mount and pre-loads the canvas) - Bulk "Apply all N" button when 2+ valid proposals are still pending in `mode=create` `flows.index.tsx`: assistant lives in a 440px right-side drawer, toggled by a "✨ Assistant" button next to "+ Create flow". On close, invalidates the `["flows"]` query so newly-created proposals appear in the list. `flows.new.tsx`: reads `sessionStorage["flow-assistant-prefill"]` on mount and seeds the canvas with the proposal — wired to the "Edit-in-canvas" Edit button on each proposal card. `FlowCanvas.tsx`: now passes `mode="canvas"` to its mounted panel (unchanged behaviour, just the new prop). ## Tests 4 new e2e tests in `FlowAssistantPanel.test.tsx`: - multiple tool_use events accumulate as N proposal cards - create mode: Apply triggers createFlow, marks card applied - create mode: Discard hides actions - create mode: Apply all batches N valid proposals via createFlow Existing 9 tests updated to pass `mode="canvas"`. All 13 pass. Server side: `flow-assistant-routes.test.ts` — 10 pass / 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>