From 89b4bd487055ba1eac34c2bb4b56958c5ad6f0c0 Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Tue, 24 Feb 2026 01:09:17 +0800 Subject: [PATCH] Replace snooze button group with clock icon dropdown Single clock icon opens a dropdown with 5/10/15 min options instead of three inline buttons. Shared SnoozeDropdown component used in both AlertBanner and toast notifications. Co-Authored-By: Claude Opus 4.6 --- .../src/components/dashboard/AlertBanner.tsx | 14 +---- .../components/reminders/SnoozeDropdown.tsx | 54 +++++++++++++++++++ frontend/src/hooks/useAlerts.tsx | 19 +++---- 3 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 frontend/src/components/reminders/SnoozeDropdown.tsx diff --git a/frontend/src/components/dashboard/AlertBanner.tsx b/frontend/src/components/dashboard/AlertBanner.tsx index bd86cc1..a511259 100644 --- a/frontend/src/components/dashboard/AlertBanner.tsx +++ b/frontend/src/components/dashboard/AlertBanner.tsx @@ -1,5 +1,6 @@ import { Bell, X } from 'lucide-react'; import { getRelativeTime } from '@/lib/date-utils'; +import SnoozeDropdown from '@/components/reminders/SnoozeDropdown'; import type { Reminder } from '@/types'; interface AlertBannerProps { @@ -33,18 +34,7 @@ export default function AlertBanner({ alerts, onDismiss, onSnooze }: AlertBanner {alert.remind_at ? getRelativeTime(alert.remind_at) : ''} -
- {([5, 10, 15] as const).map((m) => ( - - ))} -
+ onSnooze(alert.id, m)} label={alert.title} /> + {open && ( +
+ {OPTIONS.map((opt) => ( + + ))} +
+ )} + + ); +} diff --git a/frontend/src/hooks/useAlerts.tsx b/frontend/src/hooks/useAlerts.tsx index c66d920..5705b0e 100644 --- a/frontend/src/hooks/useAlerts.tsx +++ b/frontend/src/hooks/useAlerts.tsx @@ -5,6 +5,7 @@ import { toast } from 'sonner'; import { Bell } from 'lucide-react'; import api from '@/lib/api'; import { getRelativeTime } from '@/lib/date-utils'; +import SnoozeDropdown from '@/components/reminders/SnoozeDropdown'; import type { Reminder } from '@/types'; const MAX_TOASTS = 3; @@ -102,19 +103,11 @@ export function AlertsProvider({ children }: { children: ReactNode }) {

{reminder.title}

{timeAgo}

-
-
- {[5, 10, 15].map((m) => ( - - ))} -
+
+ snoozeRef.current(reminder.id, m)} + label={reminder.title} + />