From d0bf6d18bcdb554f19807403d1451ff7bf880538 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 26 Jul 2026 00:00:11 +0000 Subject: [PATCH] Auto-refresh sidebar data so a stale tab picks up backend polls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verified the PoE2 24h-change computation itself is correct (simulated 24+ hours of real hourly polling against the actual recordRate/ rateAtOrBefore/markPolled functions — change24h starts populating right on schedule at hour 24). The real problem: weather/stocks/poe2/ bookmarks are only fetched once when the layout first loads. SvelteKit never re-runs a load() on its own — only on navigation or explicit invalidation — so a browser tab left open never sees any of those widgets update no matter how long the backend has been polling. Named the layout's load() dependency ('app:sidebar') and invalidate just that on a 5-minute timer, rather than invalidateAll() — which would also re-run page-level loads and could reset things like the home feed's own pagination state on every refresh. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014c1L8ghNBFjfiH64UMViP8 --- frontend/src/routes/+layout.svelte | 14 +++++++++++++- frontend/src/routes/+layout.ts | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index e030e52..80859e7 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -1,7 +1,8 @@