refactor(web): extract ChicoryTV shell and routing #361

Merged
timothy merged 7 commits from feat/247-shell-routing into main 2026-07-16 13:42:20 +02:00
Owner

Closes #247
Refs #243 #238 #230

Summary

  • reduce App.tsx to the composition root that owns active route, navigation/popstate, the dirty guard path, and Libraries' approved subpath
  • extract one stable module-level route table, sidebar groups, shell chrome, and exhaustive screen dispatch
  • replace the global ctv:primary-action event with a minimal one-action React context whose opaque owner cleanup cannot clear a newer registration
  • colocate Builder, Settings, and component behavior tests while retaining App-level shell/routing regressions
  • document the final screen/shell/action ownership model

Preservation checks

  • Playouts and Media retain their self-owned pathname/popstate behavior
  • Libraries retains App-approved subpath ownership after dirty-guard approval
  • allowSubPaths route identity, sibling subpath changes, query-only navigation, unknown routes, and #230 popstate re-push remain covered
  • no API, route, styling, dependency, or intentional behavior change

Verification

  • npm test — 90 files / 775 tests
  • npm run lint
  • npm run typecheck
  • npm run build
  • npm run check:api
  • TZ=UTC dotnet restore ErsatzTV.sln -v minimal
  • TZ=UTC dotnet build ErsatzTV.sln --no-restore -v minimal
  • TZ=UTC dotnet test ErsatzTV.sln --no-build -v minimal
  • live hosted-SPA E2E — setup/login, extracted shell + Connect menu, Schedule primary action, sibling Playout subpaths, query-only stability, TopBar search, and unknown route; no browser errors
Closes #247 Refs #243 #238 #230 ## Summary - reduce `App.tsx` to the composition root that owns active route, navigation/popstate, the dirty guard path, and Libraries' approved subpath - extract one stable module-level route table, sidebar groups, shell chrome, and exhaustive screen dispatch - replace the global `ctv:primary-action` event with a minimal one-action React context whose opaque owner cleanup cannot clear a newer registration - colocate Builder, Settings, and component behavior tests while retaining App-level shell/routing regressions - document the final screen/shell/action ownership model ## Preservation checks - Playouts and Media retain their self-owned pathname/popstate behavior - Libraries retains App-approved subpath ownership after dirty-guard approval - allowSubPaths route identity, sibling subpath changes, query-only navigation, unknown routes, and #230 popstate re-push remain covered - no API, route, styling, dependency, or intentional behavior change ## Verification - `npm test` — 90 files / 775 tests - `npm run lint` - `npm run typecheck` - `npm run build` - `npm run check:api` - `TZ=UTC dotnet restore ErsatzTV.sln -v minimal` - `TZ=UTC dotnet build ErsatzTV.sln --no-restore -v minimal` - `TZ=UTC dotnet test ErsatzTV.sln --no-build -v minimal` - live hosted-SPA E2E — setup/login, extracted shell + Connect menu, Schedule primary action, sibling Playout subpaths, query-only stability, TopBar search, and unknown route; no browser errors
timothy added 6 commits 2026-07-16 13:21:42 +02:00
Refs #247

Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs #247

Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs #247

Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs #247

Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs #247

Co-Authored-By: OpenAI Codex <codex@openai.com>
test(web): colocate screen behavior coverage (#247)
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 20s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 20s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 26s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 26s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m50s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 5m54s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
bd84593cd1
Co-Authored-By: OpenAI Codex <codex@openai.com>
timothy added 1 commit 2026-07-16 13:31:29 +02:00
test(web): restore App composition smokes
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 12s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 12s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 13s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 14s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m26s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 10m23s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
947c8aacd8
Refs #247

Co-Authored-By: OpenAI Codex <codex@openai.com>
Author
Owner

Review-verdict: MERGEABLE @ 947c8aacd8

Cold-context adversarial re-review confirms the prior coverage finding is closed:

  • /app/new-channel now proves App dispatches the mounted Builder and hits /api/v1/channel-templates
  • /app/settings/scanner now proves allowSubPaths dispatches the Scanner pane and owned endpoint
  • component primitives again import through the public barrel
  • focused re-review tests: 35/35; git diff --check clean

No production behavior defect or remaining review finding was identified.

Review-verdict: MERGEABLE @ 947c8aacd899ff1ee3c99d283860dd7a287644c4 Cold-context adversarial re-review confirms the prior coverage finding is closed: - `/app/new-channel` now proves App dispatches the mounted Builder and hits `/api/v1/channel-templates` - `/app/settings/scanner` now proves allowSubPaths dispatches the Scanner pane and owned endpoint - component primitives again import through the public barrel - focused re-review tests: 35/35; `git diff --check` clean No production behavior defect or remaining review finding was identified.
timothy merged commit 82467f188b into main 2026-07-16 13:42:20 +02:00
timothy deleted branch feat/247-shell-routing 2026-07-16 13:42:20 +02:00
Sign in to join this conversation.