fix: handle whitespace-only values in content-has-value class#1209
fix: handle whitespace-only values in content-has-value class#1209
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 resolves a UI inconsistency within 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. Changelog
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
|
概述在单值选择输入内容组件中引入了新的布尔常量 变更
估计代码审查工作量🎯 2 (简单) | ⏱️ ~10 分钟 可能相关的拉取请求
建议的审查者
诗歌
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1209 +/- ##
=======================================
Coverage 99.43% 99.43%
=======================================
Files 31 31
Lines 1234 1234
Branches 423 445 +22
=======================================
Hits 1227 1227
Misses 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where whitespace-only values were incorrectly considered as having content. The change correctly trims the label and checks if it's empty. A test case has been added to cover this scenario. My feedback includes a suggestion to simplify the new logic for better readability.
| const showHasValueCls = | ||
| displayValue && | ||
| displayValue.label !== null && | ||
| displayValue.label !== undefined && | ||
| String(displayValue.label).trim() !== ''; | ||
|
|
There was a problem hiding this comment.
The logic to determine showHasValueCls can be simplified for better readability. The !! and extra parentheses are redundant, != null can be used to check for both null and undefined, and optional chaining (?.) can make the code more concise.
const showHasValueCls =
displayValue?.label != null && String(displayValue.label).trim() !== '';
ref ant-design/ant-design#56966
Summary by CodeRabbit
Bug Fixes