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
Scope Patrol conditional filters to run snapshots
rcourtman42ada116cbf9
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex c6aa36bc69..86132507bd 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -259,6 +259,11 @@ That same snapshot scoping must also apply to the `Findings` tab badge itself.When the selected run carries an explicit empty `finding_ids` snapshot, or whenthe run lacks snapshot ids entirely, the tab must fail closed instead ofborrowing global active-finding counts and tones from outside the selected run.+That same scoped count model must drive conditional findings filters too. The+`Needs Attention` and `Approvals` buckets, their counts, and the auto-reset+logic that returns the operator to `Active` when a bucket disappears must all+read from the same snapshot-aware count source rather than mixing+snapshot-scoped pills with global queue truth.That same findings surface should keep its section chrome functional ratherthan promotional. Inside the Patrol findings tab, the selected tab alreadynames the surface, so the findings card should not add another in-card productdiff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsxindex 926e9777b9..02d9f7e775 100644--- a/frontend-modern/src/components/AI/FindingsPanel.tsx+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx@@ -144,16 +144,6 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {}});- // Auto-reset filter when the conditional filter buttons disappear- createEffect(() => {- if (filter() === 'attention' && aiIntelligenceStore.needsAttentionCount === 0) {- setFilter('active');- }- if (filter() === 'approvals' && aiIntelligenceStore.pendingApprovalCount === 0) {- setFilter('active');- }- });-// Filter and sort findingsconst filteredFindings = createMemo(() => {let findings = [...aiIntelligenceStore.findings];@@ -253,21 +243,20 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {);return runSnapshotScopedPatrolFindings().filter((finding) => approvalIds.has(finding.id)).length;});+ const filterCounts = createMemo(() => ({+ needsAttentionCount: useRunSnapshotScopedControls()+ ? scopedNeedsAttentionCount()+ : aiIntelligenceStore.needsAttentionCount,+ pendingApprovalCount: useRunSnapshotScopedControls()+ ? scopedPendingApprovalCount()+ : aiIntelligenceStore.pendingApprovalCount,+ }));const patrolFindings = createMemo(() =>filteredFindings().filter((f) => f.source !== 'threshold' && !f.isThreshold && !hasTriggeringAlert(f),),);- const filterOptions = createMemo(() =>- buildFindingFilterOptions({- needsAttentionCount: useRunSnapshotScopedControls()- ? scopedNeedsAttentionCount()- : aiIntelligenceStore.needsAttentionCount,- pendingApprovalCount: useRunSnapshotScopedControls()- ? scopedPendingApprovalCount()- : aiIntelligenceStore.pendingApprovalCount,- }),- );+ const filterOptions = createMemo(() => buildFindingFilterOptions(filterCounts()));const emptyStateCopy = createMemo(() =>getPatrolFindingsEmptyState({filter: filter(),@@ -278,16 +267,25 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {}),);const emptyStateTone = createMemo(() => getSemanticTonePresentation(emptyStateCopy().tone));+ // Auto-reset filter when the conditional filter buttons disappear+ createEffect(() => {+ if (filter() === 'attention' && filterCounts().needsAttentionCount === 0) {+ setFilter('active');+ }+ if (filter() === 'approvals' && filterCounts().pendingApprovalCount === 0) {+ setFilter('active');+ }+ });const showFilterControls = createMemo(() =>props.showControls !== false &&(useRunSnapshotScopedControls()? runSnapshotScopedPatrolFindings().length > 0 ||- scopedNeedsAttentionCount() > 0 ||- scopedPendingApprovalCount() > 0+ filterCounts().needsAttentionCount > 0 ||+ filterCounts().pendingApprovalCount > 0: allPatrolFindings().length > 0 ||- aiIntelligenceStore.needsAttentionCount > 0 ||- aiIntelligenceStore.pendingApprovalCount > 0),+ filterCounts().needsAttentionCount > 0 ||+ filterCounts().pendingApprovalCount > 0),);const isOutOfScope = (finding: UnifiedFinding): boolean => {diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.tsindex adbb750c1f..6d8bb1ef08 100644--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts@@ -464,14 +464,23 @@ describe('aiFindingPresentation', () => {expect(findingsPanelSource).toContain('const showFilterControls = createMemo(');expect(findingsPanelSource).toContain('const useRunSnapshotScopedControls = createMemo(');expect(findingsPanelSource).toContain('const runSnapshotScopedPatrolFindings = createMemo(');- expect(findingsPanelSource).toContain('scopedNeedsAttentionCount()');- expect(findingsPanelSource).toContain('scopedPendingApprovalCount()');+ expect(findingsPanelSource).toContain('const filterCounts = createMemo(() => ({');+ expect(findingsPanelSource).toContain('filterCounts().needsAttentionCount > 0');+ expect(findingsPanelSource).toContain('filterCounts().pendingApprovalCount > 0');expect(findingsPanelSource).toContain('allPatrolFindings().length > 0');- expect(findingsPanelSource).toContain('aiIntelligenceStore.needsAttentionCount > 0');- expect(findingsPanelSource).toContain('aiIntelligenceStore.pendingApprovalCount > 0');expect(findingsPanelSource).toContain('<Show when={showFilterControls()}>');});+ it('auto-resets conditional filters from the same scoped count model used by the filter bar', () => {+ expect(findingsPanelSource).toContain(+ "if (filter() === 'attention' && filterCounts().needsAttentionCount === 0)",+ );+ expect(findingsPanelSource).toContain(+ "if (filter() === 'approvals' && filterCounts().pendingApprovalCount === 0)",+ );+ expect(findingsPanelSource).toContain('buildFindingFilterOptions(filterCounts())');+ });+it('uses explicit textual separators in finding metadata instead of relying on visual spacing', () => {expect(findingsPanelSource).toContain("{' · '}acknowledged");expect(findingsPanelSource).toContain("{' · '}last investigated");