Skip to content

[WC-3361] FileUploader: enhance limits and feedback#2208

Draft
yordan-st wants to merge 6 commits into
mainfrom
fix/WC-3361_fileuploader-limit-feedback
Draft

[WC-3361] FileUploader: enhance limits and feedback#2208
yordan-st wants to merge 6 commits into
mainfrom
fix/WC-3361_fileuploader-limit-feedback

Conversation

@yordan-st
Copy link
Copy Markdown
Contributor

@yordan-st yordan-st commented May 11, 2026

Pull request type

Bug fix (non-breaking change which fixes an issue)


Description

When the file upload limit was reached, the dropzone silently turned grey with no explanation to the user. This fix adds a warningMessage computed property to FileUploaderStore that reactively surfaces a "Maximum file count of X reached." message as soon as the limit is hit, without requiring the user to attempt another drop. The XML property description was also corrected, and it is now optional so that leaving it empty or setting it to 0 means unlimited.

A new "Maximum files per upload batch" property was added to protect server memory (Java heap) when uploading large numbers of files. Files that exceed the batch limit appear in the list with an error message explaining why they were not uploaded.

  • Silent disabled dropzone — now shows "Maximum file count of X reached."
  • Wrong XML description on maxFilesPerUpload — fixed
  • No way to set unlimited — required="false" added; 0 and empty both mean unlimited (default)
  • New "File limit reached" text property added for message customization
  • New "Maximum files per upload batch" property added to cap server commits per drop event; excess files shown with error entry instead of being silently dropped

What should be covered while testing?

Setup: File Uploader, "Maximum number of files" = 2, files mode.

File limit feedback:

  1. Upload 1 file → dropzone stays active, no warning shown
  2. Upload 2nd file (total = limit) → dropzone turns grey AND message appears: "Maximum file count of 2 reached."
  3. Remove 1 file while at limit → dropzone re-enables, message disappears
  4. Remove all files → dropzone re-enables, no message
  5. Refresh page with 2 existing files at limit=2 → dropzone immediately grey with message on load, no user action needed

Unlimited behavior:
6. Set limit = 0 → dropzone never disables regardless of file count
7. Leave limit empty → same as 0, unlimited, dropzone never disables

Batch limit:
8. Set "Maximum files per upload batch" = 2, drop 4 files at once → first 2 upload successfully, last 2 appear in list with error: "File not uploaded. Batch limit of 2 files per drop was reached."
9. Leave "Maximum files per upload batch" empty → all dropped files upload regardless of count

Other:
10. Drop 3 files at once with total limit = 2 (no batch limit set) → batch rejected with "too many files" message
11. Read-only mode → dropzone not rendered, no regression
12. Image upload mode → same limit-reached behavior applies

@yordan-st yordan-st force-pushed the fix/WC-3361_fileuploader-limit-feedback branch from 430b80b to 4d8b53f Compare May 11, 2026 15:02
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.

1 participant