From fb14db6d50bc8b248928f699597ad9b586fc641c Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sat, 12 Sep 2026 19:46:06 -0400 Subject: [PATCH] fix(notifications): Work/Gaming presets clear an active snooze Both presets claim notifications end up on, but left a "Pause Notifications" snooze in place. Sleep is unchanged (its description holds regardless). Fixes #48 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- .../settings/notifications/Notifications.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/app/features/settings/notifications/Notifications.tsx b/src/app/features/settings/notifications/Notifications.tsx index 2324cff3a..a8ac4f43f 100644 --- a/src/app/features/settings/notifications/Notifications.tsx +++ b/src/app/features/settings/notifications/Notifications.tsx @@ -11,12 +11,19 @@ import { SequenceCard } from '../../../components/sequence-card'; import { SequenceCardStyle } from '../styles.css'; import { SettingTile } from '../../../components/setting-tile'; import { settingsAtom, Settings } from '../../../state/settings'; +import { notificationSnoozeUntilAtom } from '../../../state/notificationSnooze'; const PRESETS: Array<{ label: string; icon: IconSrc; description: string; patch: Partial; + // Whether applying this preset should also clear an active "Pause + // Notifications" snooze. Work/Gaming both claim notifications end up on, + // so a leftover snooze would silently contradict them (#48). Sleep's + // description ("All notifications off") is still true with a snooze left + // active, so it does not need to touch it. + clearSnooze: boolean; }> = [ { label: 'Gaming', @@ -29,6 +36,7 @@ const PRESETS: Array<{ inviteSoundId: 'none', quietHoursEnabled: false, }, + clearSnooze: true, }, { label: 'Work', @@ -41,6 +49,7 @@ const PRESETS: Array<{ inviteSoundId: 'invite', quietHoursEnabled: false, }, + clearSnooze: true, }, { label: 'Sleep', @@ -51,15 +60,23 @@ const PRESETS: Array<{ isNotificationSounds: false, quietHoursEnabled: false, }, + clearSnooze: false, }, ]; function NotificationPresets() { const settings = useAtomValue(settingsAtom); const setSettings = useSetAtom(settingsAtom); + const setSnoozeUntil = useSetAtom(notificationSnoozeUntilAtom); - const applyPreset = (patch: Partial) => { + const applyPreset = (patch: Partial, clearSnooze: boolean) => { setSettings({ ...settings, ...patch }); + // Work/Gaming promise notifications are on; an active snooze from an + // earlier "Pause Notifications" would otherwise keep them silently + // suppressed despite the preset applying successfully (#48). + if (clearSnooze) { + setSnoozeUntil(0); + } }; return ( @@ -71,7 +88,7 @@ function NotificationPresets() {