Skip to content

Feat: Improve file upload progress feedback#135

Merged
skyl merged 7 commits intofree2z:mainfrom
0bkevin:fix-loader
Mar 17, 2025
Merged

Feat: Improve file upload progress feedback#135
skyl merged 7 commits intofree2z:mainfrom
0bkevin:fix-loader

Conversation

@0bkevin
Copy link
Contributor

@0bkevin 0bkevin commented Mar 17, 2025

Description

Improves the user experience during file uploads by providing clearer visual feedback about the upload and server processing stages.

Problem

Currently, when a user uploads files, the progress bar often stops at around 98% while the server processes the files (moving them to cloud storage, etc.). This can make users think the upload is stuck or has failed, potentially leading them to cancel the operation prematurely.

Solution

Implemented a two-stage progress indicator:

  1. A linear progress bar that shows the actual file transfer progress (0-100%)
  2. A circular indeterminate spinner that appears after the transfer is complete, indicating that server-side processing is in progress

Changes

  • Added a new upload state tracking system with two states: 'idle', and 'processing'
  • On state processing it shows the LoadingAnimation component inside a MUI Box component with some text.
  • I applied these changes in every instance where LinearProgressBackdrop is used

Explanation

It seems that the progressEvent.total value changes at some point during the process. This might indicate that Axios somehow detects two separate operations taking place on the server. Taking advantage of this, you can identify the moment when the file has been successfully uploaded. At this point, you can stop displaying the progress bar and instead switch to showing the LoadingAnimation component.

Testing

  • Tested with various file sizes and types
  • Verified proper state transitions during uploads

Related Issues

Fixes #125

Copy link
Contributor

@skyl skyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. Sometimes for small files it's so fast that maybe it's a little jolting but I think for large files it will be very helpful.

@skyl skyl merged commit cbf7d27 into free2z:main Mar 17, 2025
1 check passed
@0bkevin
Copy link
Contributor Author

0bkevin commented Mar 18, 2025

Think I can manage to make it smoother for small files, would make another pr. @skyl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After upload processing should have different progress

2 participants