Skip to content

5.4.b — Alert UI in Dashboard: Active Alerts widget with polling + acknowledge - #129

Merged
germanf merged 2 commits into
devfrom
feature/alert-ui
Jul 10, 2026
Merged

germanf merged 2 commits into
devfrom
feature/alert-ui

Conversation

@germanf

@germanf germanf commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Related to #125 (Phase 5.4.b)

Changes

  • Dashboard.tsx: added ActiveAlerts widget — auto-polls /api/alerts every 15s, shows unacknowledged alerts with severity dots, per-alert Ack button + Acknowledge-all
  • index.css: added .alert-warn class for warning-severity alerts

Implementation

  • Polling via setInterval with cleanup on unmount
  • Optimistic UI update on acknowledge (no refetch needed)
  • Existing CSS patterns: cards, severity dots, btn-ghost

Verification

  • pnpm run build: clean
  • pnpm run test: 37/37 pass

@germanf germanf left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tech Lead Review

Verdict: APPROVED (fixes applied)

What was fixed

  • ✅ Ack error handling: only update state on successful response, roll back on failure
  • ✅ Consistent polling: single poll() function shared across first fetch + interval
  • ✅ Removed unused .alert-warn CSS

Reviewed

  • Polling cleanup on unmount: correct (clearInterval + initial fetch)
  • Optimistic ack now gated by res.ok
  • Edge cases: empty list, all acked, critical unacked — all handled
  • Follows existing patterns (raw fetch + try/catch, matches rest of Dashboard.tsx)
  • Build: clean | Tests: 37/37 pass

Ready for CTO approval.

@germanf
germanf merged commit 7a7abd6 into dev Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant