7.3 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 04-frontend | 02 | execute | 2 |
|
|
false |
|
|
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.
<execution_context> @/home/jonathan/.claude/get-shit-done/workflows/execute-plan.md @/home/jonathan/.claude/get-shit-done/templates/summary.md </execution_context>
@.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):
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:
const [activeAlerts, setActiveAlerts] = useState<AlertEvent[]>([]);
3. Add alert fetching useEffect — MUST be gated by isAdmin (RESEARCH Pitfall 5):
useEffect(() => {
if (isAdmin) {
adminService.getAlerts().then(setActiveAlerts).catch(() => {});
}
}, [isAdmin]);
4. Add handleAcknowledge callback — uses optimistic update (RESEARCH Pitfall 2):
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 <nav> element (RESEARCH Pitfall 1 — must be above nav, not inside a tab):
Inside the Dashboard return JSX, immediately after <div className="min-h-screen bg-gray-50"> and before the {/* Navigation */} comment and <nav> element, add:
{isAdmin && activeAlerts.length > 0 && (
<AlertBanner alerts={activeAlerts} onAcknowledge={handleAcknowledge} />
)}
6. Replace monitoring tab content: Change:
{activeTab === 'monitoring' && isAdmin && (
<UploadMonitoringDashboard />
)}
To:
{activeTab === 'monitoring' && isAdmin && (
<AdminMonitoringDashboard />
)}
7. Keep the existing non-admin access-denied fallback for {activeTab === 'monitoring' && !isAdmin && (...)} — do not change it.
Do NOT change:
- The
analyticstab content (still renders existing<Analytics />) - Any other tab content
- The tab navigation buttons
- Any other Dashboard state or logic
cd /home/jonathan/Coding/cim_summary/frontend && npx tsc --noEmit 2>&1 | head -30
Run
npm run devand verify: (1) AlertBanner shows above nav if alerts exist, (2) Monitoring tab shows health grid and analytics panel, (3) Non-admin sees Access Denied on monitoring tab AlertBanner renders above nav for admin users with active alerts; monitoring tab shows AdminMonitoringDashboard with health status and analytics; non-admin access denied preserved
<success_criteria> Admin user sees health indicators and processing metrics on the Monitoring tab. Alert banner appears above navigation when active critical alerts exist. Acknowledge removes the alert banner immediately. Non-admin users see Access Denied on admin tabs. </success_criteria>
After completion, create `.planning/phases/04-frontend/04-02-SUMMARY.md`