From 35fea645b6ba13cde2b5778038d69ccaf21adfd0 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:14:55 +0200 Subject: [PATCH] =?UTF-8?q?fix(ui/alerts):=20InboxPage=20polish=20?= =?UTF-8?q?=E2=80=94=20status=20colors,=20selected-scrub=20on=20delete,=20?= =?UTF-8?q?drop=20stale=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - STATE_ITEMS gains color dots (text-muted/error/success) to match SEVERITY_ITEMS - onDeleteOne removes the deleted id from the selection Set so a follow-up bulk action doesn't try to re-delete a tombstoned row - drop stale comment block that described an alternative SilenceRulesForSelection implementation not matching the shipped code Co-Authored-By: Claude Opus 4.7 (1M context) --- ui/src/pages/Alerts/InboxPage.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/src/pages/Alerts/InboxPage.tsx b/ui/src/pages/Alerts/InboxPage.tsx index 38b26fb3..e548018e 100644 --- a/ui/src/pages/Alerts/InboxPage.tsx +++ b/ui/src/pages/Alerts/InboxPage.tsx @@ -34,9 +34,9 @@ const SEVERITY_ITEMS: ButtonGroupItem[] = [ ]; const STATE_ITEMS: ButtonGroupItem[] = [ - { value: 'PENDING', label: 'Pending' }, - { value: 'FIRING', label: 'Firing' }, - { value: 'RESOLVED', label: 'Resolved' }, + { value: 'PENDING', label: 'Pending', color: 'var(--text-muted)' }, + { value: 'FIRING', label: 'Firing', color: 'var(--error)' }, + { value: 'RESOLVED', label: 'Resolved', color: 'var(--success)' }, ]; // ── Bulk silence helper ───────────────────────────────────────────────────── @@ -90,12 +90,6 @@ function SilenceRulesForSelection({ selected, rows }: SilenceRulesForSelectionPr const handleCustom = () => navigate('/alerts/silences'); - // Render ONE SilenceRuleMenu that uses the first ruleId as its anchor but - // overrides the click handlers to fire against all selected rule IDs. - // We use a Dropdown-equivalent by wiring SilenceRuleMenu with the first - // ruleId; for bulk we drive our own mutation loop above. - // Since SilenceRuleMenu is self-contained, we render a parallel Button set - // for the bulk path to keep it clean. return (
{SILENCE_PRESETS.map(({ label, hours }) => ( @@ -200,6 +194,12 @@ export default function InboxPage() { const onDeleteOne = async (id: string) => { try { await del.mutateAsync(id); + setSelected((prev) => { + if (!prev.has(id)) return prev; + const next = new Set(prev); + next.delete(id); + return next; + }); // No built-in action slot in DS toast — render Undo as a Button node const undoNode = (