Skip to content

Feature: Add user preference to disable notifications for own actions #850

@timothyfroehlich

Description

@timothyfroehlich

While the default behavior should be to send notifications to users for their own actions (Issue #849), some users may find this redundant. We should provide a way for users to opt-out of this behavior in their notification settings.

Proposed Changes

  1. Update Database Schema: Add a new boolean column notify_on_own_actions to the notification_preferences table in src/server/db/schema.ts, defaulting to true.
  2. Update Preferences UI: Add a toggle in the user settings/notifications page to allow users to disable this preference.
  3. Update Notification Logic:
    • Modify createNotification in src/lib/notifications.ts to always include the actor in the initial recipientIds set (if they are a watcher/owner).
    • In the loop where preferences are checked, use the new notify_on_own_actions preference to decide whether to actually send the notification to the actor.

Relevant Files

  • src/server/db/schema.ts: Schema for notification preferences.
  • src/lib/notifications.ts: Logic for filtering recipients based on preferences.
  • src/app/(app)/settings/notifications/page.tsx: UI for managing preferences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions