Skip to content

fix(bookmarks): wire up bookmark saving, sync, and list display#190

Merged
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
Ejirowebfi:fix/bookmark-persist-sync
Apr 28, 2026
Merged

fix(bookmarks): wire up bookmark saving, sync, and list display#190
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
Ejirowebfi:fix/bookmark-persist-sync

Conversation

@Ejirowebfi
Copy link
Copy Markdown
Contributor

closes #153

Fixes #153 — bookmarks were not persisting saved items.

What changed

src/store/bookmarkStore.ts (new)

  • Zustand store with persist middleware writing to AsyncStorage key bookmarks
  • addBookmark(item) — adds to store, syncs POST /api/bookmarks to server
  • removeBookmark(itemId) — removes from store, syncs DELETE /api/bookmarks/:itemId
  • isBookmarked(itemId) — selector
  • Matches existing store patterns (notificationStore, settingsStore)

src/components/mobile/BookmarkButton.tsx (updated)

  • Now owns the toggle logic — reads/writes directly to bookmarkStore
  • Accepts item: BookmarkItem prop instead of stateless isBookmarked/onToggle
  • Handles add/remove with server sync on press

src/components/mobile/BookmarkList.tsx (new)

  • Reads bookmarks from store
  • Renders saved items with title, type, and navigation link
  • Shows empty state when no bookmarks exist

tests/components/Bookmark.test.tsx (new, 9 tests)

  • Pressing BookmarkButton adds item to store + calls POST /api/bookmarks
  • Pressing again removes it + calls DELETE /api/bookmarks/:id
  • AsyncStorage.setItem called on bookmark add (persist middleware)
  • BookmarkList renders items from store
  • BookmarkList shows empty state when no bookmarks

Test results

9/9 new tests pass. Full suite: 247 tests passing, same 2 pre-existing failures unrelated to this PR.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@Ejirowebfi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit 66c3989 into rinafcode:main Apr 28, 2026
2 of 4 checks passed
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.

Bookmark Feature Incomplete

2 participants