ChicoryTV SPA: Playouts screen #87

Closed
opened 2026-07-02 01:07:18 +02:00 by timothy · 3 comments
Owner

Recreate design-system/templates/chicorytv-admin/Playouts.jsx wired to the Playout API.

Now/next monitor (live preview, up-next, timeline strip, upcoming list). Acceptance: matches prototype; live playout data; all 3 themes.

Recreate `design-system/templates/chicorytv-admin/Playouts.jsx` wired to the Playout API. Now/next monitor (live preview, up-next, timeline strip, upcoming list). **Acceptance:** matches prototype; live playout data; all 3 themes.
timothy added the frontend label 2026-07-02 01:07:18 +02:00
timothy added a new dependency 2026-07-02 01:08:41 +02:00
timothy added a new dependency 2026-07-02 01:08:42 +02:00
timothy added a new dependency 2026-07-02 19:44:15 +02:00
timothy added a new dependency 2026-07-02 19:44:15 +02:00
Author
Owner

Starting #87 Playouts screen implementation on feat/87-playouts from origin/main.

Prototype to API mapping:

Prototype surface Live source Scope decision
Playout selector rail GET /api/playouts paged response Show all returned page items, selector/search over loaded page, include paging metadata.
On-air now metadata GET /api/channels/state Poll channel state only, at >=30s; match selected playout by channel number/name/id-adjacent data available in DTOs.
Live preview frame No player integration in current SPA Render disabled/metadata preview treatment, no video element and no new player dependency.
Up next, timeline, upcoming list GET /api/playouts/{id}/items paged response Fetch on selection change/on-demand; do not poll items. Use start, finish, duration, fillerKind.
Playout details GET /api/playouts/{id} plus list row build status Fetch selected playout details on selection change; show schedule kind/name, mode, rebuild time, status.
Warning count badge GET /api/playouts/warnings/count Surface as a header badge; non-blocking screen metadata.
Reset all POST /api/playouts/reset-all Ship only if matching prototype; destructive confirm, disable all triggers while mutating, ref-guard double submit, then refetch playout-scoped data.
Add playout / reset schedule Existing prototype affordances without complete live workflow Defer as disabled surfaces/notes unless already trivially backed by current API without additional screens.

Implementation plan: add a focused web/src/api/playouts.ts hook, wire the /app/playouts route into the existing shell patterns, and add tests first for paged handling, mount call-count, state-only polling, selection item fetch, reset success/failure, error/retry, loading, and empty states.

Starting #87 Playouts screen implementation on `feat/87-playouts` from `origin/main`. Prototype to API mapping: | Prototype surface | Live source | Scope decision | | --- | --- | --- | | Playout selector rail | `GET /api/playouts` paged response | Show all returned page items, selector/search over loaded page, include paging metadata. | | On-air now metadata | `GET /api/channels/state` | Poll channel state only, at >=30s; match selected playout by channel number/name/id-adjacent data available in DTOs. | | Live preview frame | No player integration in current SPA | Render disabled/metadata preview treatment, no video element and no new player dependency. | | Up next, timeline, upcoming list | `GET /api/playouts/{id}/items` paged response | Fetch on selection change/on-demand; do not poll items. Use `start`, `finish`, `duration`, `fillerKind`. | | Playout details | `GET /api/playouts/{id}` plus list row build status | Fetch selected playout details on selection change; show schedule kind/name, mode, rebuild time, status. | | Warning count badge | `GET /api/playouts/warnings/count` | Surface as a header badge; non-blocking screen metadata. | | Reset all | `POST /api/playouts/reset-all` | Ship only if matching prototype; destructive confirm, disable all triggers while mutating, ref-guard double submit, then refetch playout-scoped data. | | Add playout / reset schedule | Existing prototype affordances without complete live workflow | Defer as disabled surfaces/notes unless already trivially backed by current API without additional screens. | Implementation plan: add a focused `web/src/api/playouts.ts` hook, wire the `/app/playouts` route into the existing shell patterns, and add tests first for paged handling, mount call-count, state-only polling, selection item fetch, reset success/failure, error/retry, loading, and empty states.
Author
Owner

Progress update for #87:

Implemented the Playouts screen in feat/87-playouts as a frontend-only change.

What is wired:

  • GET /api/playouts for the selector rail and total count.
  • GET /api/playouts/{id} for selected playout details.
  • GET /api/playouts/{id}/items for timeline/upcoming items.
  • GET /api/playouts/warnings/count for the header badge.
  • GET /api/channels/state for now-playing/on-air metadata, with state-only polling.
  • POST /api/playouts/reset-all behind confirmation and mutation disable/guard behavior.

Scope decisions:

  • Live preview is a metadata-only disabled surface; no video player dependency or /iptv playback integration added.
  • Add Playout remains disabled because the prototype affordance needs a broader create workflow.
  • Playout items are fetched on mount/selection/reset and are not polled.

Verification run so far:

  • cd web && npm ci
  • npm run lint clean
  • npm run typecheck clean
  • npm test -- --run passed: 60 tests
  • npm run build passed
  • TZ=UTC dotnet build ErsatzTV.sln passed with existing NU1903/nullable test warnings
  • TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj passed: 368 tests
  • TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj passed: 493 passed, 1 skipped
Progress update for #87: Implemented the Playouts screen in `feat/87-playouts` as a frontend-only change. What is wired: - `GET /api/playouts` for the selector rail and total count. - `GET /api/playouts/{id}` for selected playout details. - `GET /api/playouts/{id}/items` for timeline/upcoming items. - `GET /api/playouts/warnings/count` for the header badge. - `GET /api/channels/state` for now-playing/on-air metadata, with state-only polling. - `POST /api/playouts/reset-all` behind confirmation and mutation disable/guard behavior. Scope decisions: - Live preview is a metadata-only disabled surface; no video player dependency or `/iptv` playback integration added. - Add Playout remains disabled because the prototype affordance needs a broader create workflow. - Playout items are fetched on mount/selection/reset and are not polled. Verification run so far: - `cd web && npm ci` - `npm run lint` clean - `npm run typecheck` clean - `npm test -- --run` passed: 60 tests - `npm run build` passed - `TZ=UTC dotnet build ErsatzTV.sln` passed with existing NU1903/nullable test warnings - `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj` passed: 368 tests - `TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj` passed: 493 passed, 1 skipped
Author
Owner

Closing — #87 Playouts monitor shipped

What was done: ChicoryTV SPA Playouts screen (PR #127, Codex) — selector rail (paged GET /api/playouts + search/filter), now-playing hero from the 30s channel-state poll, up-next/timeline/upcoming from GET /api/playouts/{id}/items (fetched on selection, never polled), warnings badge, reset-all with confirm + ref guard. Video preview deferred (metadata-only placeholder, no player dependency); Add Playout deferred.

Fable review (3-lens subagents): NOT mergeable as-is — 2 blocker-class defects + 6 substantials. Highlights: the filler feature was simultaneously wrong and dead (backend always emits fillerKind — real items got a truthy "None" → every real item rendered the Filler badge; meanwhile the client never sent showFiller=true so real filler could never appear; the prototype's Show filler toggle had been silently dropped); undefined --ctv-surface-1 token broke the hero background in all themes; a fetch ran inside a setState updater (StrictMode double-fetch); no responsive collapse for the new grids; several dishonest/missing tests (reset-all failure scenario the backend can't produce, mount-count test absorbing the Dashboard prefetch, untested search/filter, no paging coverage).

All findings fixed pre-merge (c4190e3a, sonnet+haiku subagents; adversarial fork verification: CONFIRMED-GOOD): isFillerItem predicate + Show filler Switch wired to ?showFiller=true + real-wire-value fixtures; baseRef hoist out of the updater + functional channel-state merge; --surface-card per prototype + responsive collapse + fallback fixes; visible disabled Reset/Schedule-reset deferrals; itemsLoading spinners; time-window now-matching; honest tests (mount delta isolation, transport-failure reset test, rail filter, paging "shown of total" label). Final: 63/63 web tests, lint/typecheck/build green, PR CI green.

Merged: PR #127 → main a8dd88ef (branch deleted). Post-merge main run being verified (image job included).

Files changed: web/src/App.tsx, web/src/App.test.tsx, web/src/api/index.ts, web/src/api/playouts.ts, web/src/shell.css.

Deferred: live video preview (player integration); Add Playout workflow; per-playout reset (no endpoint — disabled buttons with note); pagination UI (monitor scope; label is now honest about truncation).

Docs: handoff docs/handoffs/chicorytv-issue-queue.md being updated with next prompt (#88 Libraries).

## Closing — #87 Playouts monitor shipped **What was done**: ChicoryTV SPA Playouts screen (PR #127, Codex) — selector rail (paged GET /api/playouts + search/filter), now-playing hero from the 30s channel-state poll, up-next/timeline/upcoming from GET /api/playouts/{id}/items (fetched on selection, never polled), warnings badge, reset-all with confirm + ref guard. Video preview deferred (metadata-only placeholder, no player dependency); Add Playout deferred. **Fable review** (3-lens subagents): NOT mergeable as-is — 2 blocker-class defects + 6 substantials. Highlights: the filler feature was simultaneously wrong and dead (backend always emits fillerKind — real items got a truthy "None" → every real item rendered the Filler badge; meanwhile the client never sent showFiller=true so real filler could never appear; the prototype's Show filler toggle had been silently dropped); undefined `--ctv-surface-1` token broke the hero background in all themes; a fetch ran inside a setState updater (StrictMode double-fetch); no responsive collapse for the new grids; several dishonest/missing tests (reset-all failure scenario the backend can't produce, mount-count test absorbing the Dashboard prefetch, untested search/filter, no paging coverage). **All findings fixed pre-merge** (c4190e3a, sonnet+haiku subagents; adversarial fork verification: CONFIRMED-GOOD): isFillerItem predicate + Show filler Switch wired to ?showFiller=true + real-wire-value fixtures; baseRef hoist out of the updater + functional channel-state merge; --surface-card per prototype + responsive collapse + fallback fixes; visible disabled Reset/Schedule-reset deferrals; itemsLoading spinners; time-window now-matching; honest tests (mount delta isolation, transport-failure reset test, rail filter, paging "shown of total" label). Final: 63/63 web tests, lint/typecheck/build green, PR CI green. **Merged**: PR #127 → main `a8dd88ef` (branch deleted). Post-merge main run being verified (image job included). **Files changed**: web/src/App.tsx, web/src/App.test.tsx, web/src/api/index.ts, web/src/api/playouts.ts, web/src/shell.css. **Deferred**: live video preview (player integration); Add Playout workflow; per-playout reset (no endpoint — disabled buttons with note); pagination UI (monitor scope; label is now honest about truncation). **Docs**: handoff docs/handoffs/chicorytv-issue-queue.md being updated with next prompt (#88 Libraries).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: timothy/ersatztv#87