Repository navigation
feat(collections): one collection editor page, starting with Manual - #1939
Conversation
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]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Major changes requiring re-validationThe 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-testThe latest merge brings Other impacts#194 A2 has a minor Smart entry-point change. Parent #192 AC2 sees a read-only redirect for non-owner Suggested corrected line: 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]>
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.tsxreplacespages/CollectionEditor.tsxand serves/admin/collections/new,/admin/collections/:id/edit,/collections/newand/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.xlbreakpoint 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.docs/architecture/collection-editor.mdrecords how the page saves.library_idsfilter 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.featured: false, and its PATCH leavesfeaturedout, so saving never changes a pin.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 inlib/collections/copy.tsthat 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.tsis merged intocopy.ts.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
tsc -bandmake test-web(808 files, 7,494 tests) pass.description, the admin PATCH leaves outfeatured, and a personal title add followed by a rename now saves instead of answering 412.make verify-local-pathspasses. No Go, contract or migration files changed, so the Go and contract checks were not run.make verify-case-collisionsdoes not exist on this base.Risks
web/perf-budget.jsonrises 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
AI Disclosure
tsc -band the new and ported tests, and mutation-tested how the page saves. Puttingfeaturedback on the PATCH, droppingdescription, 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
CollectionEditorPagewith Manual collection editingweb/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.CollectionEditorShellresponsive layout,DetailsPanel,ManualContentsPanelwith multi-library ranked title search,WhereItShowsPanel,EditorHeader, artwork staging viaArtworkSlotField, and conflict/save handling throughuseCollectionDraftwith ETag-based three-way merging in draft.ts.featured(editor-created collections are forced tofeatured: false), and personal create/update bodies now includedescription.toAdminCollectionValue(adminCollectionsShared.tsx);featuredremoved fromSERVER_SCOPE.updaterequest body (scope.ts);ManualCollectionItemsEditoris deleted.Macroscope summarized b9faa5c.