-
Notifications
You must be signed in to change notification settings - Fork 271
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
fix(popupload): [pop-upload]Fixed popupload review issues. #2368
Conversation
WalkthroughThe changes in this pull request involve updates to three files related to the upload component. Modifications include formatting adjustments in the template sections for improved readability, specifically for the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
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: 2
🧹 Outside diff range and nitpick comments (2)
examples/sites/demos/pc/app/pop-upload/upload-tip-composition-api.vue (1)
38-39
: Add overflow handling for fixed-height tips items.With fixed height and line-height, longer text content might get clipped. Consider adding overflow handling.
.tips-item { margin: 0; height: 22px; line-height: 22px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; }examples/sites/demos/pc/app/pop-upload/upload-tip.vue (1)
48-52
: Consider avoiding !important in dialog footer styles.While the
.tips-item
height standardization looks good, the use of!important
in the dialog footer styles should be avoided as it makes the styles harder to maintain and override when needed.Consider using a more specific selector instead:
-:deep(.tiny-popupload__dialog-footer) { - justify-content: flex-end !important; +} +:deep(.tiny-popupload .tiny-popupload__dialog-footer) { + justify-content: flex-end; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- examples/sites/demos/pc/app/pop-upload/upload-tip-composition-api.vue (2 hunks)
- examples/sites/demos/pc/app/pop-upload/upload-tip.vue (2 hunks)
- packages/theme/src/pop-upload/index.less (4 hunks)
🔇 Additional comments (6)
examples/sites/demos/pc/app/pop-upload/upload-tip.vue (1)
16-17
: LGTM! Template formatting looks good.The formatting changes improve readability while maintaining the same functionality.
packages/theme/src/pop-upload/index.less (5)
17-19
: LGTM! Good use of prefix variables.The new prefix variables correctly use
@{css-prefix}
instead of hardcoding 'tiny', which aligns with the project's best practices and previous review feedback.
41-41
: LGTM! Consistent spacing.The increased margin provides better vertical spacing between elements.
75-75
: LGTM! Improved section spacing.The increased margin provides better visual separation between sections.
168-174
: LGTM! Well-structured modal styles.Good use of prefix variables and standard modal footer alignment pattern.
179-181
: Verify title truncation handling.While preventing title wrapping can improve readability, please ensure that long titles are properly handled (e.g., with ellipsis or tooltip).
Consider adding text overflow handling:
.@{popconfirm-prefix-cls}-popover__title { white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; }
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击 | ||
<tiny-link>下载模板</tiny-link> |
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.
Add click handler or href to the download template link.
The <tiny-link>
component lacks functionality to actually download the template. This should be implemented to demonstrate proper usage.
Consider adding a click handler:
-<tiny-link>下载模板</tiny-link>
+<tiny-link @click="handleTemplateDownload">下载模板</tiny-link>
And in the script section:
const handleTemplateDownload = () => {
// Implement template download logic
window.open('path/to/template/file', '_blank')
}
:deep(.tiny-popupload__dialog-footer) { | ||
justify-content: flex-end !important; |
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
Avoid using !important in CSS rules.
Using !important
is generally discouraged as it makes styles harder to maintain and override when needed. Consider increasing specificity instead.
-:deep(.tiny-popupload__dialog-footer) {
- justify-content: flex-end !important;
-}
+:deep(.tiny-popupload .tiny-popupload__dialog-footer) {
+ justify-content: flex-end;
+}
📝 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.
:deep(.tiny-popupload__dialog-footer) { | |
justify-content: flex-end !important; | |
:deep(.tiny-popupload .tiny-popupload__dialog-footer) { | |
justify-content: flex-end; |
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit