From bda02039a6228f366e6a6dafff8bf0255cc06705 Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Tue, 17 Mar 2026 20:08:56 +0800 Subject: [PATCH] Clear mini calendar selection on main calendar navigation Clicking Today/prev/next on the toolbar now clears the selected day in the mini calendar, so only the today highlight remains visible. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/calendar/MiniCalendar.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/calendar/MiniCalendar.tsx b/frontend/src/components/calendar/MiniCalendar.tsx index 39ec6ab..ca04921 100644 --- a/frontend/src/components/calendar/MiniCalendar.tsx +++ b/frontend/src/components/calendar/MiniCalendar.tsx @@ -44,14 +44,15 @@ const MiniCalendar = memo(function MiniCalendar({ ); const [selectedDate, setSelectedDate] = useState(null); - // Sync displayed month when main calendar navigates across months - // selectedDate is only set by user clicks in the mini calendar, not by external navigation + // Sync displayed month when main calendar navigates (toolbar prev/next/today) + // Also clear selected date — avoids stale highlight after "Today" click useEffect(() => { if (!currentDate) return; const incoming = startOfMonth(parseDate(currentDate)); setDisplayedMonth((prev) => prev.getTime() === incoming.getTime() ? prev : incoming ); + setSelectedDate(null); }, [currentDate, parseDate]); const days = useMemo(