Skip to content

Fix upload progress and send button#658

Merged
znick merged 7 commits intomasterfrom
fix_upload_progress_and_send_button
Apr 27, 2026
Merged

Fix upload progress and send button#658
znick merged 7 commits intomasterfrom
fix_upload_progress_and_send_button

Conversation

@znick
Copy link
Copy Markdown
Owner

@znick znick commented Apr 27, 2026

No description provided.

znick and others added 7 commits April 24, 2026 21:25
Disable submit buttons while a file upload is in progress so the
comment form cannot be submitted before the upload completes (which
caused a 500). Re-enable buttons and fade out the bar when the upload
queue finishes. Progress bar fills via fileuploadprogressall events.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
thumbnailUrl was always set to the file URL, causing the download
template to render a broken <img> pointing at e.g. a .tar.bz2.
Now only set thumbnailUrl for image file types so the preview only
appears when it would actually render.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
fileuploadstart fires only when the HTTP request begins, leaving a gap
during client-side processing where Send was still clickable. Switch to
fileuploadadd (fires immediately on file selection) to close that gap.
Also handle fileuploadprocessfail so the button re-enables if validation
rejects the file before any upload starts.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… in bar

The empty progress bar at 0% width was invisible, making uploads look stuck.
Now Send button shows spinner + percentage; bar has min-width and bold text.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ss bar

Replacing the whole Send button HTML on every progress tick was destroying and recreating the spinner span, which restarted its CSS animation each tick. Now only the percentage label inside is updated; the spinner element persists and animates smoothly. Also dropped the Bootstrap classes on the progress bar in favor of inline styles, since the file uploader template suppresses Bootstrap 3 and only the page's Bootstrap 4 alpha is active — its progress styles weren't rendering the bar visibly.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Files that fail validation (too big, wrong type, count exceeded) were only flagged by a small per-row label that was easy to miss. Now a prominent red alert appears above the file list with the failed filename, the translated reason, and for size errors the actual file size and the configured max — so the user knows by how much they're over.

Reuses existing translation keys (fajl_slishkom_bolshoj, oshibka, etc.) and the max_file_size context variable already passed to the template.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@znick znick marked this pull request as ready for review April 27, 2026 00:38
@znick znick merged commit 39a4c0d into master Apr 27, 2026
6 checks passed
@znick znick deleted the fix_upload_progress_and_send_button branch April 27, 2026 00:38
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