GRI-2140: split Media into Add media (default) and Media library #272

Merged
vivy merged 5 commits from feature/GRI-2140-media-add-library-split into dev 2026-11-16 10:15:18 +00:00
Member

Closes #268.

Summary

  • Media gets the same left sub-menu as Settings and Playlists (#210): Add media (/media, default) and Media library (/media/library).
  • AddMediaScreen owns upload and Add website; each success stays on the page and links to the library instead of jumping away, so several files can be added one after another. A conversion still running (GRI-2127/#233) shows its progress here too.
  • MediaLibraryScreen owns the list: documents with pages, campus move (#242), expand, delete — unchanged behaviour, just without the upload controls.
  • MediaSectionScreen wires the menu and the fallback: a user with no content_upload permission sees only Media library, and /media falls back to it — same rule as SettingsSectionScreen.
  • Shared job-polling extracted to useMediaJobPolling so both pages can watch their own in-flight conversions independently.

Test plan

  • npm run check (prettier, oxlint, tsc, vitest) green in frontend-web
  • ./scripts/local-gates.sh --frontend-only green
  • Default page is Add media (MediaSectionScreen.test.tsx)
  • Fallback to Media library for a user without upload rights (MediaSectionScreen.test.tsx)
  • Upload success links to the library, without navigating away (AddMediaScreen.test.tsx)
  • Full previous Media coverage (grouping, conversion progress, delete/campus-move conflicts) preserved under MediaLibraryScreen.test.tsx
Closes #268. ## Summary - Media gets the same left sub-menu as Settings and Playlists (#210): **Add media** (`/media`, default) and **Media library** (`/media/library`). - `AddMediaScreen` owns upload and *Add website*; each success stays on the page and links to the library instead of jumping away, so several files can be added one after another. A conversion still running (GRI-2127/#233) shows its progress here too. - `MediaLibraryScreen` owns the list: documents with pages, campus move (#242), expand, delete — unchanged behaviour, just without the upload controls. - `MediaSectionScreen` wires the menu and the fallback: a user with no `content_upload` permission sees only Media library, and `/media` falls back to it — same rule as `SettingsSectionScreen`. - Shared job-polling extracted to `useMediaJobPolling` so both pages can watch their own in-flight conversions independently. ## Test plan - [x] `npm run check` (prettier, oxlint, tsc, vitest) green in `frontend-web` - [x] `./scripts/local-gates.sh --frontend-only` green - [x] Default page is Add media (`MediaSectionScreen.test.tsx`) - [x] Fallback to Media library for a user without upload rights (`MediaSectionScreen.test.tsx`) - [x] Upload success links to the library, without navigating away (`AddMediaScreen.test.tsx`) - [x] Full previous Media coverage (grouping, conversion progress, delete/campus-move conflicts) preserved under `MediaLibraryScreen.test.tsx`
GRI-2140: split Media into Add media (default) and Media library
Some checks failed
CI / cargo fmt (pull_request) Has started running
CI / the pre-push hook (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 16s
CI / cargo deny advisories (pull_request) Successful in 15s
CI / cargo clippy (pull_request) Successful in 57s
CI / repository boundary (pull_request) Successful in 3s
CI / frontend-web (pull_request) Successful in 54s
CI / cargo test (pull_request) Failing after 1m58s
CI / CI (pull_request) Has been cancelled
CI / Notify gate failed (pull_request) Has been cancelled
e6bea32a55
Add media (/media) now owns upload and Add website, each success
staying on the page and linking to the library instead of jumping
away. Media library (/media/library) owns the list: documents and
pages, campus move, expand, delete. Both get the same left sub-menu
as Settings and Playlists (#210); a user with no content_upload
permission sees only Media library, with /media falling back to it.
GRI-2140: retrigger CI (flaky cargo test unrelated to this frontend-only change)
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 14s
CI / cargo fmt (pull_request) Successful in 4s
CI / cargo deny (pull_request) Successful in 27s
CI / cargo deny advisories (pull_request) Successful in 24s
CI / cargo clippy (pull_request) Successful in 1m23s
CI / repository boundary (pull_request) Successful in 5s
CI / frontend-web (pull_request) Successful in 1m17s
CI / cargo test (pull_request) Successful in 4m25s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
d1f6cdeb8a
vivy requested changes 2026-11-16 09:33:40 +00:00
Dismissed
vivy left a comment

Changes requested — one regression on the page the product owner stays on.

The split itself is right: /media opens Add media, /media/library is the list, a view-only user falls back to the library, the success row links to the library, and the poller is shared.

Blocking: the "Recently added" row on Add media loses two things the old Media page showed, and both were explicit product-owner asks:

  1. Failure reason (#239). A failed job renders <name>: Failed. It must render Failed to process: <job.errorMessage> (same text as MediaLibraryScreen), as a dismissible error or a danger note.
  2. Page progress (#233). While rendering it shows only Rendering pages. It must show Page N of M rendered with the <progress> bar, as the library does.

Since he uploads and then stays on Add media (that is the point of #268), this page is where he watches the conversion. Simplest fix: extract the job-status rendering from MediaLibraryScreen into one small component and use it on both pages.

Please add a test on AddMediaScreen for each: a failed job shows the reason, and a rendering job shows Page 2 of 5.

Then merge dev in (dev moved with #271) and push.

Changes requested — one regression on the page the product owner stays on. The split itself is right: `/media` opens Add media, `/media/library` is the list, a view-only user falls back to the library, the success row links to the library, and the poller is shared. **Blocking:** the "Recently added" row on Add media loses two things the old Media page showed, and both were explicit product-owner asks: 1. **Failure reason (#239).** A failed job renders `<name>: Failed`. It must render `Failed to process: <job.errorMessage>` (same text as `MediaLibraryScreen`), as a dismissible error or a danger note. 2. **Page progress (#233).** While rendering it shows only `Rendering pages`. It must show `Page N of M rendered` with the `<progress>` bar, as the library does. Since he uploads and then stays on Add media (that is the point of #268), this page is where he watches the conversion. Simplest fix: extract the job-status rendering from `MediaLibraryScreen` into one small component and use it on both pages. Please add a test on `AddMediaScreen` for each: a failed job shows the reason, and a rendering job shows `Page 2 of 5`. Then merge `dev` in (dev moved with #271) and push.
GRI-2140: Add media's Recently added row shows failed reason and page progress
All checks were successful
CI / the pre-push hook (pull_request) Successful in 5s
CI / install.sh client upgrade (pull_request) Successful in 13s
CI / cargo fmt (pull_request) Successful in 5s
CI / cargo deny (pull_request) Successful in 38s
CI / cargo clippy (pull_request) Successful in 1m42s
CI / cargo deny advisories (pull_request) Successful in 44s
CI / repository boundary (pull_request) Successful in 5s
CI / frontend-web (pull_request) Successful in 1m11s
CI / cargo test (pull_request) Successful in 4m16s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
e6b7cc6c0a
Review on PR #272 (forge #268): the row only showed a plain job-step
label, so a failed conversion and a page-by-page render looked the same
as every other in-progress state. Match MediaLibraryScreen's treatment —
role=alert with the failure reason, and Page N of M rendered with a
progress bar once the job reports a page count.
vivy approved these changes 2026-11-16 09:54:34 +00:00
Dismissed
vivy left a comment

Both points fixed: failure reason (role=alert) and Page N of M with progress bar on Add media, each with a test. Approved. Updating with dev (after #273) for the merge.

Both points fixed: failure reason (role=alert) and Page N of M with progress bar on Add media, each with a test. Approved. Updating with dev (after #273) for the merge.
Merge branch 'dev' into feature/GRI-2140-media-add-library-split
All checks were successful
CI / the pre-push hook (pull_request) Successful in 5s
CI / install.sh client upgrade (pull_request) Successful in 16s
CI / cargo fmt (pull_request) Successful in 7s
CI / cargo deny (pull_request) Successful in 28s
CI / cargo clippy (pull_request) Successful in 1m35s
CI / cargo deny advisories (pull_request) Successful in 24s
CI / repository boundary (pull_request) Successful in 3s
CI / frontend-web (pull_request) Successful in 1m5s
CI / cargo test (pull_request) Successful in 4m16s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
6acfb0e082
vivy dismissed vivy's review 2026-11-16 09:54:38 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

vivy merged commit 4353d22e12 into dev 2026-11-16 10:15:18 +00:00
vivy deleted branch feature/GRI-2140-media-add-library-split 2026-11-16 10:15:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!272
No description provided.