feat(437): inline RuleBuilder smart-query authoring in Channel Builder #579

Merged
timothy merged 1 commits from feat/437-rulebuilder-channelbuilder into main 2026-07-23 23:17:42 +02:00
Owner

Adopts the reusable RuleBuilder (#176) for inline query authoring in the Channel Builder (/app/new-channel).

What

  • Extract CollectionsScreen's smart-collection dialog into a shared, self-contained component SmartCollectionDialog (web/src/builder/); consume it in both CollectionsScreen and the Channel Builder.
  • The Channel Builder's Collections source gains a "New smart query" action: author an ad-hoc query with RuleBuilder → createSmartCollection persists it as a real named SmartCollection → it is added to the lineup by smartCollectionId.
  • Pure frontend — no REST/OpenAPI/MCP/migration change (the MCP already exposes ersatztv_create_smart_collection; the SPA reuses existing endpoints).

Scope note (the "and/or" in #437)

The Auto-Tune half is a different primitive (group-by, not single-query filtering) and a backend epic. It is designed separately in docs/superpowers/specs/2026-07-23-auto-tune-arbitrary-field-design.md and filed as its own issue — not wired here. Key finding: ISearchIndex has no facet API, so distinct-value enumeration must be DB-sourced (extending #434's seam).

Verification

  • web typecheck + lint clean; full vitest suite green (981), incl. a new inline-smart-query test that drives the real component through create→lineup→from-lineup body (asserts smartCollectionId).
  • Cold-context review: clean, no findings (verified the constructed lineup item field-by-field against GetLibraryBrowseItemsHandler.AppendSmartCollections).
  • Live-E2E on a real instance: query authored in the SPA persisted as SmartCollection Action Picks (genre:"Action") and added to the lineup; 0 console errors; RuleBuilder loaded the real field catalog.

Docs

  • docs/spa-conventions.md §12 updated (shared-component boundary + interface).

fixes #437

🤖 Generated with Claude Code

Adopts the reusable **RuleBuilder** (#176) for inline query authoring in the **Channel Builder** (`/app/new-channel`). ## What - Extract CollectionsScreen's smart-collection dialog into a shared, self-contained component **`SmartCollectionDialog`** (`web/src/builder/`); consume it in both CollectionsScreen and the Channel Builder. - The Channel Builder's **Collections source** gains a **"New smart query"** action: author an ad-hoc query with RuleBuilder → `createSmartCollection` persists it as a real named SmartCollection → it is added to the lineup by `smartCollectionId`. - Pure **frontend** — no REST/OpenAPI/MCP/migration change (the MCP already exposes `ersatztv_create_smart_collection`; the SPA reuses existing endpoints). ## Scope note (the "and/or" in #437) The **Auto-Tune** half is a *different primitive* (group-by, not single-query filtering) and a **backend epic**. It is designed separately in `docs/superpowers/specs/2026-07-23-auto-tune-arbitrary-field-design.md` and filed as its own issue — not wired here. Key finding: `ISearchIndex` has no facet API, so distinct-value enumeration must be DB-sourced (extending #434's seam). ## Verification - web typecheck + lint clean; **full vitest suite green (981)**, incl. a new inline-smart-query test that drives the real component through create→lineup→`from-lineup` body (asserts `smartCollectionId`). - Cold-context review: **clean, no findings** (verified the constructed lineup item field-by-field against `GetLibraryBrowseItemsHandler.AppendSmartCollections`). - **Live-E2E** on a real instance: query authored in the SPA persisted as SmartCollection `Action Picks` (`genre:"Action"`) and added to the lineup; 0 console errors; RuleBuilder loaded the real field catalog. ## Docs - `docs/spa-conventions.md` §12 updated (shared-component boundary + interface). fixes #437 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy added 1 commit 2026-07-23 22:09:15 +02:00
feat(437): inline RuleBuilder smart-query authoring in Channel Builder
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 9s
PR Gates / Docs update reminder (pull_request) Successful in 13s
PR Gates / decisions lifecycle (pull_request) Successful in 21s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m0s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 1m0s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 7m38s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 16m4s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 18m49s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
5fba6187ce
Adopt the reusable RuleBuilder (#176) for inline query authoring in the Channel
Builder (/app/new-channel). Extract CollectionsScreen's smart-collection dialog
into a shared, self-contained component (SmartCollectionDialog) and consume it in
both screens; the Channel Builder's Collections source gains a "New smart query"
action that persists the authored query as a real SmartCollection and adds it to
the lineup by smartCollectionId. Pure frontend — no REST/MCP surface change (the
MCP already exposes ersatztv_create_smart_collection).

The Auto-Tune half of #437 is a different primitive (group-by, not single-query
filtering) and a backend epic; it is designed separately in
docs/superpowers/specs/2026-07-23-auto-tune-arbitrary-field-design.md and filed as
its own issue rather than wired here.

Verification: web typecheck + lint clean; full vitest suite green (981, incl. a new
inline-smart-query test); cold-context review clean; live-E2E on a real instance
(query authored in the SPA persisted as SmartCollection "Action Picks" and added to
the lineup, 0 console errors).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Owner

Review-verdict: MERGEABLE @ 5fba6187ce

Cold-context adversarial review (fresh reviewer, no implementation role) on this head sha: clean, no findings. Verified extraction fidelity (SmartCollectionDialog is a behavior-preserving move of CollectionsScreen's SmartDialog), the constructed lineup item field-by-field against GetLibraryBrowseItemsHandler.AppendSmartCollections, dialog open/close/reset + busy guard + error surfacing, and lineupKey dedup. Frontend-only: no auth/lock/migration/API-write surface. Local gate green (typecheck, lint, 981 vitest) + live-E2E on a real instance.

Review-verdict: MERGEABLE @ 5fba6187ce9839b97246f4bd6327fc3c5638e18c Cold-context adversarial review (fresh reviewer, no implementation role) on this head sha: **clean, no findings**. Verified extraction fidelity (SmartCollectionDialog is a behavior-preserving move of CollectionsScreen's SmartDialog), the constructed lineup item field-by-field against `GetLibraryBrowseItemsHandler.AppendSmartCollections`, dialog open/close/reset + busy guard + error surfacing, and lineupKey dedup. Frontend-only: no auth/lock/migration/API-write surface. Local gate green (typecheck, lint, 981 vitest) + live-E2E on a real instance.
Author
Owner

CI note — the EF migration integrity red is an environmental cache-action flake, not this PR.

The job died at the Cache NuGet packages step, before any migration logic ran:

❌  Failure - Main Cache NuGet packages
remove /root/.cache/act/…/.gitignore: no such file or directory

This is a transient Gitea/act cache-tarball glitch (ci.infra-shaped-red-under-load). This PR touches no .cs, no migration, and no Directory.Packages.props, so it cannot introduce migration drift.

Confirming it is isolated: Build & test (.NET) passed on the same runner using the identical Cache NuGet packages step, as did API docs in sync and Formatting.

Per protocol I am not re-pushing (that re-runs the whole pipeline and can't be cancelled). Resolution is an operator UI rerun of the EF migration integrity job; the H6/H10 gate reads overall status, so merge stays blocked until that job is green.

**CI note — the `EF migration integrity` red is an environmental cache-action flake, not this PR.** The job died at the **Cache NuGet packages** step, *before* any migration logic ran: ``` ❌ Failure - Main Cache NuGet packages remove /root/.cache/act/…/.gitignore: no such file or directory ``` This is a transient Gitea/act cache-tarball glitch (`ci.infra-shaped-red-under-load`). This PR touches **no `.cs`, no migration, and no `Directory.Packages.props`**, so it cannot introduce migration drift. Confirming it is isolated: **`Build & test (.NET)` passed** on the same runner using the *identical* `Cache NuGet packages` step, as did `API docs in sync` and `Formatting`. Per protocol I am **not** re-pushing (that re-runs the whole pipeline and can't be cancelled). Resolution is an **operator UI rerun of the `EF migration integrity` job**; the H6/H10 gate reads overall status, so merge stays blocked until that job is green.
timothy merged commit be1070de51 into main 2026-07-23 23:17:42 +02:00
timothy deleted branch feat/437-rulebuilder-channelbuilder 2026-07-23 23:17:42 +02:00
Sign in to join this conversation.