Skip to content

mobile: collections section in sidebar drawer + filter library#210

Merged
mrviduus merged 1 commit into
mainfrom
feat/mobile-sidebar-collections
May 5, 2026
Merged

mobile: collections section in sidebar drawer + filter library#210
mrviduus merged 1 commit into
mainfrom
feat/mobile-sidebar-collections

Conversation

@mrviduus

@mrviduus mrviduus commented May 5, 2026

Copy link
Copy Markdown
Owner

Closes the M3 follow-up gap: sidebar drawer now shows user collections under the source tabs and filtering by collection works on both Saved and Uploads tabs. Mirrors web behaviour from PR #203/#204.

…lection

After PR #208 mobile gained collections at the data layer but the sidebar
drawer didn't show them. Closing that gap.

- LibrarySidebarDrawer takes activeCollectionId + onCollectionSelect
  props, renders a "COLLECTIONS" section under the source tabs with each
  collection name and book count. Tap a collection → filter library;
  tap again → clear filter.
- (tabs)/library.tsx: activeCollectionId state, parallel fetch of
  saved + upload book IDs for the active collection (mirrors web), pass
  Set<string>|null to SavedList and UploadsList as collectionFilterIds.
- SavedList / UploadsList apply the set as an extra filter step right
  after status + search.
- Tapping a source tab clears the active collection (mutually exclusive
  selection in the drawer — same as web behaviour).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mrviduus mrviduus merged commit fc87552 into main May 5, 2026
1 check passed
mrviduus added a commit that referenced this pull request May 5, 2026
Bug from PR #210 audit: when the active sidebar collection was already
selected and the user added a book to it from the kebab/detail sheet,
the new entry didn't appear in the filtered list — collectionFilterIds
was a one-shot fetch keyed only on activeCollectionId.

useCollections now bumps a global `version` counter on every cache
load and on invalidate. New `useCollectionsVersion()` exposes it as a
subscribable React state. (tabs)/library.tsx adds version to the
useEffect dep that fetches collection membership, so an
invalidateCollectionsCache() call from AddToCollectionSheet (or any
other future mutation) re-runs the fetch automatically.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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