Skip to content

feat: add suffix and deprecate suffixIcon - #1014

Merged
zombieJ merged 1 commit into
react-component:masterfrom
QDyanbing:deprecate-suffix-icon
Sep 7, 2026
Merged

zombieJ merged 1 commit into
react-component:masterfrom
QDyanbing:deprecate-suffix-icon

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

新增统一的 suffix 属性,并将 suffixIcon 标记为废弃,兼容现有调用。单选、多选、时间和范围选择统一使用 suffix ?? suffixIconsuffixnullundefined 时回退到旧属性,其余值优先使用新属性。

同步更新内部属性传递、中文和英文 README、示例及测试,保留现有 DOM 结构和语义样式。

验证:

  • 全量测试:473 个通过、2 个跳过,29 个快照通过。
  • TypeScript、文档构建及格式检查通过;ESLint 无错误,现有 hooks warning 共 16 条。
  • 补充旧属性兼容及新属性优先级测试;审查时额外验证四种选择模式的 32 个后缀渲染组合。

Summary by CodeRabbit

  • 新功能
    • 选择器组件新增 suffix 属性,用于自定义后缀内容。
    • 同时传入 suffix 与旧版 suffixIcon 时,优先使用 suffix
  • 弃用
    • suffixIcon 已标记为弃用,建议迁移至 suffix;现有用法仍保持兼容。
  • 文档
    • 更新中英文 API 文档及基础、范围、时间和自定义示例,统一展示 suffix 的使用方式。

@vercel

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

Copy link
Copy Markdown
Contributor

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: 6dc18a79-7091-43c8-9704-bd06c5367268

📥 Commits

Reviewing files that changed from the base of the PR and between a975a11 and d59c833.

📒 Files selected for processing (15)
  • README.md
  • README.zh-CN.md
  • docs/examples/basic.tsx
  • docs/examples/customize.tsx
  • docs/examples/range.tsx
  • docs/examples/time.tsx
  • src/PickerInput/RangePicker.tsx
  • src/PickerInput/Selector/Input.tsx
  • src/PickerInput/Selector/RangeSelector.tsx
  • src/PickerInput/Selector/SingleSelector/index.tsx
  • src/PickerInput/SinglePicker.tsx
  • src/PickerInput/hooks/useFilledProps.ts
  • src/interface.tsx
  • tests/picker.spec.tsx
  • tests/range.spec.tsx

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


Walkthrough

Picker 组件新增 suffix 属性,并将其传递到单选、范围选择器和输入组件。suffixIcon 保留兼容支持。文档、示例和测试同步更新。

Changes

suffix 属性迁移

Layer / File(s) Summary
属性契约与兼容处理
src/interface.tsx, src/PickerInput/hooks/useFilledProps.ts
公共接口新增 suffix,并将 suffixIcon 标记为已废弃。useFilledProps 在两者同时存在时优先使用 suffix
选择器属性传递与渲染
src/PickerInput/Selector/*, src/PickerInput/RangePicker.tsx, src/PickerInput/SinglePicker.tsx
选择器组件改用 suffix 进行属性解构、传递和渲染。
示例、文档与测试更新
README*.md, docs/examples/*, tests/picker.spec.tsx, tests/range.spec.tsx
示例和文档改用 suffix。测试覆盖新属性、旧属性兼容性及新属性优先级。

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

Merge Risk: ⚪ Minimal · up to d59c8

Picker components now support suffix as the preferred custom suffix prop while retaining suffixIcon compatibility. The documented rendering behavior and precedence are covered, with no remaining concrete merge-blocking risk.

Suggested reviewers: zombiej, afc163

Poem

小兔把 suffix 放进选择器,
旧的 suffixIcon 仍在守门。
新旧属性同时出现时,
suffix 轻轻跳到前面。
文档与测试排好队,
后缀图标开心转圈。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 13 files. (2 skipped: … 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 标题准确概括了主要变更:新增统一的 suffix 属性,并弃用 suffixIcon。内容简洁且与代码、文档和测试变更一致。
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 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 13 files. (2 skipped: 2 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 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.88%. Comparing base (a975a11) to head (d59c833).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1014   +/-   ##
=======================================
  Coverage   98.88%   98.88%           
=======================================
  Files          68       68           
  Lines        2867     2868    +1     
  Branches      822      795   -27     
=======================================
+ Hits         2835     2836    +1     
  Misses         29       29           
  Partials        3        3           

☔ 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.

@zombieJ
zombieJ merged commit 8d5c608 into react-component:master Sep 7, 2026
9 of 10 checks passed
@QDyanbing
QDyanbing deleted the deprecate-suffix-icon branch September 7, 2026 03:31
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