SIGN IN SIGN UP

perf(frontend): stop dashboard polling while the window is hidden (#1967)

Storage health polled every 10s and 60s, and external component guidance
every 60s, through ungated `setInterval` timers. A window closed to the
tray keeps its WebView resident, so those timers kept driving IPC, state
updates, and layout for a surface nobody was looking at. WebKit throttles
hidden-page timers only down to a ~1s floor, which does not slow an
interval that is already longer than that.

Route the three timers through `startVisiblePolling`, which mirrors the
visibility gating `ProcessPollingCoordinator` and `useHardwareEventListener`
already apply: poll while the document is visible, clear the interval while
it is hidden, and refresh immediately on resume so a returning surface does
not show the value it was hidden with.

Measured on macOS (M4) with the window hidden: WebContent CPU 1.5-3.7% ->
a flat 0.0%. In the mocked frontend, `get_live_storage_health` over 27s
hidden went from 4 calls to 0.

Refs #1960
S
shm committed
e9bf304d3785e50e879554e0fbaa1aba16aa6a91
Parent: fce1b29
Committed by GitHub <noreply@github.com> on 8/22/2026, 4:13:49 AM