Playlist editor: show which screens show a playlist, assign several at once #156

Closed
opened 2026-11-13 14:35:21 +00:00 by vivy · 3 comments
Owner

What

Users think they must assign every screen to the playlist again after each change. They do not: a device keeps its playlist, and a saved playlist reaches it by itself. The panel does not say so.

Today

PlaylistEditorScreen.tsx AssignToDeviceForm: one device per click, no list of devices that already show this playlist, and Save gives no hint that devices update automatically.

Done when

  • The playlist editor shows "Shown on: , …" for the devices that have this playlist.
  • Assign takes several devices at once (checkbox list), and already-assigned devices read as assigned.
  • After Save: "Saved. N devices get the change automatically." (no reassign needed).
  • The devices list shows each device's current playlist.

Field feedback from the product owner on GRI-1960.

## What Users think they must assign every screen to the playlist again after each change. They do not: a device keeps its playlist, and a saved playlist reaches it by itself. The panel does not say so. ## Today `PlaylistEditorScreen.tsx` `AssignToDeviceForm`: one device per click, no list of devices that already show this playlist, and *Save* gives no hint that devices update automatically. ## Done when - The playlist editor shows **"Shown on: <device>, <device> …"** for the devices that have this playlist. - Assign takes several devices at once (checkbox list), and already-assigned devices read as assigned. - After *Save*: "Saved. N devices get the change automatically." (no reassign needed). - The devices list shows each device's current playlist. Field feedback from the product owner on GRI-1960.
Author
Owner

Released to prismancer, after the small push follow-up on #155. Hold removed.

Released to prismancer, after the small push follow-up on #155. Hold removed.
Member

Implemented. On feature/GRI-1972-playlist-editor-assign-multi (not yet pushed, pending local-gates).

Backend (crates/server/src/playlists/{handlers,store}.rs, mod.rs, plan/server/rest-api.md):

  • GET /playlists/{id} now returns assigned_devices: [{id, name}] — the devices currently showing it.
  • New GET /device-playlist-assignments → [{device_id, playlist_id, playlist_name}], every device's current assignment.
  • No change to assignment itself — the panel still calls POST /devices/{device_id}/playlist once per device, just several times in one click.
  • Added getting_a_playlist_lists_the_devices_assigned_to_it_by_name and listing_device_playlist_assignments_returns_every_devices_current_playlist to playlist_integration.rs; full suite (24 tests) green against a real Postgres.

Frontend (frontend-web/src):

  • PlaylistEditorScreen: "Shown on: , …" line; AssignToDeviceForm is now a checkbox list (was a single-select), already-assigned devices read checked and disabled; assignPlaylistToDevices fires one request per selected device; after Save, "Saved. N devices get the change automatically." (or "no devices yet").
  • DevicesScreen: each approved device's row now has a Playlist: <name> / Playlist: none assigned tag, from the new GET /device-playlist-assignments.
  • api/types.ts, httpPlaylistsApi.ts, mockPlaylistsApi.ts, playlistsApi.ts updated for the new shapes on both the real and mock backends.
  • Added/updated tests in DevicesScreen.test.tsx and PlaylistsScreen.test.tsx for: no-playlist / has-playlist device rows, multi-select assign, already-assigned checkbox state, and the "Shown on"/"Saved. N devices…" copy.
  • npm run check (prettier + oxlint + tsc + vitest, 37 tests) is green. cargo fmt, cargo clippy -p server --all-targets clean.

Loading/empty/error states: unchanged existing ones still apply (loading spinner, retry-on-error, "no approved devices yet" when the device list is empty); the new "Shown on" line reads "no devices yet." when the list is empty, same pattern as the rest of the screen.

Running the full ./scripts/local-gates.sh now (background); will push once it's green.

Implemented. On `feature/GRI-1972-playlist-editor-assign-multi` (not yet pushed, pending local-gates). **Backend** (`crates/server/src/playlists/{handlers,store}.rs`, `mod.rs`, `plan/server/rest-api.md`): - `GET /playlists/{id}` now returns `assigned_devices: [{id, name}]` — the devices currently showing it. - New `GET /device-playlist-assignments` → `[{device_id, playlist_id, playlist_name}]`, every device's current assignment. - No change to assignment itself — the panel still calls `POST /devices/{device_id}/playlist` once per device, just several times in one click. - Added `getting_a_playlist_lists_the_devices_assigned_to_it_by_name` and `listing_device_playlist_assignments_returns_every_devices_current_playlist` to `playlist_integration.rs`; full suite (24 tests) green against a real Postgres. **Frontend** (`frontend-web/src`): - `PlaylistEditorScreen`: "Shown on: <device>, <device>…" line; `AssignToDeviceForm` is now a checkbox list (was a single-select), already-assigned devices read checked and disabled; `assignPlaylistToDevices` fires one request per selected device; after *Save*, "Saved. N devices get the change automatically." (or "no devices yet"). - `DevicesScreen`: each approved device's row now has a `Playlist: <name>` / `Playlist: none assigned` tag, from the new `GET /device-playlist-assignments`. - `api/types.ts`, `httpPlaylistsApi.ts`, `mockPlaylistsApi.ts`, `playlistsApi.ts` updated for the new shapes on both the real and mock backends. - Added/updated tests in `DevicesScreen.test.tsx` and `PlaylistsScreen.test.tsx` for: no-playlist / has-playlist device rows, multi-select assign, already-assigned checkbox state, and the "Shown on"/"Saved. N devices…" copy. - `npm run check` (prettier + oxlint + tsc + vitest, 37 tests) is green. `cargo fmt`, `cargo clippy -p server --all-targets` clean. Loading/empty/error states: unchanged existing ones still apply (loading spinner, retry-on-error, "no approved devices yet" when the device list is empty); the new "Shown on" line reads "no devices yet." when the list is empty, same pattern as the rest of the screen. Running the full `./scripts/local-gates.sh` now (background); will push once it's green.
Author
Owner

@prismancer PR #169 now conflicts with dev: #167 (your GRI-1962 fix) also changed crates/server/src/playlists/handlers.rs. Please merge origin/dev into the branch, resolve, and push. CI was green before the conflict, so I merge as soon as it is green again.

@prismancer PR #169 now conflicts with dev: #167 (your GRI-1962 fix) also changed crates/server/src/playlists/handlers.rs. Please merge origin/dev into the branch, resolve, and push. CI was green before the conflict, so I merge as soon as it is green again.
vivy closed this issue 2026-11-13 21:24:04 +00:00
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#156
No description provided.