-
-
Notifications
You must be signed in to change notification settings - Fork 947
fix(Sender): add disabled style for SpeechButton when browser doesn't… #1525
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
base: main
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthrough对语音按钮组件的 props 传递与 className 组合进行了调整,新增 speech-disabled 的样式规则并将其映射到按钮的禁用逻辑和视觉状态。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 分钟
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)packages/x/components/sender/components/SpeechButton/index.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
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 |
Summary of ChangesHello @Chiaki-xps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 本次拉取请求旨在解决 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
这个 PR 旨在修复当浏览器不支持语音识别 API 时,语音按钮样式异常的问题。整体思路是正确的,通过添加一个特定的 CSS 类来应用禁用样式。我对代码实现有几点建议,主要集中在 SpeechButton 组件中类名的构建方式和 disabled 属性的冗余处理上。这些修改将使代码更简洁且符合组件的现有设计。样式文件的修改看起来没有问题。
| className={classNames(className, { | ||
| [`${prefixCls}-actions-btn-speech-disabled`]: onSpeechDisabled, | ||
| })} | ||
| disabled={onSpeechDisabled || restProps.disabled} |
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.
Bundle ReportChanges will increase total bundle size by 320.38kB (10.52%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: antdx-array-pushAssets Changed:
view changes for bundle: x-markdown-array-pushAssets Changed:
|
… support SpeechRecognition
123191d to
29163ba
Compare
|
@utoo/pack/ ci 编译异常 cc @kimteayon |
|
disabled 的样式需要在考虑下 不是没有设置 而是被 antd 的按钮覆盖了样式导致的 目前的修改方案有些冗余和不统一 |

根据本次修改内容,帮你填写 PR 模板:
🤔 这个变动的性质是?
🔗 相关 Issue
当浏览器不支持
SpeechRecognitionAPI 时,Sender 组件的语音按钮显示异常,按钮不可见但 hover 时会出现禁用提示。💡 需求背景和解决方案
问题描述:
当浏览器不支持
SpeechRecognitionAPI(如部分移动端浏览器或旧版浏览器)时,Sender 组件的语音按钮虽然设置了disabled状态,但没有对应的禁用样式,导致按钮不可见,用户体验不佳。解决方案:
SpeechButton组件中,当onSpeechDisabled为true时,添加speech-disabled类名&-speech-disabled禁用样式,包括灰色文字和not-allowed光标修改前后对比:
📝 更新日志
Summary by CodeRabbit
发布说明
样式
重构
✏️ Tip: You can customize this high-level summary in your review settings.