diff --git a/src/app/alerts/[id]/AlertDetail.tsx b/src/app/alerts/[id]/AlertDetail.tsx index 92a8f5d..4476ab1 100644 --- a/src/app/alerts/[id]/AlertDetail.tsx +++ b/src/app/alerts/[id]/AlertDetail.tsx @@ -230,11 +230,6 @@ export default function AlertDetail({ initialAlert }: { initialAlert: Alert }) { )} - {/* Media type */} - {alert.mediaType && ( - - )} - {/* User (for user-behavior alerts) */} {alert.userName && !alert.mediaTitle && ( diff --git a/src/lib/db.ts b/src/lib/db.ts index 1780013..b75b3e1 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -185,6 +185,12 @@ export function upsertAlerts(candidates: AlertCandidate[]): number { alert.closeReason = "resolved"; alert.closedAt = nowISO; alert.suppressedUntil = null; + alert.comments.push({ + id: store.nextCommentId++, + body: "Condition resolved — alert closed automatically.", + createdAt: nowISO, + author: "system", + }); } save(store); @@ -221,10 +227,17 @@ export function closeAlert(id: number): Alert | null { suppressedUntil = d.toISOString(); } + const now = new Date().toISOString(); alert.status = "closed"; alert.closeReason = "manual"; - alert.closedAt = new Date().toISOString(); + alert.closedAt = now; alert.suppressedUntil = suppressedUntil; + alert.comments.push({ + id: store.nextCommentId++, + body: "Manually closed.", + createdAt: now, + author: "system", + }); save(store); return toAlert(alert); }