GRI-2210: show the library name for a url playlist item, not its address #321

Merged
vivy merged 2 commits from feature/GRI-2210-url-item-library-name into dev 2026-11-18 11:21:00 +00:00
Member

Summary

  • Fixes #320: a url playlist item added from the media library lost its media_id on save, so the panel fell back to showing the raw address forever.
  • replacePlaylistItems now keeps media_id for a url item when it still resolves to a current library entry.
  • itemFromWire (read side) also heals existing rows with no media_id by matching the item's url against library url items, only when exactly one matches — so old rows like "Am Playlist" resolve a name on load without a migration, then persist the link on the next save.
  • PlaylistMediaTab shows the resolved library name (linked to /media/library) with the address underneath in smaller, --text-subtle-toned text. An item with no library match, or an ambiguous address shared by more than one library item, still shows just the address.

Not done, flagged for a follow-up call

  • Server-side validation that a media_id on a url item actually has kind = url and a matching address — the server already accepts any media_id on any item kind, and this change doesn't tighten that.
  • A SQL backfill migration — unnecessary here since the client-side address match on load heals existing rows already.

Test plan

  • scripts/local-gates.sh --frontend-only passed locally (prettier, oxlint, tsc, vitest, build)
  • Added tests: rename-in-library follows through, ambiguous-address fallback, component rendering of linked-name/address split vs plain address vs non-url items
  • Updated the existing GRI-2174 round-trip tests whose fixture incidentally encoded the bug (asserted mediaId: '')
## Summary - Fixes #320: a `url` playlist item added from the media library lost its `media_id` on save, so the panel fell back to showing the raw address forever. - `replacePlaylistItems` now keeps `media_id` for a `url` item when it still resolves to a current library entry. - `itemFromWire` (read side) also heals existing rows with no `media_id` by matching the item's `url` against library `url` items, only when exactly one matches — so old rows like "Am Playlist" resolve a name on load without a migration, then persist the link on the next save. - `PlaylistMediaTab` shows the resolved library name (linked to `/media/library`) with the address underneath in smaller, `--text-subtle`-toned text. An item with no library match, or an ambiguous address shared by more than one library item, still shows just the address. ## Not done, flagged for a follow-up call - Server-side validation that a `media_id` on a `url` item actually has `kind = url` and a matching address — the server already accepts any `media_id` on any item kind, and this change doesn't tighten that. - A SQL backfill migration — unnecessary here since the client-side address match on load heals existing rows already. ## Test plan - [x] `scripts/local-gates.sh --frontend-only` passed locally (prettier, oxlint, tsc, vitest, build) - [x] Added tests: rename-in-library follows through, ambiguous-address fallback, component rendering of linked-name/address split vs plain address vs non-url items - [x] Updated the existing GRI-2174 round-trip tests whose fixture incidentally encoded the bug (asserted `mediaId: ''`)
GRI-2210: show the library name for a url playlist item, not its address
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 6s
CI / install.sh client upgrade (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 29s
CI / cargo deny advisories (pull_request) Successful in 28s
CI / repository boundary (pull_request) Successful in 3s
CI / cargo clippy (pull_request) Successful in 1m18s
CI / frontend-web (pull_request) Successful in 59s
CI / cargo test (pull_request) Successful in 3m46s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
d69b227fb7
A url item sent to the server dropped media_id even when added from the
library, so a saved item lost its link and only the raw address remained.
replacePlaylistItems now keeps media_id for a url item that still resolves
to a library entry; itemFromWire also resolves a legacy item (no media_id)
by matching its url against library url items when exactly one matches, so
existing rows heal on load without a migration. PlaylistMediaTab now shows
the resolved library name linked to /media/library, with the address in
smaller text underneath.
GRI-2210: merge dev (keep both CSS blocks from #324 and this branch)
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 15s
CI / cargo fmt (pull_request) Successful in 4s
CI / cargo clippy (pull_request) Successful in 1m31s
CI / cargo deny (pull_request) Successful in 30s
CI / cargo deny advisories (pull_request) Successful in 22s
CI / repository boundary (pull_request) Successful in 4s
CI / frontend-web (pull_request) Successful in 1m4s
CI / cargo test (pull_request) Successful in 3m54s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
e7beb18c25
vivy merged commit a4c4b81501 into dev 2026-11-18 11:21:00 +00:00
vivy deleted branch feature/GRI-2210-url-item-library-name 2026-11-18 11:21:07 +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!321
No description provided.