feat: Add badge to leaf nodes#138
Open
lornakelly wants to merge 1 commit intoserverlessworkflow:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds subtype “badges” to task leaf nodes in the React Flow diagram editor, along with subtype extraction helpers and initial support for TryCatch/Catch nodes to advance the agreed node styling/UX work.
Changes:
- Introduces task subtype extraction utilities for
Call,Run, andListentasks and exports them fromsrc/core. - Adds badge rendering to leaf task nodes (text for known subtypes, info-icon with tooltip for unknown).
- Adds
Catchas a leaf node (incl. config + tests) andTryCatchas a placeholder container node; adjusts default node sizing and demo diagram data.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/serverless-workflow-diagram-editor/tests/react-flow/nodes/taskNodeConfig.test.ts | Updates leaf node config coverage to include Catch. |
| packages/serverless-workflow-diagram-editor/tests/react-flow/nodes/Nodes.test.tsx | Extends node rendering tests for TryCatch/Catch and adds badge rendering tests. |
| packages/serverless-workflow-diagram-editor/tests/core/taskSubType.test.ts | Adds unit tests for subtype extraction utilities. |
| packages/serverless-workflow-diagram-editor/src/react-flow/nodes/taskNodeConfig.ts | Adds Catch leaf node config (color/icon/type label). |
| packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx | Adds TryCatch/Catch node types and implements TaskNodeBadge rendering. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.tsx | Updates hardcoded demo nodes to include badges and tweaks positions/edge waypoints. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.css | Adds badge styling and adjusts leaf node layout to accommodate badge + truncation. |
| packages/serverless-workflow-diagram-editor/src/core/taskSubType.ts | Implements getCallSubType, getRunSubType, getListenSubType, getTaskSubType. |
| packages/serverless-workflow-diagram-editor/src/core/index.ts | Exports the new taskSubType module. |
| packages/serverless-workflow-diagram-editor/src/core/autoLayout.ts | Increases default node width to 200. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: lornakelly <lornakelly88@gmail.com>
3d87847 to
21beae8
Compare
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.
Closes #85
Summary
Add badge rendering and subtype extraction for leaf nodes
Changes
Catchleaf node andTryCatchcontainer node with placeholder content