Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Use current recency for active Patrol findings
rcourtman998f7e5e9041
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 7cfccba992..a96611ab09 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -203,6 +203,11 @@ separators rather than CSS-only spacing. Badge counts should preserve readableplain-text output such as `Findings 1` and `Runs 30`, and metadata trailsshould use textual separators like `· acknowledged 22d ago` so copied orextracted Patrol output does not collapse words together.+That same findings contract must preserve and use `last_seen_at` for active+Patrol findings. Recurring active issues should read as `last seen ...` and+sort by current observation recency rather than presenting only the original+`detected_at`, which makes still-active Patrol service issues look stale when+they were re-observed on recent runs.That same finding row should avoid redundant state stacking. When an activefinding is already explicitly marked `Acknowledged`, the UI should not also addthe baseline `detected` loop-state badge beside it; loop-state badges only adddiff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsxindex b744505d15..cf5d27d31d 100644--- a/frontend-modern/src/components/AI/FindingsPanel.tsx+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx@@ -43,6 +43,7 @@ import {getFindingStatusLabel,getFindingSourceBadgeClasses,getFindingSourceLabel,+ getFindingRecencyPresentation,hasFindingInvestigationDetails,getInvestigationOutcomeBadgeClasses,getInvestigationOutcomeLabel,@@ -194,7 +195,9 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {if (aAcked !== bAcked) return aAcked - bAcked;}- return new Date(b.detectedAt).getTime() - new Date(a.detectedAt).getTime();+ const aRecency = getFindingRecencyPresentation(a);+ const bRecency = getFindingRecencyPresentation(b);+ return new Date(bRecency.timestamp).getTime() - new Date(aRecency.timestamp).getTime();});// Limit items@@ -396,8 +399,11 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {};// Render a single finding item- const renderFindingItem = (finding: UnifiedFinding, showSourceBadge: boolean = false) => (- <div+ const renderFindingItem = (finding: UnifiedFinding, showSourceBadge: boolean = false) => {+ const recency = getFindingRecencyPresentation(finding);++ return (+ <divid={`finding-${finding.id}`}class={`p-3 cursor-pointer transition-colors ${finding.status === 'active'@@ -536,7 +542,8 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {</div>{/* Resource info */}<div class="text-xs text-muted mt-1">- {finding.resourceName} ({finding.resourceType}) - {formatTime(finding.detectedAt)}+ {finding.resourceName} ({finding.resourceType}) - {recency.label}{' '}+ {formatTime(recency.timestamp)}<Show when={finding.status === 'resolved' && finding.resolvedAt}><span class="ml-2 text-green-600 dark:text-green-400">{' · '}@@ -638,8 +645,9 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {{/* Expanded content */}<Show when={expandedId() === finding.id}>{renderExpandedContent(finding)}</Show>- </div>- );+ </div>+ );+ };// Render expanded content for a findingconst renderExpandedContent = (finding: UnifiedFinding) => (diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.tsindex 7bb50a8216..ddcb867272 100644--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts@@ -9,6 +9,7 @@ import {getFindingSeverityCompactLabel,getFindingSeveritySortOrder,getFindingResolutionReason,+ getFindingRecencyPresentation,getFindingLoopStateBadgeClasses,getFindingSeverityBadgeClasses,getFindingStatusBadgeClasses,@@ -129,6 +130,34 @@ describe('aiFindingPresentation', () => {});});+ describe('findingRecencyPresentation', () => {+ it('uses last seen recency for active findings', () => {+ expect(+ getFindingRecencyPresentation({+ status: 'active',+ detectedAt: '2026-03-01T00:00:00Z',+ lastSeenAt: '2026-03-25T12:00:00Z',+ }),+ ).toEqual({+ label: 'last seen',+ timestamp: '2026-03-25T12:00:00Z',+ });+ });++ it('falls back to detected recency for inactive findings', () => {+ expect(+ getFindingRecencyPresentation({+ status: 'resolved',+ detectedAt: '2026-03-01T00:00:00Z',+ lastSeenAt: '2026-03-25T12:00:00Z',+ }),+ ).toEqual({+ label: 'detected',+ timestamp: '2026-03-01T00:00:00Z',+ });+ });+ });+describe('filterPresentation', () => {it('builds canonical filter options', () => {expect(@@ -209,6 +238,12 @@ describe('aiFindingPresentation', () => {"!(finding.acknowledgedAt && finding.loopState === 'detected')",);});++ it('uses canonical finding recency presentation instead of raw detected timestamps for active rows', () => {+ expect(findingsPanelSource).toContain('const recency = getFindingRecencyPresentation(finding);');+ expect(findingsPanelSource).toContain("{recency.label}{' '}");+ expect(findingsPanelSource).toContain('{formatTime(recency.timestamp)}');+ });});describe('sourceColors', () => {diff --git a/frontend-modern/src/stores/__tests__/aiIntelligence.test.ts b/frontend-modern/src/stores/__tests__/aiIntelligence.test.tsindex afb7f662f2..378b0cd441 100644--- a/frontend-modern/src/stores/__tests__/aiIntelligence.test.ts+++ b/frontend-modern/src/stores/__tests__/aiIntelligence.test.ts@@ -48,6 +48,7 @@ describe('aiIntelligenceStore', () => {title: 'CPU high',description: 'CPU usage is high',detected_at: '2026-03-01T00:00:00Z',+ last_seen_at: '2026-03-05T00:00:00Z',alertIdentifier: 'instance:node:100::metric/cpu',},],@@ -59,6 +60,7 @@ describe('aiIntelligenceStore', () => {expect(aiIntelligenceStore.findings).toHaveLength(1);expect(aiIntelligenceStore.findings[0]).toMatchObject({alertIdentifier: 'instance:node:100::metric/cpu',+ lastSeenAt: '2026-03-05T00:00:00Z',});});diff --git a/frontend-modern/src/stores/aiIntelligence.ts b/frontend-modern/src/stores/aiIntelligence.tsindex 97873442b4..e164b9105f 100644--- a/frontend-modern/src/stores/aiIntelligence.ts+++ b/frontend-modern/src/stores/aiIntelligence.ts@@ -111,6 +111,7 @@ export interface UnifiedFinding {description: string;recommendation?: string;detectedAt: string;+ lastSeenAt?: string;resolvedAt?: string;acknowledgedAt?: string;snoozedUntil?: string;@@ -290,6 +291,7 @@ export const aiIntelligenceStore = {description: item.description,recommendation: item.recommendation,detectedAt: item.detected_at,+ lastSeenAt: item.last_seen_at || item.detected_at,resolvedAt: item.resolved_at,acknowledgedAt: item.acknowledged_at,snoozedUntil: item.snoozed_until,diff --git a/frontend-modern/src/utils/aiFindingPresentation.ts b/frontend-modern/src/utils/aiFindingPresentation.tsindex bb4a25abb7..11598b8b0c 100644--- a/frontend-modern/src/utils/aiFindingPresentation.ts+++ b/frontend-modern/src/utils/aiFindingPresentation.ts@@ -196,6 +196,11 @@ export interface FindingEmptyStateCopy {body?: string;}+export interface FindingRecencyPresentation {+ label: string;+ timestamp: string;+}+export const getFindingSourceLabel = (source: UnifiedFinding['source'] | string): string =>FINDING_SOURCE_LABELS[source] || source;@@ -224,6 +229,22 @@ export const getFindingSeverityCompactLabel = (severity: UnifiedFinding['severity'] | string,): string => FINDING_SEVERITY_COMPACT_LABELS[severity] || String(severity).toUpperCase();+export const getFindingRecencyPresentation = (+ finding: Pick<UnifiedFinding, 'status' | 'detectedAt' | 'lastSeenAt'>,+): FindingRecencyPresentation => {+ if (finding.status === 'active' && finding.lastSeenAt) {+ return {+ label: 'last seen',+ timestamp: finding.lastSeenAt,+ };+ }++ return {+ label: 'detected',+ timestamp: finding.detectedAt,+ };+};+export const getInvestigationStatusBadgeClasses = (status: InvestigationStatus): string =>INVESTIGATION_STATUS_CLASSES[status] || DEFAULT_BADGE_CLASSES;