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.

Align Patrol header recency labels

rcourtman0703e687669e
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 332ee06dae..84c30b919d 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -146,6 +146,9 @@ The summary recency chip must follow the same governed scope distinction. When
the latest completed activity was only a scoped run, the summary should label
that timestamp as `Last activity` instead of `Last patrol`; `Last full patrol`
belongs only to the most recent completed full Patrol run.
+That same recency contract also applies to the header metadata row. The top
+header must not revert to a generic `Last:` timestamp when the rest of Patrol
+is explicitly distinguishing activity from full verification recency.
That summary surface must also avoid reintroducing a second compact assessment
or verification layer beneath the primary card. Supporting metric strips
belong to counts and outcomes such as active findings, critical findings,
diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
index 9dab683746..579539cbcb 100644
--- a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
@@ -13,6 +13,7 @@ import { groupModelsByProvider } from '@/utils/patrolFormat';
import { getAIQuickstartCreditsPresentation } from '@/utils/aiQuickstartPresentation';
import { buildPatrolScheduleOptions } from '@/utils/aiPatrolSchedulePresentation';
import { getPatrolRuntimePresentation } from '@/utils/patrolRuntimePresentation';
+import { getPatrolRecencyPresentation } from '@/utils/patrolSummaryPresentation';
import type { PatrolIntelligenceState } from './usePatrolIntelligenceState';
export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState }) {
@@ -27,6 +28,12 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
const runtimePresentation = createMemo(() =>
getPatrolRuntimePresentation(state.runtimeState(), state.blockedReason()),
);
+ const recency = createMemo(() =>
+ getPatrolRecencyPresentation({
+ runs: state.patrolRunHistory() ?? [],
+ lastPatrolAt: state.patrolStatus()?.last_patrol_at,
+ }),
+ );
const showQuickstartStatus = createMemo(() => {
const patrolStatus = state.patrolStatus();
if (!patrolStatus) return false;
@@ -61,11 +68,11 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
class="mb-3"
actions={
<div class="flex flex-wrap items-center justify-end gap-3">
- <Show when={state.patrolStatus()?.last_patrol_at}>
+ <Show when={recency().timestamp}>
<div class="hidden sm:flex items-center gap-3 text-xs text-muted">
<span>
- Last:{' '}
- {formatRelativeTime(state.patrolStatus()?.last_patrol_at, {
+ {recency().label}:{' '}
+ {formatRelativeTime(recency().timestamp, {
compact: true,
emptyText: 'Never',
})}
diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
index 2d4db9470b..98b6048364 100644
--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
@@ -817,12 +817,13 @@ describe('AIIntelligence entitlement gating', () => {
await waitFor(() => {
expect(screen.getAllByText('Coverage incomplete').length).toBeGreaterThan(0);
expect(screen.getByText('No recent full patrol')).toBeInTheDocument();
- expect(screen.getByText(/Last activity/i)).toBeInTheDocument();
+ expect(screen.getAllByText(/Last activity/i).length).toBeGreaterThan(0);
expect(screen.getByText('Warnings')).toBeInTheDocument();
});
expect(screen.queryByText('No issues found')).not.toBeInTheDocument();
expect(screen.queryByText(/Last patrol/i)).not.toBeInTheDocument();
+ expect(screen.queryByText(/^Last:/i)).not.toBeInTheDocument();
expect(screen.queryByText('Partial verification')).not.toBeInTheDocument();
expect(
screen.getAllByText(