Skip to content

feat(ui): create trigger source node components for workflow canvas - #1109

Open
geoffjay wants to merge 2 commits into
issue-1096from
issue-1097
Open

geoffjay wants to merge 2 commits into
issue-1096from
issue-1097

Conversation

@geoffjay

Copy link
Copy Markdown
Owner

Add TriggerNode custom React Flow node supporting all 14 trigger types with category-coloured styling (external/blue, schedule/violet, event/amber, internal/slate), config summaries, output handles, and selected/disabled states. Export workflowNodeTypes map. 31 tests.

Closes #1097

@geoffjay geoffjay added the review-agent Used to invoke a review by an agent tracking this label label Apr 14, 2026

@geoffjay geoffjay left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: feat(ui): create trigger source node components for workflow canvas

Stack position: issue-1097 (#1109) stacked on issue-1096 (#1108). Parent #1108 is being reviewed simultaneously and has no blocking issues.

Overview

Adds TriggerNode — a category-coloured React Flow node supporting all 13 trigger types with config summaries, an output handle, and selected/disabled states. Registers it in workflowNodeTypes. 31 tests across all major trigger categories.

What looks good

  • Icon and colour maps: TRIGGER_ICONS and CATEGORY_COLOURS are both typed as Record<TriggerType, ...> and Record<TriggerCategory, ...>, respectively. TypeScript enforces completeness on both. The ?? Hand / ?? CATEGORY_COLOURS.internal fallbacks are correct safety nets for runtime unknowns.
  • configSummary switch: Covers all 13 variants plus default: return "". The github_issues/github_pull_requests fall-through case sharing is appropriate since both have the same field shape. Labels are shown with overflow truncation (+N) which is good UX for space-constrained node cards.
  • filter(Boolean) on className array: Correctly removes the empty string produced by !enabled ? "opacity-50 grayscale" : "" when enabled. Pattern is consistent with AgentNode in the next PR in the stack.
  • data-trigger-type attribute: Useful for E2E targeting without coupling to text content. Consistent with AgentNode's data-agent-id.
  • Test coverage: 31 tests covering 9 trigger types, selected state, disabled state, and custom label. The composite test regex /AND.0 trigger/ correctly handles the separator via ..

Non-blocking notes

  1. "All 14 backend trigger types" in the file doc comment — the count is 13 (same discrepancy flagged in #1108). TRIGGER_ICONS has 13 keys, configSummary has 13 cases.
  2. delay and ask_response trigger types have no dedicated tests — the delay variant's new Date(run_at).toLocaleString() and ask_response's category ?? "Any category" paths are untested. Not blocking but worth a follow-up.
  3. cron branch returns config.expression || "No expression" — since expression is a required string field on the cron variant (not string | undefined), the fallback is unreachable. Harmless but slightly misleading.

Verdict

Well-structured node component with solid test coverage and exhaustive type handling. LGTM.

@geoffjay geoffjay added merge-queue Approved by reviewer, queued for merge by conductor and removed review-agent Used to invoke a review by an agent tracking this label labels Apr 17, 2026
geoffjay added 2 commits May 12, 2026 16:38
- Create TriggerNode base component with category accent colouring
- Support all 14 trigger types with distinct lucide-react icons
- Category colour system: external (blue), schedule (violet), event (amber), internal (slate)
- Config summary renders the most relevant fields per trigger type
- Output handle (right side) for connecting to agent nodes
- Selected state with ring highlight, disabled state with opacity/grayscale
- Export workflowNodeTypes map for React Flow registration
- 31 tests covering all trigger variants, selected/disabled states, custom label

This branch has not been deployed

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

Labels

merge-queue Approved by reviewer, queued for merge by conductor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant