-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Sender with actions
missing SpeechButton
#549
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 📝 WalkthroughWalkthrough本次改动在 sender 模块中新增了 Changes
Sequence Diagram(s)sequenceDiagram
participant User as 用户
participant Demo as Demo组件
participant ActionPanel as 按钮区容器
participant SpeechButton as SpeechButton组件
participant Sender as ForwardSender组件
User->>Demo: 加载并展示动作面板
Demo->>ActionPanel: 传递按钮组件(Send, Loading, Clear, Speech)
ActionPanel->>SpeechButton: 渲染 SpeechButton(当允许语音时)
User->>SpeechButton: 点击 Speech 按钮
SpeechButton->>Sender: 触发语音输入逻辑
Sender-->>SpeechButton: 返回处理结果
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Bundle ReportBundle size has no change ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/sender/index.tsx (1)
346-348
: 语音功能状态管理完善语音按钮的状态管理逻辑完整,包括:
- 禁用状态控制
- 录音状态同步
- 触发回调处理
建议添加错误处理逻辑。
onSpeech: () => triggerSpeech(false), onSpeechDisabled: !speechPermission, speechRecording, +onSpeechError: (error: Error) => { + console.error('Speech recognition error:', error); + // 可以在这里添加用户提示 +},
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
components/sender/__tests__/__snapshots__/demo-extend.test.ts.snap
is excluded by!**/*.snap
components/sender/__tests__/__snapshots__/demo.test.ts.snap
is excluded by!**/*.snap
📒 Files selected for processing (2)
components/sender/demo/actions.tsx
(1 hunks)components/sender/index.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: test / react component workflow
- GitHub Check: build preview
- GitHub Check: size
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: test / react component workflow
- GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
components/sender/demo/actions.tsx (1)
38-38
: 新增语音按钮组件集成
SpeechButton
组件已正确集成到操作按钮中。按钮布局合理,位于清除按钮和发送按钮之间。Also applies to: 46-46
components/sender/index.tsx (3)
36-36
: 类型定义更新完善
ActionsRender
接口中已正确添加SpeechButton
组件类型定义。
261-264
: 语音按钮条件渲染逻辑合理语音按钮的条件渲染逻辑正确,仅在
allowSpeech
为真时显示。按钮布局合理,位于加载/发送按钮之前。
274-274
: 组件导出更新完整
SpeechButton
已正确添加到自定义 actions 的组件列表中,确保用户可以在自定义渲染时使用该组件。
Deploying ant-design-x with
|
Latest commit: |
601347a
|
Status: | ✅ Deploy successful! |
Preview URL: | https://56b764ca.ant-design-x.pages.dev |
Branch Preview URL: | https://fix-miss-speech.ant-design-x.pages.dev |
size-limit report 📦
|
Deploying ant-design-x with
|
Latest commit: |
90ddf92
|
Status: | ✅ Deploy successful! |
Preview URL: | https://8ca67df8.ant-design-x.pages.dev |
Branch Preview URL: | https://fix-miss-speech.ant-design-x.pages.dev |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #549 +/- ##
=======================================
Coverage 91.79% 91.79%
=======================================
Files 67 67
Lines 1463 1463
Branches 385 386 +1
=======================================
Hits 1343 1343
Misses 120 120 ☔ View full report in Codecov by Sentry. |
great work! |
修复 Sender 的
actions
缺少 SpeechButton 组件的问题。Summary by CodeRabbit