Playlist editor: add from library in two steps (file, then pages) with a page range #208
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#208
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Product owner, 2026-11-15 (GRI-2051): "Split up the 'add from library' so that you first select which file and then the pages. If there are 10 files with 50 pages it will be a nightmare. Also add a simple range option."
Today.
PlaylistEditorScreen.tsx(around line 416) has one<select>"Add from the library" that lists every media item and, under each document, every page. With 10 documents of 50 pages that is 500+ options in one list.Wanted — two steps.
1-5,8-9→ pages 1 to 5 and 8 to 9*(or empty) → all pages10-→ page 10 to the last page0,7-3, a page beyond the end, letters) is refused with a message that says which part is wrong.The field and the checkboxes stay in sync, and the dialog shows "12 of 50 pages selected" before adding.
Pages are added in document order, as one item per page (today's model), so the per-page time and "Skip this page" keep working.
This is the same range syntax as a print dialog, which is what non-technical users already know — not a regular expression. The parser is a pure function with unit tests for each case above.
Acceptance. Adding pages 1-5 and 8-9 of a 50-page PDF takes one file pick, one typed range and one click.
Implemented the two-step picker in
frontend-web:AddFromLibraryDialog(pick a file — searchable, filtered by type Image/Video/PDF/PowerPoint/Web page, with a thumbnail — then, only for a multi-page file, pick pages), backed by a pureparsePageRange/formatPageRangeinsrc/pageRange.ts(unit-tested for every case in the issue:1-5,8-9,*/empty,10-, spaces ignored,0,7-3, beyond the end, letters). Pages are still added onePlaylistItemper page in document order, so the existing per-page duration field and the cogwheel page-overrides on an already-addeddocumentitem are unaffected.One scope note: the server never tags a row literally
pptx(crates/server/src/media/handlers.rs'sclassify) — a PowerPoint upload becomesdocument(slide-image fallback) orvideo(converted), same as PDF/video. So the "PDF" vs "PowerPoint" filter is a frontend-only heuristic on the filename extension, not an API field. Flagging this in case the type filter matters enough to want a real field later; not blocking.frontend-web: prettier, oxlint --deny-warnings, tsc, vitest all green (94/94, including a newpageRange.test.tsandAddFromLibraryDialog.test.tsx, plus the twoPlaylistsScreen.test.tsxcases updated for the new two-step flow). Full./scripts/local-gates.shrunning now; will push once green.Pushed and opened pull request #222 (dev <- feature/GRI-2074-playlist-add-from-library-pages). Local
./scripts/local-gates.shwas green (frontend-web prettier/oxlint/tsc/vitest 94/94, cargo workspace, cargo-deny). Forge CI is now running; will report the verdict here.Addressed the PR #222 review comments: added an explicit 'Add whole document' button in the pages step (so a multi-page document can still be added as one item and keep the page-overrides cogwheel / Skip this page), disabled Add while the typed range is invalid, and added loading=lazy to the page thumbnails. Added a test for each of the first two behaviors; frontend-web check (prettier/oxlint/tsc/vitest) is green at 98/98 total (7 in this file). Pushed to PR #222 (
78a4e8f). Running full local-gates.sh now before pinging the CTO for re-review.