-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: fix attachments docs #619
Conversation
📝 WalkthroughWalkthrough此 PR 更新了 Changes
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Walkthrough: 本次更改修复了由于文档格式冲突导致的 API 表格渲染错误,确保文档在中英文版本中正确显示。 Changes:
|
@@ -66,8 +66,8 @@ interface PlaceholderType { | |||
| className | Style class name | string | - | - | | |||
| style | Style Object | React.CSSProperties | - | - | | |||
| item | Attachment, same as Upload `UploadFile` | Attachment | - | - | | |||
| onRemove | A callback function, will be executed when removing file button is clicked, remove event will be prevented when the return value is false or a Promise which resolve(false) or reject | (item: Attachment) => boolean | Promise | - | - | | |||
| imageProps | Image config, same as [Image](https://ant.design/components/image) | ImageProps | - | - | | |||
| onRemove | A callback function, will be executed when removing file button is clicked, remove event will be prevented when the return value is false or a Promise which resolve(false) or reject | (item: Attachment) => boolean \| Promise | - | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type definition for onRemove
has been corrected to include both boolean
and Promise
, ensuring accurate documentation.
| prefixCls | 样式类名的前缀 | string | - | - | | ||
| className | 样式类名 | string | - | - | | ||
| style | 样式对象 | React.CSSProperties | - | - | | ||
| item | 附件,同 Upload `UploadFile` | Attachment | - | - | | ||
| onRemove | 点击移除文件时的回调,返回值为 false 时不移除。支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不移除 | (item: Attachment) => boolean | Promise | - | - | | ||
| onRemove | 点击移除文件时的回调,返回值为 false 时不移除。支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不移除 | (item: Attachment) => boolean \| Promise | - | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正了 onRemove
的类型定义,现包括 boolean
和 Promise
,确保文档的准确性。
Bundle ReportChanges will increase total bundle size by 22 bytes (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antdx-array-pushAssets Changed:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #619 +/- ##
==========================================
+ Coverage 91.81% 91.88% +0.06%
==========================================
Files 67 67
Lines 1466 1466
Branches 372 388 +16
==========================================
+ Hits 1346 1347 +1
+ Misses 120 119 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/attachments/index.en-US.md
(1 hunks)components/attachments/index.zh-CN.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test / react component workflow
🔇 Additional comments (2)
components/attachments/index.zh-CN.md (1)
67-73
: 更新 onRemove 属性类型
已将 onRemove 的返回类型更新为(item: Attachment) => boolean | Promise
,这可以更好支持异步操作,符合业务需求。请确认相关文档描述与实现保持一致。components/attachments/index.en-US.md (1)
69-69
: 确认 onRemove 属性类型更新
已将 onRemove 的类型更新为(item: Attachment) => boolean | Promise
,满足新要求。
| onRemove | A callback function, will be executed when removing file button is clicked, remove event will be prevented when the return value is false or a Promise which resolve(false) or reject | (item: Attachment) => boolean | Promise | - | - | | ||
| imageProps | Image config, same as [Image](https://ant.design/components/image) | ImageProps | - | - | | ||
| onRemove | A callback function, will be executed when removing file button is clicked, remove event will be prevented when the return value is false or a Promise which resolve(false) or reject | (item: Attachment) => boolean \| Promise | - | - | | ||
| imageProps | Image config, same as [Image](https://ant.design/components/image) | | ImageProps | - | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
检查 imageProps 行的表格格式
目前这行记录显示了多余的文本 "ImageProps",导致表格列数与标题不匹配。根据 PR 目标,应移除该类型说明,使得 “类型” 栏为空,从而避免渲染错误。
建议应用以下 diff 修正格式:
-| imageProps | Image config, same as [Image](https://ant.design/components/image) | | ImageProps | - | - |
+| imageProps | Image config, same as [Image](https://ant.design/components/image) | | - | - |
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| imageProps | Image config, same as [Image](https://ant.design/components/image) | | ImageProps | - | - | | |
| imageProps | Image config, same as [Image](https://ant.design/components/image) | | - | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里多了一个 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afc163 您说得对,确实有一个多余的 |
。应该是这样修改:
| imageProps | Image config, same as [Image](https://ant.design/components/image) | | - | - |
这样就只有5列,符合表格的标题结构:Property、Description、Type、Default、Version。
---
✏️ Learnings added
Learnt from: afc163
PR: ant-design/x#619
File: components/attachments/index.en-US.md:70-70
Timestamp: 2025-03-18T13:46:36.177Z
Learning: 在 Markdown 表格中,列的数量由分隔符 `|` 决定,需要确保表格的每一行中分隔符数量与表头一致,否则会导致渲染错误。
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
修复文档格式冲突导致的api表格渲染错误
Summary by CodeRabbit