From 8ee9c53b83884005887529aeff74547f28a67a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 11 Jul 2026 10:39:24 +0200 Subject: [PATCH] fix(dashboard): refetch the snapshot on window focus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dashboard is exactly the surface a user leaves open in a background tab while editing its tile selection elsewhere; with focus refetch off, the stale layout sat visible for up to the poll interval — a save appeared to do nothing, then 'worked' minutes later. staleTime still bounds the refetch to once a minute and the server side is SWR-cached, so a focus flick is a cheap cache hit. Chart batch series stay on the poll (heavier payloads; the tile selection itself lives on the snapshot query). --- src/app/page-client.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/page-client.tsx b/src/app/page-client.tsx index 980498c04..f4cb973a6 100644 --- a/src/app/page-client.tsx +++ b/src/app/page-client.tsx @@ -65,7 +65,13 @@ import { VorsorgeDashboardCard } from "@/components/measurement-reminders/vorsor // but the slot is one future-callback-field away from cache poisoning. const DASHBOARD_QUERY_OPTS = { staleTime: 60_000, - refetchOnWindowFocus: false, + // v1.28.28 — refetch on window focus: the dashboard is exactly the surface + // a user leaves open in a background tab while editing its tile selection + // elsewhere; without a focus refetch the stale layout sat visible for up to + // the poll interval ("saved but nothing changed"). staleTime still bounds + // the cost to at most one refetch per minute, and the server side is SWR- + // cached, so a focus flick is a cheap cache hit. + refetchOnWindowFocus: true, } as const; // v1.19.0 — day-span the batched dashboard series (`series-batch`) fetches.