Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

Show unknown Patrol snapshot state in selected-run shell

rcourtman85d28db3949a
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index ba729f0076..d9ebc79da2 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -273,6 +273,10 @@ That same rule applies to the primary findings workspace when a run is
selected. A selected run without `finding_ids` must not borrow global Patrol
findings, filter buckets, or queue counts; the findings surface should enter an
explicit snapshot-unavailable state instead.
+That same unknown-snapshot state should be visible in the selected-run shell
+too. When the operator is filtered to a legacy run without findings snapshot
+ids, the selected-run banner should explicitly say that findings snapshot data
+is unavailable instead of implying a fully verifiable run-scoped findings view.
That same findings surface should keep its section chrome functional rather
than promotional. Inside the Patrol findings tab, the selected tab already
names the surface, so the findings card should not add another in-card product
diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx
index 3a22a8250f..416b5a51fd 100644
--- a/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx
+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx
@@ -92,6 +92,9 @@ export function PatrolIntelligenceWorkspace(props: { state: PatrolIntelligenceSt
<span>
Filtered to run {formatRelativeTime(run().started_at, { compact: true })} (
{formatTriggerReason(run().trigger_reason)})
+ <Show when={state.selectedRunHasFindingsSnapshot() === false}>
+ {' · '}Findings snapshot unavailable
+ </Show>
</span>
<button
type="button"
diff --git a/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts b/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts
index c2dc060acb..9fe0063699 100644
--- a/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts
+++ b/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts
@@ -435,6 +435,11 @@ export function usePatrolIntelligenceState() {
if (!run) return undefined;
return run.finding_ids;
});
+ const selectedRunHasFindingsSnapshot = createMemo(() => {
+ const run = selectedRun();
+ if (!run) return undefined;
+ return run.finding_ids !== undefined;
+ });
const selectedRunScopeResourceIds = createMemo(() => getCanonicalScopeResourceIds(selectedRun()));
const allPatrolFindings = createMemo(() =>
@@ -726,6 +731,7 @@ export function usePatrolIntelligenceState() {
saveAdvancedSettings,
selectedRun,
selectedRunFindingIds,
+ selectedRunHasFindingsSnapshot,
selectedRunScopeResourceIds,
setActiveTab,
setAdvancedSettingsRef,
diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
index 2bea676cd1..c2ab78b19b 100644
--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
@@ -1039,6 +1039,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(screen.getByText(/Filtered to run/i)).toBeInTheDocument();
});
+ expect(screen.queryByText('Findings snapshot unavailable')).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Findings' }).textContent).toBe('Findings');
expect(findingsPanelState.latestProps).toMatchObject({
@@ -1101,6 +1102,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(screen.getByText(/Filtered to run/i)).toBeInTheDocument();
});
+ expect(screen.queryByText('Findings snapshot unavailable')).not.toBeInTheDocument();
expect(findingsPanelState.latestProps).toMatchObject({
filterOverride: 'all',
filterFindingIds: [],
@@ -1170,6 +1172,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(screen.getByText(/Filtered to run/i)).toBeInTheDocument();
});
+ expect(screen.getByText(/Findings snapshot unavailable/)).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Findings' }).textContent).toBe('Findings');
expect(findingsPanelState.latestProps).toMatchObject({