fix(web): recognize loop and approval node types in DAG builder#1744
Conversation
resolveNodeDisplay() fell through to the 'prompt' fallback for loop and approval nodes, giving them nodeType='prompt' with no promptText. useBuilderValidation then raised false-positive "prompt cannot be empty" errors for both node types. Changes: - dag-layout.ts: add loop and approval cases to resolveNodeDisplay() - DagNodeComponent.tsx: extend nodeType union; add TYPE_CONFIG entries and getContentPreview cases for loop and approval - index.css: add --node-loop (teal) and --node-approval (amber) tokens Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…types Tests requested by Wirasm for PR coleam00#1722: - resolveNodeDisplay(): loop node → { label, nodeType, promptText }, approval → { label, nodeType } - dagNodesToReactFlow() integration: asserts loop and approval nodes have correct nodeType in output - getContentPreview(): loop multi-line prompt returns first line; approval returns empty string - Exports getContentPreview from DagNodeComponent.tsx to make it testable - Extends test script to cover src/components/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds support for two new DAG node types ( ChangesLoop and Approval Node Type Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@nhiendohao this PR appears to fully address #1336. Consider adding |
Review SummaryVerdict: ready-to-merge Clean addition of Blocking issuesNone. Suggested fixesNone. Minor / nice-to-haveNone — this PR is clean. Compliments
Reviewed via maintainer-review-pr workflow (Pi/Minimax). Aspects run: code-review. |
Summary
loopandapprovalnodes were falling through to theprompttype inresolveNodeDisplay()dag-layout.ts,DagNodeComponent.tsx, andindex.cssCloses #1336
Note
This is a retarget of #1722 which was closed because it targeted
maininstead ofdev. Code and tests are unchanged — no rework was needed.Test plan
resolveNodeDisplay()andDagNodeComponent(included in this branch)Summary by CodeRabbit
New Features
Tests