feat: chatsdk card node#334
Conversation
|
yangyu.1 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
📝 WalkthroughWalkthroughThis PR documents a bug fix for the Taro version of chatsdk not outputting Q&A nodes, bumps the package version to 0.1.11-alpha.7d4161, and standardizes the ChatflowNodeData interface by converting PascalCase property names ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/chat-sdk/src/libs/ui-kit/message/components/chatflow-node/index.tsx (1)
108-114:⚠️ Potential issue | 🟡 MinorInconsistent disabled state check.
Line 109 checks
disabled(prop) but line 93 definesrealDisabled = disabled || hasSend. After the first click,hasSendbecomestrue, but subsequent clicks only checkdisabled, allowing the handler logic to proceed (thoughsetHasSend(true)is idempotent).For consistency with the
InputNodecomponent (line 71) and the visual disabled state, userealDisabled:Proposed fix
onClick={() => { - if (disabled) { + if (realDisabled) { return; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/chat-sdk/src/libs/ui-kit/message/components/chatflow-node/index.tsx` around lines 108 - 114, The onClick handler currently checks the prop disabled but should use the computed realDisabled (defined earlier as disabled || hasSend) for consistency with InputNode and the visual state; update the onClick first-line guard to if (realDisabled) return; so that setHasSend and sendTextMessage(item.name) are skipped when either disabled prop or hasSend is true, referencing the onClick handler, realDisabled, setHasSend, and sendTextMessage symbols.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@packages/chat-sdk/src/libs/ui-kit/message/components/chatflow-node/index.tsx`:
- Around line 108-114: The onClick handler currently checks the prop disabled
but should use the computed realDisabled (defined earlier as disabled ||
hasSend) for consistency with InputNode and the visual state; update the onClick
first-line guard to if (realDisabled) return; so that setHasSend and
sendTextMessage(item.name) are skipped when either disabled prop or hasSend is
true, referencing the onClick handler, realDisabled, setHasSend, and
sendTextMessage symbols.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 722570d3-a2f6-4959-a177-ac8b408c7283
📒 Files selected for processing (3)
common/changes/@coze/chat-sdk/fix-chatsdk_card_2026-03-26-06-47.jsonpackages/chat-sdk/package.jsonpackages/chat-sdk/src/libs/ui-kit/message/components/chatflow-node/index.tsx
Summary by CodeRabbit