From 5434656e03d39d34d4fab5c0746bbce4f75b3a9b Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:19:04 +0200 Subject: [PATCH] feat: bring a tapped reminder's day into view in the calendar --- src/screens/CalendarScreen.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/screens/CalendarScreen.tsx b/src/screens/CalendarScreen.tsx index e5c885e9..af9c829e 100644 --- a/src/screens/CalendarScreen.tsx +++ b/src/screens/CalendarScreen.tsx @@ -249,8 +249,15 @@ export default function CalendarScreen() { // Task to open in the tasks sheet when a task chip on the grid is tapped. const [tasksInitialId, setTasksInitialId] = React.useState(null); // A tapped reminder notification opens its event or task here. + // Set to jumpTo below; a reminder resolves asynchronously. + const jumpToRef = React.useRef<(date: Date) => void>(() => {}); useCalendarReminderOpen({ - onEvent: setDetailEvent, + onEvent: (event) => { + setDetailEvent(event); + // Its day comes into view behind the sheet. + const start = getEventStartDate(event); + if (!isNaN(start.getTime())) jumpToRef.current(start); + }, onTask: (id) => { setTasksInitialId(id); setTasksVisible(true); }, }); const toggleCalendarVisibility = useCalendarStore((s) => s.toggleCalendarVisibility); @@ -447,6 +454,7 @@ export default function CalendarScreen() { }, [viewMode, windowOptions], ); + jumpToRef.current = jumpTo; // The grids add their rows for the wider window right away (the events // follow); the agenda waits for one extension to load before the next.