perf: UX-safe fetch trimming and instant layer-enable refresh.

Drop duplicate slow-tier weather/ukraine jobs, gate correlations when off, slim health probes, keyed layer-panel subscriptions, align backend layer defaults with the dashboard, and fetch CCTV/FIRMS/PSK/etc. synchronously on enable so toggles stay responsive without background prefetch waste.
This commit is contained in:
BigBodyCobain
2026-06-23 00:16:38 -06:00
parent 4968f706bb
commit 53ed63ffcf
12 changed files with 532 additions and 59 deletions
+55 -2
View File
@@ -143,8 +143,61 @@ import type {
KiwiSDR,
Scanner,
TrackedFlight,
DashboardData,
} from '@/types/dashboard';
import { useDataSnapshot } from '@/hooks/useDataStore';
import { useDataKeys } from '@/hooks/useDataStore';
/** Keys the layer panel reads — avoids re-rendering on unrelated fast-poll keys. */
const WORLDVIEW_PANEL_DATA_KEYS = [
'ships',
'sigint_totals',
'sigint',
'cctv_total',
'cctv',
'satnogs_total',
'satnogs_stations',
'tinygs_total',
'tinygs_satellites',
'tracked_flights',
'commercial_flights',
'private_flights',
'private_jets',
'military_flights',
'gps_jamming',
'fishing_activity',
'satellite_source',
'satellite_analysis',
'satellites',
'road_corridor_trends',
'earthquakes',
'firms_fires',
'ukraine_alerts',
'weather_alerts',
'volcanoes',
'air_quality',
'sar_anomalies',
'sar_scenes',
'uap_sightings',
'wastewater',
'datacenters',
'internet_outages',
'power_plants',
'military_bases',
'trains',
'malware_threats',
'scm_suppliers',
'cyber_threats',
'kiwisdr',
'psk_reporter',
'scanners',
'frontlines',
'gdelt',
'telegram_osint',
'crowdthreat',
'correlations',
'gt_risk',
'freshness',
] as const satisfies readonly (keyof DashboardData)[];
// ---------------------------------------------------------------------------
// ScannerTracker — in-app audio player for tracked police scanner systems
@@ -699,7 +752,7 @@ const WorldviewLeftPanel = React.memo(function WorldviewLeftPanel({
onOpenSarAoiEditor?: () => void;
viewBoundsRef?: React.RefObject<{ south: number; west: number; north: number; east: number } | null>;
}) {
const data = useDataSnapshot() as import('@/types/dashboard').DashboardData;
const data = useDataKeys(WORLDVIEW_PANEL_DATA_KEYS) as DashboardData;
const { t } = useTranslation();
const [internalMinimized, setInternalMinimized] = useState(true);
const isMinimized = isMinimizedProp !== undefined ? isMinimizedProp : internalMinimized;