Skip to content

add dismiss/undo for system health dashboard warnings - #6399

Merged
atomantic merged 2 commits into
mainfrom
cos/task-mtq19ozo/agent-0c056826
Sep 6, 2026
Merged

add dismiss/undo for system health dashboard warnings#6399
atomantic merged 2 commits into
mainfrom
cos/task-mtq19ozo/agent-0c056826

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • The Live health page and dashboard widget recompute warnings fresh on every read, so a stale-but-still-true condition (e.g. a crash-loop restart count that hasn't reset) had no way to be cleared from view.
  • Adds a dismiss control on each warning (dashboard widget and the /system-resources/overview page). Dismissing records the warning's (type, message) pair server-side; the next read hides it as long as that exact occurrence recurs, and auto-un-dismisses (pruning the stale record) once the condition changes or clears — so a genuinely new occurrence is never silently hidden.
  • An Undo toast reverses a dismissal immediately.
  • New endpoints: POST/DELETE /api/system/health/warnings/:type/dismiss.
  • Extracted the shared dismiss/undo logic into a useHealthWarningDismiss hook (used by both surfaces), and consolidated the server-side settings.health merge idiom into one patchHealth helper.

Test plan

  • server/routes/health.test.js: new coverage for suppress-on-match, show-again-on-different-message, stale-dismissal pruning, and the dismiss/undo endpoints (invalid type, missing message).
  • client/src/components/SystemHealthWidget.test.jsx and client/src/pages/SystemHealthPage.test.jsx: dismiss + refetch, and error-toast-on-failure.
  • Full server (npm test in server/) and client (npm test in client/) suites pass.

Warnings on the Live health page and dashboard widget are recomputed
fresh every read, so a stale-but-still-true condition (e.g. a crash-loop
restart count that hasn't reset) stuck around with no way to clear it.
Dismissing a warning now records its (type, message) pair server-side;
the next read hides it as long as that exact occurrence recurs, and
auto-un-dismisses (with the stale record pruned) once the condition
changes or clears, so a genuinely new occurrence is never silently
hidden. An Undo toast reverses a dismissal immediately.
The Undo toast's request had no .catch, so a failed undo silently
no-oped while the toast still disappeared, leaving the user unaware
the warning wasn't actually restored.
@atomantic
atomantic merged commit 72ff452 into main Sep 6, 2026
12 checks passed
@atomantic
atomantic deleted the cos/task-mtq19ozo/agent-0c056826 branch September 6, 2026 17:05
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