--- phase: 04-frontend plan: 02 type: execute wave: 2 depends_on: - 04-01 files_modified: - frontend/src/App.tsx autonomous: false requirements: - ALRT-03 - ANLY-02 - HLTH-01 must_haves: truths: - "Alert banner appears above tab navigation when there are active critical alerts" - "Alert banner disappears immediately after admin clicks Acknowledge (optimistic update)" - "Monitoring tab shows health status indicators and processing analytics from Supabase backend" - "Non-admin user on monitoring tab sees Access Denied, not the dashboard" - "Alert fetching only happens for admin users (gated by isAdmin check)" artifacts: - path: "frontend/src/App.tsx" provides: "Dashboard with AlertBanner wired above nav and AdminMonitoringDashboard in monitoring tab" contains: "AlertBanner" key_links: - from: "frontend/src/App.tsx" to: "frontend/src/components/AlertBanner.tsx" via: "import and render above nav" pattern: "import.*AlertBanner" - from: "frontend/src/App.tsx" to: "frontend/src/components/AdminMonitoringDashboard.tsx" via: "import and render in monitoring tab" pattern: "import.*AdminMonitoringDashboard" - from: "frontend/src/App.tsx" to: "frontend/src/services/adminService.ts" via: "getAlerts call in Dashboard useEffect" pattern: "adminService\\.getAlerts" --- Wire AlertBanner and AdminMonitoringDashboard into the Dashboard component in App.tsx. Add alert state management with optimistic acknowledge. Replace the monitoring tab content from UploadMonitoringDashboard to AdminMonitoringDashboard. Purpose: This completes the frontend delivery of ALRT-03 (in-app alert banner), ANLY-02 (processing metrics UI), and HLTH-01 (health status UI). Output: Fully wired admin monitoring UI visible in the application. @/home/jonathan/.claude/get-shit-done/workflows/execute-plan.md @/home/jonathan/.claude/get-shit-done/templates/summary.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/04-frontend/04-RESEARCH.md @.planning/phases/04-frontend/04-01-SUMMARY.md @frontend/src/App.tsx Task 1: Wire AlertBanner and AdminMonitoringDashboard into Dashboard frontend/src/App.tsx Modify the Dashboard component in `frontend/src/App.tsx` with these changes: **1. Add imports** (at the top of the file): ```typescript import AlertBanner from './components/AlertBanner'; import AdminMonitoringDashboard from './components/AdminMonitoringDashboard'; ``` Import `AlertEvent` type from `./services/adminService`. The `UploadMonitoringDashboard` import can be removed since the monitoring tab will now use `AdminMonitoringDashboard`. **2. Add alert state** inside the Dashboard component, after the existing state declarations: ```typescript const [activeAlerts, setActiveAlerts] = useState([]); ``` **3. Add alert fetching useEffect** — MUST be gated by `isAdmin` (RESEARCH Pitfall 5): ```typescript useEffect(() => { if (isAdmin) { adminService.getAlerts().then(setActiveAlerts).catch(() => {}); } }, [isAdmin]); ``` **4. Add handleAcknowledge callback** — uses optimistic update (RESEARCH Pitfall 2): ```typescript const handleAcknowledge = async (id: string) => { setActiveAlerts(prev => prev.filter(a => a.id !== id)); try { await adminService.acknowledgeAlert(id); } catch { // On failure, re-fetch to restore correct state adminService.getAlerts().then(setActiveAlerts).catch(() => {}); } }; ``` **5. Render AlertBanner ABOVE the `