Skip to content

mobile: collections support (sheet picker + kebab action + detail buttons)#208

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

mobile: collections support (sheet picker + kebab action + detail buttons)#208
mrviduus merged 1 commit into
mainfrom
feat/mobile-collections

Conversation

@mrviduus
Copy link
Copy Markdown
Owner

@mrviduus mrviduus commented May 5, 2026

Mobile had zero collections UI; web has had them since PR #203. Ports collection API to @textstack/shared, adds useCollections hook, AddToCollectionSheet bottom-sheet picker, kebab action, and Add-to-collection buttons on book detail pages.

…ttons)

Mobile had zero collections UI. Web has had them since PR #203.

shared:
- new packages/shared/src/api/collections.ts with list/create/update/delete/
  addBookToCollection/removeBookFromCollection/getCollectionBookIds, exposed
  via collectionsApi + Collection / CollectionBookType types.
- en.json gains library.actions.addToCollection*, library.collections.*
  strings (mirroring web).

mobile:
- useCollections hook (cache 60s + subs + refresh + create/update/remove),
  ported from the web version.
- new AddToCollectionSheet (bottom-sheet modal): list of collections, "+ New
  collection" inline create flow, success/error feedback, native UX rather
  than the web popover.
- useBookActions: showSavedActions / showUploadActions now accept an
  optional onAddToCollection callback that, when provided, prepends an
  "Add to collection" entry to the action sheet.
- (tabs)/library.tsx: SavedList and UploadsList host their own sheet
  instances, wire onAddToCollection in handleAction, toast on success.
- app/book/[slug].tsx: "Add to collection" button in the secondary actions
  row, only when the book is in the library (web parity).
- app/my-books/[id].tsx: "Add to collection" button alongside Mark as
  read / Download EPUB / Share for ready uploads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mrviduus mrviduus merged commit ae9c971 into main May 5, 2026
5 checks passed
mrviduus added a commit that referenced this pull request May 5, 2026
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>
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