feat(ui): create trigger source node components for workflow canvas#1109
Open
geoffjay wants to merge 2 commits intoissue-1096from
Open
feat(ui): create trigger source node components for workflow canvas#1109geoffjay wants to merge 2 commits intoissue-1096from
geoffjay wants to merge 2 commits intoissue-1096from
Conversation
Owner
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced Apr 14, 2026
geoffjay
commented
Apr 17, 2026
Owner
Author
geoffjay
left a comment
There was a problem hiding this comment.
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
- "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.
- 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.
- 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.
- 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 was referenced Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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