-
-
Notifications
You must be signed in to change notification settings - Fork 998
fix: attachments show extension & antd v6 props update #1395
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
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit 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. 📝 WalkthroughWalkthrough提取并统一附件列表中扩展名/上传按钮的显示条件;将进度组件的圆环样式属性从 Changes
预计代码审查工作量🎯 3 (中等) | ⏱️ ~20 分钟
诗歌
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
Summary of ChangesHello @kimteayon, 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! This pull request resolves a user interface issue within the attachments component, specifically ensuring that the upload button is consistently displayed when there is capacity for more file uploads, even if a maximum count for attachments hasn't been explicitly configured. This enhancement improves the usability of the file upload feature by making the upload option reliably available to users. Highlights
Using Gemini Code AssistThe 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
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 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
|
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.
Code Review
This pull request correctly fixes a bug where the upload button was not displayed when maxCount was not set on attachments. The logic for showing the upload button has been extracted into a showExtension variable, which improves readability. I have one suggestion to further simplify the condition for this new variable, making the code even cleaner.
Deploying ant-design-x with
|
| Latest commit: |
c6e2266
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f9e22172.ant-design-x.pages.dev |
| Branch Preview URL: | https://fix-attachments.ant-design-x.pages.dev |
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: 0
🧹 Nitpick comments (1)
packages/x/components/attachments/FileList/index.tsx (1)
127-129: 建议简化条件逻辑。条件中的
upload.maxCount &&检查是多余的。当maxCount未定义时,第一个条件已经处理;当maxCount为数字(包括 0)时,直接比较maxCount > items.length就能正确工作。应用此差异来简化逻辑:
const showExtension = !disabled && - (typeof upload.maxCount === 'undefined' || (upload.maxCount && upload.maxCount > items.length)); + (typeof upload.maxCount === 'undefined' || upload.maxCount > items.length);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/x/components/attachments/FileList/index.tsx(3 hunks)
⏰ 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). (4)
- GitHub Check: build preview
- GitHub Check: size
- GitHub Check: test
- GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
packages/x/components/attachments/FileList/index.tsx (1)
157-171: 代码逻辑正确!条件渲染清晰地实现了 PR 目标:当未设置
maxCount或当前上传数量未达到上限时显示上传按钮。这正确修复了上传按钮未显示的问题。
size-limit report 📦
|
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1395 +/- ##
==========================================
- Coverage 94.10% 94.09% -0.01%
==========================================
Files 144 144
Lines 3712 3711 -1
Branches 1039 1038 -1
==========================================
- Hits 3493 3492 -1
Misses 217 217
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log
Summary by CodeRabbit
发布说明
✏️ Tip: You can customize this high-level summary in your review settings.