-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add single resources to store after uploading #1361
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
ec2775b to
89faee0
Compare
89faee0 to
7811c6e
Compare
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.
Pull Request Overview
This PR optimizes the resource fetching behavior after file uploads by implementing selective resource fetching instead of always reloading the entire file list. When 5 or fewer files are uploaded, the system now fetches them individually, reducing server load and eliminating UI flickering.
Key changes:
- Replaced forEach loop with traditional for loop in UppyService for file removal
- Added logic to selectively fetch individual resources vs. full reload based on upload count threshold
- Enhanced test coverage for the new upload completion behavior
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web-pkg/src/services/uppy/uppyService.ts | Replaced forEach with for loop for file removal |
| packages/web-app-files/tests/unit/components/AppBar/CreateAndUpload.spec.ts | Added comprehensive test cases for new upload completion logic |
| packages/web-app-files/src/views/spaces/GenericSpace.vue | Removed Number type from itemId prop |
| packages/web-app-files/src/composables/resourcesViewDefaults/useResourcesViewDefaults.ts | Added extra nextTick call for item highlighting |
| packages/web-app-files/src/components/AppBar/CreateAndUpload.vue | Implemented selective resource fetching logic with upload threshold |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/web-app-files/src/components/AppBar/CreateAndUpload.vue
Outdated
Show resolved
Hide resolved
packages/web-app-files/src/components/AppBar/CreateAndUpload.vue
Outdated
Show resolved
Hide resolved
packages/web-app-files/src/composables/resourcesViewDefaults/useResourcesViewDefaults.ts
Outdated
Show resolved
Hide resolved
f464d1a to
daff9ec
Compare
daff9ec to
7d23154
Compare
| for (let i = 0; i < result.successful.length; i++) { | ||
| this.uppy.removeFile(result.successful[i].id) | ||
| } |
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.
For performance reasons, there may be several thousand files.
Instead of reloading the entire file list. This results in an improved UX and performance. Also, fixes the highlighting of new resources in the files list.
7d23154 to
03fb9a4
Compare
kulmann
left a comment
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.
nice 💪
…upload feat: add single resources to store after uploading
Instead of reloading the entire file list. This results in an improved UX and performance. Also, fixes the highlighting of new resources in the files list.
closes #1358
fixes #1364