Skip to content

Build node palette sidebar with drag-and-drop onto workflow canvas #1099

Description

@geoffjay

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

  • Sidebar palette renders categorized trigger types with icons and labels
  • Agents section shows available agents with status badges
  • Items are draggable onto the canvas via HTML5 drag-and-drop
  • Drop creates new node at correct canvas position with default config
  • Only running agents are draggable (others grayed out)
  • Search input filters triggers and agents
  • Palette is collapsible with toggle button
  • Styling matches existing theme system
  • Tests cover drag, search, and collapse interactions

Blocked By

Stack Base

Stack on: feature/autonomous-pipeline after #1097 and #1098 merge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity:largeLarge scope: 200+ lines, multiple filesenhancementNew feature or requestfrontendFrontend application codetriagedIssue has been triaged, ready for planning or implementationuiUser interface and frontend

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions