feat(notes): make incoming-note popup attention-grabbing

Task #409: incoming notes now mirror UpcomingMeetingAlert's attention model
so recipients can't miss them.

Changes:
- DB: add `notification_sound_note` (default "knock"), `notify_notes_enabled`,
  `vibration_enabled_note` to users schema; pushed via drizzle.
- API spec: add 3 new fields to AuthUser + UpdateNotificationPreferencesBody;
  regenerated codegen.
- Auth route: include new fields in buildAuthUser + PATCH allowlist.
- Socket hook: play notification sound + vibrate on `note_received`,
  gated by mute/notifyNotesEnabled/socket warmup, with playedNoteIdsRef
  dedupe (mirrors upcoming-meeting-alert playedRef).
- IncomingNotePopupContext: enqueue() now returns boolean acceptance so
  the socket hook can suppress sound on own-note/duplicate.
- Popup visual: z-[110], ring-4 amber, shadow-2xl, animate-in zoom,
  avatar animate-ping pulse.
- Settings UI: refactored to SLOT_KEYS map, added 3rd "Notes" slot tab
  (grid-cols-3) with enabled/vibration toggles + sound picker.
- Locales en/ar: added notifSettings.slot.note, notesEnabled, vibrationNote.

Pre-existing typecheck errors in executive-meetings.ts (font settings
scope) are unrelated to this task.
This commit is contained in:
riyadhafraa
2026-05-05 16:21:14 +00:00
parent 33038106b4
commit aaadd9b520
12 changed files with 260 additions and 60 deletions
+6
View File
@@ -64,10 +64,13 @@ function buildAuthUser(
isActive: user.isActive,
notificationSoundOrder: user.notificationSoundOrder,
notificationSoundMeeting: user.notificationSoundMeeting,
notificationSoundNote: user.notificationSoundNote,
notifyOrdersEnabled: user.notifyOrdersEnabled,
notifyMeetingsEnabled: user.notifyMeetingsEnabled,
notifyNotesEnabled: user.notifyNotesEnabled,
vibrationEnabledOrder: user.vibrationEnabledOrder,
vibrationEnabledMeeting: user.vibrationEnabledMeeting,
vibrationEnabledNote: user.vibrationEnabledNote,
notificationsMuted: user.notificationsMuted,
roles,
groups,
@@ -435,10 +438,13 @@ router.patch("/auth/me/notification-preferences", requireAuth, async (req, res):
for (const k of [
"notificationSoundOrder",
"notificationSoundMeeting",
"notificationSoundNote",
"notifyOrdersEnabled",
"notifyMeetingsEnabled",
"notifyNotesEnabled",
"vibrationEnabledOrder",
"vibrationEnabledMeeting",
"vibrationEnabledNote",
"notificationsMuted",
] as const) {
if (parsed.data[k] !== undefined) updates[k] = parsed.data[k];