GRI-1764: panel media library screen #88

Merged
vivy merged 1 commit from feature/GRI-1764-panel-media into dev 2026-11-09 20:12:38 +00:00
Member

What

Media library screen in frontend-web/, closes #24.

  • Upload image, video or PDF; add a web page by URL; list; delete.
  • PDF uploads split into one item per page at upload time, per plan/server/media-pipeline.md.
  • accept on the file input matches exactly the set the mock (and the planned server) supports, so the type-rejection path isn't reachable through the real file picker; it's covered by a direct unit test on the mock API instead.
  • All four async states covered: loading, empty, error (with retry), success.

Stacked on #87 (which stacks on #85)

Cut from feature/GRI-1764-panel-devices, so the diff includes both earlier commits until #85 and #87 merge. Will rebase onto dev once they do.

Why mocked

Same pattern as #85/#87 — server media routes aren't built yet. Mocked behind src/api/mediaApi.ts, with a real httpMediaApi.ts already written against plan/server/rest-api.md (multipart upload is the one non-JSON body in that contract, handled directly with fetch/FormData rather than through the shared JSON request helper).

Verification

cd frontend-web && npm run check
cd frontend-web && npm run build
./scripts/local-gates.sh --frontend-only

All green.

Test plan

  • Loading, then empty library
  • Upload an image, see it listed
  • Upload a PDF, see 3 page items
  • Add a web page by URL, then delete it
  • Non-http URL rejected client-side
  • Error state with retry
  • Unsupported MIME type rejected at the API layer (unit test)
## What Media library screen in `frontend-web/`, closes #24. - Upload image, video or PDF; add a web page by URL; list; delete. - PDF uploads split into one item per page at upload time, per `plan/server/media-pipeline.md`. - `accept` on the file input matches exactly the set the mock (and the planned server) supports, so the type-rejection path isn't reachable through the real file picker; it's covered by a direct unit test on the mock API instead. - All four async states covered: loading, empty, error (with retry), success. ## Stacked on #87 (which stacks on #85) Cut from `feature/GRI-1764-panel-devices`, so the diff includes both earlier commits until #85 and #87 merge. Will rebase onto `dev` once they do. ## Why mocked Same pattern as #85/#87 — server media routes aren't built yet. Mocked behind `src/api/mediaApi.ts`, with a real `httpMediaApi.ts` already written against `plan/server/rest-api.md` (multipart upload is the one non-JSON body in that contract, handled directly with `fetch`/`FormData` rather than through the shared JSON `request` helper). ## Verification ``` cd frontend-web && npm run check cd frontend-web && npm run build ./scripts/local-gates.sh --frontend-only ``` All green. ## Test plan - [x] Loading, then empty library - [x] Upload an image, see it listed - [x] Upload a PDF, see 3 page items - [x] Add a web page by URL, then delete it - [x] Non-http URL rejected client-side - [x] Error state with retry - [x] Unsupported MIME type rejected at the API layer (unit test)
GRI-1764: panel first-user setup and login screens
Some checks failed
CI / the pre-push hook (pull_request) Successful in 11s
CI / cargo fmt (pull_request) Successful in 4s
CI / cargo deny (pull_request) Successful in 52s
CI / cargo deny advisories (pull_request) Failing after 53s
CI / cargo clippy (pull_request) Successful in 9m45s
CI / repository boundary (pull_request) Successful in 15s
CI / cargo test (pull_request) Successful in 9m36s
CI / frontend-web (pull_request) Successful in 9m47s
CI / CI (pull_request) Successful in 3s
CI / Notify gate failed (pull_request) Has been skipped
16a6093b15
Mocks the setup/session API behind one switch (src/api/sessionApi.ts)
until the server routes land (GRI-1838, GRI-1853); swap USE_MOCK to
false once they're exercised against the real server.
GRI-1764: panel devices and IP rules screens
Some checks failed
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 5s
CI / cargo deny (pull_request) Successful in 39s
CI / cargo deny advisories (pull_request) Failing after 38s
CI / repository boundary (pull_request) Successful in 10s
CI / cargo clippy (pull_request) Successful in 9m38s
CI / cargo test (pull_request) Successful in 9m41s
CI / frontend-web (pull_request) Successful in 9m56s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 11s
31a84b5706
Devices: pending list with approve/block, approved list with inline
rename, last-seen and assigned playlist. IP rules: blocklist and
auto-approve, each addable/removable, with the evaluation-order note
on screen.

Adds a tiny History API router (no library yet, per
plan/frontend/stack.md) now that there is more than one screen behind
login. Mocked behind devicesApi.ts/ipRulesApi.ts the same way as the
session API, until the server routes land.
GRI-1764: panel media library screen
Some checks failed
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 4s
CI / cargo deny (pull_request) Successful in 48s
CI / cargo deny advisories (pull_request) Failing after 48s
CI / cargo clippy (pull_request) Successful in 9m41s
CI / repository boundary (pull_request) Successful in 11s
CI / cargo test (pull_request) Successful in 9m36s
CI / frontend-web (pull_request) Successful in 9m59s
CI / CI (pull_request) Successful in 3s
CI / Notify gate failed (pull_request) Has been skipped
8993db2cec
Upload image/video/PDF, add a web-page URL, list and delete. A PDF
upload is split into one item per page at upload time, per
plan/server/media-pipeline.md. Mocked behind mediaApi.ts the same way
as the other screens, until the server routes land.
vivy merged commit c31b340260 into dev 2026-11-09 20:12:38 +00:00
vivy deleted branch feature/GRI-1764-panel-media 2026-11-09 20:12:39 +00:00
nexus-warden left a comment

Review after the merge: this PR was merged into dev on 2026-11-09 at 20:12Z before any review existed. I reviewed it on the merged head.

Approved. The upload, URL and delete paths are sound. A PDF expanding into one item per page matches the media-pipeline plan.

Only in the mock, so not shipped: let nextId = 1 resets on every page load, while the store persists in sessionStorage. After a reload, a new item can reuse an existing id, and deleting it then removes both. This is the same in mockIpRulesApi and mockPlaylistsApi. It only matters for npm run dev:mock.

Review after the merge: this PR was merged into `dev` on 2026-11-09 at 20:12Z before any review existed. I reviewed it on the merged head. **Approved.** The upload, URL and delete paths are sound. A PDF expanding into one item per page matches the media-pipeline plan. Only in the mock, so not shipped: `let nextId = 1` resets on every page load, while the store persists in `sessionStorage`. After a reload, a new item can reuse an existing id, and deleting it then removes both. This is the same in `mockIpRulesApi` and `mockPlaylistsApi`. It only matters for `npm run dev:mock`.
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!88
No description provided.