Summary
Create a collapsible sidebar panel that lists all available trigger types and agents as draggable items. Users drag items from the palette onto the React Flow canvas to add new nodes to their workflow composition.
Context
The node palette is the primary mechanism for adding nodes to the workflow canvas. It replaces the dropdown-based trigger type selection in the current WorkflowForm. The palette should be categorized, searchable, and support native HTML5 drag-and-drop to integrate with React Flow's onDrop / onDragOver handlers.
Implementation Details
1. Node palette component
Create ui/src/components/workflows/canvas/NodePalette.tsx:
- Collapsible sidebar panel (left side of canvas)
- Two main sections:
- Trigger Sources - categorized list of trigger types
- Agents - list of available agents from the API
Trigger Sources Section
Organized by category using the getTriggerCategory() helper from #1096:
External Sources
- GitHub Issues
- GitHub Pull Requests
- Linear Issues
- Webhook
Schedules
- Cron Schedule
- One-time Delay
Events
- Agent Lifecycle
- Agent Idle
- Dispatch Result
- Ask Response
Internal
- Manual Trigger
- Queue
- Composite
Each item shows:
Agents Section
- List of agents fetched via
useAgents() hook
- Each item shows: agent name, status badge, model
- Only
running agents are draggable (others shown grayed out with tooltip)
2. Drag-and-drop implementation
- Each palette item has
draggable="true" and onDragStart handler
onDragStart sets transfer data: { type: "trigger" | "agent", triggerType?: TriggerType, agentId?: string }
- Canvas
onDragOver handler: event.preventDefault() + event.dataTransfer.dropEffect = "move"
- Canvas
onDrop handler:
3. Search/filter
- Search input at top of palette filters both triggers and agents
- Matches on name, category, and description
- Empty state message when no results
4. Responsive behavior
- Palette collapses to icon-only on narrow viewports
- Toggle button to expand/collapse
- Keyboard shortcut to toggle (consistent with existing sidebar pattern)
5. Tests
- Palette renders all trigger categories and agent list
- Drag start sets correct transfer data
- Search filters items correctly
- Disabled agents are not draggable
- Collapse/expand toggle works
Files to Create
ui/src/components/workflows/canvas/NodePalette.tsx
ui/src/components/workflows/canvas/NodePalette.test.tsx
- Update
ui/src/components/workflows/canvas/index.ts exports
Acceptance Criteria
Blocked By
Stack Base
Stack on: feature/autonomous-pipeline after #1097 and #1098 merge.
Summary
Create a collapsible sidebar panel that lists all available trigger types and agents as draggable items. Users drag items from the palette onto the React Flow canvas to add new nodes to their workflow composition.
Context
The node palette is the primary mechanism for adding nodes to the workflow canvas. It replaces the dropdown-based trigger type selection in the current
WorkflowForm. The palette should be categorized, searchable, and support native HTML5 drag-and-drop to integrate with React Flow'sonDrop/onDragOverhandlers.Implementation Details
1. Node palette component
Create
ui/src/components/workflows/canvas/NodePalette.tsx:Trigger Sources Section
Organized by category using the
getTriggerCategory()helper from #1096:Each item shows:
Agents Section
useAgents()hookrunningagents are draggable (others shown grayed out with tooltip)2. Drag-and-drop implementation
draggable="true"andonDragStarthandleronDragStartsets transfer data:{ type: "trigger" | "agent", triggerType?: TriggerType, agentId?: string }onDragOverhandler:event.preventDefault()+event.dataTransfer.dropEffect = "move"onDrophandler:reactFlowInstance.screenToFlowPosition()getDefaultTriggerConfig()from Extend frontend TriggerConfig types to match all backend trigger variants #1096useAgents()3. Search/filter
4. Responsive behavior
5. Tests
Files to Create
ui/src/components/workflows/canvas/NodePalette.tsxui/src/components/workflows/canvas/NodePalette.test.tsxui/src/components/workflows/canvas/index.tsexportsAcceptance Criteria
Blocked By
Stack Base
Stack on:
feature/autonomous-pipelineafter #1097 and #1098 merge.