refactor: use shared renderability and value guards - #1252
Conversation
|
@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. Walkthrough本次变更升级 Changes选择器值与图标处理
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Select now consistently renders numeric zero for clear icons and prefix/suffix affixes while omitting non-renderable values. The covered behavior and passing checks show no current merge-blocking risk. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1252 +/- ##
=======================================
Coverage 99.46% 99.46%
=======================================
Files 31 31
Lines 1304 1307 +3
Branches 473 475 +2
=======================================
+ Hits 1297 1300 +3
Misses 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
CI failed. |
|
已补充 |
yoyo837
left a comment
There was a problem hiding this comment.
The migration is incomplete for numeric-zero affixes.
Both prefix and suffix eventually pass through src/SelectInput/Affix.tsx, which still returns null for !children. Therefore prefix={0} and suffix={0} are still dropped. For a zero suffix, BaseSelect can also add the -show-arrow class while no affix is rendered, leaving CSS state and DOM output inconsistent.
Please update Affix to use isReactRenderable(children) and add coverage for numeric zero plus the false/empty/nullish fallback cases. The current clear-icon changes and the ^1.13.0 dependency update otherwise look reasonable.
|
Addressed in 677efee. |
yoyo837
left a comment
There was a problem hiding this comment.
Affix now renders numeric-zero children, with integration coverage for the affix and clear-icon boundaries, and the coverage gates are green again. LGTM.
说明
isNonNullable替换 combobox value 与 suffix icon 的本地非空判断isReactRenderable统一 clear icon 的 fallback 与渲染逻辑,支持数字0hasValuehelper,并将@rc-component/util最低版本提升到^1.13.0验证
npm run tscnpm run lintnpm test -- tests/Select.test.tsx --runInBandSummary by CodeRabbit
0等可渲染内容作为清除图标。