Skip to content

feat(notifications): add 'Clear all' button to notification panel (fixes #22)#134

Open
aagear wants to merge 2 commits into
Ghbounty:mainfrom
aagear:feat/ghb-22-clear-all-notifications
Open

feat(notifications): add 'Clear all' button to notification panel (fixes #22)#134
aagear wants to merge 2 commits into
Ghbounty:mainfrom
aagear:feat/ghb-22-clear-all-notifications

Conversation

@aagear

@aagear aagear commented Jun 23, 2026

Copy link
Copy Markdown

Description

Fixes #22

Adds a "Clear all" button to the notification panel dropdown next to the existing "Mark all read" button.

Changes

  1. frontend/lib/notifications.ts — New clearAllNotifications(supabase, userId) function:

    • Deletes ALL notifications for the user via the existing RLS DELETE policy
    • Best-effort (console.warn on error, same pattern as other notification writers)
  2. frontend/components/NotificationsBell.tsx — "Clear all" button in the panel header:

    • Button visible only when items.length > 0
    • Two-step confirmation: click "Clear all" → confirmation prompt ("Delete all? Yes / No") → destructive delete
    • Optimistic UI: the list empties immediately, the DB delete runs in the background
    • Consistent styling with the existing "Mark all read" button pattern

Verification

  • Button hidden when inbox is empty
  • Confirmation prompt before deletion
  • Optimistic UI: list clears immediately on confirm
  • No new dependencies

@aagear aagear requested a review from tomazzi14 as a code owner June 23, 2026 07:17
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@aagear is attempting to deploy a commit to the weareghbounty-6269's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Notification panel needs a Clear all button

1 participant