Replaces the ChicoryTV Dashboard prototype/stub data with real REST API sources.
Head SHA: 6a9f1e41a4dbeaaf5c620140aad91d3fc23cdcfe
Widget to endpoint mapping
Sidebar version: GET /api/version (appVersion)
Sidebar health dot: GET /api/health summary status
Channels tile: GET /api/channels count
Active playouts tile: GET /api/playoutstotalCount
On air tile/cards: GET /api/channels/state filtered by onAir, joined to GET /api/channels for channel name/number; nowPlaying.title, startUtc, and finishUtc drive title/progress when present
Libraries tile: GET /api/media-sources, summed libraries.length
System health panel: GET /api/health rows from title, status, and detail
Health fetch policy
GET /api/health is demand-loaded only: once on app mount for the shell/dashboard health state, then only from the manual Refresh health action. No interval polling was added because the endpoint reruns the full health-check set per request.
Removed prototype-only content
Removed fabricated Recent activity feed.
Removed fabricated Release notes body.
Verification
cd web && npm ci
cd web && npm run lint
cd web && npm run typecheck
cd web && npm test -- --run src/App.test.tsx (19 passed)
cd web && npm run build
TZ=UTC dotnet build ErsatzTV.sln (passed; existing NU1903 and test nullable warnings only)
TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj --no-build -v minimal (368 passed)
## Summary
Replaces the ChicoryTV Dashboard prototype/stub data with real REST API sources.
Head SHA: `6a9f1e41a4dbeaaf5c620140aad91d3fc23cdcfe`
## Widget to endpoint mapping
- Sidebar version: `GET /api/version` (`appVersion`)
- Sidebar health dot: `GET /api/health` summary status
- Channels tile: `GET /api/channels` count
- Active playouts tile: `GET /api/playouts` `totalCount`
- On air tile/cards: `GET /api/channels/state` filtered by `onAir`, joined to `GET /api/channels` for channel name/number; `nowPlaying.title`, `startUtc`, and `finishUtc` drive title/progress when present
- Libraries tile: `GET /api/media-sources`, summed `libraries.length`
- System health panel: `GET /api/health` rows from `title`, `status`, and `detail`
## Health fetch policy
`GET /api/health` is demand-loaded only: once on app mount for the shell/dashboard health state, then only from the manual `Refresh health` action. No interval polling was added because the endpoint reruns the full health-check set per request.
## Removed prototype-only content
- Removed fabricated Recent activity feed.
- Removed fabricated Release notes body.
## Verification
- `cd web && npm ci`
- `cd web && npm run lint`
- `cd web && npm run typecheck`
- `cd web && npm test -- --run src/App.test.tsx` (19 passed)
- `cd web && npm run build`
- `TZ=UTC dotnet build ErsatzTV.sln` (passed; existing NU1903 and test nullable warnings only)
- `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj --no-build -v minimal` (368 passed)
- `TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj --no-build -v minimal` (493 passed, 1 skipped)
- PR CI for `6a9f1e41a4dbeaaf5c620140aad91d3fc23cdcfe`: success for `.NET build/test` and EF migration integrity; image push skipped on PR
Live backend + Vite proxy sanity check was not run in this session; verification above covers typed web build/tests and backend regression tests.
Closes #109
Fable review — verdict: FIX-FIRST (fixes being applied in-session per user instruction, not bounced to Codex)
SUBSTANTIAL (1): health status contract mismatch. The backend emits exactly pass|fail|warn|info (Health/Mapper.cs GetStatus), but App.tsx matches error|failed|unhealthy and warning|degraded — fail/warn never match, so every real failing/warning check renders green and the sidebar dot reads Healthy forever. The tests masked it with fictional Healthy/Warning fixtures. Fix: match the four real values, give info a neutral (uncounted) presentation, rewrite fixtures with real strings + add a fail fixture.
NITS (4): duplicate /api/version fetch on mount (dead version field in DashboardData); Refresh-health button not disabled while in flight (double-click → 2 concurrent runs of the expensive endpoint); useDashboardHealthQuery missing the active unmount-guard idiom the other hooks use; ~13 lines of dead .ctv-activity-*/.ctv-release-* CSS.
Verified good: all six endpoint usages match the generated schemas exactly (incl. nullable nowPlaying narrowing, totalCount paging semantics, libraries[] nesting); health polling discipline clean (mount + manual refresh only, no intervals, fetch-count test); progress math guards non-finite dates, finish<=start, clamping; type safety solid (all types from components['schemas'], no any); scope clean (4 web-only files, v1.d.ts untouched); design-system tokens/components used throughout; on-air join is exactly what #109 asked for.
Fixes will be pushed to this branch and CI re-run before merge.
## Fable review — verdict: FIX-FIRST (fixes being applied in-session per user instruction, not bounced to Codex)
**SUBSTANTIAL (1):** health status contract mismatch. The backend emits exactly `pass|fail|warn|info` (Health/Mapper.cs GetStatus), but App.tsx matches `error|failed|unhealthy` and `warning|degraded` — `fail`/`warn` never match, so every real failing/warning check renders green and the sidebar dot reads Healthy forever. The tests masked it with fictional `Healthy`/`Warning` fixtures. Fix: match the four real values, give `info` a neutral (uncounted) presentation, rewrite fixtures with real strings + add a `fail` fixture.
**NITS (4):** duplicate /api/version fetch on mount (dead `version` field in DashboardData); Refresh-health button not disabled while in flight (double-click → 2 concurrent runs of the expensive endpoint); useDashboardHealthQuery missing the `active` unmount-guard idiom the other hooks use; ~13 lines of dead `.ctv-activity-*`/`.ctv-release-*` CSS.
**Verified good:** all six endpoint usages match the generated schemas exactly (incl. nullable `nowPlaying` narrowing, `totalCount` paging semantics, `libraries[]` nesting); health polling discipline clean (mount + manual refresh only, no intervals, fetch-count test); progress math guards non-finite dates, `finish<=start`, clamping; type safety solid (all types from `components['schemas']`, no `any`); scope clean (4 web-only files, v1.d.ts untouched); design-system tokens/components used throughout; on-air join is exactly what #109 asked for.
Fixes will be pushed to this branch and CI re-run before merge.
- Match the backend's exact health status contract ('pass'|'fail'|'warn'|'info')
instead of fictional strings; 'info' now renders as a neutral/idle presentation
and is excluded from failing/warning counts in summarizeHealth.
- Drop the redundant /api/version fetch from getDashboardData/DashboardData;
SidebarVersion's useDashboardVersionQuery remains the single source.
- Disable "Refresh health" (via Button's loading prop) while a health request
is in flight to prevent concurrent double-click requests.
- Add the active-flag unmount guard to useDashboardHealthQuery for consistency
with useDashboardQuery/useChannelsQuery.
- Remove dead .ctv-activity-*/.ctv-release-* CSS left over from the removed
activity feed/release notes UI.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
timothy
merged commit 4ffd777b49 into main2026-07-04 21:20:38 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Replaces the ChicoryTV Dashboard prototype/stub data with real REST API sources.
Head SHA:
6a9f1e41a4dbeaaf5c620140aad91d3fc23cdcfeWidget to endpoint mapping
GET /api/version(appVersion)GET /api/healthsummary statusGET /api/channelscountGET /api/playoutstotalCountGET /api/channels/statefiltered byonAir, joined toGET /api/channelsfor channel name/number;nowPlaying.title,startUtc, andfinishUtcdrive title/progress when presentGET /api/media-sources, summedlibraries.lengthGET /api/healthrows fromtitle,status, anddetailHealth fetch policy
GET /api/healthis demand-loaded only: once on app mount for the shell/dashboard health state, then only from the manualRefresh healthaction. No interval polling was added because the endpoint reruns the full health-check set per request.Removed prototype-only content
Verification
cd web && npm cicd web && npm run lintcd web && npm run typecheckcd web && npm test -- --run src/App.test.tsx(19 passed)cd web && npm run buildTZ=UTC dotnet build ErsatzTV.sln(passed; existing NU1903 and test nullable warnings only)TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj --no-build -v minimal(368 passed)TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj --no-build -v minimal(493 passed, 1 skipped)6a9f1e41a4dbeaaf5c620140aad91d3fc23cdcfe: success for.NET build/testand EF migration integrity; image push skipped on PRLive backend + Vite proxy sanity check was not run in this session; verification above covers typed web build/tests and backend regression tests.
Closes #109
Fable review — verdict: FIX-FIRST (fixes being applied in-session per user instruction, not bounced to Codex)
SUBSTANTIAL (1): health status contract mismatch. The backend emits exactly
pass|fail|warn|info(Health/Mapper.cs GetStatus), but App.tsx matcheserror|failed|unhealthyandwarning|degraded—fail/warnnever match, so every real failing/warning check renders green and the sidebar dot reads Healthy forever. The tests masked it with fictionalHealthy/Warningfixtures. Fix: match the four real values, giveinfoa neutral (uncounted) presentation, rewrite fixtures with real strings + add afailfixture.NITS (4): duplicate /api/version fetch on mount (dead
versionfield in DashboardData); Refresh-health button not disabled while in flight (double-click → 2 concurrent runs of the expensive endpoint); useDashboardHealthQuery missing theactiveunmount-guard idiom the other hooks use; ~13 lines of dead.ctv-activity-*/.ctv-release-*CSS.Verified good: all six endpoint usages match the generated schemas exactly (incl. nullable
nowPlayingnarrowing,totalCountpaging semantics,libraries[]nesting); health polling discipline clean (mount + manual refresh only, no intervals, fetch-count test); progress math guards non-finite dates,finish<=start, clamping; type safety solid (all types fromcomponents['schemas'], noany); scope clean (4 web-only files, v1.d.ts untouched); design-system tokens/components used throughout; on-air join is exactly what #109 asked for.Fixes will be pushed to this branch and CI re-run before merge.
- Match the backend's exact health status contract ('pass'|'fail'|'warn'|'info') instead of fictional strings; 'info' now renders as a neutral/idle presentation and is excluded from failing/warning counts in summarizeHealth. - Drop the redundant /api/version fetch from getDashboardData/DashboardData; SidebarVersion's useDashboardVersionQuery remains the single source. - Disable "Refresh health" (via Button's loading prop) while a health request is in flight to prevent concurrent double-click requests. - Add the active-flag unmount guard to useDashboardHealthQuery for consistency with useDashboardQuery/useChannelsQuery. - Remove dead .ctv-activity-*/.ctv-release-* CSS left over from the removed activity feed/release notes UI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>