Skip to content

Conversation

@Chiaki-xps
Copy link
Contributor

@Chiaki-xps Chiaki-xps commented Dec 22, 2025

🤔 这个变动的性质是?

  • 🆕 新特性提交
  • 🐞 Bug 修复
  • 📝 站点、文档改进
  • 📽️ 演示代码改进
  • 💄 组件样式/交互改进
  • 🤖 TypeScript 定义更新
  • 📦 包体积优化
  • ⚡️ 性能优化
  • ⭐️ 功能增强
  • 🌐 国际化改进
  • 🛠 重构
  • 🎨 代码风格优化
  • ✅ 测试用例
  • 🔀 分支合并
  • ⏩ 工作流程
  • ⌨️ 无障碍改进
  • ❓ 其他改动(是关于什么的改动?)

🔗 相关 Issue

  1. 描述相关需求的来源,如相关的 issue 讨论链接。
  2. 例如 close #xxxx、 fix #xxxx

💡 需求背景和解决方案

  1. 要解决的具体问题。
  2. 列出最终的 API 实现和用法。
  3. 涉及UI/交互变动建议提供截图或 GIF。

补充 Sender 组件缺失的 API 文档,以确保文档与代码定义(interface.ts)保持一致。

主要补充内容:

  1. Sender 属性:新增 onPaste, onKeyDown, onFocus, onBlur, placeholder 的 API 说明。
  2. Sender Ref:补充 inputElement 属性说明。
  3. Sender Switch 模式:补充 defaultValue, classNames, styles 等相关属性说明。

📝 更新日志

语言 更新描述
🇺🇸 英文 Docs(Sender): Supplement missing API documentation (onPaste, onKeyDown, etc.)
🇨🇳 中文 Docs(Sender): 补充缺失的 API 文档(包括 onPaste, onKeyDown 等)

Summary by CodeRabbit

  • 新增功能
    • Sender 组件新增事件回调:支持粘贴(onPaste)、键盘(onKeyDown)、聚焦(onFocus)与失焦(onBlur)事件。
    • 新增输入框占位符配置(placeholder)。
    • 暴露输入框元素的公共引用(inputElement),便于直接访问输入控件。
    • Sender 的 Switch 变体新增默认值配置(defaultValue)。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

更新了 Sender 组件的公开 API:在 SenderProps 中新增输入与事件相关属性(onPasteonKeyDownonFocusonBlurplaceholder),在 Ref/ActionsComponents 中暴露 inputElement,并为 Sender.Switch 添加 defaultValue(均为增量变更)。

Changes

Cohort / 文件(s) 变更摘要
Sender 组件文档(英文/中文)
packages/x/components/sender/index.en-US.md, packages/x/components/sender/index.zh-CN.md
新增 SenderProps 属性:onPasteonKeyDownonFocusonBlurplaceholder;在 SenderRefActionsComponents 中新增并暴露 inputElementHTMLTextAreaElement);在 Sender.Switch 中新增 defaultValueboolean)。仅为公开 API 与文档/类型的增量扩展。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 我在文档里轻轻跳,
新增回调与占位笑,
输入引用悄然露爪,
Switch 多了默认好,
小改动,快乐到绕跳 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确反映了主要变更,即为Sender组件补充API文档。标题简洁明确,与变更集内容完全对应。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

Preview failed

@dosubot dosubot bot added the documentation Improvements or additions to documentation label Dec 22, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Chiaki-xps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在完善 Sender 组件的 API 文档,确保其与代码定义(interface.ts)保持一致,从而提高文档的完整性和准确性,方便开发者查阅和使用。

Highlights

  • Sender 属性: 补充了 onPaste, onKeyDown, onFocus, onBlur, placeholder 等属性的 API 文档。
  • Sender Ref: 增加了 inputElement 属性的说明。
  • Sender.Switch 模式: 补充了 defaultValue, classNames, styles 等相关属性的文档。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

这次的 PR 主要是为 Sender 组件补充了缺失的 API 文档,包括 Sender 的属性、Ref 方法以及 Sender.Switch 的属性,确保了文档和代码定义的一致性。做得很好!

我有几点关于文档内容组织和一致性的小建议,主要涉及属性的排序,希望能让文档更清晰易读。具体请看下面的评论。

@codecov
Copy link

codecov bot commented Dec 22, 2025

Bundle Report

Changes will decrease total bundle size by 209 bytes (-0.01%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antdx-array-push 1.76MB -209 bytes (-0.01%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: antdx-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antdx.min.js -209 bytes 1.76MB -0.01%

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.84%. Comparing base (2a35844) to head (60f0394).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1561   +/-   ##
=======================================
  Coverage   94.84%   94.84%           
=======================================
  Files         140      140           
  Lines        4245     4245           
  Branches     1184     1203   +19     
=======================================
  Hits         4026     4026           
  Misses        217      217           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 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.

- Reorder properties in Sender Ref and Sender.Switch for better readability based on review suggestions.

- Remove redundant classNames and styles properties from Sender.Switch documentation.
@Chiaki-xps Chiaki-xps changed the title docs(Sender): 补充 API 文档 docs(Sender): Supplement API documentation Dec 22, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 23, 2025
Chiaki-xps and others added 2 commits December 23, 2025 18:12
Wrap HTMLElement and HTMLTextAreaElement with backticks in API tables to prevent dumi from parsing them as JSX tags during SSR pre-rendering.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/x/components/sender/index.en-US.md (1)

62-67: 属性排序可进一步优化(建议非必要)

虽然新增的 5 个属性已正确添加,但当前排序方式将 onPaste 和其他新增属性由 onPasteFile 分隔。建议将事件回调按字母顺序排列,或将相关属性分组:

期望顺序:

  • onBlur, onCancel, onFocus, onKeyDown, onPaste, onPasteFile(事件回调按字母序)
  • placeholder(非事件属性放在最后)

这样可以提升表格的可读性和一致性。

packages/x/components/sender/index.zh-CN.md (1)

64-69: 属性排序可进一步优化(建议非必要)

虽然新增的 5 个属性已正确添加,但当前排序方式将 onPaste 和其他新增属性由 onPasteFile 分隔。建议将事件回调按字母顺序排列,或将相关属性分组:

期望顺序:

  • onBlur, onCancel, onFocus, onKeyDown, onPaste, onPasteFile(事件回调按字母序)
  • placeholder(非事件属性放在最后)

这样可以提升表格的可读性和一致性,与英文文档保持对称。

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ece264 and 9372c96.

📒 Files selected for processing (2)
  • packages/x/components/sender/index.en-US.md
  • packages/x/components/sender/index.zh-CN.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: size
  • GitHub Check: test
  • GitHub Check: build preview
🔇 Additional comments (6)
packages/x/components/sender/index.en-US.md (3)

62-67: 类型转义处理正确,SSR 兼容性有保障

新增属性的通用类型参数都已正确用反引号包裹(如 `HTMLElement``HTMLTextAreaElement`),与现有属性一致,能够有效防止 dumi SSR 预渲染时将其误解析为 JSX 标签。


109-109: inputElement 放置位置正确,与 SenderRef 类型定义保持一致

inputElement 已正确放置在 nativeElement 之前,符合之前审查反馈的要求。类型转义同样正确。


190-190: defaultValue 属性文档完整,位置合理

defaultValue 已正确添加到 Sender.Switch 表格中,并与 value 属性相邻,便于关联理解。

packages/x/components/sender/index.zh-CN.md (3)

64-69: 类型转义处理正确,SSR 兼容性有保障

新增属性的通用类型参数都已正确用反引号包裹(如 `HTMLElement``HTMLTextAreaElement`),与现有属性一致,能够有效防止 dumi SSR 预渲染时将其误解析为 JSX 标签。


111-111: inputElement 放置位置正确,与 SenderRef 类型定义保持一致

inputElement 已正确放置在 nativeElement 之前,符合之前审查反馈的要求。类型转义同样正确。


192-192: defaultValue 属性文档完整,位置合理

defaultValue 已正确添加到 Sender.Switch 表格中,并与 value 属性相邻,便于关联理解。中文描述"默认选中状态"准确简洁。

@Chiaki-xps
Copy link
Contributor Author

@kimteayon 请教一下,为啥test不通过,我在本地跑是通过的

@kimteayon
Copy link
Collaborator

@kimteayon 请教一下,为啥test不通过,我在本地跑是通过的

更新下依赖 重新跑下就好了

@kimteayon kimteayon merged commit a548ff9 into ant-design:main Dec 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants