Skip to content

refactor: use shared non-nullable guards - #397

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

refactor: use shared non-nullable guards#397
yoyo837 merged 1 commit into
react-component:masterfrom
QDyanbing:refactor-renderable-guards

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

说明

  • 使用 isNonNullable 替换 title、subTitle 和 content 的本地 hasContent 判断
  • 移除重复 helper,保持原有非空语义
  • @rc-component/util 的最低版本提升到 ^1.13.0

验证

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

Summary by CodeRabbit

  • 重构
    • 优化步骤组件对标题、副标题及内容存在性的判断逻辑。
    • 统一使用更可靠的非空值判断方式,提升代码一致性。
    • 此调整不改变现有界面呈现或用户操作体验。

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

@QDyanbing is attempting to deploy a commit to the afc163's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 3, 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: 5802c919-9e3a-4bc7-99a7-30c2b5f3dcf6

📥 Commits

Reviewing files that changed from the base of the PR and between 95b7a56 and 1e05b4a.

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

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


Walkthrough

项目升级 @rc-component/util 版本。Step.tsx 移除本地 hasContent,改用 isNonNullable 判断标题、副标题和内容。判断语义及渲染行为保持不变。

Changes

Step 非空判断工具更新

Layer / File(s) Summary
替换本地非空判断实现
package.json, src/Step.tsx
@rc-component/util^1.11.1 升级到 ^1.13.0Step.tsx 使用 isNonNullable 替代本地 hasContent

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 1e05b

This change replaces duplicated null and undefined checks in Step rendering with the shared utility and updates its required dependency version. Title, subtitle, and content rendering behavior remains unchanged, with no current merge-readiness risk identified.

Suggested reviewers: afc163

Poem

小兔带来工具新版本,
isNonNullable 轻快登场。
标题副标题继续显示,
内容判断保持原样。
代码更短,月光更亮。

🚥 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 标题准确概括了主要变更:使用共享的非空值守卫替代本地辅助函数。标题简洁、明确,并与代码和依赖版本更新相关。
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 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (95b7a56) to head (1e05b4a).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #397   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines           99        97    -2     
  Branches        38        36    -2     
=========================================
- Hits            99        97    -2     

☔ 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 merged commit 400f7cf into react-component:master Sep 3, 2026
9 of 10 checks passed
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