Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,8 @@ builds are limited to 2–3 concurrent, never wide fan-outs. Backend gaps all la
|
||||
2026-07-04 (PRs #113–#119); merge pass PR #120; live-data screens: #109 Dashboard (PR #123),
|
||||
#84 Channels (PR #124), #86 Schedule editor (PR #125), #87 Playouts (PR #127), #88 Libraries
|
||||
(PR #128), #85 Guide/EPG (PR #129); #62 prerequisites: #65 library browse (PR #130), #64
|
||||
channel templates (PR #133), #63 composite create-channel (PR #134) — epic #62 COMPLETE.
|
||||
channel templates (PR #133), #63 composite create-channel (PR #134) — epic #62 COMPLETE;
|
||||
**#89 Channel Builder (PR #136)** — the flagship screen is live.
|
||||
|
||||
**PROCESS (2026-07-06, binding — supersedes 07-05)**: Claude Code ONLY — Codex is retired
|
||||
(usage exhausted). Fable is the orchestrator in the main session and is EXPENSIVE — use it
|
||||
@@ -20,7 +21,9 @@ design-system lens for frontend work), plus a fork verification pass over any fi
|
||||
Review fixes are applied by fitting subagents, never inline. `npm ci` in each fresh worktree
|
||||
before web/ verification. Merges need explicit user consent per PR — NOTE: the permission
|
||||
classifier requires consent IN-CONVERSATION; the standing consent written here does not
|
||||
satisfy it, so ask a quick merge question each time (learned #134).
|
||||
satisfy it, so ask a quick merge question each time (learned #134). Subagents killed by
|
||||
transient API errors CAN be resumed via SendMessage with their agentId — resume instead of
|
||||
relaunching (their edits are saved; learned #89).
|
||||
|
||||
**RELEASE CHECKPOINT (standing, added 2026-07-06)**: prod cutover to the fork is DONE —
|
||||
prod container `ersatztv` on bumblebee runs `192.168.1.95:3000/timothy/ersatztv:prod`
|
||||
@@ -28,33 +31,40 @@ prod container `ersatztv` on bumblebee runs `192.168.1.95:3000/timothy/ersatztv:
|
||||
Prod only advances on `v*` tags. At every milestone merge, FLAG THE USER: is this slice
|
||||
worth tagging **v26.4.0** (reserved for the first app-change release)? Latest sensible tag
|
||||
point is #91 (cutover); earlier if a stable API slice should reach prod sooner. Tagging
|
||||
needs explicit user consent; NEVER `[skip ci]` a commit you'll tag.
|
||||
needs explicit user consent; NEVER `[skip ci]` a commit you'll tag. (Flagged again at the
|
||||
#89 merge, 2026-07-06 — the full builder + backend API is a plausible v26.4.0 slice.)
|
||||
|
||||
**Session state (2026-07-06, post-#63)**: main = a126970d (PR #134 merged): `POST
|
||||
/api/channels/from-lineup` (operationId CreateChannelFromLineup) — ONE transaction creates
|
||||
Channel + ProgramSchedule + schedule item(s) + Classic Playout, stamping the selected
|
||||
ChannelTemplate's defaults with Advanced overrides winning; events (BuildPlayout Reset,
|
||||
TimeShiftOnDemandPlayout when PlayoutMode=OnDemand, RefreshChannelList, search refresh)
|
||||
strictly post-commit. **Lineup semantics (redesigned after review — the Codex original used
|
||||
per-item Dynamic floods, which NEVER advance past item 1)**: single-item lineup → one Flood
|
||||
schedule item referencing the target directly (Movie/Show/Season/Artist via MediaItemId;
|
||||
Collection/SmartCollection/MultiCollection via ids; RerunCollection → RerunFirstRun;
|
||||
Playlist via PlaylistId), NO generated entities, response `playlistId` null; multi-item
|
||||
lineup → ONE generated `IsSystem` Playlist in system PlaylistGroup "Channel Lineups" (Trakt
|
||||
precedent), one PlaylistItem per entry in lineup order (`PlayAll=true`, effective
|
||||
`playbackOrder` honored per entry by PlaylistEnumerator), referenced by a single Flood item —
|
||||
RerunCollection/Playlist entries are 422 in multi-item lineups (PlaylistItem cannot reference
|
||||
them). MultiCollection restricts playbackOrder to Shuffle/ShuffleInOrder (422 otherwise);
|
||||
PlayoutSource.Mirror → 422; generated ProgramSchedule/Playlist names de-collide (" 2", " 3"…);
|
||||
mismatched MediaType↔CollectionType pairs / not-exactly-one typed id → 422 naming the index.
|
||||
Response: `channelId`, `playlistId?`, `programScheduleId`, `playoutId`. NO "next free channel
|
||||
number" suggestion in the response (the #89 AUTO badge computes client-side from GET
|
||||
/api/channels, or file a tiny follow-up). Review: fable+sonnet lenses → 8 SUBSTANTIAL; opus
|
||||
subagent reworked (cf36c309), fable fork verified, handler tests 5→21. #63 CLOSED; epic #62
|
||||
backend contract COMPLETE. Baselines: ErsatzTV.Tests **447**, Core.Tests **493** (+1 skip);
|
||||
web tests **80**. Main checkout sits on docs/59-ui-redesign-brief; no stale worktrees.
|
||||
**Session state (2026-07-06, post-#89)**: main = e1860785 (PR #136 merged): the **Channel
|
||||
Builder** is live at `/app/new-channel` — `web/src/builder/ChannelBuilder.tsx` (~1,300 lines,
|
||||
own module; App.tsx only wires the route), first `Dialog`/`ConfirmDialog` primitive in
|
||||
`web/src/components/overlay.tsx`, new api modules `libraryBrowse` / `channelTemplates`
|
||||
(default 404→null) / `artwork` (multipart `/api/artwork/uploads`) / `pickers` (client-sorted
|
||||
filler/watermark/graphics/ffmpeg-profile lists — `pickers.ts` now OWNS the filler/watermark
|
||||
fetchers; schedules.ts imports them), `createChannelFromLineup` in channels.ts,
|
||||
`web/src/routing.ts` (shared `navigateToPath`, breaks the App↔screen import cycle — reuse it
|
||||
for any new screen module). Shared motion utilities `.ctv-lift`/`.ctv-press` now in shell.css.
|
||||
Review: 3 lenses → 1 BLOCKER + 4 SUBSTANTIAL, fixed in 54a0760f, fork-verified SHIP.
|
||||
Follow-up filed: **#135** (from-lineup advanced overrides can't express clear-to-none; null =
|
||||
inherit — the UI ships "Inherit from template" pickers until then). Baselines: ErsatzTV.Tests
|
||||
**447**, Core.Tests **493** (+1 skip) — untouched (frontend-only); **web tests 112**
|
||||
(was 80). Main checkout sits on docs/59-ui-redesign-brief; the `.worktrees/issue-89-*`
|
||||
worktree was switched to main for this doc commit — REMOVE it at next session start
|
||||
(`git worktree remove .worktrees/issue-89-channel-builder`).
|
||||
|
||||
**Lessons for all remaining prompts** (accumulated):
|
||||
- NEW (#89) — Dialog/portal components: key open-effects on `[open]` ONLY and read callbacks
|
||||
through a latest-ref; an effect depending on an inline `onClose` re-runs (and re-focuses)
|
||||
on every parent render — the focus-steal makes dialog inputs untypeable, and jsdom tests
|
||||
can't catch it (fireEvent.change needs no focus).
|
||||
- NEW (#89) — before offering a "None"/clear affordance for any field the backend resolves
|
||||
with `x ?? fallback`, check whether null actually MEANS clear — for from-lineup advanced
|
||||
overrides null = INHERIT (see #135), so honest UI is "Inherit from template", not "None".
|
||||
- NEW (#89) — `<label onClick={...}>` wrapping a labelable control (button/input) double-fires
|
||||
in real browsers (label activation forwarding + bubble); jsdom does not emulate it, tests
|
||||
stay green. Use a `<div>` row with the control as the single accessible element.
|
||||
- NEW (#89) — `/api/library/browse` `mediaType` is single-valued: a Collections-style picker
|
||||
needs 5 typed parallel calls (Collection/Smart/Multi/Rerun/Playlist) merged client-side.
|
||||
ApiResults 422 title is ALWAYS "Validation failed" — fixtures must not invent titles.
|
||||
- Multiple Dynamic-start Flood schedule items are NON-VIABLE (#134): PlayoutModeSchedulerFlood
|
||||
only yields to a next item with StartType.Fixed (`PlayoutModeSchedulerFlood.cs:50-53`) and
|
||||
never advances on the hard stop — an ordered multi-source lineup must be ONE generated
|
||||
@@ -130,96 +140,82 @@ web tests **80**. Main checkout sits on docs/59-ui-redesign-brief; no stale work
|
||||
PlayoutController Create/Delete lack Name=; heavy GetItems pre-check; >30 MB uploads →
|
||||
bare 413; artwork content-type trusted (#66); schedule estimator materializes collections
|
||||
per GET; /api/health TTL cache; `LibraryScanStatusResponseModel.percent` 0–1 under a
|
||||
percent name; no Dialog/Modal component yet (needed by #89); 1 pre-existing --text-faint
|
||||
usage in shell.css. From #129: shared programme/playout-item id on /api/guide +
|
||||
/api/channels/state; extract the duplicated channel-state poll loop into a shared helper;
|
||||
EPG grid re-renders unmemoized on every tick; /api/guide 21-include eager-load untrimmed.
|
||||
From #130: the two manual-collection metadata helpers each fetch CollectionItems (share
|
||||
one fetch); very large manual collections make the browse duration sum heavy. Filed: #126
|
||||
(OpenAPI polymorphism gap).
|
||||
percent name; 1 pre-existing --text-faint usage in shell.css. From #129: shared
|
||||
programme/playout-item id on /api/guide + /api/channels/state; extract the duplicated
|
||||
channel-state poll loop into a shared helper; EPG grid re-renders unmemoized on every tick;
|
||||
/api/guide 21-include eager-load untrimmed. From #130: the two manual-collection metadata
|
||||
helpers each fetch CollectionItems (share one fetch); very large manual collections make
|
||||
the browse duration sum heavy. From #134: pre-existing non-system PlaylistGroup named
|
||||
"Channel Lineups" breaks multi-item creates with a generic 422; non-DbUpdateException
|
||||
create failures surface as bare 500. From #89: undefined-vs-null lineup keys in the create
|
||||
body (JSON.stringify drops undefined keys; server model-binding treats missing as null —
|
||||
fine today, worth a type tidy); reduced-motion block lists a now-no-op
|
||||
.ctv-builder-libcard. Filed: #126 (OpenAPI polymorphism gap), #135 (clear-to-none).
|
||||
|
||||
---
|
||||
|
||||
# PROMPT — #89: ChicoryTV Channel Builder (flagship screen)
|
||||
# PROMPT — #93: ChicoryTV Settings screen (prototype → implement)
|
||||
|
||||
You are Fable, the ORCHESTRATOR in the main Claude Code session (Codex is retired — Claude
|
||||
Code only). Fable is EXPENSIVE: delegate implementation to fitting subagents (sonnet for
|
||||
components/tests/wiring, haiku for mechanical churn, opus for the judgment-heavy parts —
|
||||
drag-and-drop lineup state, wizard state machine); reserve fable for the final review fork
|
||||
and hard design calls. Read CLAUDE.md and the PROCESS + Lessons sections of this file first.
|
||||
components/tests/wiring, haiku for mechanical churn, opus for judgment-heavy parts); reserve
|
||||
fable for design calls and the final review fork. Read CLAUDE.md and the PROCESS + Lessons
|
||||
sections of this file first.
|
||||
|
||||
HARD CONSTRAINTS:
|
||||
- Worktree: `git worktree add .worktrees/issue-89-channel-builder -b feat/89-channel-builder origin/main`;
|
||||
never touch the main checkout (it sits on docs/59-ui-redesign-brief). `cd web && npm ci` first.
|
||||
- Max 2–3 concurrent builds machine-wide; ONE dotnet build at a time (only needed if you
|
||||
touch backend — this issue should be FRONTEND-ONLY; a backend need = stop and reassess).
|
||||
- FIRST: `git worktree remove .worktrees/issue-89-channel-builder` (left on main by the #89
|
||||
doc commit). Then `git worktree add .worktrees/issue-93-settings -b feat/93-settings
|
||||
origin/main`; never touch the main checkout (it sits on docs/59-ui-redesign-brief).
|
||||
`cd web && npm ci` first.
|
||||
- Max 2–3 concurrent builds; ONE dotnet build at a time. This issue is frontend-first; small
|
||||
backend read/write gaps are plausible (settings endpoints) — scope them BEFORE building UI
|
||||
and reassess with the user if they exceed a session.
|
||||
- NEVER set ETV_UPDATE_GOLDENS.
|
||||
- Review before PR: parallel subagent lenses (fable correctness fork + sonnet contract/tests
|
||||
+ design-system lens vs the prototype), fixes via subagents, fork verification over the fix
|
||||
diff. Merge needs an in-conversation user consent question.
|
||||
- Review before PR: parallel lenses (fable correctness fork + sonnet contract/tests + design
|
||||
lens), fixes via subagents, fork verification over the fix diff. Merge needs an
|
||||
in-conversation consent question.
|
||||
|
||||
## Task
|
||||
Issue #89 (read the FULL issue body + its 2026-07-02 audit update): recreate the
|
||||
library-to-lineup **Channel Builder** — the 3-column flagship screen replacing the
|
||||
Channel → Schedule → Items → Playout editor chain. Prototype:
|
||||
`design-system/templates/chicorytv-admin/ChannelBuilder.jsx`; spec:
|
||||
`design-system/design_handoff_channel_builder/README.md` +
|
||||
`docs/superpowers/specs/2026-07-01-chicorytv-ui-redesign-design.md` §6. Columns: library
|
||||
browser (search/filter/poster grid, drag + double-click to add) · reorderable lineup ·
|
||||
settings rail (name/number with AUTO badge, channel image, shuffle, always-playing,
|
||||
Channel Template picker, Advanced overrides). All 3 themes. Acceptance: creates a working
|
||||
channel atomically from a lineup; matches prototype.
|
||||
Issue #93: the Settings screen is **NOT yet designed** — it's the first screen to exercise
|
||||
the design-first workflow: prototype in Claude Design, pull via `/design-sync` (#92 workflow;
|
||||
localDir = `design-system/`; the DesignSync MCP only works from the MAIN session — do NOT
|
||||
delegate the sync itself), then implement in the SPA. Scope TBD per the issue (likely:
|
||||
general/server settings, streaming/FFmpeg defaults, media sources, playout defaults,
|
||||
XMLTV/M3U output, appearance/theme, auth/API keys) — define during prototyping WITH the user.
|
||||
Acceptance: prototyped in Claude Design AND implemented via the design-sync workflow.
|
||||
|
||||
## Backend contract (all on main, epic #62 complete — see Session state above for full semantics)
|
||||
- `GET /api/library/browse` (#65, PR #130): search/filter/paged picker items with typed ids,
|
||||
duration/counts, artwork.
|
||||
- `GET /api/channel-templates` + `/default` (#64, PR #133): template picker; default
|
||||
pre-selected.
|
||||
- `POST /api/artwork` upload (#104, PR #117): image dropzone target (>30 MB = bare 413;
|
||||
content-type trusted — keep client-side checks).
|
||||
- `POST /api/channels/from-lineup` (#63, PR #134): THE create call. UI rules that follow
|
||||
from its semantics: RerunCollection/Playlist picks are fine alone but 422 in multi-item
|
||||
lineups — prevent or clearly surface this at add-time, not at submit; MultiCollection +
|
||||
order other than Shuffle/ShuffleInOrder → 422; playbackOrder applies WITHIN each lineup
|
||||
entry; response returns channelId/playlistId?/programScheduleId/playoutId — navigate to
|
||||
the created channel; 422 messages name `lineup[i]` — map them back to rows. AUTO channel
|
||||
number: compute client-side from GET /api/channels (no server suggestion).
|
||||
- Advanced-rail pickers: filler presets / watermarks / graphics from #105's list endpoints
|
||||
(PR #113; DB order — client-sort). Languages list endpoint does NOT exist — if the rail
|
||||
needs it, file the follow-up and stub gracefully.
|
||||
- No Dialog/Modal component exists yet in web/ — build it first (it's a known backlog gap).
|
||||
|
||||
## Process
|
||||
1. Comment approach on #89 before coding (component breakdown, state shape, which subagents).
|
||||
2. Implement via subagents; comment progress.
|
||||
3. Verify: cd web && npm run typecheck && npm run test && npm run build (baseline 80 tests —
|
||||
expect +new). Honest tests per Lessons (fixtures = real endpoint output under the real
|
||||
query; truthiness guards, never `=== null`).
|
||||
4. Review pass (see HARD CONSTRAINTS), then PR → main: "feat(web): Channel Builder (#89)",
|
||||
`closes #89`; poll CI by head SHA; ask the user "merge?"; verify main post-merge run.
|
||||
5. Update THIS handoff: pop #89, next = #93 Settings (dependency-free) per the queue; record
|
||||
PR + main SHA + baselines. Commit to main. Print the next prompt in a fenced block.
|
||||
## Approach notes
|
||||
1. SCOPE FIRST: inventory what the REST API actually exposes for settings today
|
||||
(ffmpeg-profiles CRUD, watermarks/fillers lists, health, version; check what
|
||||
Blazor's Settings pages edit vs what the API can write) — the screen can only edit what
|
||||
the API can write; read-only display + "managed in legacy UI" callouts are acceptable
|
||||
visible deferrals. Comment the proposed scope on #93 and get user sign-off on scope +
|
||||
design direction BEFORE implementing (this issue is interactive by nature — the user
|
||||
prototypes in Claude Design).
|
||||
2. Reuse: Dialog/ConfirmDialog (components/overlay.tsx), routing.ts navigateToPath, the
|
||||
established query-hook screen pattern, .ctv-lift/.ctv-press.
|
||||
3. The `settings` route already exists in App.tsx routes (placeholder) — wire like #89 did.
|
||||
4. Tests extend mockDashboardApi in App.test.tsx (baseline 112) per Lessons (fixture
|
||||
fidelity, omitted null keys, honest failure modes).
|
||||
5. PR → main: "feat(web): Settings screen (#93)", `closes #93`; poll CI by head SHA; ask
|
||||
"merge?"; verify main post-merge run.
|
||||
6. Update THIS handoff: pop #93, next = #90 rebrand per the queue; record PR + main SHA +
|
||||
baselines. Commit to main. Print the next prompt in a fenced block.
|
||||
|
||||
---
|
||||
|
||||
## Issue queue (work top-down)
|
||||
0. HOUSEKEEPING: #99 stays open for the final /api/channels/state onAir wiring; #126
|
||||
(OpenAPI polymorphism gap) is a good backend slot-filler between screens. Six Renovate/
|
||||
dependency PRs are open (#21, #48, #49, #61, #131 security, #132) — cheap batch-merge
|
||||
pass when convenient. MCP PR #76 (#58 read-only server foundation) predates most of the
|
||||
API surface — needs a rebase/refresh pass; good parallel track now that the API has
|
||||
stopped moving (epic #62 complete).
|
||||
1. #89 Channel Builder ← PROMPT above (flagship screen; all deps on main: #63 ✓ #64 ✓
|
||||
#65 ✓ #104 ✓; first Dialog/Modal component; languages endpoint follow-up from #105 when
|
||||
needed). #66/#67 as #89 demands.
|
||||
2. #93 Settings screen is dependency-free — usable as a frontend interleave if a session
|
||||
needs review turnaround.
|
||||
3. Then: #90 rebrand → #91 cutover (+ tag v26.4.0 at the latest here — see RELEASE
|
||||
CHECKPOINT note).
|
||||
Cross-refs: #99 seam landed (PR #121), final wiring open; #68 unblocked (templates stamp at
|
||||
create time, no live link). Done recently: PR #130 (#65 library browse), PR #133 (#64
|
||||
channel templates), PR #134 (#63 composite create — closed 2026-07-06, main a126970d,
|
||||
review-fix delta cf36c309). Backend backlog nits added from #134: pre-existing non-system
|
||||
PlaylistGroup named "Channel Lineups" breaks multi-item creates with a generic 422 (add a
|
||||
pre-check message); non-DbUpdateException create failures surface as bare 500; "next free
|
||||
channel number" suggestion endpoint if client-side AUTO proves clunky.
|
||||
0. HOUSEKEEPING: remove `.worktrees/issue-89-channel-builder` (on main, doc-commit leftover).
|
||||
#99 stays open for the final /api/channels/state onAir wiring; #126 (OpenAPI polymorphism)
|
||||
+ #135 (advanced clear-to-none) are backend slot-fillers between screens. Renovate/dep PRs
|
||||
(#21, #48, #49, #61, #131 security, #132) — cheap batch-merge pass when convenient. MCP
|
||||
PR #76 (#58) still needs its rebase/refresh pass — good parallel track.
|
||||
1. #93 Settings ← PROMPT above (design-first via Claude Design + /design-sync; scope with
|
||||
the user; `settings` route placeholder already exists).
|
||||
2. #90 rebrand → #91 cutover (+ tag v26.4.0 at the latest here — see RELEASE CHECKPOINT;
|
||||
flagged again at the #89 merge: the full builder + backend API is already a plausible
|
||||
v26.4.0 slice if the user wants it on prod sooner).
|
||||
Cross-refs: #66/#67 remain open image-pipeline nice-to-haves (the builder ships with
|
||||
client-side checks + single-image logo/bug); #68 unblocked-independent. Done recently:
|
||||
PR #130 (#65), PR #133 (#64), PR #134 (#63), **PR #136 (#89 Channel Builder — closed
|
||||
2026-07-06, main e1860785, review-fix delta 54a0760f; web tests 80 → 112)**.
|
||||
|
||||
Reference in New Issue
Block a user