Skip to content

Feature: Saved / Bookmarked Bounties #185

Description

@Benjtalkshow

Overview

The bounty catalog has filters but no way for a user to mark a bounty as "interesting" and revisit it later. Contributors browsing 20–50 active bounties at a time often want to compare a few before applying. Add a bookmark system so users can save bounties to a personal list and optionally receive notifications when those bounties change status.

Goals

  • Allow authenticated users to bookmark/unbookmark any bounty
  • Show a bookmark icon on bounty cards and the bounty detail page that toggles state
  • Provide a "Saved Bounties" view (sidebar widget on the profile page, or a dedicated /saved route) that lists everything the user has bookmarked
  • Trigger notifications (via the existing notification center) when a bookmarked bounty changes status (deadline approaching, status moves to IN_REVIEW, etc.)

Implementation Details

1. Bookmark mutations and query

Create: hooks/use-bookmarks.ts

  • useBookmarks() returns the current user's bookmarks
  • useToggleBookmark(bountyId) adds or removes with optimistic update
  • Uses a new bookmarkKeys factory in lib/query/query-keys.ts

2. Bookmark icon component

Create: components/bounty/bookmark-button.tsx

  • Renders a bookmark icon (filled when active, outline when not)
  • Click toggles via useToggleBookmark
  • Accessible: aria-pressed, keyboard activatable

3. Wire into existing surfaces

Modify: components/bounty/bounty-card.tsx

  • Add BookmarkButton to the card header (top-right corner)

Modify: components/bounty-detail/bounty-detail-header-card.tsx

  • Add BookmarkButton next to the StatusBadge

4. Saved Bounties view

Create: app/saved/page.tsx

  • Lists bookmarked bounties with the same BountyCard grid as /bounty
  • Empty state with a primary CTA back to /bounty
  • Server-side guard: redirect to sign-in if unauthenticated

5. Notification integration

Extend: hooks/use-notifications.ts and hooks/use-bounty-subscription.ts

  • When bountyUpdated fires for a bounty in the user's bookmarks, push a notification of type saved-bounty-updated
  • Notification links back to /bounty/[id]

Files Affected

Created

  • hooks/use-bookmarks.ts
  • components/bounty/bookmark-button.tsx
  • app/saved/page.tsx

Modified

  • components/bounty/bounty-card.tsx
  • components/bounty-detail/bounty-detail-header-card.tsx
  • hooks/use-notifications.ts
  • hooks/use-bounty-subscription.ts
  • lib/query/query-keys.ts

Acceptance Criteria

  • Authenticated users can bookmark and unbookmark any bounty from the card and detail page
  • Bookmark state persists across sessions and devices (server-backed, not just localStorage)
  • /saved lists all bookmarked bounties for the current user
  • Unauthenticated users see a sign-in prompt instead of the bookmark icon
  • Bookmarked bounties trigger notifications via the notification center when their status changes
  • Bookmark toggle is keyboard-accessible and has correct ARIA attributes

Additional Notes

  • For optimism: write through to the cache so the icon flips immediately, then reconcile on success/error
  • If the backend mutation isn't ready, the issue can land with a localStorage fallback gated by a TODO, but the persistence layer should be server-backed before this ships to production
  • Consider a small "saved" count badge in the navbar next to the bookmark icon (optional polish)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions