SPA parity: Channel edit + channel numbers (#91 blocker) #146

Closed
opened 2026-07-07 10:45:06 +02:00 by timothy · 3 comments
Owner

Blocking sub-issue for #91 (Blazor retirement, phase b). Recon (2026-07-07) found this functionality exists only in the legacy Blazor UI — deleting Blazor before the SPA covers it would remove the feature. Part of epic #59.

Blazor routes covered: /channels/{id} (full channel editor) and /channels/numbers (bulk renumbering). The SPA Channels screen lists/monitors and the builder creates; editing an existing channel end-to-end needs a home.

Blocking sub-issue for #91 (Blazor retirement, phase b). Recon (2026-07-07) found this functionality exists only in the legacy Blazor UI — deleting Blazor before the SPA covers it would remove the feature. Part of epic #59. Blazor routes covered: `/channels/{id}` (full channel editor) and `/channels/numbers` (bulk renumbering). The SPA Channels screen lists/monitors and the builder creates; editing an existing channel end-to-end needs a home.
Author
Owner

UX review of the #91 root-flip PR found a live dead-end that makes this issue more urgent: the SPA Channels screen's edit pencil navigates to /app/new-channel?edit={id}, but ChannelBuilderScreen never reads the edit query param — it silently opens a blank new-channel wizard. Once root redirects to the SPA this becomes the primary edit path users hit. Interim options: honor edit= in the builder, or repoint the pencil at Blazor's /channels/{id} until parity lands.

UX review of the #91 root-flip PR found a live dead-end that makes this issue more urgent: the SPA Channels screen's edit pencil navigates to `/app/new-channel?edit={id}`, but `ChannelBuilderScreen` never reads the `edit` query param — it silently opens a blank new-channel wizard. Once root redirects to the SPA this becomes the primary edit path users hit. Interim options: honor `edit=` in the builder, or repoint the pencil at Blazor's `/channels/{id}` until parity lands.
Author
Owner

Scope call (2026-07-07, pre-implementation): going with a dedicated ChannelEditScreen, not builder hydration.

Recon findings:

  • ChannelBuilder.tsx is a lineup-centric create-only workspace (~40 pieces of useState, submits the composite POST /api/channels/from-lineup). It has no hydration path and its model doesn't map onto editing an existing channel's settings — retrofitting an edit mode would be invasive and risky.
  • The API round-trips cleanly: PUT /api/channels/{id} (UpdateChannelRequest) is exactly GET /api/channels/{id} (ChannelViewModel) minus read-only Id/PlayoutCount. Hydrate-then-PUT is trivial with a form screen.
  • The channel table's edit pencil already emits /app/new-channel?edit={id} that nothing consumes — will repoint it at the new edit route.
  • The edit screen will model itself on SettingsScreen (draft/saved state, section rail, save pill, existing form primitives) and cover the full Blazor ChannelEditor.razor field set.

Gap found: Blazor's editor exposes ExternalLogoUrl, which does NOT exist on ChannelViewModel/UpdateChannelRequest — the JSON contract can't set an external logo URL today. Logo upload works via the artwork upload API (#104). Will note/file a follow-up rather than widen this PR to the backend contract.

/channels/numbers (bulk renumbering): the SPA already exposes bulkRenumberChannels via the Renumber toolbar action on selected channels (sequential from a starting number). That covers the core parity use-case; the Blazor drag-to-reorder screen is a nicer affordance but not required for #91 phase (b). Deferring drag-to-reorder to a follow-up unless review disagrees.

**Scope call (2026-07-07, pre-implementation):** going with a **dedicated ChannelEditScreen**, not builder hydration. Recon findings: - `ChannelBuilder.tsx` is a lineup-centric create-only workspace (~40 pieces of `useState`, submits the composite `POST /api/channels/from-lineup`). It has no hydration path and its model doesn't map onto editing an existing channel's settings — retrofitting an edit mode would be invasive and risky. - The API round-trips cleanly: `PUT /api/channels/{id}` (`UpdateChannelRequest`) is exactly `GET /api/channels/{id}` (`ChannelViewModel`) minus read-only `Id`/`PlayoutCount`. Hydrate-then-PUT is trivial with a form screen. - The channel table's edit pencil already emits `/app/new-channel?edit={id}` that nothing consumes — will repoint it at the new edit route. - The edit screen will model itself on `SettingsScreen` (draft/saved state, section rail, save pill, existing form primitives) and cover the full Blazor `ChannelEditor.razor` field set. **Gap found:** Blazor's editor exposes `ExternalLogoUrl`, which does NOT exist on `ChannelViewModel`/`UpdateChannelRequest` — the JSON contract can't set an external logo URL today. Logo upload works via the artwork upload API (#104). Will note/file a follow-up rather than widen this PR to the backend contract. **`/channels/numbers` (bulk renumbering):** the SPA already exposes `bulkRenumberChannels` via the Renumber toolbar action on selected channels (sequential from a starting number). That covers the core parity use-case; the Blazor drag-to-reorder screen is a nicer affordance but not required for #91 phase (b). Deferring drag-to-reorder to a follow-up unless review disagrees.
Author
Owner

Closed via PR #154 (merged to main).

Done: dedicated ChannelEditScreen at /app/edit-channel/{id} (scope call above: builder hydration rejected). Hydrate-then-PUT on GET/PUT /api/channels/{id}; full ChannelEditor.razor field parity in a 6-section rail (identity, playout source/mode incl. Mirror conditionals + generated-with-playout lock, streaming/FFmpeg profile/watermark with HLS-Direct lock, stream selector default/custom branch, music video credits gating, logo preview+upload, fallback filler). Channel-table edit pencil repointed from the dead ?edit= URL.

Files: web/src/screens/ChannelEditScreen.tsx (+tests), web/src/api/channels.ts (getChannelById/updateChannel +tests), web/src/App.tsx (route + pencil).

Verification: 152 web tests green; tsc/eslint/vite build clean; live E2E against a real server (PUT/GET round-trip persisted + reverted, 404 path). Adversarial review SHIP; should-fixes applied in 1f3385a2 (Enabled-off now forces ShowInEpg off — backend 422s otherwise; keyed edit route; full-body PUT assertion).

Deferred:

  • /channels/numbers drag-to-reorder — existing Renumber toolbar accepted as parity (see scope comment).
  • ExternalLogoUrl — absent from the JSON contract (ChannelViewModel/UpdateChannelRequest); backend gap, not widened here.
  • Language-code/stream-selector/credits-template enumeration endpoints don't exist → free-text inputs with hints.
  • Review noted dead null-clear code in UpdateChannelHandler.cs:144–151 (pre-existing) — backlog nit.

TimeSpan note: the SPA's playout-offset math uses total hours and round-trips the "c" format incl. days — fixing a latent Blazor display bug (PlayoutOffset?.Hours reads only the hours component).

**Closed via PR #154** (merged to main). **Done:** dedicated `ChannelEditScreen` at `/app/edit-channel/{id}` (scope call above: builder hydration rejected). Hydrate-then-PUT on GET/PUT /api/channels/{id}; full ChannelEditor.razor field parity in a 6-section rail (identity, playout source/mode incl. Mirror conditionals + generated-with-playout lock, streaming/FFmpeg profile/watermark with HLS-Direct lock, stream selector default/custom branch, music video credits gating, logo preview+upload, fallback filler). Channel-table edit pencil repointed from the dead `?edit=` URL. **Files:** web/src/screens/ChannelEditScreen.tsx (+tests), web/src/api/channels.ts (getChannelById/updateChannel +tests), web/src/App.tsx (route + pencil). **Verification:** 152 web tests green; tsc/eslint/vite build clean; live E2E against a real server (PUT/GET round-trip persisted + reverted, 404 path). Adversarial review SHIP; should-fixes applied in 1f3385a2 (Enabled-off now forces ShowInEpg off — backend 422s otherwise; keyed edit route; full-body PUT assertion). **Deferred:** - `/channels/numbers` drag-to-reorder — existing Renumber toolbar accepted as parity (see scope comment). - `ExternalLogoUrl` — absent from the JSON contract (ChannelViewModel/UpdateChannelRequest); backend gap, not widened here. - Language-code/stream-selector/credits-template enumeration endpoints don't exist → free-text inputs with hints. - Review noted dead null-clear code in UpdateChannelHandler.cs:144–151 (pre-existing) — backlog nit. TimeSpan note: the SPA's playout-offset math uses total hours and round-trips the "c" format incl. days — fixing a latent Blazor display bug (`PlayoutOffset?.Hours` reads only the hours component).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#146