Skip to content

refactor: use renderable guards for option icons - #664

Merged
yoyo837 merged 1 commit into
react-component:masterfrom
QDyanbing:refactor-renderable-guards
Sep 3, 2026
Merged

refactor: use renderable guards for option icons#664
yoyo837 merged 1 commit into
react-component:masterfrom
QDyanbing:refactor-renderable-guards

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

说明

  • 使用 isReactRenderable 统一判断展开图标和加载图标是否需要渲染
  • 支持数字 0 等有效 React 内容
  • @rc-component/util 的最低版本提升到首次提供该 helper 的 ^1.13.0

验证

  • npm run tsc
  • npm run lint
  • npm test -- tests/index.spec.tsx --runInBand

Summary by CodeRabbit

  • Bug 修复
    • 优化级联选项列表中的展开图标和加载图标渲染逻辑。
    • 仅在图标内容可正常显示时渲染对应区域,避免出现空白或异常的图标占位。
    • 改善包含特殊图标配置时的界面显示效果与稳定性。

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 662a1779-cad5-4567-a989-0b4166db1a77

📥 Commits

Reviewing files that changed from the base of the PR and between a894dc9 and 7de1527.

📒 Files selected for processing (2)
  • package.json
  • src/OptionList/Column.tsx

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

更新 @rc-component/util 依赖版本。Column 仅在图标值可被 React 渲染时渲染展开图标和加载图标区块。

Changes

图标渲染

Layer / File(s) Summary
图标渲染条件与依赖更新
src/OptionList/Column.tsx, package.json
引入 isReactRenderable。展开图标和加载图标改用 React 可渲染性判断。@rc-component/util 版本约束从 ^1.11.1 更新为 ^1.13.0

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 7de15

The change standardizes when existing option icons render and updates the utility dependency needed for that behavior. It introduces no actionable merge-blocking risk and is merge-ready after normal checks and review.

Suggested reviewers: zombiej, afc163

Poem

小兔检查图标门,
可渲染值才入门。
展开加载排好队,
工具版本也更新。
代码轻快向前奔。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了主要变更:使用可渲染值检查来处理选项图标。标题简洁、明确,并与代码及 PR 目标一致。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.40%. Comparing base (a894dc9) to head (7de1527).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #664   +/-   ##
=======================================
  Coverage   99.40%   99.40%           
=======================================
  Files          22       22           
  Lines         669      669           
  Branches      201      212   +11     
=======================================
  Hits          665      665           
  Misses          4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yoyo837 yoyo837 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the renderability semantics, helper selection, dependency floor, existing feedback, and completed CI results. The implementation looks correct. The Vercel failure is limited to team deployment authorization and is not a code or build failure.

@yoyo837
yoyo837 merged commit e7a65ef into react-component:master Sep 3, 2026
10 of 11 checks passed
aibayanyu20 added a commit to antdv-next/vue-components that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants