Skip to content

feat(collections): one collection editor page, starting with Manual - #1939

Merged
Quick104 merged 7 commits into
feat/collections-revampfrom
feat/collection-editor-manual
Oct 4, 2026
Merged

Quick104 merged 7 commits into
feat/collections-revampfrom
feat/collection-editor-manual

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #192
Validation tasks: changes #194 A1–A3, #195 W2, W3, W5–W7, and #192 AC2, AC5, AC6 (cases Not run; each needs a walk on a running build after merge); reaches #195 W1 and #194 A4 (Not run), and #193 S2 (Pass, build 1012) and S6 (Partial, #1616) through unchanged API routes

Server and personal collections are edited on different pages that look and save differently. To make a Manual collection you fill in a form, create it, then open it again to add titles. A personal collection has no description field. On a personal collection, adding a title changes its ETag, so a rename saved after the add fails with a 412. This PR adds one editor page for both scopes and moves Manual collections onto it. Titles, details and where the collection shows sit on one page, titles can be picked before Create, and Save keeps working after title changes. Smart collections and Synced lists still open their current editors inside the new page; later PRs in this stack move them over.

Stacked on #1926 (refactor(web): share the Home rows list, menu and dialog parts).

Approach

  • pages/CollectionEditorPage.tsx replaces pages/CollectionEditor.tsx and serves /admin/collections/new, /admin/collections/:id/edit, /collections/new and /collections/:id/edit. Each pair sits under one pathless route, so after Create the page moves to the edit URL without remounting, with focus in the title search and no unsaved-changes prompt. A viewer who can't change the collection is sent to its page with ?notice=read-only, the notice from feat(collections): edit a collection from where you browse it #1920. For a personal collection the page waits for the current profile before it decides.
  • The page has a header (cover, type tag, title, Open, and ⋯ with Delete…) and three panels: Titles, Details (name, description, artwork) and Where it shows. It goes two-column from 1280px, the xl breakpoint the existing editors have used since fix(web): keep the smart collection details step in one column below xl #1679. From 1024 to 1279px the panels stack, and below 1024px a sticky switcher picks the panel, with Details first when creating.
  • Titles save as you add, remove or drag them; everything else waits for Save, and the save bar names the unsaved fields. After each title write the editor reads the collection again and merges it into the draft field by field, so Save sends the current ETag. A Save that still gets a 412 merges and retries once without asking. If the same field changed on both sides, it shows "This collection changed since you opened it." with Keep mine and Use theirs. Removing a title offers Undo for 6 seconds. docs/architecture/collection-editor.md records how the page saves.
  • Titles picked before Create are added in order after the POST. Titles that fail stay marked, with "Created, but couldn't add N titles" and Try again. An artwork upload that fails after Create keeps its slot staged with Retry.
  • The title search is a combobox over the viewer-scoped catalog query, so it offers only titles the viewer can see. A server collection in several libraries searches each library, at most four requests at once, and merges the results by rank. A library_ids filter on the catalog query would make this one request; it is left out because fix(catalog): stop queries outside a viewer's libraries from matching every library #1855 is rewriting that scope code.
  • The editor has no Featured switch. Per the owner's decision for this redesign, a collection is pinned from the Arrange view (a later PR), and collections made in the editor start unpinned. The editor creates server collections with featured: false, and its PATCH leaves featured out, so saving never changes a pin.
  • Personal create and PATCH now send description, which feat(api): accept a description when creating a personal collection #1888 added to the API. Where it shows has "Show on the Collections tab" with the help "For you and anyone you share it with", and on accounts with more than one profile, the one Show to other profiles switch. Turning sharing off on a saved collection names the profiles that lose it. That switch's help text is now one string in lib/collections/copy.ts that the older editors use too: "Every profile on this account sees it, minus titles it can't access. Nobody else on the server can see it." lib/collections/personalCollectionCopy.ts is merged into copy.ts.
  • Until the New collection picker lands, the create entry points work like this: in Admin > Collections, the Add Collection chooser's Manual card opens the new page, a new Smart card opens today's rule builder with the type fixed to Smart, and MDBList and TMDB keep their forms. In the personal New Collection form, choosing Manual opens the new page.

Where it shows does not yet list the Home rows that use a collection or offer Add as a row; those come in later PRs, as do the Smart and Synced list editors and Pin in Arrange.

No API change. jellycompat and the Apple and Android clients need no change. The user manual's collections page needs lines on the editor page (Titles, Details, Where it shows), on titles saving as you add them, and on staying on the collection after Create. 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 (808 files, 7,494 tests) pass.
  • Page tests cover how the page saves: a rename after a title add sends one PATCH with the ETag the add left; a 412 caused only by another change retries once with no banner; a field changed on both sides shows the banner, and both choices work; a drag after an add uses the item-order ETag read again after the add. They also cover Create with picked titles and the partial-failure message, Undo putting a title back at its position, artwork Retry, the read-only redirect and the wait for the profile, the layout at 1023, 1024, 1279 and 1280px, and the search (one request per library, at most four at once, only titles the viewer's catalog query returns). A unit table covers the per-field merge.
  • The saved-request goldens from test(web): pin what the collection pages and editors save today #1912 change on purpose in three places: personal create and PATCH send description, the admin PATCH leaves out featured, and a personal title add followed by a rename now saves instead of answering 412.
  • Not checked on a running build: Collections — Web admin #194 A1, A3 and Collections — Web #195 W2, W3, W5, W7 have not been walked, and the page has not been compared with the design in a browser. The W7 walk should also cover the new help text on the older editors' sharing switch.
  • make verify-local-paths passes. No Go, contract or migration files changed, so the Go and contract checks were not run. make verify-case-collisions does not exist on this base.

Risks

  • Until the Arrange PR adds Pin, the web has no way to pin or unpin a Manual server collection. Existing pins stay as they are. New Manual server collections are unpinned, so they sort after pinned ones in the capped Server collections section on each profile's Collections page.
  • The editor reads the collection again after every title write (one GET each), and a server collection in several libraries runs up to four catalog queries per search. The server editor also fetches the personal collection capabilities, which it doesn't use.
  • web/perf-budget.json rises from 321,326 to 322,423 B brotli. The base already measured 322,194 B, inside the 1,024 B tolerance; this branch measures 322,625 B. The editor code loads lazily. Of the 431 B added to the launch bundle, about 280 B are hashed file names of the new lazy chunks in the entry chunk's preload list, about 130 B are other entry code, and 21 B are CSS.

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, ran tsc -b and the new and ported tests, and mutation-tested how the page saves. Putting featured back on the PATCH, dropping description, skipping the re-read after title writes, removing the 412 retry, raising the search concurrency and removing the profile wait each made a test fail. It approved with four minor findings and three nits. Fixed, with tests: the page could flash a "not saved" bar, or stay on /new, when the read after Create was slow or failed; the Undo test removed the last title, so it could not catch a wrong position; Where it shows had its own sharing switch with different help text from the older editors; the Saved status sat inside the Titles heading and changed its accessible name; Create was disabled with no visible reason when a server collection had no library; and the personal editor downloaded the admin editors and set no document title. Dismissed: showing each title's library instead of its type in the title rows, because catalog items carry no library field.

🤖 Generated with Claude Code

Note

Add unified CollectionEditorPage with Manual collection editing

  • Adds a single scope-aware editor page (web/src/pages/CollectionEditorPage.tsx) that hosts Manual editing directly and lazy-loads the legacy Smart, imported, user, and admin editors as children. Both personal and admin create/edit routes now mount this shared page in App.tsx.
  • Builds new editor UI: CollectionEditorShell responsive layout, DetailsPanel, ManualContentsPanel with multi-library ranked title search, WhereItShowsPanel, EditorHeader, artwork staging via ArtworkSlotField, and conflict/save handling through useCollectionDraft with ETag-based three-way merging in draft.ts.
  • Selecting Manual for a new personal or admin collection now navigates to the editor page's create route instead of opening the old form; the admin form defaults new collections to Smart and locks the type.
  • Server updates no longer send featured (editor-created collections are forced to featured: false), and personal create/update bodies now include description.
  • Behavioral Changes: admin create default flipped from manual to smart in toAdminCollectionValue (adminCollectionsShared.tsx); featured removed from SERVER_SCOPE.update request body (scope.ts); ManualCollectionItemsEditor is deleted.

Macroscope summarized b9faa5c.

Quick104 and others added 6 commits October 4, 2026 15:40
Server and personal collections now open on one editor page under one
route per family, so Create stays on the same page at the new edit URL.
Manual collections get the redesigned editor: titles save as you add,
remove (with Undo) or drag them, everything else waits for the save bar,
which names the pending fields. Each title write re-reads the collection
and merges it into the draft, so a later Save sends a current ETag
instead of answering 412; a 412 with only other people's changes retries
once, and a field both sides changed shows Keep mine / Use theirs.

Titles can be staged before Create. The title search covers every
library a server collection is in. Editor creates are unpinned and
editor saves leave `featured` out, so Pin set in Arrange stays. Personal
saves send the description. Someone who can't change a collection is
sent to its page with the read-only notice instead of a form. Smart
collections and Synced lists keep their earlier editors inside the page.

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

Create marked the editor created before reading the new collection, so
the save bar flashed the edit state, and a failed read after a
successful POST left the page stuck on /new with no version to save
against. The editor now turns created only once the read lands; when
just that read fails it still moves to the edit URL, and the next save
reads the collection first.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Not created yet tag and the Saved tick sat inside the h2 that names
the panel and its list, so screen readers heard the save status as part
of the name, and the name changed on every title write.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Where it shows built its own sharing switch with new help text, so the
older editors and the new page described sharing differently and the new
one dropped that nobody else on the server can see it. The panel now
renders ShowToOtherProfilesField, which reads the shared copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The editor page imported the admin editors for both scopes, so a
profile opening a personal collection downloaded them too; they now
load lazily, and tests that open them preload them. The Manual editor
and the not-found state set the document title again, and a server
create with no library says why Create waits.

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

Undo now removes the first title, so restoring at the end would fail.
Covers a create whose read-back fails, the Titles heading name, the
library hint, document titles and the shared sharing copy.

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: d87d3e23-ae1a-4363-8ba7-82e7f0717b09

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-04T22:35:52.915566Z b9faa5c New commits
ℹ️ 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.

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Major changes requiring re-validation

The Manual editor replaces the Web and Web admin create/edit paths for titles, ordering, and artwork. This changes #194 A1/A3 and #195 W2/W3/W5/W6; the sharing save path for W7 is also reworked. The PR now explains these intended workflow changes; these cases still need a running-build walk after merge. Parent criteria #192 AC5/AC6 are affected.

W7 is ready for a Web re-test

The latest merge brings feat/collections-revamp into the base, including the #1615 server and Web-list behavior: owner-only mutations, shared-with-me grouping, and owner/viewer-filtered members. This PR adds the Manual editor's sharing path. #195 W7 remains Not run, but is ready for a Web walk after merge; #1615 remains open for native-client work. This is not a pass.

Other impacts

#194 A2 has a minor Smart entry-point change. Parent #192 AC2 sees a read-only redirect for non-owner /edit URLs. #195 W1's browse/member path is unchanged. #194 A4 retains the existing /admin/* RequireAdmin guard; #193 S2/S6 still use the same server/API routes (S2 passed on build 1012; S6's recorded partial is #1616). #990 remains relevant to W2, but W2 is Not run, so this does not record an unblock. #195 still lists #1618 as a blocker, although GitHub shows it closed on 30 Sep; this PR does not change generated-poster handling.

Suggested corrected line:
Validation tasks: unblocks #195 W7; changes #194 A1–A3, #195 W2, W3, W5, W6, and #192 AC2, AC5, AC6 (cases Not run; each needs a walk on a running build after merge); reaches #195 W1 and #194 A4 (Not run), and #193 S2 (Pass, build 1012) and S6 (Partial, #1616) through unchanged API routes

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

CollectionEditor.tsx stays deleted; its replacement CollectionEditorPage
now passes the editor's rebase to the personal Synced list editor as
onSaved, carrying the revamp's fix for saving twice from that editor.

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

Quick104 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Updated the Validation tasks line per the Macroscope check: added #194 A2, #195 W6, #192 AC2 (changed) and #193 S6 (reached).

@Quick104
Quick104 merged commit ede66ab into feat/collections-revamp Oct 4, 2026
15 checks passed
@Quick104
Quick104 deleted the feat/collection-editor-manual branch October 4, 2026 22:49
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