GRI-1981: media library groups a PDF's pages under its document #176
No reviewers
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!176
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/GRI-1981-media-pdf-grouping"
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?
Closes #158.
What
After a PDF upload the media library listed every rendered page as its own top-level item.
GET /mediaalready returns thedocumentrow and itsdocument_pagerows withdocument_id/pdf_pagesset (crates/server/src/media/handlers.rs); the client only carried a subset of those fields through. This groups on the client, per the comment on #158.Changes
MediaItemcarriesdocumentId/pageCount;httpMediaApi.fromWirestops dropping them.mockMediaApinow emits adocumentparent row plusdocument_pagerows (matching the real wire shape) instead of only page rows, and a document delete cascades to its pages, same as the server'sDELETE ... WHERE id = $1 OR document_id = $1.MediaScreen: a document is one row with a page count and an expand control; its pages render nested under it when expanded and never appear at top level. Deleting the document removes its pages too.PlaylistEditorScreen's add-from-library picker: the document is the selectable option (optgrouplabelled with its name), its pages nested under it — never a page at top level.Gap
"Thumbnails" in the acceptance text assumes a way to render a page's image. There is no file-serving endpoint for media today (
crates/server/src/media/mod.rshas only upload/list/url/delete routes) and the panel has no<img>anywhere yet. Pages render as text (page number + size), consistent with the rest of the library. Flagged on the forge issue as follow-up backend+frontend work rather than inventing an endpoint here.Test plan
npm --prefix frontend-web run check(prettier, oxlint, tsc, vitest) — 50/50 passing../scripts/local-gates.sh --frontend-only— every gate passed.MediaScreen.test.tsx(grouping, expand/collapse, document-delete-cascades-to-pages),PlaylistsScreen.test.tsx(picker groups a document's pages under it viaoptgroup, no page listed at top level).