Skip to content

feat(collections): Starter packs replace template bundles - #1941

Merged
Quick104 merged 2 commits into
feat/collections-revampfrom
feat/collection-starter-packs
Oct 4, 2026
Merged

Quick104 merged 2 commits into
feat/collections-revampfrom
feat/collection-starter-packs

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #192
Validation tasks: changes #194 A1 (Not run; needs a walk on a running build before merge); reaches #1141 C1 (Not run) and #193 S5 (Pass) through unchanged API routes

Template bundles add a set of synced lists to libraries in one go. In the admin web they are a view inside the single-template gallery. By default, applying one sets a hero banner on Home and on each chosen library, which takes the banner away from the row an admin picked by hand. The optional Preview is one line of counts, so an admin can't see per library which lists are new and which already exist. A "Delete Existing Server Collections" switch sits just above Apply Defaults.

This PR moves bundles into their own Starter packs dialog. It shows per library what a pack will add before anything changes, hero banners are opt-in, and the web no longer offers to delete existing collections.

Stacked on #1939 (feat(collections): one collection editor page, starting with Manual).

Approach

  • StarterPacksDialog opens from a new "Starter packs…" button in the Admin > Collections header, from "Add a starter pack" on both empty states (it replaces "Start from a template" there), and from /admin/collections?dialog=starter-packs. Opening and closing replace the URL entry, so Back leaves the page.
  • The left rail lists packs with their list counts, Everything last. The right pane has the pack's description and library chips. Only enabled libraries that can take at least one of the pack's lists are offered. A "What will happen" table has one row per library: New, Already there, and Not for this library ("2 TV lists"). Each row expands to every list and tags only the exceptions: Pinned first, Already there, Can't add. Above 30 new lists a note says the first syncs take a while. Below 1024px the rail becomes a Pack select and the dialog a bottom sheet.
  • The table comes from the existing POST /api/v2/admin/collections/template-bundles/{bundle_id}/apply with dry_run: true and delete_existing: false. Add runs the same dry run again, then queues the existing apply job. The dialog stays open while the job runs. When it ends, the dialog moves focus to a per-library result and checks the pack again. The pack gets an Added tag only when a new list landed or nothing failed; otherwise the result is titled "finished with problems".
  • Hero banners sit behind a switch that is off by default. Off, the requests carry no featured member, so the server never clears a page's current hero banner. On, each page (Home and each chosen library) gets a select of the pack's lists for that page or Keep current, and the line names the hero banner it would replace, read from the admin sections list. The dry run and the job carry the same featured, pages left on Keep current are not in it, and the table adds a line for each banner. After the banners are set, the switch turns back off.
  • The dialog reads only the bundle templates summaries added in feat(api): list each template bundle's templates #1894, never the admin template catalog. Discover and Franchise lists therefore keep their titles once a follow-up narrows that catalog, and that follow-up must merge after this PR. Templates marked needs_setup (the TMDB Franchise placeholder) are not shown or counted.
  • The template gallery loses its bundle view; single templates stay under Browse Templates for now. The Discover and Franchise notices in the gallery point to Starter packs. The web's non-dry-run apply hook had no other caller and is removed, along with the duplicate "queued" toast. docs/architecture/collection-templates.md gains a Starter packs section with these rules.

This uses defaults for product questions that are still open:

  • Starter packs apply one pack at a time, and the dialog stays open with an Added tag instead of queuing several packs.
  • The franchise placeholder stays in its bundle and is hidden by its needs_setup flag, instead of being removed from the bundle on the server.
  • Pack collections keep the template's pinned-first setting, shown as a Pinned first tag, while collections made in the editor start unpinned.

No API change. The Apple and Android clients don't use this admin flow, and jellycompat needs no change. The user manual's page on template bundles needs updating: they are now Starter packs, with a per-library table, opt-in hero banners that name what they replace, packs keeping the template's pinned-first setting, and no delete option. That siloserver.org issue is not filed yet.

Validation

  • Web: lint (no errors; the changed files add no warnings), format:check, build, budget:check, tsc -b and make test-web (809 files, 7,533 tests) pass. make verify-apiv2-web-types and make verify-local-paths pass.
  • Tests record every request the dialog sends. With the hero switch off, no dry run or job carries featured. With it on, the dry runs and the job carry the same featured and leave out Keep current pages. delete_existing is never true, and Add repeats the dry run before queuing the job. They also cover the table built from a dry-run fixture, Discover and Franchise titles taken from the summaries, the hidden placeholder, Retry after a failed check, "Nothing new to add", the link to Libraries when no library fits, focus moving to the result, the Added tag only when something landed, the switch turning off after banners are set, the phone Pack select, the rail tabs tied to their pane, and Back after closing.
  • The bundle goldens from test(web): pin what the collection pages and editors save today #1912 are replaced on purpose: the default apply no longer carries featured, and the delete-existing bodies are gone.
  • Before the review fixes, the dialog was run in a browser against a local server with three empty libraries. With hero banners on, adding Core Defaults created 24 collections and set 4 hero banners, and the dialog stayed open with the result focused.
  • Not walked yet: Collections — Web admin #194 A1 and Curated home sections — Web admin #1141 C1. No Go, contract or migration files changed, so the Go checks and the other contract checks were not run. make verify-case-collisions does not exist on this base.

Risks

  • Admins who relied on a bundle setting hero banners by default now have to turn the switch on. Existing hero banners are no longer replaced by accident.
  • The web no longer offers "Delete Existing Server Collections". The API's delete_existing option is unchanged for other callers.
  • Franchise Collections and Everything still create the empty TMDB Franchise placeholder collection, which the dialog neither counts nor mentions, so "Add N collections" is one short for those packs. Closing that gap means removing the placeholder from the bundle on the server, which needs an owner decision.
  • The landing line uses the redesign's names, "No heading" and "Arrange". Until the Arrange view lands later in this stack, the admin page still calls that group "Ungrouped".
  • Each pack or library change runs a dry run (a POST that writes nothing), Add runs one more, and the dialog polls the job every 2 seconds while it runs.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent checked the diff against the redesign plan, read the server's hero banner handling to confirm Keep current leaves a page alone, ran tsc -b, eslint and the focused tests, and mutation-tested the dialog. Turning hero banners on by default, sending delete_existing: true, dropping the dry run before Add, removing the focus move and showing needs_setup templates each made tests fail. It found no blockers and reported four minor findings and two nits. Fixed, with tests: after a run that set hero banners, the switch stayed on and offered to set the same banners again; the Added tag showed even when every list failed; the rail's tabs controlled no panel; and opening the dialog added a history entry, so Back reopened it. A long line in the architecture doc was rewrapped. Not changed: the placeholder collection the dialog doesn't count, which is listed under Risks because fixing it needs a server change.

🤖 Generated with Claude Code

Note

Add Starter packs dialog to replace Template Bundles apply flow

  • Adds StarterPacksDialog, opened from the Collections page header, empty states, or a starter-packs query param. It lists packs as vertical tabs (mobile select), runs non-deleting dry runs per selected library, supports opt-in hero banner choices, queues one apply job at a time, and shows per-library results.
  • Adds the starterPacks.ts helper: pack catalog building, library/template eligibility, dry-run and apply-result planning, hero defaulting and request construction. Dry runs become a TanStack query (starterPackDryRunQuery) with retries disabled.
  • Removes the bundle apply view and helpers from CollectionTemplateGallery.tsx; the gallery no longer requests template bundles or shows bundle cards. Read-only TMDB summary actions now show "In Starter packs" instead of "Use Template Bundles".
  • Behavioral Change: applies always send delete_existing as false, apply queuing no longer shows a success toast, and Add performs a fresh dry run before queueing; collection/section queries are invalidated after apply.

Macroscope summarized 1f7843e.

Quick104 and others added 2 commits October 4, 2026 16:36
Template bundles were buried in the template gallery, turned hero banners
on by default (clearing hand-set heroes) and offered a switch that deleted
every server collection in the chosen libraries. Starter packs is a
two-pane dialog on the admin Collections page: a pack rail, the chosen
libraries, and a per-library table from the bundle's dry run (new, already
there, not for this library, pinned first). Hero banners are opt-in and
each page line names the hero it replaces; the web never sends
delete_existing. One pack is added at a time: the dry run runs again right
before the job, and the dialog stays open with an Added tag and the
result. Templates that need setup are hidden.

Open it from the header, the empty state, or ?dialog=starter-packs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…o its pane

After an apply with hero banners, the switch stayed on and the next check
offered "Set hero banners" for heroes that were just set; it now turns off
once the job succeeds. A run where nothing new landed and lists failed no
longer tags the pack Added; its summary says it finished with problems.

The pack rail's tabs now control a labelled tabpanel, opening and closing
the dialog replaces the URL so Back leaves the page, and the template doc
paragraph is rewrapped.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cab9414a-5057-4c98-b62e-6475729bf20d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T20:55:26.060911Z 1f7843e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f7843e173

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +177 to +179
// Also checks the pack again, so the table shows what is there now.
void invalidateAdminCollectionQueries(queryClient);
void queryClient.invalidateQueries({ queryKey: sectionKeys.all });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Invalidate the starter-pack dry run after apply

When an apply job finishes with the hero switch off, this effect only invalidates the generic admin collection and section keys; it never invalidates the adminKeys.starterPackDryRun(...) query used for the table. As a result, the dialog can continue showing the pre-apply would_create/new rows instead of reflecting the collections just created, despite the comment claiming it checks the pack again. Invalidate or explicitly refetch the active dry-run query after the job completes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bug: the dry-run key is ["admin", "collections", "templateBundles", packId, "dryRun", body] (adminKeys.starterPackDryRun in web/src/hooks/queries/keys.ts), and invalidateAdminCollectionQueries invalidates the ["admin", "collections"] prefix, so the active dry run refetches once the job ends. The test "sends no featured member while the hero switch is off, then a fresh dry run and the job" pins this with the switch off: it waits for a third dry-run call after the job finishes. Commenting out the invalidation makes that test fail with 2 calls instead of 3.

Base automatically changed from feat/collection-editor-manual to feat/collections-revamp October 4, 2026 22:49
@Quick104
Quick104 merged commit 831cda4 into feat/collections-revamp Oct 4, 2026
19 checks passed
@Quick104
Quick104 deleted the feat/collection-starter-packs branch October 4, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant