mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-25 13:10:13 +00:00
f9da241f18
Dedupe the copy-pasted Global-Admin scope apparatus across 8 pages (audit finding #4). New shared primitives: useTenantList (the byte-identical tenant fetch+sort), useGlobalAdminScope (override variant), useAggregatedAdminScope (aggregated 'All tenants' variant with URL seed), plus GlobalAdminBanner + TenantScopeSelector. Migrated: gather-rules, analyze-rules, sla, usage-metrics (override) and fleet-health, geographic-performance, apps, apps/[appName] (aggregated, incl. ?global=1 deep-link). Behaviour preserved (endpoints, aggregated view, dynamic banner) after reading every page in full to prove the variant taxonomy. Review fixes: useAggregatedAdminScope re-defaults selection on GA-mode toggle via render-time state adjustment (no committed render exposes a stale scope -> no aggregated/own-tenant fetch race) and exposes a stable scopeKey the page fetch effects depend on; TenantScopeSelector gains an opt-in 'themed' prop so the SLA dark header keeps its dark-mode classes without affecting the light-only pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>