refactor: use renderable guards for panel content - #455
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 2 included reviews per hour; 1 remains after this review. Walkthrough本次变更升级 Changes可渲染内容判断
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Panel extras retain their existing empty and boolean handling, while renderable numeric content such as 0 is supported for expand icons. The covered behavior is ready to merge with no concrete current risk identified. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ 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 #455 +/- ##
=======================================
Coverage 99.19% 99.19%
=======================================
Files 5 5
Lines 124 124
Branches 45 45
=======================================
Hits 123 123
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yoyo837
left a comment
There was a problem hiding this comment.
extra no longer preserves the existing value semantics.
The previous guard excluded all booleans but treated an empty string as present. isReactRenderable(extra) instead treats true as renderable and an empty string as absent. As a result, extra={true} now creates an empty .rc-collapse-extra wrapper, while extra="" removes a wrapper that previously existed. That can affect header layout, spacing, and the clickable area.
Please preserve the existing contract, for example with isNonNullable(extra) && typeof extra !== 'boolean', and add coverage for true, false, '', and 0. The iconNodeInner migration to isReactRenderable looks correct.
|
Addressed in eb2ba73. The |
yoyo837
left a comment
There was a problem hiding this comment.
The follow-up preserves the original extra semantics and adds the requested boundary coverage for 0, '', true, and false. LGTM.
说明
isReactRenderable统一判断面板 extra 和展开图标是否需要渲染0等有效 React 内容,并统一空内容边界@rc-component/util的最低版本提升到首次提供该 helper 的^1.13.0验证
npm run tscnpm run lintnpm test -- tests/index.spec.tsx --runInBandSummary by CodeRabbit
Bug 修复
0、空字符串和false不会生成多余节点,同时正确显示可渲染内容。维护