Picker: Add N pages makes one document item with page overrides (frontend half of #304) #314

Closed
opened 2026-11-17 19:29:56 +00:00 by vivy · 2 comments
Owner

Frontend half of #304. The backend half is PR #312 (green, held for this).

Why it must land with #312. After #312, PUT /playlists/{id}/items refuses kind: "document_page" with 422 document_page_not_allowed, and migration 0014 converts existing page items into one document item with page_overrides. The web UI still creates and sends document_page items:

  • frontend-web/src/api/httpPlaylistsApi.ts:201 builds a document_page wire item.
  • AddFromLibraryDialog / libraryPicker.ts: Choose pages / Add N pages adds one playlist item per page.

So with #312 alone, saving a playlist after "Add N pages" fails.

Change.

  • Add N pages (selection or range 1-5,8-9) adds one document item (document media id) with page_overrides = {"<page>": {"skip": true}} for every page not chosen. Add whole document is unchanged.
  • httpPlaylistsApi.ts: never send document_page; drop that branch.
  • Read side: a playlist read back after 0014 has document items with page_overrides; check the playlist view shows them (works with #278).
  • Update the tests in AddFromLibraryDialog.test.tsx that expect N items.

Done when: adding pages 1-5,8-9 of a deck makes one item, saves without error, and frontend-web gates pass. Merge order: this PR and #312 back to back.

Frontend half of #304. The backend half is PR #312 (green, held for this). **Why it must land with #312.** After #312, `PUT /playlists/{id}/items` refuses `kind: "document_page"` with 422 `document_page_not_allowed`, and migration 0014 converts existing page items into one `document` item with `page_overrides`. The web UI still creates and sends `document_page` items: - `frontend-web/src/api/httpPlaylistsApi.ts:201` builds a `document_page` wire item. - `AddFromLibraryDialog` / `libraryPicker.ts`: **Choose pages** / **Add N pages** adds one playlist item per page. So with #312 alone, saving a playlist after "Add N pages" fails. **Change.** - **Add N pages** (selection or range `1-5,8-9`) adds **one** `document` item (document media id) with `page_overrides` = `{"<page>": {"skip": true}}` for every page not chosen. **Add whole document** is unchanged. - `httpPlaylistsApi.ts`: never send `document_page`; drop that branch. - Read side: a playlist read back after 0014 has `document` items with `page_overrides`; check the playlist view shows them (works with #278). - Update the tests in `AddFromLibraryDialog.test.tsx` that expect N items. **Done when:** adding pages 1-5,8-9 of a deck makes one item, saves without error, and `frontend-web` gates pass. Merge order: this PR and #312 back to back.
Member

PR #316 CI is green (commit 5290ac08): CI aggregate verdict passed — cargo clippy/fmt/test/deny, frontend-web, repository boundary, pre-push hook all succeeded (the one red row, "Notify gate failed", is a notification-only job, not a gate). PR is open and mergeable, not yet merged. Ready for the merge order: this PR first, then #312 (since #312 makes the server refuse document_page items).

PR #316 CI is green (commit 5290ac08): CI aggregate verdict passed — cargo clippy/fmt/test/deny, frontend-web, repository boundary, pre-push hook all succeeded (the one red row, "Notify gate failed", is a notification-only job, not a gate). PR is open and mergeable, not yet merged. Ready for the merge order: this PR first, then #312 (since #312 makes the server refuse `document_page` items).
Member

Frontend half done and merged: PR #316 landed in dev at commit 13517fef (verified by ancestry). Closing this issue since the frontend scope is complete; backend half tracked separately in #312, which is behind dev and owes a re-review after REQUEST_CHANGES #541.

Frontend half done and merged: PR #316 landed in dev at commit 13517fef (verified by ancestry). Closing this issue since the frontend scope is complete; backend half tracked separately in #312, which is behind dev and owes a re-review after REQUEST_CHANGES #541.
Sign in to join this conversation.
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#314
No description provided.