Skip to content

feat(notifications): add Clear all button with confirmation + CSS styles (fixes #22)#143

Open
aagear wants to merge 1 commit into
Ghbounty:mainfrom
aagear:fix/notif-clear-all-22
Open

feat(notifications): add Clear all button with confirmation + CSS styles (fixes #22)#143
aagear wants to merge 1 commit into
Ghbounty:mainfrom
aagear:fix/notif-clear-all-22

Conversation

@aagear

@aagear aagear commented Jul 14, 2026

Copy link
Copy Markdown

Description

Adds a "Clear all" button to the notification panel header that deletes all the user notifications (read + unread).

Changes

  • frontend/lib/notifications.ts: Add clearAllNotifications() — uses the existing RLS DELETE policy on the notifications table
  • frontend/components/NotificationsBell.tsx:
    • Import clearAllNotifications
    • Add confirmingClear state for destructive-action confirmation
    • Add onClearAll() handler with optimistic UI
    • Add "Clear all" button next to "Mark all read", wrapped in a .notif-actions flex container
    • Confirmation prompt ("Delete all? Yes/No") before deletion
  • frontend/app/globals.css: Add CSS for .notif-actions, .notif-clear-all, .notif-clear-confirm, .notif-clear-yes, .notif-clear-no — styled to match existing panel theme

Acceptance criteria (from #22)

  • Button visible only when items.length > 0
  • Confirmation prompt before deletion (it is destructive)
  • Optimistic UI: the list empties immediately, the DB delete runs in the background

Fixes #22

 Ghbounty#22)

- Add clearAllNotifications() to notifications lib
- Add Clear all button with destructive-action confirmation
- Include CSS styles for .notif-actions, .notif-clear-all, .notif-clear-confirm
- Optimistic UI: list empties immediately, DB delete runs async
@aagear
aagear requested a review from tomazzi14 as a code owner July 14, 2026 11:25
@vercel

vercel Bot commented Jul 14, 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