Refetch dashboard panels on the shared polling cadence

PanelPreview only refetched its PromQL series when panel.promql,
chart_type, or range bounds changed, so panels went stale under a
fixed range or between rolling-preset ticks that didn't move the
window. Add a POLL_MS-driven tick folded into the same fetch effect
(alongside the existing deps) so it refreshes on the same cadence as
App.tsx's log/timeline polling without double-fetching when a range
change and a tick coincide. POLL_MS is now shared via
webapp/src/lib/polling.ts instead of living only in App.tsx.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
Hugh Kaznowski
2026-09-05 19:33:56 +01:00
co-authored by Claude Sonnet 5
parent e6e5bc8f50
commit 68a18a286f
3 changed files with 20 additions and 4 deletions
+4
View File
@@ -0,0 +1,4 @@
/// Shared polling cadence for the whole app — the log/timeline poll in `App.tsx` and any
/// other section that should refresh on the same rhythm (e.g. dashboard panels) import this
/// instead of hardcoding their own interval, so they can never drift apart.
export const POLL_MS = 2000