-
-
Notifications
You must be signed in to change notification settings - Fork 720
docs(attachments): add high-quality preview example for image file #960
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
base: main
Are you sure you want to change the base?
docs(attachments): add high-quality preview example for image file #960
Conversation
📝 WalkthroughWalkthrough本次更改在 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Attachments
participant DemoComponent
participant State
User->>Attachments: 上传/移除文件
Attachments->>Attachments: 判断文件状态
alt 文件被移除
Attachments->>State: 移除文件并更新状态
else 文件添加或更改
Attachments->>Attachments: 撤销旧 URL,生成新 URL
Attachments->>State: 替换并更新文件列表
end
DemoComponent->>DemoComponent: 组件卸载时撤销所有 blob URL
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
Bundle ReportBundle size has no change ✅ |
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
🧹 Nitpick comments (1)
components/attachments/demo/with-sender.tsx (1)
6-6
: 考虑使用更直接的类型定义当前的类型提取方式功能正确,但可以考虑使用更直接的方法来提高可读性。
可以考虑直接使用 antd 的内置类型:
-type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0]; +type FileType = File;或者如果需要兼容 antd 的 UploadFile 类型:
-type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0]; +import type { UploadFile } from 'antd'; +type FileType = UploadFile;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/attachments/demo/with-sender.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: test / react component workflow
- GitHub Check: size
- GitHub Check: build preview
🔇 Additional comments (1)
components/attachments/demo/with-sender.tsx (1)
3-3
: 导入语句更新合理新增的类型导入支撑了后续的类型定义,变更合理。
49faf6f
to
427de1a
Compare
中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
Before:
After:
📝 Change Log
Summary by CodeRabbit