-
Notifications
You must be signed in to change notification settings - Fork 330
fix(upload-list):progress props width type issue in upload-list(#2915) #2916
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
WalkthroughThis change updates the Changes
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/renderless/src/upload-list/vue.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. ✨ Finishing Touches
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 (
|
WalkthroughThis pull request addresses a type issue in the Changes
|
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/renderless/src/upload-list/vue.ts (1)
78-81: Consider adding documentation for the progressWidth property.While the type change is correct, it would be helpful to document the purpose and expected range of values for this property.
Add a JSDoc comment above the property:
progressType: designConfig?.state?.progressType || 'line', + /** Width of the progress bar in pixels. Default is 68. */ progressWidth: designConfig?.state && Object.hasOwnProperty.call(designConfig.state, 'progressWidth') ? designConfig.state.progressWidth : 68,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/renderless/src/upload-list/vue.ts(1 hunks)
🔇 Additional comments (1)
packages/renderless/src/upload-list/vue.ts (1)
78-81:✅ Verification successful
LGTM! Type correction improves type safety.
The change from string
'68'to number68for theprogressWidthproperty is a good fix, as it ensures type consistency for width calculations and UI rendering.Let's verify the type definition and usage:
🏁 Script executed:
#!/bin/bash # Description: Verify the type definition and usage of progressWidth # Check the type definition ast-grep --pattern 'interface IUploadListState { $$$ progressWidth: number $$$ }' # Check for any direct usage of progressWidth in calculations or UI rg -A 5 'progressWidth'Length of output: 5055
LGTM! The numeric fallback for
progressWidthis correct and aligns with the type definition.The change now consistently enforces type safety by providing a number (68) when the
designConfig.state.progressWidthis absent. Verification confirms that theIUploadListStateinterface definesprogressWidthas a number and all usages in both computation and UI rendering (e.g., inpackages/vue/src/upload-list/src/pc.vue) expect a numeric value.
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
|
@all-contributors please add @Darkingtail for bug. |
|
I've put up a pull request to add @Darkingtail! 🎉 |
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: #2915
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit