Adopt RuleBuilder inline in ChannelBuilder & Auto-Tune (#176 follow-up) #437

Closed
opened 2026-07-18 01:50:37 +02:00 by timothy · 4 comments
Owner

Follow-up to #176 (PR #433). web/src/builder/rules/RuleBuilder was built as a reusable controlled component (see spa-conventions.md §11). Adopt it for inline query authoring in the Channel Builder (/app/new-channel) and to generalize Auto-Tune's fixed 3-axis picker into an arbitrary-field builder.

Done-when

  • adversarial review passed
  • RuleBuilder embedded in ChannelBuilder and/or Auto-Tune; live-E2E
Follow-up to #176 (PR #433). `web/src/builder/rules/RuleBuilder` was built as a reusable controlled component (see `spa-conventions.md` §11). Adopt it for inline query authoring in the Channel Builder (`/app/new-channel`) and to generalize Auto-Tune's fixed 3-axis picker into an arbitrary-field builder. ## Done-when - [x] adversarial review passed - [x] RuleBuilder embedded in ChannelBuilder and/or Auto-Tune; live-E2E
timothy added the enhancementpriority: lowfrontend labels 2026-07-18 01:50:37 +02:00
Author
Owner

🔗 Session bundle — rule builder (#176 follow-ups): #434, #435, #436, #437, #438

All frontend RuleBuilder follow-ups deferred from #176: facet-value typeahead (#434), relative-date operators (#435), deeper nesting (#436), inline adoption in ChannelBuilder & Auto-Tune (#437), input validation & polish (#438). One SPA component, one session.

When you claim any member, check this cluster for co-workable siblings and sweep the disjoint set in one session (per docs/handoffs/chicorytv-issue-queue.md → bundles).

🔗 **Session bundle — rule builder (#176 follow-ups):** #434, #435, #436, #437, #438 All frontend RuleBuilder follow-ups deferred from #176: facet-value typeahead (#434), relative-date operators (#435), deeper nesting (#436), inline adoption in ChannelBuilder & Auto-Tune (#437), input validation & polish (#438). One SPA component, one session. When you claim any member, check this cluster for co-workable siblings and sweep the disjoint set in one session (per docs/handoffs/chicorytv-issue-queue.md → bundles).
timothy added the in-progress label 2026-07-23 21:26:20 +02:00
Author
Owner

Claiming (Claude Code, Opus 4.8). Working this as the substantive remaining RuleBuilder #176 follow-up (the bundle's #434/#435/#438 have landed via PR #577; #436 left as its self-declared YAGNI placeholder). Plan: embed the reusable RuleBuilder for inline query authoring — starting with the Channel Builder — and evaluate generalizing Auto-Tune's fixed axis picker. Note for parallel sessions: #440 also touches the Auto-Tune DetailPanel.

Claiming (Claude Code, Opus 4.8). Working this as the substantive remaining RuleBuilder #176 follow-up (the bundle's #434/#435/#438 have landed via PR #577; #436 left as its self-declared YAGNI placeholder). Plan: embed the reusable `RuleBuilder` for inline query authoring — starting with the Channel Builder — and evaluate generalizing Auto-Tune's fixed axis picker. Note for parallel sessions: #440 also touches the Auto-Tune DetailPanel.
Author
Owner

Scoped decision (with operator): ship the Channel Builder half here (PR #579) — the natural, frontend-only RuleBuilder fit — and split the Auto-Tune generalization into its own backend issue, #580, with a full design spec.

Rationale: Auto-Tune is a group-by primitive (one channel per distinct field value), not RuleBuilder'''s single-query filtering, and generalizing it is a backend epic (generic distinct-value enumeration, additive API, MCP parity). The issue'''s Done-when says "ChannelBuilder and/or Auto-Tune", so the Channel Builder delivery + live-E2E satisfies it; Auto-Tune continues in #580.

Scoped decision (with operator): ship the **Channel Builder** half here (PR #579) — the natural, frontend-only RuleBuilder fit — and split the **Auto-Tune** generalization into its own backend issue, **#580**, with a full design spec. Rationale: Auto-Tune is a *group-by* primitive (one channel per distinct field value), not RuleBuilder'''s single-query filtering, and generalizing it is a backend epic (generic distinct-value enumeration, additive API, MCP parity). The issue'''s Done-when says "ChannelBuilder **and/or** Auto-Tune", so the Channel Builder delivery + live-E2E satisfies it; Auto-Tune continues in #580.
Author
Owner

Closing record

Outcome: Shipped inline RuleBuilder smart-query authoring in the Channel Builder — PR #579 (merged to main). Extracted CollectionsScreen's smart-collection dialog into a shared SmartCollectionDialog (web/src/builder/), consumed by both CollectionsScreen and the Channel Builder; the Collections source gained a "New smart query" action that persists the authored query as a real SmartCollection and adds it to the lineup by smartCollectionId. The Auto-Tune half of the issue was split to #580 (see below).
Root cause: n/a (feature).
Decisions/conventions changed: none reversed; spa-conventions.md §12 extended to document the shared SmartCollectionDialog boundary + interface {open, busy, error, initial, onCancel, onSubmit({name,query})}.
Reusable knowledge: (1) The Channel Builder lineup requires a smartCollectionId — an inline query is necessarily persisted as a real named SmartCollection (no throwaway/raw-query lineup entry exists). The constructed browse item must mirror GetLibraryBrowseItemsHandler.AppendSmartCollections field-for-field (id = smartCollectionId, collectionKind "Smart", other typed ids null). (2) Adopting RuleBuilder is SPA-only: the MCP already exposes ersatztv_create_smart_collection, so no REST/OpenAPI/MCP change. (3) The EF migration integrity job can fail at the Cache NuGet packages step (act cache-tarball glitch) on a no-model-change PR — an environmental flake; Build & test passing the same cache step confirms isolation; operator reruns the one job.
Verification: web typecheck + lint clean; full vitest suite 981 pass (incl. a new inline-smart-query test driving the real component through create→lineup→from-lineup body); cold-context adversarial review clean (verified lineup-item mapping field-by-field); 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, real field catalog loaded); CI green (migration passed on operator rerun of the cache flake).
Deferred: Auto-Tune generalization → #580 (backend epic: group-by an arbitrary field, not RuleBuilder filtering). Full design spec at docs/superpowers/specs/2026-07-23-auto-tune-arbitrary-field-design.md (landed with this PR). Key finding: ISearchIndex has no facet API, so distinct-value enumeration must be DB-sourced (extends #434).
Docs updated: docs/spa-conventions.md (§12); design spec added under docs/superpowers/specs/.

## Closing record **Outcome:** Shipped inline RuleBuilder smart-query authoring in the Channel Builder — PR #579 (merged to `main`). Extracted CollectionsScreen's smart-collection dialog into a shared `SmartCollectionDialog` (`web/src/builder/`), consumed by both CollectionsScreen and the Channel Builder; the Collections source gained a "New smart query" action that persists the authored query as a real SmartCollection and adds it to the lineup by `smartCollectionId`. The Auto-Tune half of the issue was split to #580 (see below). **Root cause:** n/a (feature). **Decisions/conventions changed:** none reversed; `spa-conventions.md` §12 extended to document the shared `SmartCollectionDialog` boundary + interface `{open, busy, error, initial, onCancel, onSubmit({name,query})}`. **Reusable knowledge:** (1) The Channel Builder lineup requires a `smartCollectionId` — an inline query is *necessarily* persisted as a real named SmartCollection (no throwaway/raw-query lineup entry exists). The constructed browse item must mirror `GetLibraryBrowseItemsHandler.AppendSmartCollections` field-for-field (id = smartCollectionId, collectionKind "Smart", other typed ids null). (2) Adopting RuleBuilder is SPA-only: the MCP already exposes `ersatztv_create_smart_collection`, so no REST/OpenAPI/MCP change. (3) The `EF migration integrity` job can fail at the *Cache NuGet packages* step (act cache-tarball glitch) on a no-model-change PR — an environmental flake; `Build & test` passing the same cache step confirms isolation; operator reruns the one job. **Verification:** web typecheck + lint clean; full vitest suite 981 pass (incl. a new inline-smart-query test driving the real component through create→lineup→`from-lineup` body); cold-context adversarial review clean (verified lineup-item mapping field-by-field); 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, real field catalog loaded); CI green (migration passed on operator rerun of the cache flake). **Deferred:** Auto-Tune generalization → **#580** (backend epic: group-by an arbitrary field, not RuleBuilder filtering). Full design spec at `docs/superpowers/specs/2026-07-23-auto-tune-arbitrary-field-design.md` (landed with this PR). Key finding: `ISearchIndex` has no facet API, so distinct-value enumeration must be DB-sourced (extends #434). **Docs updated:** `docs/spa-conventions.md` (§12); design spec added under `docs/superpowers/specs/`.
timothy removed the in-progress label 2026-07-23 23:18:14 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#437