GRI-2121: panel shows upload percentage while a file is sent #255

Merged
vivy merged 2 commits from feature/GRI-2121-upload-progress-percent into dev 2026-11-15 21:21:55 +00:00
Member

Summary

  • Panel shows an upload percentage while a file is sent (part 1 of #233): uploadMedia() now sends through XMLHttpRequest with upload.onprogress, since fetch has no upload progress event.
  • MediaScreen tracks the percentage and renders it next to "Uploading…", with a <progress> bar, clearing it on completion, error, or cancel (fileInputRef clear path unchanged).
  • mockMediaApi.uploadMedia takes the same onProgress callback for signature parity and reports completion once (no real transfer to report partial progress for).

Done when (from forge #250)

  • While a file is sent, the panel shows a bar with the percentage. ✅
  • Error and cancel still give the existing error note. ✅ (existing error path untouched; progress clears in the finally)
  • Works for PDF, PPTX, image and video uploads. ✅ (panel-only change to the transport, not to file-type handling)

Test plan

  • npx vitest run src/api/httpMediaApi.test.ts src/api/mockMediaApi.test.ts src/screens/MediaScreen.test.tsx — 21/21 passed
  • npm run check (prettier, oxlint, tsc, full vitest suite) — 126/126 passed
  • ./scripts/local-gates.sh --frontend-only — every gate passed
## Summary - Panel shows an upload percentage while a file is sent (part 1 of #233): `uploadMedia()` now sends through `XMLHttpRequest` with `upload.onprogress`, since `fetch` has no upload progress event. - `MediaScreen` tracks the percentage and renders it next to "Uploading…", with a `<progress>` bar, clearing it on completion, error, or cancel (`fileInputRef` clear path unchanged). - `mockMediaApi.uploadMedia` takes the same `onProgress` callback for signature parity and reports completion once (no real transfer to report partial progress for). ## Done when (from forge #250) - While a file is sent, the panel shows a bar with the percentage. ✅ - Error and cancel still give the existing error note. ✅ (existing error path untouched; progress clears in the `finally`) - Works for PDF, PPTX, image and video uploads. ✅ (panel-only change to the transport, not to file-type handling) ## Test plan - [x] `npx vitest run src/api/httpMediaApi.test.ts src/api/mockMediaApi.test.ts src/screens/MediaScreen.test.tsx` — 21/21 passed - [x] `npm run check` (prettier, oxlint, tsc, full vitest suite) — 126/126 passed - [x] `./scripts/local-gates.sh --frontend-only` — every gate passed
GRI-2121: panel shows upload percentage while a file is sent
All checks were successful
CI / the pre-push hook (pull_request) Successful in 5s
CI / install.sh client upgrade (pull_request) Successful in 14s
CI / cargo fmt (pull_request) Successful in 7s
CI / cargo deny (pull_request) Successful in 19s
CI / cargo deny advisories (pull_request) Successful in 21s
CI / cargo clippy (pull_request) Successful in 1m35s
CI / repository boundary (pull_request) Successful in 5s
CI / frontend-web (pull_request) Successful in 1m35s
CI / cargo test (pull_request) Successful in 4m17s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
324ec20bc6
vivy merged commit cb06c667b0 into dev 2026-11-15 21:21:55 +00:00
vivy deleted branch feature/GRI-2121-upload-progress-percent 2026-11-15 21:21:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!255
No description provided.