Skip to content

Feature: Notification Center #182

Description

@Benjtalkshow

Overview

The codebase has hooks/use-notifications.ts and live GraphQL subscriptions in hooks/use-bounty-subscription.ts that already collect events for bountyCreated, bountyUpdated, application reviews, and submission status changes. But there is no surfaced UI; events are stored in localStorage and never shown to the user. Build a notification center so users can actually see and act on these events.


Goals

  • Provide a notification bell in the global navbar with unread count badge
  • Open a dropdown/panel listing recent notifications
  • Allow mark-as-read, mark-all-as-read, and clear-all
  • Link each notification to the relevant resource (bounty, dispute, profile)
  • Persist read state in localStorage (already partially set up)

Implementation Details

1. Notification bell component

Create: components/notifications/notification-bell.tsx

  • Shows a bell icon with an unread count badge in the navbar
  • Click opens a Popover or Sheet with the notification list
  • Connects to useNotifications()

2. Notification list and item

Create: components/notifications/notification-list.tsx, components/notifications/notification-item.tsx

  • Item shows icon (per notification type), title, timestamp, and link
  • Unread items have a visual marker
  • Click marks as read and navigates to the linked resource

3. Wire into navbar

Modify: components/global-navbar.tsx

  • Mount NotificationBell next to the wallet button (only when authenticated)

4. Notification types to support

  • bounty-updated → link to /bounty/[id]
  • new-application → link to /bounty/[id] (creator only)
  • submission-reviewed → link to /bounty/[id] (contributor only)
  • dispute-raised → link to /dispute/[id] (creator and contributor)
  • payment-received → link to /wallet

Files Affected

Created

  • components/notifications/notification-bell.tsx
  • components/notifications/notification-list.tsx
  • components/notifications/notification-item.tsx

Modified

  • components/global-navbar.tsx
  • hooks/use-notifications.ts (extend to cover dispute and payment events)

Acceptance Criteria

  • Bell icon visible in navbar with accurate unread count
  • Clicking opens a panel listing recent notifications
  • Each notification links to the relevant resource
  • Mark-as-read and mark-all-as-read work and persist
  • Notifications survive page reload
  • Bell is keyboard-accessible (focusable, escape closes panel)

Additional Notes

  • Keep the panel max height bounded with internal scroll
  • Consider grouping by date (Today, Yesterday, Earlier)
  • Subscription events should push into the same store consumed by the UI

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions