# 020 — Alerts webapp UI ## Summary A webapp page for managing `AlertRule`s ([017](017-ntfy-alerts.md)) end to end: create/edit/enable/delete rules and configure their ntfy sink, without touching `settings.json` by hand. ## Scope - A new route/panel (matching how `Dashboards`/`Metrics` are already surfaced in `App.tsx`) listing existing alert rules: name, condition summary, enabled state. - A rule editor: - Condition type picker (Immediate / Threshold / New value / Ratio, see [018](018-alert-trigger-evaluation.md)) with type-specific fields, reusing `FilterBar`'s query input for the query-based conditions rather than a separate text field. - Ntfy sink fields: topic and optional server override. - Enabled toggle. - "Send test notification" button wired to the sink delivery endpoint from [019](019-ntfy-sink-delivery.md), so a topic/server can be verified without waiting for a real trigger. - Contextual "?" help icons on the condition-type picker and sink fields, matching [021](021-docs-contextual-help.md)'s pattern. ## Acceptance criteria - Rules created/edited/deleted in the UI persist across a page reload (i.e. round-trip through the CRUD endpoints from 017). - Each condition type's fields validate before save (e.g. Ratio requires two queries and a threshold). - "Send test notification" delivers to the currently-entered topic/server without requiring the rule to be saved first. ## Depends on - [017 — Alert definitions & settings persistence](017-ntfy-alerts.md) - [018 — Alert trigger evaluation](018-alert-trigger-evaluation.md) - [019 — Ntfy sink delivery](019-ntfy-sink-delivery.md) - [021 — Docs contextual help](021-docs-contextual-help.md)