Notification preferences per type

Aperta
#129 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
full-stack

Direzione di ricerca

Start with apps/api/src/services/notificationService.ts, where the preference check has to run before a notification is created and before a push is sent, and read apps/web/src/components/PushSettings.tsx and apps/web/src/pages/SettingsPage.tsx for the switch UI. Add the notificationPrefs field and the GET/PATCH /api/users/me/notification-prefs routes, with a shared schema in packages/shared. Done means that turning a type off stops new notifications and pushes of that type, existing notifications are kept, and a test shows the defaults are unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

api enhancement help wanted web

Difficulty: Intermediate · Estimated size: 1 to 2 days

Context

Push settings exist (PushSettings.tsx) but people cannot choose which events notify them. A popular account can get many like notifications.

Problem or goal

Let each person turn notification types on or off: likes, comments, follows, messages.

Suggested approach

  • API: store notificationPrefs on User with all types on by default; GET/PATCH /api/users/me/notification-prefs validated by a Zod schema in packages/shared.
  • Check the preference in notificationService before creating the notification and before sending a push.
  • Web: a list of switches in Settings.

Where to look

  • apps/api/src/services/notificationService.ts
  • apps/web/src/components/PushSettings.tsx
  • apps/web/src/pages/SettingsPage.tsx

Acceptance criteria

  • Turning a type off stops new notifications and pushes of that type.
  • Existing notifications are not deleted.
  • Defaults are unchanged for current users (add a test).
  • Switches are keyboard and screen-reader friendly.

How to work on it

  1. Comment here to claim it, so two people do not do the same work.
  2. Fork the repo and branch from main (feat/short-name or fix/short-name). Setup steps are in docs/DEVELOPMENT.md.
  3. Keep the change focused and add tests for backend logic.
  4. Run npm run typecheck, npm test and npm run lint and npm run format before opening the pull request.
  5. Use a Conventional Commits title (for example feat(web): add bookmarks). More in CONTRIBUTING.md.

Stuck? Ask in this issue. Questions are welcome.


Generated by Claude Code

Lingua principale
TypeScript
Stelle
6
Fork
6
Merge medio
1h 59m
PR unite (30g)
59

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Haseeb-MernStack/commune

Tutte le issue di Haseeb-MernStack/commune

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.