Skip to content

fix: preserve zero-valued step handlers - #756

Merged
yoyo837 merged 1 commit into
react-component:masterfrom
QDyanbing:fix-react-node-guards
Sep 28, 2026
Merged

yoyo837 merged 1 commit into
react-component:masterfrom
QDyanbing:fix-react-node-guards

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

说明

  • 上下调节按钮的自定义内容为 0 时保留该内容,不再回退到默认图标。
  • 补充零值按钮显示、增加和减少数值的交互测试。

验证

  • npm test -- --runInBand(188 项通过)
  • npm run tsc
  • 改动源码 ESLint 检查通过。

关联 ant-design/ant-design#59193

Summary by CodeRabbit

  • 修复
    • 修正内容渲染行为:数字 0 等有效内容不再被内部占位元素替换。
    • 修复数字输入框的加减按钮显示为 0 时无法正常交互的问题;点击后会正确触发数值变化。

@vercel

vercel Bot commented Sep 28, 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 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ce52bce1-1759-4f75-a775-5d343b50541e

📥 Commits

Reviewing files that changed from the base of the PR and between 2e4c1b7 and 0e00745.

📒 Files selected for processing (2)
  • src/StepHandler.tsx
  • tests/renderability.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


Walkthrough

StepHandler 现在使用 isReactRenderable 判断子元素是否可渲染。不可渲染时仍渲染内部占位 span。新增测试验证 InputNumber 的零值步进处理器显示为 0,并触发预期的数值更新。

Changes

步进处理器可渲染性

Layer / File(s) Summary
可渲染性判断与零值测试
src/StepHandler.tsx, tests/renderability.test.tsx
StepHandler 使用 isReactRenderable 判断子元素是否可渲染。测试验证 upHandler 和 downHandler 为 0 时按钮显示 0,增加和减少操作分别使 onChange 最近一次收到 3 和 2。

Priority: ⬇️ Low

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

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 0e007

The change preserves zero-valued step handlers, and the supplied tests cover their display and interactions. No actionable merge risk is established by the available evidence.

🚥 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 2 files. 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 标题准确概括了主要变更:保留值为 0 的 step handlers。标题简洁、明确,并与代码和测试变更一致。
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

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 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.16%. Comparing base (2e4c1b7) to head (0e00745).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #756      +/-   ##
==========================================
+ Coverage   96.14%   96.16%   +0.02%     
==========================================
  Files           6        6              
  Lines         363      365       +2     
  Branches      102      105       +3     
==========================================
+ Hits          349      351       +2     
  Misses         14       14              

☔ 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 2b12adb into react-component:master Sep 28, 2026
11 of 12 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