Repository navigation
fix(web): refresh library Collections tabs after a personal collection changes - #1917
Conversation
…n changes A personal collection shown on the Collections tab is listed in each library's tab, but saving, sharing, syncing or deleting it only refreshed the profile's own collection keys, so the tab kept the old state until a reload. The personal scope now also refreshes the library tab queries. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…der changes Adding or removing a title, reordering, or removing a poster on a personal collection left an already loaded library Collections tab showing the old item count and poster until its cache went stale. These writes now go through the personal scope's invalidation, like create, edit and delete. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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. |
|
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 |
|
This does not unblock W7's #1615 dependency or fix #1616's cross-profile ordering behavior. Please record these as changed cases and re-check the tab refresh path on a web build. Suggested correction: -Validation tasks: reaches #195 W1, W2, W5 and W7 (all Not run; refresh only, no re-walk needed)
+Validation tasks: changes #195 W1, W2, W5, W7Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
Corrected the Validation tasks line to "changes #195 W1, W2, W5, W7" per the Macroscope note. |
Problem
Related issue: #192
Validation tasks: changes #195 W1, W2, W5, W7
When a profile changes a personal collection that has "Show in my library Collections tab" on, the library's Collections tab keeps showing the old version. A new collection, a rename, a delete, added or removed titles, a new order or a removed poster don't show there until the page reloads or the cached tab goes stale two minutes later. After these writes the web refreshed the profile's own collection lists and the catalog, but not the library tab. This PR refreshes the library tab too.
Stacked on #1914 (
refactor(web): add the collection scope adapter and one set of type labels).Approach
PERSONAL_SCOPE.invalidate(web/src/lib/collections/scope.ts) now also invalidateslibraryCollectionKeys.all, the queries behind every library's Collections tab and its collection item lists. Personal create, update (including the Show to other profiles switch), delete, imports, sync and the 412 recovery paths already call it.invalidateUserCollectionQueriesdirectly. They now callPERSONAL_SCOPE.invalidate, so they get the same refresh.No API change. jellycompat and the Apple and Android clients need no change. No manual change.
Validation
tsc -bandmake test-webpass.PERSONAL_SCOPE.invalidatethat the scope test covers.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 and was not run.Risks
Checklist
AI Disclosure
PERSONAL_SCOPE.invalidate. In a throwaway copy it restored the base branch'sscope.ts; the rendered tab tests and the scope test then failed. It found one minor problem: adding or removing titles, reordering and removing a poster still skipped the library tab, so a tab's item count and poster stayed stale. Those writes now go throughPERSONAL_SCOPE.invalidate, with a test for each that failed before the change.🤖 Generated with Claude Code
Note
Refresh library Collections tabs after personal collection changes
PERSONAL_SCOPE.invalidatein scope.ts also invalidate thelibraryCollectionsquery-key root, so all library Collections-tab queries go stale after any personal collection writeuseAddItemToCollection,useRemoveCollectionItem,useReorderCollections,useReorderCollectionItems,useDeleteUserCollectionImage) to use this invalidation; library/admin paths keep admin invalidationMacroscope summarized 2aac868.