fix: Badge ref not working with text mode#56532
Conversation
|
|
Summary of ChangesHello @zombieJ, 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! This pull request addresses a bug in the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
👁 Visual Regression Report for PR #56532 Failed ❌
Important There are 3 diffs found in this PR: 🔄
|
📝 WalkthroughSummary by CodeRabbit发布说明
✏️ Tip: You can customize this high-level summary in your review settings. 功能概述Badge组件在status-only渲染分支中添加了ref转发支持,并新增测试用例验证该功能。总改动量:7行。 改动清单
预期代码审查工作量🎯 1 (Trivial) | ⏱️ ~3 分钟 庆祝诗
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (8)**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
components/**/*.tsx📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
components/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/__tests__/**/*.test.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,md}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,css}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.tsx📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.test.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (6)📓 Common learnings📚 Learning: 2025-11-24T16:30:28.374ZApplied to files:
📚 Learning: 2025-11-24T16:30:28.374ZApplied to files:
📚 Learning: 2025-11-24T16:30:28.374ZApplied to files:
📚 Learning: 2026-01-04T15:16:45.886ZApplied to files:
📚 Learning: 2025-11-24T16:30:28.374ZApplied to files:
🧬 Code graph analysis (1)components/badge/__tests__/index.test.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). (18)
🔇 Additional comments (2)
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.
Code Review
This pull request correctly fixes a bug where the ref was not being forwarded on a Badge component when used in text mode without children. The fix involves adding the ref to the appropriate <span> element in the status-only rendering path. A new test case has also been added to verify this fix and prevent future regressions. The changes are correct and well-tested.
Deploying ant-design-next with
|
| Latest commit: |
c2bbb45
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://deeb1acb.ant-design-next.pages.dev |
| Branch Preview URL: | https://fix-badge-ref.ant-design-next.pages.dev |
size-limit report 📦
|
Deploying ant-design with
|
| Latest commit: |
c2bbb45
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0ed07f47.ant-design.pages.dev |
| Branch Preview URL: | https://fix-badge-ref.ant-design.pages.dev |
|
这个没相关 issue 吗 |
Bundle ReportChanges will increase total bundle size by 12 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
More templates
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #56532 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 805 805
Lines 14847 14847
Branches 3920 3920
=========================================
Hits 14847 14847 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
没有,业务发现的 |










中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log
refnot working withtextprops.text属性时,ref无效的问题。