Skip to content

feat: add per-pool notification muting (#146)#167

Merged
Sendi0011 merged 1 commit into
JointSave-org:mainfrom
Francis6-git:feat/per-pool-notification-mute
Jun 29, 2026
Merged

feat: add per-pool notification muting (#146)#167
Sendi0011 merged 1 commit into
JointSave-org:mainfrom
Francis6-git:feat/per-pool-notification-mute

Conversation

@Francis6-git

Copy link
Copy Markdown
Contributor

Description:
Implemented per-pool notification muting end-to-end (DB → UI toggle → Edge Function email sending).

Changes made:

  1. Database: store per-pool mute state
  • Added migration: supabase/migrations/20260629010000_add_muted_pools_to_user_profiles.sql
  • Adds user_profiles.muted_pools JSONB NOT NULL DEFAULT '[]'::jsonb
  1. Edge Function: respect muted pools when sending emails
    Updated: supabase/functions/notify-pool-event/index.ts
  • Fetches muted_pools alongside global notification_preferences
  • When sending email to a recipient:
  • If recipientProfile.muted_pools contains the event pool_id, skip sending email for that pool
  • In-app notifications inserts are unchanged (still written for all recipients)
  1. Frontend model + API payload support
    Updated: frontend/hooks/useUserProfile.ts
  • Added muted_pools: string[]
  • Defaulting logic uses muted_pools: []
  • saveProfile typing now allows updating muted_pools

Updated: frontend/app/api/user-profile/route.ts

  • GET now selects muted_pools
  • POST already upserts ...updates, so it persists muted_pools automatically
  1. UI: add toggle on the group detail page
    Created: frontend/components/group/GroupMuteNotificationsToggle.tsx
  • Renders a “Mute notifications for this pool” button
  • Uses useUserProfile(address) and toggles membership in muted_pools
  • Updated: frontend/components/group/group-details.tsx
  • Imports and renders

Files touched/added:

  • Added: supabase/migrations/20260629010000_add_muted_pools_to_user_profiles.sql
  • Updated: supabase/functions/notify-pool-event/index.ts
  • Updated: frontend/hooks/useUserProfile.ts
  • Updated: frontend/app/api/user-profile/route.ts
  • Added: frontend/components/group/GroupMuteNotificationsToggle.tsx
  • Updated: frontend/components/group/group-details.tsx

Acceptance Criteria coverage:

  • Muting stops email notifications for that pool only (Edge Function checks muted_pools per recipient + pool_id)
  • Toggle persists (saved into user_profiles.muted_pools)
  • Additive with global preferences (mute is checked in addition to existing notification_preferences gating)

Closes #146

@Sendi0011 Sendi0011 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great implementations @Francis6-git

@Sendi0011 Sendi0011 merged commit 272a710 into JointSave-org:main Jun 29, 2026
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.

[Improvement] Add a per-pool notification mute option

2 participants