Skip to content

feat(notifications): add scoped channel preferences - #298

Closed
micheal000010000-hub wants to merge 2 commits into
Devlaner:mainfrom
micheal000010000-hub:feat/scoped-notification-preferences
Closed

feat(notifications): add scoped channel preferences#298
micheal000010000-hub wants to merge 2 commits into
Devlaner:mainfrom
micheal000010000-hub:feat/scoped-notification-preferences

Conversation

@micheal000010000-hub

Copy link
Copy Markdown
Contributor

Summary

Adds workspace/project notification preference scopes and splits each notification type into separate in-app and email toggles. Preference resolution now falls back from project to workspace to global defaults.

Linked issues

Closes #203

Type of change

  • Feature (feat:) — user-visible new capability

Surface

  • API (apps/api/)
  • UI (apps/web/)
  • Database migration (apps/api/migrations/)

What changed

  • Added migration columns for per-type *_in_app and *_email notification preferences.
  • Expanded notification preference APIs to support global, workspace, and project scopes.
  • Updated notification fan-out so in-app and email delivery are resolved independently.
  • Added settings UI controls for Global / Workspace / Project preferences.
  • Added API regression tests for scoped notification preferences.

Why this approach

This reuses the existing user_notification_preferences scope fields and adds channel-specific columns instead of creating a separate preference table. Existing boolean fields remain compatible while newer clients use the explicit in-app/email fields.

Database / migrations

  • Added apps/api/migrations/000007_notification_preference_channels.up.sql AND matching .down.sql
  • Migration is idempotent / safe to re-run on a fresh DB
  • Migration applied cleanly via database.RunMigrations on startup

Breaking changes

  • No

Test plan

  • npm --prefix apps/web run typecheck
  • npm --prefix apps/web run lint
  • npm --prefix apps/web run format:check
  • cd apps/api && go vet ./...
  • cd apps/api && go test ./...

Note: npm run validate reached the Go step, then failed locally because Snap-confined Go cannot run inside the sandbox. The equivalent Go steps were run directly and passed.

Screenshots / recordings (UI changes)

Before After

Rollout notes

New notification preference columns are default-enabled and backfilled from the existing global booleans. No env vars or manual backfill required.

AI assistance

  • AI tools were used — tool(s): Codex — and AI-assisted commits include a Co-Authored-By: trailer

Checklist

  • PR title follows Conventional Commits and is ≤ 100 chars
  • Hooks ran cleanly (no --no-verify bypass)
  • Trailing slashes on new routes match the surrounding pattern
  • New env vars added to internal/config/config.go and documented above
  • No secrets, tokens, or .env values committed

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 21975721-1c75-451c-9e55-c89b27c3ceb4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@martian56

Copy link
Copy Markdown
Member

@micheal000010000-hub This issue was closed by an earlier PR.

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 workspace/project notification preferences and email-vs-in-app toggles

2 participants