Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39455a96ed | ||
|
|
2362850559 | ||
|
|
7e5a6b75ce | ||
|
|
fbb659b19f | ||
|
|
7319e31fa1 | ||
|
|
d3f71faf66 | ||
|
|
1cf4a7a90c | ||
|
|
21ede49253 | ||
|
|
d04769ccdb | ||
|
|
439272b405 | ||
|
|
b564545ff7 |
@@ -274,8 +274,8 @@ jobs:
|
||||
done
|
||||
echo " FAIL $path (no 2xx containing '$needle' within timeout)"; return 1
|
||||
}
|
||||
if check "/iptv/channels.m3u" "#EXTM3U" && check "/iptv/xmltv.xml" "<tv"; then
|
||||
echo "Smoke + IPTV E2E passed: channels.m3u + xmltv.xml serve a valid playlist + guide"
|
||||
if check "/iptv/channels.m3u" "#EXTM3U" && check "/iptv/xmltv.xml" "<tv" && check "/app/" "ChicoryTV"; then
|
||||
echo "Smoke + IPTV E2E passed: channels.m3u + xmltv.xml serve a valid playlist + guide; /app/ serves the ChicoryTV SPA"
|
||||
else
|
||||
echo "===== container logs (tail) ====="; docker logs "$NAME" 2>&1 | tail -n 40 || true
|
||||
exit 1
|
||||
|
||||
@@ -4,7 +4,8 @@ Custom IPTV channel server for Jellyfin. Forked from [ErsatzTV/ErsatzTV](https:/
|
||||
|
||||
## Architecture
|
||||
|
||||
- **Language**: C# / .NET 10, Blazor Server UI (MudBlazor)
|
||||
- **Language**: C# / .NET 10
|
||||
- **UI**: ChicoryTV React SPA (`web/`, Vite, served at `/app`) over the REST API — the default UI; root `/` and migrated legacy routes 302 there (`ErsatzTV/LegacyUiRedirects.cs`). The legacy Blazor Server UI (MudBlazor) still serves un-migrated admin screens (collections, media browse, trakt, filler, watermarks, ffmpeg profiles, blocks/decos/templates, playout editors, logs, troubleshooting; Blazor home = `/system/health`); its removal is #91 phase (b), gated on parity issues #140–#147
|
||||
- **Pattern**: CQRS via MediatR — queries/commands in `ErsatzTV.Application/`
|
||||
- **Database**: EF Core (SQLite default, MySQL optional) — context in `ErsatzTV.Infrastructure/Data/TvContext.cs`
|
||||
- **Media**: FFmpeg via CliWrap, SkiaSharp for logo generation
|
||||
@@ -14,7 +15,8 @@ Custom IPTV channel server for Jellyfin. Forked from [ErsatzTV/ErsatzTV](https:/
|
||||
|
||||
| Project | Role |
|
||||
|---------|------|
|
||||
| `ErsatzTV/` | ASP.NET Core host, Blazor pages, API controllers, DI setup |
|
||||
| `ErsatzTV/` | ASP.NET Core host, API controllers, SPA static hosting, legacy Blazor pages, DI setup |
|
||||
| `web/` | ChicoryTV React SPA (Vite + TypeScript; builds into `ErsatzTV/wwwroot/app`) |
|
||||
| `ErsatzTV.Application/` | MediatR handlers (business logic) |
|
||||
| `ErsatzTV.Core/` | Domain entities, interfaces, no infrastructure deps |
|
||||
| `ErsatzTV.Infrastructure/` | EF Core repos, data access |
|
||||
@@ -36,7 +38,7 @@ Custom IPTV channel server for Jellyfin. Forked from [ErsatzTV/ErsatzTV](https:/
|
||||
- **Docker host**: jazz (192.168.1.99), container `ersatztv`, port 8409
|
||||
- **Config volume**: `~/downloadswarm/ersatztv/` on jazz → `/config` in container
|
||||
- **SQLite DB**: `/config/ersatztv.sqlite3` (WAL mode, root-owned)
|
||||
- **Images** (our fork, built by `.gitea/workflows/docker-build.yml` → `192.168.1.95:3000/timothy/ersatztv`): push to `main` → `:latest` + `:<sha>` (test image); push `v*` tag → `:prod` + `:<version>` + `:<sha>`. Cutover done (2026-06-27, server-management#481/#482): prod container runs fork `:prod` (currently v26.3.1), test container tracks `:latest`; prod advances only when a new `v*` tag is pushed (next: `v26.4.0`, first app-change release). Pipeline details: `docs/ci-cd.md`.
|
||||
- **Images** (our fork, built by `.gitea/workflows/docker-build.yml` → `192.168.1.95:3000/timothy/ersatztv`): push to `main` → `:latest` + `:<sha>` (test image); push `v*` tag → `:prod` + `:<version>` + `:<sha>`. Prod deploys via **Komodo GitOps**: the `media-servers` compose in `timothy/server-management` (`docker/bumblebee/stacks/media-servers/compose.yaml`) pins the version tag (currently `26.5.0`, deployed 2026-07-07); releasing = tag here, wait for the image build, bump that pin and push (the Komodo pre-deploy hook backs up before recreating). Test container tracks `:latest`. Pipeline details: `docs/ci-cd.md`.
|
||||
|
||||
## Development
|
||||
|
||||
@@ -56,7 +58,7 @@ docker build -f docker/Dockerfile -t ersatztv:dev .
|
||||
- **Read [`docs/contributing.md`](docs/contributing.md)** before non-trivial changes — it documents the established patterns (layering, CQRS handlers, LanguageExt, Blazor/MudBlazor, EF Core + dual-provider migrations, the FFmpeg pipeline, analyzers, testing) and the **deviation policy**: match the established style; diverge only with a concrete, stated reason.
|
||||
- Follow existing MediatR CQRS pattern for new features
|
||||
- Domain logic in `ErsatzTV.Core`, infrastructure in `ErsatzTV.Infrastructure`
|
||||
- Keep Blazor pages thin — delegate to MediatR handlers
|
||||
- Keep UI thin: the SPA talks to `/api/*` only; legacy Blazor pages delegate to MediatR handlers. New screens go in the SPA (`web/`), never in Blazor
|
||||
- Test with **NUnit** + Shouldly + NSubstitute (the existing `*.Tests` projects); xUnit is **not** used here
|
||||
- **Dependencies use Central Package Management**: versions live in the repo-root `Directory.Packages.props`; csproj reference packages by name only. Add/upgrade by editing the central `<PackageVersion>` — never put `Version=` back on a `<PackageReference>` (trips `NU1008`). See `docs/ci-cd.md` → Dependency management.
|
||||
- **DB migrations target BOTH providers**: a `TvContext` model change needs a migration in `ErsatzTV.Infrastructure.Sqlite` **and** `ErsatzTV.Infrastructure.MySql` — run `scripts/add-migration.sh <Name>` (does both). CI's `migrations` job enforces model-drift + apply-to-fresh-DB per provider. See `docs/ci-cd.md` → Migration integrity.
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="AsyncFixer" Version="2.1.0" />
|
||||
<PackageVersion Include="Blazored.FluentValidation" Version="2.2.0" />
|
||||
<PackageVersion Include="BlazorSortable" Version="5.2.1" />
|
||||
<PackageVersion Include="BlazorSortable" Version="6.0.2" />
|
||||
<PackageVersion Include="Blurhash.SkiaSharp" Version="2.0.0" />
|
||||
<PackageVersion Include="Chronic.Core" Version="0.4.0" />
|
||||
<PackageVersion Include="CliWrap" Version="3.10.0" />
|
||||
<PackageVersion Include="CliWrap" Version="3.10.2" />
|
||||
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
|
||||
<PackageVersion Include="Dapper" Version="2.1.66" />
|
||||
<PackageVersion Include="Dapper" Version="2.1.79" />
|
||||
<PackageVersion Include="Destructurama.Attributed" Version="5.2.0" />
|
||||
<PackageVersion Include="EFCore.BulkExtensions" Version="[9.0.2,10)" />
|
||||
<PackageVersion Include="EFCore.BulkExtensions.MySql" Version="[9.0.2,10)" />
|
||||
<PackageVersion Include="EFCore.BulkExtensions.Sqlite" Version="[9.0.2,10)" />
|
||||
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="9.3.0" />
|
||||
<PackageVersion Include="EntityFrameworkProfiler.Appender" Version="6.0.6049" />
|
||||
<PackageVersion Include="EntityFrameworkProfiler.Appender" Version="6.0.6053" />
|
||||
<PackageVersion Include="FluentValidation" Version="12.1.1" />
|
||||
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.1" />
|
||||
<PackageVersion Include="Flurl" Version="4.0.0" />
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using NUnit.Framework;
|
||||
using Shouldly;
|
||||
|
||||
namespace ErsatzTV.Tests;
|
||||
|
||||
[TestFixture]
|
||||
public class LegacyUiRedirectsTests
|
||||
{
|
||||
private static readonly string StartupSource = File.ReadAllText(FindStartupPath());
|
||||
|
||||
[Test]
|
||||
public void Every_Mapping_Should_Resolve()
|
||||
{
|
||||
foreach ((string from, string to) in LegacyUiRedirects.Map)
|
||||
{
|
||||
LegacyUiRedirects.TryGetRedirect(new PathString(from), out string target).ShouldBeTrue();
|
||||
target.ShouldBe(to);
|
||||
}
|
||||
}
|
||||
|
||||
[TestCase("/", "/app")]
|
||||
[TestCase("/channels", "/app/channels")]
|
||||
[TestCase("/channels/add", "/app/new-channel")]
|
||||
[TestCase("/schedules", "/app/schedules")]
|
||||
[TestCase("/playouts", "/app/playouts")]
|
||||
[TestCase("/media/libraries", "/app/libraries")]
|
||||
[TestCase("/settings/ffmpeg", "/app/settings/streaming")]
|
||||
[TestCase("/settings/hdhr", "/app/settings/system")]
|
||||
[TestCase("/settings/logging", "/app/settings/logging")]
|
||||
[TestCase("/settings/playout", "/app/settings/playout")]
|
||||
[TestCase("/settings/scanner", "/app/settings/scanner")]
|
||||
[TestCase("/settings/ui", "/app/settings/general")]
|
||||
[TestCase("/settings/xmltv", "/app/settings/xmltv")]
|
||||
public void Known_Route_Should_Redirect(string path, string expected)
|
||||
{
|
||||
LegacyUiRedirects.TryGetRedirect(new PathString(path), out string target).ShouldBeTrue();
|
||||
target.ShouldBe(expected);
|
||||
}
|
||||
|
||||
[TestCase("/channels/", "/app/channels")]
|
||||
[TestCase("/schedules/", "/app/schedules")]
|
||||
[TestCase("/settings/ffmpeg/", "/app/settings/streaming")]
|
||||
public void Trailing_Slash_Should_Match(string path, string expected)
|
||||
{
|
||||
LegacyUiRedirects.TryGetRedirect(new PathString(path), out string target).ShouldBeTrue();
|
||||
target.ShouldBe(expected);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Lookup_Should_Be_Case_Insensitive()
|
||||
{
|
||||
LegacyUiRedirects.TryGetRedirect(new PathString("/Channels"), out string target).ShouldBeTrue();
|
||||
target.ShouldBe("/app/channels");
|
||||
}
|
||||
|
||||
[TestCase("/channels/5")] // channel edit (Blazor-only)
|
||||
[TestCase("/channels/numbers")] // Blazor-only
|
||||
[TestCase("/system/health")] // Blazor home escape hatch
|
||||
[TestCase("/media/collections")] // Blazor-only media page
|
||||
[TestCase("/ffmpeg")] // Blazor-only
|
||||
[TestCase("/watermarks")] // Blazor-only
|
||||
[TestCase("/app")] // already the SPA
|
||||
[TestCase("/app/channels")] // already the SPA
|
||||
[TestCase("/iptv/channels.m3u")] // IPTV surface
|
||||
[TestCase("/api/health")] // API surface
|
||||
[TestCase("")] // empty
|
||||
[TestCase("//")] // all-slash path must not collapse to root "/"
|
||||
[TestCase("/channels//")] // double trailing slash is not normalized to a match
|
||||
public void Non_Migrated_Route_Should_Not_Redirect(string path)
|
||||
{
|
||||
LegacyUiRedirects.TryGetRedirect(new PathString(path), out string target).ShouldBeFalse();
|
||||
target.ShouldBe(string.Empty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Startup_Should_Redirect_Legacy_Routes_In_Blazor_Branch_Before_Routing()
|
||||
{
|
||||
// The redirect middleware must be wired inside the blazor branch and run
|
||||
// before UseRouting so migrated routes never reach the Blazor fallback.
|
||||
int redirectIndex = StartupSource.IndexOf("LegacyUiRedirects.TryGetRedirect", StringComparison.Ordinal);
|
||||
redirectIndex.ShouldBeGreaterThan(-1);
|
||||
|
||||
// The Blazor branch's UseRouting call that follows the redirect middleware.
|
||||
int routingIndex = StartupSource.IndexOf("blazor.UseRouting()", StringComparison.Ordinal);
|
||||
routingIndex.ShouldBeGreaterThan(-1);
|
||||
|
||||
redirectIndex.ShouldBeLessThan(routingIndex);
|
||||
|
||||
// 302 (temporary), not a permanent redirect.
|
||||
StartupSource.ShouldContain("context.Request.PathBase + target");
|
||||
StartupSource.ShouldNotContain("RedirectPermanent(target");
|
||||
}
|
||||
|
||||
private static string FindStartupPath()
|
||||
{
|
||||
DirectoryInfo? directory = new(TestContext.CurrentContext.TestDirectory);
|
||||
|
||||
while (directory is not null)
|
||||
{
|
||||
string candidate = Path.Combine(directory.FullName, "ErsatzTV", "Startup.cs");
|
||||
if (File.Exists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
|
||||
directory = directory.Parent;
|
||||
}
|
||||
|
||||
throw new FileNotFoundException("Could not find ErsatzTV/Startup.cs");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace ErsatzTV;
|
||||
|
||||
// Phase (a) of the Blazor -> ChicoryTV SPA cutover (ersatztv#91).
|
||||
//
|
||||
// The React SPA (served under /app) is now the default UI: the legacy Blazor
|
||||
// routes below 302-redirect to their SPA equivalents. Only routes that already
|
||||
// have SPA parity are listed here. Blazor pages WITHOUT a SPA equivalent are
|
||||
// deliberately left reachable (no redirect) so their functionality stays
|
||||
// available while the SPA catches up:
|
||||
// /system/health (Blazor home escape hatch; Index.razor also lives here),
|
||||
// /channels/{id} edit, /channels/numbers, /media/* (collections etc.),
|
||||
// /ffmpeg, /watermarks, /blocks, /decos, /templates, /deco-templates,
|
||||
// schedule/playout detail editors, /system/logs, /system/troubleshooting.
|
||||
//
|
||||
// Phase (b) removes the redirected Blazor pages entirely, but that is GATED on
|
||||
// full SPA parity for every route in this map. Until then this map is the
|
||||
// single source of truth for "what has migrated" and is expected to grow.
|
||||
public static class LegacyUiRedirects
|
||||
{
|
||||
// Blazor route -> SPA route. EXACT paths only (no prefix matching); a single
|
||||
// trailing slash on the request is normalized away before lookup.
|
||||
public static readonly IReadOnlyDictionary<string, string> Map =
|
||||
new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["/"] = "/app",
|
||||
["/channels"] = "/app/channels",
|
||||
["/channels/add"] = "/app/new-channel",
|
||||
["/schedules"] = "/app/schedules",
|
||||
["/playouts"] = "/app/playouts",
|
||||
["/media/libraries"] = "/app/libraries",
|
||||
["/settings/ffmpeg"] = "/app/settings/streaming",
|
||||
["/settings/hdhr"] = "/app/settings/system",
|
||||
["/settings/logging"] = "/app/settings/logging",
|
||||
["/settings/playout"] = "/app/settings/playout",
|
||||
["/settings/scanner"] = "/app/settings/scanner",
|
||||
["/settings/ui"] = "/app/settings/general",
|
||||
["/settings/xmltv"] = "/app/settings/xmltv"
|
||||
};
|
||||
|
||||
public static bool TryGetRedirect(PathString path, out string target)
|
||||
{
|
||||
target = string.Empty;
|
||||
|
||||
string value = path.Value;
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Normalize a single trailing slash so "/channels/" matches "/channels"
|
||||
// (but keep root "/" intact). Guard against a path of all slashes (e.g.
|
||||
// "//") collapsing down to "/" and falsely matching the root entry.
|
||||
if (value.Length > 1 && value.EndsWith('/'))
|
||||
{
|
||||
string trimmed = value[..^1];
|
||||
if (trimmed == "/")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
value = trimmed;
|
||||
}
|
||||
|
||||
if (Map.TryGetValue(value, out string mapped))
|
||||
{
|
||||
target = mapped;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -141,6 +141,9 @@
|
||||
<data name="ButtonSettingsXmltv" xml:space="preserve">
|
||||
<value>XMLTV</value>
|
||||
</data>
|
||||
<data name="ButtonOpensInChicoryTv" xml:space="preserve">
|
||||
<value>Opens in ChicoryTV</value>
|
||||
</data>
|
||||
<data name="ButtonSupport" xml:space="preserve">
|
||||
<value>Support</value>
|
||||
</data>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
{
|
||||
<MudDrawer @bind-Open="@_drawerIsOpen" Elevation="2" ClipMode="DrawerClipMode.Always">
|
||||
<MudNavMenu>
|
||||
<MudNavLink Href="channels">@StringLocalizer["ButtonChannels"]</MudNavLink>
|
||||
<MudNavLink Href="channels">@StringLocalizer["ButtonChannels"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="ffmpeg">@StringLocalizer["ButtonFFmpegProfiles"]</MudNavLink>
|
||||
<MudNavLink Href="watermarks">@StringLocalizer["ButtonWatermarks"]</MudNavLink>
|
||||
<MudNavGroup Title="@StringLocalizer["ButtonMediaSources"]">
|
||||
@@ -127,7 +127,7 @@
|
||||
<MudNavLink Href="media/sources/plex">@StringLocalizer["ButtonMediaSourcesPlex"]</MudNavLink>
|
||||
</MudNavGroup>
|
||||
<MudNavGroup Title="@StringLocalizer["ButtonMedia"]">
|
||||
<MudNavLink Href="media/libraries">@StringLocalizer["ButtonMediaLibraries"]</MudNavLink>
|
||||
<MudNavLink Href="media/libraries">@StringLocalizer["ButtonMediaLibraries"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="media/trash">@StringLocalizer["ButtonMediaTrash"]</MudNavLink>
|
||||
<MudNavLink Href="media/tv/shows">@StringLocalizer["ButtonMediaTvShows"]</MudNavLink>
|
||||
<MudNavLink Href="media/movies">@StringLocalizer["ButtonMediaMovies"]</MudNavLink>
|
||||
@@ -161,7 +161,7 @@
|
||||
}
|
||||
</TitleContent>
|
||||
<ChildContent>
|
||||
<MudNavLink Href="schedules">@StringLocalizer["ButtonSchedulingSchedules"]</MudNavLink>
|
||||
<MudNavLink Href="schedules">@StringLocalizer["ButtonSchedulingSchedules"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="blocks">@StringLocalizer["ButtonSchedulingBlocks"]</MudNavLink>
|
||||
<MudNavLink Href="templates">@StringLocalizer["ButtonSchedulingTemplates"]</MudNavLink>
|
||||
<MudNavLink Href="decos">@StringLocalizer["ButtonSchedulingDecos"]</MudNavLink>
|
||||
@@ -180,17 +180,18 @@
|
||||
{
|
||||
@StringLocalizer["ButtonSchedulingPlayouts"]
|
||||
}
|
||||
@ChicoryCue
|
||||
</MudNavLink>
|
||||
</ChildContent>
|
||||
</MudNavGroup>
|
||||
<MudNavGroup Title="@StringLocalizer["ButtonSettings"]">
|
||||
<MudNavLink Href="settings/ffmpeg">@StringLocalizer["ButtonSettingsFFmpeg"]</MudNavLink>
|
||||
<MudNavLink Href="settings/logging">@StringLocalizer["ButtonSettingsLogging"]</MudNavLink>
|
||||
<MudNavLink Href="settings/hdhr">@StringLocalizer["ButtonSettingsHdHomeRun"]</MudNavLink>
|
||||
<MudNavLink Href="settings/scanner">@StringLocalizer["ButtonSettingsScanner"]</MudNavLink>
|
||||
<MudNavLink Href="settings/playout">@StringLocalizer["ButtonSettingsPlayout"]</MudNavLink>
|
||||
<MudNavLink Href="settings/ui">@StringLocalizer["ButtonSettingsUi"]</MudNavLink>
|
||||
<MudNavLink Href="settings/xmltv">@StringLocalizer["ButtonSettingsXmltv"]</MudNavLink>
|
||||
<MudNavLink Href="settings/ffmpeg">@StringLocalizer["ButtonSettingsFFmpeg"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="settings/logging">@StringLocalizer["ButtonSettingsLogging"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="settings/hdhr">@StringLocalizer["ButtonSettingsHdHomeRun"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="settings/scanner">@StringLocalizer["ButtonSettingsScanner"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="settings/playout">@StringLocalizer["ButtonSettingsPlayout"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="settings/ui">@StringLocalizer["ButtonSettingsUi"]@ChicoryCue</MudNavLink>
|
||||
<MudNavLink Href="settings/xmltv">@StringLocalizer["ButtonSettingsXmltv"]@ChicoryCue</MudNavLink>
|
||||
</MudNavGroup>
|
||||
<MudNavGroup Expanded="true">
|
||||
<TitleContent>
|
||||
@@ -260,6 +261,15 @@
|
||||
</MudLayout>
|
||||
|
||||
@code {
|
||||
// Lightweight cue (ersatztv#147): marks nav entries that 302-redirect into the
|
||||
// ChicoryTV SPA (see LegacyUiRedirects.Map) so it's clear before clicking that the
|
||||
// entry leaves this Blazor UI. Non-redirecting entries in the same MudNavGroup are
|
||||
// left bare.
|
||||
private RenderFragment ChicoryCue =>
|
||||
@<MudTooltip Text="@StringLocalizer["ButtonOpensInChicoryTv"]">
|
||||
<MudIcon Icon="@Icons.Material.Filled.OpenInNew" Size="Size.Small" Class="ml-1" Style="opacity:.55;vertical-align:text-bottom"/>
|
||||
</MudTooltip>;
|
||||
|
||||
private static readonly string InfoVersion = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "unknown";
|
||||
private static readonly string BuildConfiguration = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyConfigurationAttribute>()?.Configuration?.ToLower() ?? "unset";
|
||||
|
||||
|
||||
@@ -726,6 +726,28 @@ public class Startup
|
||||
ctx => !IsIptvPath(ctx.Request.Path) && !IsSpaPath(ctx.Request.Path),
|
||||
blazor =>
|
||||
{
|
||||
// ersatztv#91 phase (a): make the ChicoryTV SPA the default UI by
|
||||
// redirecting migrated legacy Blazor routes to their /app equivalents.
|
||||
// 302 (not 301): this map grows as pages migrate, and permanent-redirect
|
||||
// browser caching would make rollback painful. UsePathBase (ETV_BASE_URL)
|
||||
// only rewrites the request side (Request.Path/PathBase); it never touches
|
||||
// redirect Location headers, so the PathBase prefix must be re-applied here.
|
||||
blazor.Use(async (context, next) =>
|
||||
{
|
||||
if (HttpMethods.IsGet(context.Request.Method) ||
|
||||
HttpMethods.IsHead(context.Request.Method))
|
||||
{
|
||||
if (LegacyUiRedirects.TryGetRedirect(context.Request.Path, out string target))
|
||||
{
|
||||
context.Response.Redirect(
|
||||
context.Request.PathBase + target + context.Request.QueryString);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await next(context);
|
||||
});
|
||||
|
||||
blazor.UseRouting();
|
||||
|
||||
if (OidcHelper.IsEnabled)
|
||||
|
||||
@@ -2,252 +2,113 @@
|
||||
|
||||
Paste the prompt below into a fresh session to work the next item. Each session ends by
|
||||
UPDATING THIS FILE in place (rewrite the state section and the queue for the next item) so it
|
||||
always holds the current handoff. History: created 2026-07-02 after the plan audit (#59 epic)
|
||||
filed backend gap issues #100–#111; a 7–9-way parallel workflow build once exhausted RAM, so
|
||||
builds are limited to 2–3 concurrent, never wide fan-outs. Backend gaps all landed by
|
||||
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 (PR #130), #64 (PR #133), #63
|
||||
(PR #134) — epic #62 COMPLETE; #89 Channel Builder (PR #136); **#93 Settings (PR #138) —
|
||||
first screen through the full design-first workflow; #92 design-sync round-trip verified and
|
||||
documented (`docs/design-sync.md`)**.
|
||||
always holds the current handoff. History: created 2026-07-02 after the plan audit (#59 epic);
|
||||
all backend gap issues (#100–#111) and all SPA screens (#84–#89, #93, #109), the rebrand (#90)
|
||||
and the cutover root-flip (#91 phase a, PR #148) are MERGED. v26.5.0 tagged + DEPLOYED to prod
|
||||
2026-07-07 (verified live: image :26.5.0, / 302→/app, ChicoryTV title, /api/version 26.5.0,
|
||||
M3U serving). Blazor removal (#91 phase b) is blocked on parity issues #140–#147.
|
||||
|
||||
**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
|
||||
SPARINGLY: delegate implementation to the best-fitting subagent models (haiku for mechanical
|
||||
churn, sonnet for standard components/tests, opus for judgment-heavy logic/orchestration
|
||||
code; fable only for the hardest design calls and the final review fork). Reviews stay
|
||||
multi-lens via subagents (fable correctness fork + cheaper contract/tests lens + a
|
||||
design-system lens for frontend work), plus a fork verification pass over any fix diff.
|
||||
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). Subagents killed by
|
||||
transient API errors CAN be resumed via SendMessage with their agentId — resume instead of
|
||||
relaunching (their edits are saved; learned #89). NEW (#93): LIVE-E2E the new screen against
|
||||
a real fresh local server BEFORE the review lenses — it caught two ship-blockers jsdom
|
||||
can't see (see Lessons: local-run recipe).
|
||||
|
||||
**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`
|
||||
(= v26.3.1, app-identical to upstream 26.3.0); `ersatztv-test` tracks `:latest` (main).
|
||||
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. (Flagged again at the
|
||||
#93 merge, 2026-07-07 — builder + settings + full API is a very plausible v26.4.0 slice;
|
||||
#90 rebrand would make it present as ChicoryTV.)
|
||||
|
||||
**Session state (2026-07-07, post-#93)**: main = 17f49304 (PR #138 merged): **Settings** is
|
||||
live at `/app/settings/<section>` — backend `GET/PUT /api/settings/{ffmpeg,playout,xmltv,
|
||||
scanner,logging,ui,hdhr}` + `/api/settings/resolutions` CRUD (`SettingsController`, DTOs in
|
||||
`ErsatzTV.Core/Api/Settings`), frontend `web/src/screens/SettingsScreen.tsx` +
|
||||
`web/src/api/settings.ts` (tiered loader: settings groups gate the screen, reference data
|
||||
via allSettled with per-resource failure notes). App.tsx `ScreenRoute` gained an opt-in
|
||||
`allowSubPaths` flag (settings only); the screen parses its own URL suffix. Design-first
|
||||
workflow proven end-to-end: prototype `design-system/templates/chicorytv-admin/Settings.jsx`
|
||||
+ handoff bundle `design-system/design_handoff_settings/` synced both directions with the
|
||||
DesignSync MCP (main session only) — workflow documented in `docs/design-sync.md`, #92
|
||||
CLOSED. Also this session: **PR #137** — Scriban.Signed 6.5.2→7.2.5 (GHSA-5wr9-m6jw-xx44
|
||||
sandbox escape; the fresh advisory made NuGetAudit fail EVERY CI restore, merged first to
|
||||
unblock); media-sources fresh-DB 500 fixed (Dapper→EF, see Lessons). Review: 3 lenses →
|
||||
11 findings (2 backend contract clusters + frontend silent-failure/partial-save cluster),
|
||||
fixed by 2 parallel subagents, fork-verified SHIP. Baselines: ErsatzTV.Tests **495**,
|
||||
Core.Tests **493** (+1 skip), **web tests 145** (was 112). All #93 worktrees removed;
|
||||
main checkout still sits on docs/59-ui-redesign-brief — do NOT touch it.
|
||||
**Session state (2026-07-07, post-housekeeping)**: main = 7e5a6b75 (+ this doc commit).
|
||||
Housekeeping session did:
|
||||
- Dep batch: PR #61 (BlazorSortable 6.0.2 + CliWrap 3.10.2 + Dapper 2.1.79, rebased) and
|
||||
PR #132 (EFProfiler.Appender 6.0.6053, rebased) MERGED; #21/#48/#49 closed as superseded by
|
||||
#61; #131 (Scriban 7.2.0) closed obsolete — main already has Scriban 7.2.5 (47c3c3b5).
|
||||
- MCP PR #76 (#58): rebased onto main (clean, purely additive ErsatzTV.Mcp project), 12 tests
|
||||
green locally, pushed (head d1c04030). Still OPEN — needs a content refresh against the full
|
||||
API surface before merge, plus review.
|
||||
- Filed #149: CI flake — migrations job MySQL service publishes fixed host port 3306:3306, so
|
||||
two concurrent runs collide ("port is already allocated"). Fix = drop the `ports:` mapping
|
||||
(job connects via `Server=mysql` service name); verify MySql drift/apply still passes.
|
||||
- Worktrees: removed issue-91-cutover; .worktrees/deps was this session's scratch (remove it).
|
||||
**.worktrees/parity-147 exists** (branch feat/147-classic-ui-link off 1cf4a7a9, web/ npm ci
|
||||
already done) — rebase onto current main and use it for #147.
|
||||
- PARITY NOT STARTED — recon done though; facts baked into the prompt below.
|
||||
|
||||
**Lessons for all remaining prompts** (accumulated):
|
||||
- NEW (#93) — Local live-E2E recipe: `npm run build` (outputs to gitignored
|
||||
`ErsatzTV/wwwroot/app/`), then `ln -sfn <worktree>/ErsatzTV/wwwroot/app
|
||||
ErsatzTV/bin/Debug/net10.0/wwwroot/app` (Program.cs sets ContentRoot to the ASSEMBLY dir,
|
||||
so the SPA static-file provider reads bin's wwwroot — publish/Docker copy it, `dotnet run`
|
||||
doesn't), then `ETV_CONFIG_FOLDER=<scratch> ASPNETCORE_URLS=http://127.0.0.1:8409 dotnet
|
||||
run --project ErsatzTV`. Fresh DB migrates in seconds; ffmpeg autodetected from PATH.
|
||||
update-openapi.sh FAILS while an instance runs (single-instance mutex) — kill it first.
|
||||
- NEW (#93) — Dapper + Microsoft.Data.Sqlite infers expression columns (COUNT(*)) as BLOB
|
||||
when the result set is EMPTY → incompatible deserializer → 500 on every fresh DB. Prefer
|
||||
EF LINQ GroupBy for aggregates in Api handlers; regression-test the empty-DB path.
|
||||
- NEW (#93) — Screen hooks must TIER their loads: the screen's own resources gate
|
||||
loading/error; reference data (pickers, sources, health, version) settles per-resource
|
||||
(allSettled) with inline "Couldn't load X" notes. Precedent: settings.ts. Also: render the
|
||||
error branch BEFORE the loading branch — a draft-null loading guard ahead of the error
|
||||
check made the error state unreachable (infinite spinner).
|
||||
- NEW (#93) — ApiResults maps ONLY NotFoundError→404; plain BaseError→422. Handlers that
|
||||
collapse "missing" and "invalid state" into one query filter can't 404 — split the lookup
|
||||
(precedent: DeleteCustomResolutionHandler). Request DTOs in Controllers/Api/Requests
|
||||
deliberately have NO `#nullable enable` (only RESPONSE DTOs get it). Startup's
|
||||
UseStringEnumSchemas registers non-Core enums (OutputFormatKind, LogEventLevel)
|
||||
INDIVIDUALLY — assembly-wide reflection over ErsatzTV.FFmpeg throws
|
||||
ReflectionTypeLoadException (optional NvEncSharp natives). Core↔Application enum twins
|
||||
bridge via exhaustive switch expressions, never int casts.
|
||||
- NEW (#93) — `npm run check:api` diff-guards v1.d.ts against the LAST COMMIT — it fails
|
||||
mid-branch after a backend OpenAPI change until the regenerated file is committed;
|
||||
regen-idempotence (running generate:api twice → no diff) is the real sync check.
|
||||
- NEW (#93) — OSV advisories can break ALL CI overnight: NuGetAudit + warnings-as-errors
|
||||
turns a fresh critical advisory into NU1904 restore failures on every branch. Fix = a
|
||||
one-line central bump PR straight off main, merged before feature PRs (PR #137,
|
||||
Scriban 6→7 validated by both suites + unchanged XMLTV goldens).
|
||||
- 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
|
||||
`IsSystem` Playlist (PlayAll=true per entry, entries in Index order) behind a single Flood
|
||||
item. PlaylistItem supports Movie/Show/Season/Artist/Collection/Smart/Multi but has NO
|
||||
RerunCollectionId and NO nested-playlist support (CollectionKey.ForPlaylistItem +
|
||||
MediaCollectionRepository.GetPlaylistItemMap are the two switches that define support).
|
||||
- Validation must see the SAME data the build path uses (#134): normalizing on a `with {}`
|
||||
copy inside the validator let raw request values reach persistence (FK violation → opaque
|
||||
422). Normalize the whole input once up front; both validation and build consume the
|
||||
normalized form.
|
||||
- Any handler that SYNTHESIZES names into unique-indexed columns needs de-collision (" 2",
|
||||
" 3"…, max-length-safe) — deleting a channel doesn't cascade its generated
|
||||
schedule/playlist, so recreate-after-delete is a routine path, not an edge case (#134).
|
||||
- `SelectOneAsync` re-applies `.OrderBy(keySelector)` INTERNALLY, which REPLACES any ordering
|
||||
the caller composed before it (#133) — never pre-`OrderBy` into SelectOneAsync; write the
|
||||
explicit `.Where(...).OrderBy(...).FirstOrDefaultAsync(...)` when ordering matters.
|
||||
- Normalize user input ONCE (#133): validate uniqueness/lengths against the SAME normalized
|
||||
(e.g. trimmed) value you persist, or a whitespace variant slips past validation and dies on
|
||||
the unique index as an unhandled 500.
|
||||
- Application command/query records + handlers live in `<Domain>/Commands/` and
|
||||
`<Domain>/Queries/` subfolders (contributing §2); namespace stays
|
||||
`ErsatzTV.Application.<Domain>` regardless of subfolder (#133).
|
||||
- Deferral wording must ENUMERATE what is deferred (#130): "aggregate collection metadata is
|
||||
deferred" quietly swallowed manual collections, which are a cheap direct join — the review
|
||||
had to split the deferral. Cheap-vs-expensive is per collection kind, not per feature.
|
||||
- Merged-source paging pattern (#130): Lucene supplies media ids+total, EF supplies
|
||||
collection-likes; page = media first, then a skip cascade through each collection type
|
||||
(`remainingSkip`/`take` threading). Stale Lucene entries can drift collection paging for a
|
||||
scan window — accepted, documented in-code. Any similar dual-source endpoint should copy
|
||||
the GetLibraryBrowseItemsHandler pattern AND its multi-type-overflow paging test.
|
||||
- User text into BOTH Lucene and SQL needs per-side treatment (#130): raw query text is the
|
||||
established Lucene idiom (parser falls back to escaped-literal on ParseException — malformed
|
||||
input degrades to empty/literal results, never throws), but the same text in EF LIKE needs
|
||||
`%`/`_`/escape-char escaping or semantics diverge between the two halves.
|
||||
- Direct `*Metadata` DbSet queries need a deterministic winner (#130): items can carry >1
|
||||
metadata row; either go through the navigation + HeadOrNone() idiom or
|
||||
GroupBy(itemId).OrderBy(Id).First().
|
||||
- NULL FIELDS ARE OMITTED ON THE WIRE (#129): Startup.cs sets Newtonsoft
|
||||
`NullValueHandling.Ignore` globally, so any null DTO property is ABSENT from the JSON →
|
||||
`undefined` in the browser, even though generated types say `| null`. Frontend guards must
|
||||
use truthiness (`!x`), NEVER `=== null`; fixtures for null cases must OMIT the key (test
|
||||
precedent: "renders the Guide screen when an on-air channel omits nowPlaying").
|
||||
- Cross-endpoint correlation needs shared ids (#129): /api/guide titles are show-only
|
||||
(ChannelGuideMetadata.GetTitle) while /api/channels/state nowPlaying uses GetDisplayTitle
|
||||
("Show - s01e01 - Ep") — string matching across endpoints can never work for episodes.
|
||||
Live match is now timestamps-only; the real fix is a shared programme/playout-item id on
|
||||
both endpoints (backlog).
|
||||
- Fixture fidelity (#109/#127/#128): fixtures must be what the actually-called endpoint
|
||||
returns UNDER THE QUERY THE CLIENT SENDS. `percent` is a 0–1 fraction despite its name.
|
||||
Enum-with-None fields are never truthiness-checked. Verify UNITS/scale of numeric wire
|
||||
fields against the producing code, not the field name.
|
||||
- Trigger≠started (#128): a 202/200 on a trigger endpoint means QUEUED; poll while
|
||||
pending∪active nonempty with a grace window; drain grace on persistent errors.
|
||||
- setState updaters must be PURE — no fetches (#127), no ref mutations (#128); StrictMode
|
||||
double-invokes updaters and the test renderer doesn't, so reviewers must catch it.
|
||||
- OpenAPI can UNDER-report the wire (#125/#126); check the serializer before widening types.
|
||||
- Every new multi-column grid → the @media (max-width: 980px) collapse block; var() fallback
|
||||
= the token's resolved value; verify the token EXISTS (--ctv-surface-1, --text-faint don't;
|
||||
#93: handoff said --status-warn-soft, the SPA token is --ctv-warn-soft — Toast precedent).
|
||||
- Prototype affordances: implemented or VISIBLY deferred — never silently dropped.
|
||||
- Actionable = visible (#84); disable all mutation triggers while mutating; ref-based
|
||||
double-submit guards; mutations never refetch the world (#125/#127).
|
||||
- Honest tests: no scenarios the backend can't produce (no exception middleware → failures
|
||||
are BARE 4xx/5xx unless the controller returns ProblemDetails); mount call-counts assert
|
||||
the DELTA across navigation; status-dot state never color-only (StatusDot has a label).
|
||||
- The image-build job runs ONLY on main pushes. DTO records in Core/Api need `#nullable
|
||||
enable`; Application has NO nullable context. NSubstitute+ConfigElementKey:
|
||||
`Arg.Any<ConfigElementKey>()` + `<T>`. `Option<T>.ToNullable()` → `MatchUnsafe`.
|
||||
update-openapi.sh needs a prior normal build. Child GETs 404 unknown parents via pre-check.
|
||||
Validation.Apply ERASES NotFoundError subtypes (#44 gotcha) — multi-check validation that
|
||||
must 404 stays early-return.
|
||||
- Backlog nits (unfiled): unclamped pageSize (browse is clamped; older endpoints aren't);
|
||||
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; 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; reduced-motion block lists a now-no-op .ctv-builder-libcard. From #93: enumeration
|
||||
endpoints missing for MPEG-TS scripts / audio language codes / UI cultures (settings fields
|
||||
are free-text meanwhile); media sources have no status/reachability signal in the API
|
||||
(Settings omits the StatusDot); full FFmpeg profile editor screen; edits made to an
|
||||
already-saved group DURING an in-flight save can be overwritten by the returned DTO
|
||||
(narrow race, noted by the verification fork). Filed: #126, #135.
|
||||
- The main checkout (/Users/timothy/ersatztv) sits on the STALE docs/59-ui-redesign-brief
|
||||
branch. NEVER recon/edit there — point subagents at a worktree pinned to origin/main, or
|
||||
they report placeholders that no longer exist (this bit a recon agent on 2026-07-07).
|
||||
- Gitea 1.24 has no rerun-run API; retrigger CI with an empty commit. Runs on the single
|
||||
runner queue mostly sequentially; concurrent migration jobs collide on port 3306 until #149
|
||||
lands.
|
||||
- DTO records in ErsatzTV.Core/Api MUST get file-scoped `#nullable enable` (else OpenAPI emits
|
||||
`["null","string"]` and SPA typegen degrades). ErsatzTV.Application has NO nullable context —
|
||||
`string?` there trips CS8632.
|
||||
- NSubstitute + ConfigElementKey: keys are fresh instances per access — stub with
|
||||
`Arg.Any<ConfigElementKey>()` disambiguated by the generic `<T>`.
|
||||
- `Option<T>.ToNullable()` doesn't exist; use `MatchUnsafe(v => (T?)v, () => null)`.
|
||||
- ./scripts/update-openapi.sh needs a prior normal `dotnet build ErsatzTV/ErsatzTV.csproj`.
|
||||
- Id-taking child-collection GETs 404 on unknown parent via pre-check + ApiResults + an
|
||||
OpenApiErrorResponseContractTests [TestCase] entry.
|
||||
- Backlog nits: pageSize unclamped on paged endpoints; artwork content-type trusted (#66);
|
||||
GET /api/guide runs the full 21-include eager-load per channel per request; `fillerKind`
|
||||
almost always `None` in JSON guide (merged into adjacent programmes).
|
||||
|
||||
---
|
||||
|
||||
# PROMPT — #90: ChicoryTV rebrand (assets + naming)
|
||||
# PROMPT — Parity kickoff: #147 escape hatch → #146 channel edit → #140 collections
|
||||
|
||||
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 (this issue is
|
||||
mostly mechanical — haiku/sonnet territory; fable only for the review fork). Read CLAUDE.md
|
||||
and the PROCESS + Lessons sections of this file first.
|
||||
You are Fable, the ORCHESTRATOR in the main Claude Code session (Claude Code only). Fable is
|
||||
EXPENSIVE: delegate (recon → Explore/haiku; mechanical → sonnet; judgment-heavy code → opus;
|
||||
fable forks for review). Read CLAUDE.md + the Lessons above first.
|
||||
|
||||
HARD CONSTRAINTS:
|
||||
- `git worktree add .worktrees/issue-90-rebrand -b feat/90-rebrand 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. Frontend-only expected — if backend
|
||||
strings turn out to be in scope, they're NOT (deeper product rebrand is epic #59).
|
||||
- NEVER set ETV_UPDATE_GOLDENS.
|
||||
- Review before PR: this is a small mechanical issue — a single fable correctness/design fork
|
||||
over the diff suffices (skip the 3-lens panel unless the diff grows); fixes via subagents.
|
||||
Merge needs an in-conversation consent question.
|
||||
- Work in worktrees off origin/main; NEVER touch /Users/timothy/ersatztv (stale branch).
|
||||
.worktrees/parity-147 exists (npm ci done) — rebase feat/147-classic-ui-link onto
|
||||
origin/main first. `cd web && npm ci` in any NEW worktree.
|
||||
- Max 2–3 concurrent builds; ONE dotnet build at a time. NEVER set ETV_UPDATE_GOLDENS.
|
||||
- Merge consent in-conversation per PR. CI reruns = empty commit (no rerun API).
|
||||
- Live-E2E new screens per the #93 recipe (curl `localhost`, NOT 127.0.0.1 — host guard;
|
||||
wait for "Done migrating search index").
|
||||
|
||||
## Task
|
||||
Issue #90: apply the ChicoryTV rebrand across the SPA surface. Naming (ErsatzTV → ChicoryTV
|
||||
in user-facing UI copy), favicon/app icon/wordmark from `design-system/assets/`
|
||||
(chicory-mark.svg, chicorytv-icon.svg, chicorytv-wordmark.svg), page title/meta.
|
||||
Acceptance: the SPA presents consistently as ChicoryTV. (Product-wide rebrand = epic #59.)
|
||||
## Recon facts (2026-07-07, verified against main)
|
||||
- Routing: web/src/App.tsx (~150–252). /app/collections renders PlaceholderScreen
|
||||
(App.tsx ~2776). Manual pushState routing, no router lib.
|
||||
- #147: web/src/screens/SettingsScreen.tsx, System pane About card (~852) is the natural home
|
||||
for a "Classic UI" link to /system/health; reuse the existing `LegacyCallout` component
|
||||
(ExternalLink icon + "Legacy UI" badge, used by the Media sources card ~840). Remove again
|
||||
in #91 phase (b).
|
||||
- #146: Channels screen edit pencil already navigates
|
||||
navigateToPath(`/app/new-channel?edit=${channel.id}`) (App.tsx ~1216) but
|
||||
web/src/builder/ChannelBuilder.tsx never reads query params → dead-end. Backend ready:
|
||||
GET /api/channels/{id} → full ChannelViewModel; PUT /api/channels/{id} takes
|
||||
UpdateChannelRequest (ChannelController.cs). Issue #146 also covers /channels/numbers bulk
|
||||
renumbering — bulkRenumberChannels already exists in web/src/api/channels.ts (check what UI
|
||||
exposes it). Decide: hydrate the builder for edit vs a dedicated edit view — the builder's
|
||||
lineup model (from-lineup composite create) does NOT map 1:1 onto editing an existing
|
||||
channel's 30+ settings; a form-style edit view calling PUT may be the honest shape.
|
||||
- #140: manual + smart collections have FULL API CRUD (CollectionController incl. items
|
||||
add/remove; SmartCollectionController). NO API exists for multi-collections, playlists,
|
||||
rerun collections → those need backend gap issues/endpoints for full Blazor parity
|
||||
(/media/multi-collections, /media/playlists, /media/rerun-collections). SPA has
|
||||
getCollections()/getSmartCollections() in web/src/api/schedules.ts (no collections.ts yet).
|
||||
Tests: Vitest + testing-library; App.test.tsx mocks fetch by path (mockDashboardApi).
|
||||
|
||||
## Approach notes
|
||||
1. Inventory first (delegate to Explore): every user-facing "ErsatzTV" in web/ (index.html
|
||||
title/meta/favicon, shell header, empty states, aria-labels, App.test.tsx copy
|
||||
assertions), what web/index.html currently ships as favicon, how the shell renders the
|
||||
brand mark today (the admin template uses chicory-mark.svg + "Chicory<accent>TV</accent>"
|
||||
— mirror that), and whether vite needs assets in web/public/ vs imported.
|
||||
2. Do NOT rename API strings, C# namespaces, Docker images, or docs — SPA surface only.
|
||||
The legacy Blazor UI stays ErsatzTV.
|
||||
3. Favicon: derive from chicorytv-icon.svg (SVG favicon is fine for modern browsers; add a
|
||||
PNG fallback only if trivial).
|
||||
4. Tests: update copy assertions; baseline 145 web tests must stay green (some assert brand
|
||||
strings). dotnet suites should be untouched (frontend-only): ErsatzTV.Tests 495,
|
||||
Core.Tests 493 (+1 skip).
|
||||
5. PR → main: "feat(web): ChicoryTV rebrand (#90)", `closes #90`; poll CI by head SHA; ask
|
||||
"merge?"; verify main post-merge run.
|
||||
6. RELEASE CHECKPOINT: after #90 merges, the SPA is feature-complete-enough AND branded —
|
||||
this is the strongest v26.4.0 tag point before #91. Ask the user explicitly whether to
|
||||
tag v26.4.0 now (never `[skip ci]` the tagged commit).
|
||||
7. Update THIS handoff: pop #90, next = #91 cutover; record PR + main SHA + baselines.
|
||||
Commit to main. Print the next prompt in a fenced block.
|
||||
## Task (in order)
|
||||
1. #147 [small, sonnet]: Classic UI link in Settings → System About card (+ optional
|
||||
"opens in ChicoryTV" cue on migrated Blazor sidebar links, per the issue). Vitest
|
||||
coverage. PR, CI, consent, merge.
|
||||
2. #146 [opus]: channel edit path. Scope call first (builder hydration vs edit form —
|
||||
recommend and confirm in an issue comment), then implement + tests + live E2E. Include or
|
||||
explicitly defer /channels/numbers with an issue comment. PR, consent, merge.
|
||||
3. #140 [opus, biggest]: collections screen for manual + smart collections (list/create/
|
||||
edit/delete/items). File follow-up issues for multi/playlist/rerun API gaps and cover
|
||||
those types read-only if feasible (they surface in GET /api/collections by CollectionType).
|
||||
PR, consent, merge.
|
||||
4. Adversarial review fork over each PR diff before asking merge consent.
|
||||
5. Update THIS handoff: merged PRs + main SHA, pop done items, next prompt = remaining parity
|
||||
(#141–#145). 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) + #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 (note: Scriban already bumped to 7.2.5 by PR #137). MCP PR #76 (#58) still
|
||||
needs its rebase/refresh pass — good parallel track.
|
||||
1. #90 rebrand ← PROMPT above (small, mechanical; strongest v26.4.0 tag point at its merge).
|
||||
2. #91 cutover (+ tag v26.4.0 at the latest here — see RELEASE CHECKPOINT).
|
||||
Cross-refs: #66/#67 remain open image-pipeline nice-to-haves; #68 unblocked-independent.
|
||||
Done recently: PR #136 (#89 Channel Builder), **PR #138 (#93 Settings — closed 2026-07-07,
|
||||
main 17f49304; web tests 112 → 145, ErsatzTV.Tests 447 → 495), PR #137 (Scriban GHSA
|
||||
CI-unblock), #92 design-sync round-trip closed (docs/design-sync.md)**.
|
||||
1. #147 SPA escape-hatch link (tiny) ← PROMPT above
|
||||
2. #146 channel edit + /channels/numbers (blocker for #91b)
|
||||
3. #140 collections management (biggest gap; spawns multi/playlist/rerun API follow-ups)
|
||||
4. #141–#145 remaining parity gaps (media browse/search, trakt, filler, watermarks, ffmpeg
|
||||
profiles, blocks/decos/templates, playout editors, logs, troubleshooting — see each issue)
|
||||
5. #91 phase (b): remove Blazor once #140–#147 close; also remove the #147 link then.
|
||||
6. MCP PR #76 (#58): refresh tool catalog against the full API surface, review, merge.
|
||||
7. #149 CI flake (migrations job host-port collision) — small, slot into any session.
|
||||
Cross-refs: #99 (TS/HLS-Direct sessions) stays backlog. Done this pass: dep PRs #61/#132
|
||||
merged; #21/#48/#49/#131 closed; prod verified on v26.5.0.
|
||||
|
||||
@@ -2728,6 +2728,15 @@ describe('Settings screen (#93)', () => {
|
||||
expect(await screen.findByText('Local')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows a Classic UI link to the legacy Blazor app in the System pane (#147)', async () => {
|
||||
mockDashboardApi();
|
||||
await openSettings();
|
||||
fireEvent.click(await screen.findByRole('button', { name: /^System/ }));
|
||||
|
||||
const link = await screen.findByRole('link', { name: /Open Classic UI/ });
|
||||
expect(link).toHaveAttribute('href', '/system/health');
|
||||
});
|
||||
|
||||
it('renders and stays editable when media sources (tier-2 reference data) fail to load', async () => {
|
||||
mockDashboardApi({ mediaSourcesFailuresBeforeSuccess: 99 });
|
||||
await openSettings();
|
||||
|
||||
@@ -854,6 +854,12 @@ function SystemPane({
|
||||
Open Dashboard
|
||||
</Button>
|
||||
</Row>
|
||||
<Row control={220} help="Collections, media browse/search, trakt, filler, watermarks, ffmpeg profiles, blocks/decos/templates, playout editors, logs and troubleshooting still live here." label="Classic UI">
|
||||
<a className="ctv-button ctv-button-secondary ctv-button-sm" href="/system/health">
|
||||
<span>Open Classic UI</span>
|
||||
<ExternalLink aria-hidden="true" size={13} />
|
||||
</a>
|
||||
</Row>
|
||||
</Card>
|
||||
</Pane>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user