Portal calendar auto-refresh
Notes
- 2026-09-24: The calendar and Route Board now refresh themselves. Both pages used to fetch once per view change and never again, so a tab left open kept rendering the schedule as it stood at load. Surfaced when three intake approvals landed at 11:23 ET and the open calendar still showed the 11:00 picture; the data was correct throughout (projects, site_visits and /portal/calendar/events all agreed within 5 seconds of the approve). Shipped in entirely-portal a01a01b and 71d3323: poll every 60s while the tab is visible, catch up on tab focus when the last fetch is older than 30s, silent background passes (no spinner, no blanking on a transient failure, yields to a fetch in flight) so only the “Last updated” stamp moves. The calendar skips a tick mid-drag; the Route Board pauses while a suggested move is being applied. Covers /calendar, /ppdr-calendar and /route-board. The poll lives in src/lib/autoRefresh.ts (useAutoRefresh) and both pages call it rather than duplicating it; its paused and lastFetch arguments are refs, not values, because an inline predicate changes identity every render and would restart the interval before it fires.