Commit Graph
6 Commits
Author SHA1 Message Date
timothyandClaude Opus 5 4d33462732 fix(721,740): align Auto-Tune proposal rows on a grid; guard AddItemsDialog's async searches
review-verdict/h10 Review-verdict: MERGEABLE @ 4d33462 (base: main)
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 20s
Build ErsatzTV Image / Delimiter ban (release path) (pull_request) Successful in 47s
PR Gates / Docs update reminder (pull_request) Successful in 48s
Build ErsatzTV Image / CI toolchain image resolves (pull_request) Successful in 49s
PR Gates / Fix proofs (Proves trailers) (pull_request) Successful in 16s
Review verdict / Set review-verdict status (pull_request_target) Successful in 10s
PR Gates / decisions lifecycle (pull_request) Successful in 35s
PR Gates / Script lint and tests (ruff + pytest) (pull_request) Successful in 5m12s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m43s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 6m55s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Skipped
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 5m54s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 13s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 5s
#721 — the Auto-Tune proposal list was hard to scan because the channel number started
wherever the preceding text ended: the row was a flex line whose first child was a
`<Checkbox label={displayName}>`, so `minWidth: 42` reserved width for the number without
being able to align it. The same name then rendered a second time in the detail column, and
the group header above the rows had the same duplicate (`Select all TV Shows` immediately
followed by `TV Shows`).

The row is now a grid. What makes the column line up is that everything to the LEFT of the
number is fixed-width — a label-less Checkbox renders one fixed-size control — and the number
track is fixed rather than content-sized, because each row is its own grid container and an
`auto`/`max-content` track would resolve per row.

No fixed track is a true upper bound on the value: `AutoTuneNumberAllocator.Allocate` emits
`int.ToString()` from a `StartingNumber` that `PreviewAutoTuneChannelsHandler` only floors at
1, and a per-proposal override is free text checked against `Channel.NumberValidator`
(`^[0-9]+(\.[0-9]{1,2})?$`) — unbounded integer part plus up to two decimals. So the cell
clips: an extreme value degrades to an ellipsis with the full value on hover instead of
overflowing into the checkbox beside it. That is a real trade — the flex box it replaces grew
instead of truncating — so the `title` fallback is part of the fix, not decoration, and is
pinned. The number is right-aligned and tabular so 2-, 3- and 4-digit numbers agree on their
last digit.

`Checkbox` gains `hideLabel`, mirroring the prop `Switch` in the same file already has: the
name lives in its own column and the control keeps `label` as its accessible name, so the
existing `getByRole('checkbox', { name })` assertions are untouched.

#740 — `AddItemsDialog` had neither of the two guards spa-conventions.md §3b mandates for
asynchronous pickers, and their triggers differ. `runSearch` is reachable twice concurrently
(a form submit fanning out over DEFAULT_SEARCH_KINDS, a kind-chip click issuing one request),
so a superseded response could settle after a newer one — repainting the list with every kind
under an active "Movies" chip, wiping a newer successful result with a superseded search's
error, or clearing `searching` while the other request was still in flight. Separately, the
dialog is unmount-reachable mid-request through Escape, a backdrop click and the header close
button, none of which consult the in-flight flag — so `submit`'s post-await writes to its own
state need the is-mounted guard even though its Add button is disabled and nothing can
supersede it. `onAdded`/`onClose` are deliberately NOT guarded: they belong to the parent,
which owns its own guarding, and dropping the list reload after a write that succeeded would
leave the collection stale.

Every clause listed below ships with a test that reddens when THAT clause alone is removed.
Verified by applying each mutation to the pristine source, asserting it matched exactly once,
reading it back, and re-running — 14/14 red:

  runSearch success guard   -> repaint test        submit catch guard    -> failed-add test
  runSearch catch guard     -> failed-search test  submit finally guard  -> failed-add test
  runSearch finally guard   -> spinner test        row grid track list   -> #721 test
  isCurrent mounted half    -> unmount test        textAlign / overflow  -> #721 test
  isCurrent seq half        -> 3 search tests      whiteSpace / title    -> #721 test
  row + group-header hideLabel -> #721 test

Two of those needed the test strengthened before they were pinned at all, and both are the
kind of green that means nothing:

- The two `submit` guards MASKED each other — removing either alone left the suite green,
  because the survivor still read the ref. That test now counts the reads rather than
  asserting merely that one of them saw `false`.
- The failed-search test asserted `queryByText('Unable to search library')`, which
  `messageFromCollectionError` only produces for a non-`Error` throw — so it was null-vs-null
  and passed with the guard removed. It matches `role="alert"` instead, verified to fail on
  its own with the other assertions in that test removed.

The unmount tests record what the component read out of the is-mounted ref because an
unmounted tree renders nothing either way and no DOM assertion can tell "the guard stopped it"
from "React discarded it"; same construction as schedules/pickers.test.tsx.

The design-system prototypes already had a label-less proposal checkbox — the SPA had drifted
from them — so the mirrored delta is the number's right-align. The prototypes keep their flex
row; converting them to the grid is a layout change to a mockup, not part of this fix.

Verification: web suite 115 files / 1206 tests green; `npm run typecheck` and `npm run lint`
clean; repo guard suite `scripts/tests` 956 passed / 2 skipped. Live-E2E not required —
`docs/e2e-local.md` scopes it to API write-path handler changes and this is pure-SPA and
read-only. No .cs files touched.

fixes #721
fixes #740

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 23:23:38 +02:00
timothy daedf003e5 fix(644): round-3 review — split truncated/incomplete picker hints, F2 out-of-list gaps, F3 abort warns, F4 aria wiring, F5 FillerPresetsScreen tests
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 14s
PR Gates / Docs update reminder (pull_request) Successful in 24s
PR Gates / decisions lifecycle (pull_request) Successful in 28s
Review verdict / Set review-verdict status (pull_request) Successful in 6s
PR Gates / Script tests (pytest) (pull_request) Successful in 33s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m17s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 9s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 7s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 20m19s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 16m24s
review-verdict/h10 Review-verdict: MERGEABLE @ daedf00
Addresses the round-3 cold re-review's five low-severity findings on #644's client-side paging fix:

- F1: `loadPickerOptions` (RerunCollectionsScreen, PlaylistsScreen) returned one `truncated:
  boolean` for two different conditions — a real Class B cap hit vs an unconverged Class A
  `loadAllPages` load — so an incomplete multi-collection load rendered the self-contradictory
  "Showing the first 47 of 47 — use search to narrow." Replaced with a `hint: 'incomplete' | 'none'
  | 'truncated'` discriminator and distinct copy per value; 'incomplete' matches the wording already
  used by the Class A list-load warn Badge.
- F2: mirrored the out-of-list current-selection injection (RerunCollectionsScreen/PlaylistsScreen's
  `selectedInList` prepend) into FillerPresetsScreen and ScheduleItemInspector's rerun-collection
  picker, so an id outside the loaded page still renders as selected instead of misrepresenting the
  stored value as "(none)".
- F3: gated the `console.warn` on an incomplete Class A load with `!signal?.aborted` in the `multi`
  branches (RerunCollectionsScreen, PlaylistsScreen) and SchedulesScreen.loadAllRerunCollections, so
  a superseded/aborted load (Retry, or a type switch mid-load) no longer logs a false warning.
- F4: added `Select`'s `ariaDescribedBy` prop and wired the truncation/incomplete hint span to it via
  `useId()` in RerunCollectionsScreen and PlaylistsScreen, so screen readers announce the hint
  (FillerPresetsScreen already routed it through `Row help=`).
- F5: added FillerPresetsScreen.test.tsx (previously untested) covering the Class B single-request
  guarantee, the truncation hint's totalCount>100/<=100 boundary, and the F2 injection; added the
  two assertions the re-review found missing anywhere in the suite — the Class A `incomplete` warn
  Badge actually rendering, and a screen-level seqRef stale-overwrite race — to
  RerunCollectionsScreen.test.tsx.

Updates docs/spa-conventions.md §3b and the
spa.list-completeness-vs-bounded-pickers decision record to describe the hint discriminator.

Decisions-Edit: yes
2026-07-26 21:29:53 +02:00
timothy d5da504651 feat(67): add Use logo as on-screen bug toggle with preview to the channel editor 2026-07-20 20:51:58 +02:00
timothyandClaude Opus 4.8 d639946b5c feat(404): weighted-distribution SPA — per-source weight inputs + WeightedShuffle order
Build ErsatzTV Image / CI image pin matches docker/ci (pull_request) Successful in 9s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 11s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 7s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 7s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m39s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 16m37s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 21m41s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 24m50s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
The UI half of #70 (backend + API shipped in PR #402). Pure SPA + docs — no new
endpoint/DTO (`weight` was already on MultiCollectionItemRequest/Response, and
`WeightedShuffle` already in the PlaybackOrder enum).

- Multi-collection editor (`/app/multi-collections`): per-source weight input
  (1..1000, mirroring the API validator), a computed % share (3:1 shows 75/25),
  and a "Reset to fair share" action (fair-share = all weights 1, decisions.md
  2026-07-17 — a reset, not a separate mode). Weight round-trips through the
  draft (read in itemsFromMultiCollection, written in toItemRequest) so the
  replace-all PUT never silently resets it.
- Classic schedule editor: `WeightedShuffle` offered as a Playback Order ONLY
  for MultiCollection sources (itemRules `MULTI_COLLECTION_ORDERS`) — it needs
  per-source weights and the write path rejects it elsewhere. Excluded from
  fillWithGroup like ShuffleInOrder (PlayoutBuilder schedules fill-groups
  per-group, incompatible with whole-collection weighted share).
- `Input` gained min/max/inputMode/onBlur passthroughs for bounded numeric
  fields (reusable by #425's weight UI); weight held as a string for smooth
  editing, clamped on blur and at save so an out-of-range value never 400s.
- Docs: domain-model + spa-conventions (replace-all round-trip trap, bounded
  numeric input pattern) + decisions.md entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 11:28:12 +02:00
timothyandClaude Fable 5 91e23bcd57 feat(spa): wire playout delete/reset/erase + scheduling context + templates preview calendar (#210)
Adds the SPA slice for the newly-merged playout endpoints:
- api/playouts: deletePlayout, resetChannelPlayout, erasePlayoutItems,
  erasePlayoutItemsAndHistory, getPlayoutItemSchedulingContext (+ types).
- PlayoutsScreen: enable per-playout Reset (channel playout reset), Delete
  (danger, confirm), and erase-by-kind buttons (Block = items + items&history;
  Classic/Sequential/Scripted = items&history; none for ExternalJson); replaces
  the stale "no per-playout reset endpoint" block. Disable Alternate schedules
  for OnDemand Classic playouts (Blazor parity).
- Per-item scheduling-context dialog (info button when hasSchedulingContext &&
  id != null), rendering the decoded JSON in a scrollable <pre>.
- Playout-templates editor: "Preview calendar" toggle with a Monday-first month
  grid; winning template per day computed client-side via a colocated
  appliesToDate/firstMatchingIndex helper that ports
  AlternateScheduleSelector.GetScheduleForDate / PlayoutTemplateEditViewModel
  .AppliesToDate exactly (inclusive range, year-wrap reverse, start-day rollover,
  end-day clamp, explicit-year override).
- Button gains a title prop (parity with IconButton) for the disabled-button hint.

Tests: api client URL/method assertions, PlayoutsScreen action flows
(delete/reset/erase per kind, OnDemand gating, scheduling-context dialog +
error), calendar-helper unit tests, and a preview-calendar render test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:30:28 +02:00
timothy e6df6ac10a feat(web): add ChicoryTV component primitives
refs #80
2026-07-02 08:09:09 +02:00