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.

Tighten recovery audit UX

rcourtman2edc1cba6023
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index d89d416f8d..5241c285fe 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1232,6 +1232,11 @@ shell, `frontend-modern/src/components/shared/useColumnPickerState.ts` owns
dropdown open state and outside-click listener lifecycle, and
`frontend-modern/src/components/shared/columnPickerModel.ts` owns hidden-column
count, reset visibility policy, and column-option text-class/copy policy.
+Column-picker trigger badges must describe what the count means, such as
+`N hidden`, rather than exposing a bare number or ratio that competing table
+surfaces can interpret differently. Shared column-picker tests must cover that
+copy alongside the owner split so governed product tables do not regress to
+ambiguous utility badges.
Future column-picker work should extend those owners instead of pushing
document-level listener logic or column-count policy back into the shell.
The shared tag input now follows that same owner split.
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 68a532bc7c..34980322a1 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -68,6 +68,14 @@ querying, and the operator-facing storage health presentation layer.
1. Add or change recovery-point persistence, rollups, or series derivation through `internal/recovery/`
2. Add or change recovery page UX through `frontend-modern/src/components/Recovery/` and keep canonical route/query/filter state ownership in `frontend-modern/src/features/recovery/useRecoverySurfaceState.ts`
+ Recovery inventory protection posture and recovery-event outcome filtering
+ must stay separate in that owner: protected inventory uses the route-backed
+ `state` query for health, stale, failed, warning, running, unknown, and
+ never-succeeded states, while recovery events use `status` for event
+ outcomes. Legacy `stale=1` input may hydrate the inventory `state=stale`
+ compatibility path, but event views and event drill-ins must drop
+ protected-inventory-only state so hidden filters cannot make valid history
+ look empty.
3. Add or change storage page UX through `frontend-modern/src/pages/Storage.tsx`, `frontend-modern/src/components/Storage/`, `frontend-modern/src/features/storageBackups/`, and the shared storage-source contract in `frontend-modern/src/utils/storageSources.ts`
4. Route transport changes for storage and recovery endpoints through `internal/api/` and the owning `api-contracts` proof routes
That same adjacent API boundary also owns TrueNAS feature-default semantics for
@@ -453,8 +461,8 @@ querying, and the operator-facing storage health presentation layer.
11c. Letting route-owned recovery platform selections disappear while filter options are still hydrating; the recovery page state owner must keep the current canonical `platform` query value present in the platform option set until transport-backed facets and records arrive so shared filter selects keep the user-visible TrueNAS or other owned platform selection instead of flashing back to `All Platforms`
11a. Letting adjacent workload-route changes in shared `frontend-modern/src/routing/resourceLinks.ts` perturb recovery parse/build semantics; expanding canonical `/workloads` platform scoping must not alter the owned `/recovery` `platform` and `itemType` vocabulary, legacy alias rewrites, or recovery drill-down workspace selection
11b. Letting adjacent storage-link additions in shared `frontend-modern/src/routing/resourceLinks.ts` perturb recovery route semantics; expanding canonical `/storage` deep links for unified resources must not reuse recovery-owned query names or alter the owned `/recovery` parse/build contract while those surfaces continue sharing the same route-helper module
-12. Letting protected-item recovery outcome filtering fork from the canonical history status filter; the protected inventory status control must drive the same route-backed `status` field and the same rollups, points, series, and facets transport filters as the history surface instead of keeping a protected-only local outcome branch
-13. Letting visible protected-item filters fall out of shared recovery links; the protected `Stale only` toggle must restore from the canonical recovery URL and rewrite to one owned `stale=1` route form instead of disappearing on refresh or copy/paste
+12. Letting protected-inventory protection posture overload recovery-event outcome filtering; the protected inventory protection-state control must drive the route-backed `state` field and local rollup posture filtering, while the recovery events `status` field remains the canonical outcome filter for points, series, and facets transport filters
+13. Letting visible protected-item filters fall out of shared recovery links; protected inventory state such as stale, failed, warning, running, unknown, healthy, and never-succeeded must restore from the canonical recovery URL and rewrite to the owned `state=<value>` route form, with legacy `stale=1` accepted only as compatibility input
14. Reintroducing stacked full-width recovery tables as the primary desktop layout; the governed recovery surface must expose one primary data region at a time with explicit protected-items versus recovery-events view switching so Pulse stays inventory-first for Proxmox operators without collapsing the page back into a single-platform backup screen
15. Letting the primary recovery workspace tabs drift out of canonical route state; when operators explicitly switch between protected items and recovery events, the shared recovery link builder and page model must preserve that selection in route state unless the active `rollupId` or `day` context already implies the default workspace
16. Treating a selected protected-item rollup as row-click-only or header-only state instead of a canonical history filter; when a protected-item row focuses recovery history, the governed recovery events controls must surface that focus inside the shared filter surface through the same user-creatable item filter control, count it with the rest of the active filters, and let the same filter reset path clear it
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 3b6bd18e3d..861d2d9780 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -984,6 +984,11 @@ TrueNAS-backed top-level systems through canonical `/recovery` route state
there, using owned `platform` and `node` queries instead of rebuilding
drawer-local recovery links or assuming only PBS services can expose recovery
handoffs from infrastructure.
+When shared recovery links include protected-inventory posture, they must use
+the recovery-owned `state` query instead of overloading event `status`. Event
+outcome `status` remains recovery-history state, and compatibility input such
+as legacy `stale=1` must be normalized by the recovery route owner before
+cross-surface links are rebuilt.
That same shared routing boundary now also owns alert-investigation handoffs.
Resource-incident panels and other alert-side resource drill-down consumers
must route operators back through canonical infrastructure resource detail and
@@ -1561,10 +1566,11 @@ items and recovery events, canonical `/recovery` links must round-trip that
`view` selection unless the active `rollupId` or selected day already implies
the default recovery-events workspace.
That same shared recovery route helper contract now also owns canonical
-boolean filter encoding for protected-inventory drill-down state. Visible
-recovery toggles such as `stale` must round-trip through the owned `stale=1`
-query form instead of leaking ad hoc truthy strings or disappearing from
-shared links on reload.
+protected-inventory posture encoding. Visible recovery inventory filters must
+round-trip through the owned `state=<value>` query form instead of leaking ad
+hoc booleans, overloading event `status`, or disappearing from shared links on
+reload. Legacy `stale=1` may be parsed only as compatibility input that
+rewrites to canonical inventory state.
That same route contract now also owns the canonical recovery `itemType`
query. `/recovery` links must round-trip a provider-neutral item category such
as `vm`, `dataset`, or `pvc`, and
diff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsx
index 97801a0089..ca1fff09da 100644
--- a/frontend-modern/src/components/Recovery/Recovery.tsx
+++ b/frontend-modern/src/components/Recovery/Recovery.tsx
@@ -10,6 +10,7 @@ import { EmptyState } from '@/components/shared/EmptyState';
import { PageHeader } from '@/components/shared/PageHeader';
import { Subtabs } from '@/components/shared/Subtabs';
import { useRecoverySurfaceState } from '@/features/recovery/useRecoverySurfaceState';
+import type { ProtectedStateFilter } from '@/features/recovery/useRecoverySurfaceState';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
import type { ColumnDef } from '@/hooks/useColumnVisibility';
@@ -37,6 +38,7 @@ import {
getRecoveryArtifactColumnLabel,
getRecoveryGroupNoTimestampLabel,
getRecoveryArtifactTableMinWidth,
+ getRecoveryRollupInventoryStatus,
STALE_ISSUE_THRESHOLD_MS,
} from '@/utils/recoveryTablePresentation';
import { getRecoveryTimelineLabelEvery } from '@/utils/recoveryTimelineChartPresentation';
@@ -70,7 +72,7 @@ const Recovery: Component = () => {
namespaceOptions,
nodeFilter,
nodeOptions,
- protectedStaleOnly,
+ protectedStateFilter,
platformFilter,
platformOptions,
queryFilter,
@@ -91,7 +93,7 @@ const Recovery: Component = () => {
setModeFilter,
setNamespaceFilter,
setNodeFilter,
- setProtectedStaleOnly,
+ setProtectedStateFilter,
setPlatformFilter,
setQueryFilter,
setRollupId,
@@ -181,24 +183,13 @@ const Recovery: Component = () => {
const overallRollupsSummary = createMemo(() => summarizeRollups(rollups()));
const filteredRollups = createMemo<ProtectionRollup[]>(() => {
- const selectedOutcome = historyOutcomeFilter();
- const staleOnly = protectedStaleOnly();
- if (selectedOutcome === 'all' && !staleOnly) return baseRollups();
+ const selectedState = protectedStateFilter();
+ if (selectedState === 'all') return baseRollups();
const nowMs = Date.now();
- const staleThreshold = nowMs - STALE_ISSUE_THRESHOLD_MS;
return baseRollups().filter((rollup) => {
- if (selectedOutcome !== 'all' && normalizeOutcome(rollup.lastOutcome) !== selectedOutcome) {
- return false;
- }
- if (!staleOnly) return true;
-
- const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;
- const successMs = rollup.lastSuccessAt ? Date.parse(rollup.lastSuccessAt) : 0;
- if (successMs > 0) return successMs < staleThreshold;
- if (attemptMs > 0) return attemptMs < staleThreshold;
- return false;
+ return getRecoveryRollupInventoryStatus(rollup, nowMs) === selectedState;
});
});
@@ -362,7 +353,7 @@ const Recovery: Component = () => {
const artifactColumnVisibility = useColumnVisibility(
STORAGE_KEYS.RECOVERY_HIDDEN_COLUMNS,
artifactColumns,
- ['entityId', 'cluster', 'nodeAgent', 'namespace', 'verified', 'size', 'repository', 'details'],
+ ['entityId', 'cluster', 'nodeAgent', 'namespace', 'size', 'details'],
relevantArtifactColumnIDs,
LEGACY_RECOVERY_COLUMN_ID_ALIASES,
);
@@ -498,6 +489,7 @@ const Recovery: Component = () => {
setNodeFilter('all');
setNamespaceFilter('all');
setVerificationFilter('all');
+ setProtectedStateFilter('all');
setChartRangeDays(30);
setSelectedDateKey(null);
setCurrentPage(1);
@@ -508,6 +500,7 @@ const Recovery: Component = () => {
batch(() => {
setWorkspaceView('events');
setRollupId(nextRollupId);
+ setProtectedStateFilter('all');
setSelectedDateKey(null);
setCurrentPage(1);
});
@@ -521,6 +514,8 @@ const Recovery: Component = () => {
if (nextView === 'inventory') {
setRollupId('');
setSelectedDateKey(null);
+ } else {
+ setProtectedStateFilter('all');
}
});
};
@@ -607,6 +602,7 @@ const Recovery: Component = () => {
onOpenEvents={() => {
batch(() => {
setWorkspaceView('events');
+ setProtectedStateFilter('all');
setCurrentPage(1);
});
}}
@@ -615,12 +611,11 @@ const Recovery: Component = () => {
setWorkspaceView('inventory');
setRollupId('');
setSelectedDateKey(null);
+ setHistoryOutcomeFilter('all');
if ((overallRollupsSummary().counts.failed || 0) > 0) {
- setHistoryOutcomeFilter('failed');
- setProtectedStaleOnly(false);
+ setProtectedStateFilter('failed');
} else {
- setHistoryOutcomeFilter('all');
- setProtectedStaleOnly(true);
+ setProtectedStateFilter('stale');
}
setCurrentPage(1);
});
@@ -631,7 +626,7 @@ const Recovery: Component = () => {
setRollupId('');
setSelectedDateKey(null);
setHistoryOutcomeFilter('all');
- setProtectedStaleOnly(true);
+ setProtectedStateFilter('stale');
setCurrentPage(1);
});
}}
@@ -646,13 +641,12 @@ const Recovery: Component = () => {
<Show when={workspaceView() === 'inventory'}>
<RecoveryProtectedInventorySection
filteredRollups={filteredRollups}
- historyOutcomeFilter={historyOutcomeFilter}
isMobile={isMobile()}
kioskMode={kioskMode()}
loading={recoveryRollupsLoading}
error={() => recoveryRollups.rollups.error}
onSelectRollup={handleSelectRollup}
- protectedStaleOnly={protectedStaleOnly}
+ protectedStateFilter={protectedStateFilter}
itemTypeFilter={itemTypeFilter}
itemTypeOptions={itemTypeOptions}
platformFilter={platformFilter}
@@ -661,9 +655,10 @@ const Recovery: Component = () => {
resourcesById={resourcesById}
rollups={rollups}
rollupsSummary={rollupsSummary}
- setHistoryOutcomeFilter={setHistoryOutcomeFilter}
setItemTypeFilter={setItemTypeFilter}
- setProtectedStaleOnly={setProtectedStaleOnly}
+ setProtectedStateFilter={(value: ProtectedStateFilter) =>
+ setProtectedStateFilter(value)
+ }
setPlatformFilter={setPlatformFilter}
setQueryFilter={setQueryFilter}
setVerificationFilter={setVerificationFilter}
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
index 1b707305e6..f62c8da14e 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
@@ -158,7 +158,7 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
props.setCurrentPage(1);
}}
>
- All protected items
+ All events
</button>
<span class="text-muted">/</span>
<span class="min-w-0 truncate font-medium text-base-content">
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
index 0c79645098..11d81a8153 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
@@ -435,7 +435,7 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
</button>
</div>
<div class="px-4">
- <RecoveryPointDetails point={point} />
+ <RecoveryPointDetails point={point} relatedPoints={group.items} />
</div>
</TableCell>
</TableRow>
diff --git a/frontend-modern/src/components/Recovery/RecoveryPointDetails.test.tsx b/frontend-modern/src/components/Recovery/RecoveryPointDetails.test.tsx
index df0b4049fc..9a98866be9 100644
--- a/frontend-modern/src/components/Recovery/RecoveryPointDetails.test.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryPointDetails.test.tsx
@@ -151,4 +151,75 @@ describe('RecoveryPointDetails', () => {
expect(platformCard).not.toBeNull();
expect(within(platformCard as HTMLDivElement).getByText('TrueNAS')).toBeInTheDocument();
});
+
+ it('uses platform-aware PVE wording and suppresses meaningless task details', () => {
+ render(() => (
+ <RecoveryPointDetails
+ point={{
+ id: 'point-3',
+ platform: 'proxmox-pve',
+ itemResourceId: 'res:vm-105',
+ kind: 'snapshot',
+ mode: 'snapshot',
+ outcome: 'success',
+ completedAt: '2026-03-31T10:00:00Z',
+ details: {
+ instance: 'delly',
+ node: 'delly',
+ snapshotName: 'vzdump',
+ vmid: '105',
+ },
+ }}
+ relatedPoints={[
+ {
+ id: 'point-4',
+ platform: 'proxmox-pbs',
+ itemResourceId: 'res:vm-105',
+ kind: 'backup',
+ mode: 'remote',
+ outcome: 'success',
+ verified: true,
+ completedAt: '2026-03-31T10:10:00Z',
+ repositoryRef: {
+ type: 'pbs-datastore',
+ namespace: 'pbs-main',
+ name: 'fast-store',
+ },
+ },
+ ]}
+ />
+ ));
+
+ expect(screen.queryByText('Snapshot / Snapshot')).not.toBeInTheDocument();
+ expect(screen.getAllByText('Snapshot').length).toBeGreaterThan(0);
+ expect(screen.getByText('Local snapshot on delly')).toBeInTheDocument();
+ expect(screen.getByText('Protection chain')).toBeInTheDocument();
+ expect(screen.getByText('Remote copy')).toBeInTheDocument();
+ expect(screen.getByText(/Verified/)).toBeInTheDocument();
+ });
+
+ it('turns generic PVE job errors into actionable failure copy and hides VMID zero', () => {
+ render(() => (
+ <RecoveryPointDetails
+ point={{
+ id: 'point-5',
+ platform: 'proxmox-pve',
+ kind: 'backup',
+ mode: 'local',
+ outcome: 'failed',
+ completedAt: '2026-03-31T10:00:00Z',
+ details: {
+ status: 'job errors',
+ taskName: 'vzdump',
+ vmid: '0',
+ },
+ }}
+ />
+ ));
+
+ expect(screen.getByText('Failure detail')).toBeInTheDocument();
+ expect(screen.getByText(/Inspect the platform task log for the failing step/i)).toBeInTheDocument();
+ expect(screen.queryByText('VMID')).not.toBeInTheDocument();
+ expect(screen.queryByText('0')).not.toBeInTheDocument();
+ });
});
diff --git a/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx b/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx
index ac7c91f2af..1077f759e4 100644
--- a/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx
@@ -26,6 +26,7 @@ import { getRecoveryPointPlatform } from '@/utils/recoveryPlatformModel';
interface RecoveryPointDetailsProps {
point: RecoveryPoint;
+ relatedPoints?: RecoveryPoint[];
}
const detailNumber = (p: RecoveryPoint, key: string): number | null => {
@@ -80,6 +81,103 @@ const labelForRef = (ref: RecoveryExternalRef | null | undefined): string => {
return parts.length > 0 ? parts.join(' ') : 'n/a';
};
+type RecoveryChainStage = 'snapshot' | 'local' | 'remote';
+
+const CHAIN_STAGES: Array<{ id: RecoveryChainStage; label: string }> = [
+ { id: 'snapshot', label: 'Local snapshot' },
+ { id: 'local', label: 'Local copy' },
+ { id: 'remote', label: 'Remote copy' },
+];
+
+const normalizeDetailText = (value: unknown): string => {
+ if (typeof value === 'string') return value.trim();
+ if (typeof value === 'number' && Number.isFinite(value)) return String(value);
+ if (typeof value === 'boolean') return value ? 'true' : 'false';
+ return '';
+};
+
+const getPointTimestampMs = (p: RecoveryPoint): number => {
+ const raw = p.completedAt || p.startedAt || '';
+ const ms = raw ? Date.parse(raw) : 0;
+ return Number.isFinite(ms) ? ms : 0;
+};
+
+const getPointChainStage = (p: RecoveryPoint): RecoveryChainStage | null => {
+ const mode = String(p.mode || '').trim().toLowerCase();
+ const kind = String(p.kind || '').trim().toLowerCase();
+ if (mode === 'remote') return 'remote';
+ if (mode === 'local') return 'local';
+ if (mode === 'snapshot' || kind === 'snapshot') return 'snapshot';
+ return null;
+};
+
+const getPointItemIdentity = (p: RecoveryPoint): string => {
+ const refs = [p.itemRef, p.subjectRef];
+ const refKey = refs
+ .map((ref) => {
+ if (!ref) return '';
+ if (ref.uid) return `uid:${ref.uid}`;
+ if (ref.id) return `id:${ref.id}`;
+ return [ref.type, ref.namespace, ref.name].filter(Boolean).join(':');
+ })
+ .find(Boolean);
+ return (
+ String(p.itemResourceId || '').trim() ||
+ refKey ||
+ String(p.entityId || '').trim() ||
+ String(p.display?.itemLabel || p.display?.subjectLabel || '').trim() ||
+ p.id
+ );
+};
+
+const getLocalPlacementLabel = (p: RecoveryPoint): string =>
+ String(
+ p.display?.nodeHostLabel ||
+ p.display?.nodeAgentLabel ||
+ p.node ||
+ p.details?.node ||
+ p.details?.instance ||
+ '',
+ ).trim();
+
+const getArtifactSummaryLabel = (p: RecoveryPoint): string => {
+ const kindLabel = getRecoveryPointKindLabel(p.kind);
+ const modeLabel = getRecoveryPointModeLabel(p.mode);
+ return kindLabel === modeLabel ? kindLabel : `${kindLabel} / ${modeLabel}`;
+};
+
+const getTargetSummaryLabel = (p: RecoveryPoint): string => {
+ const repositoryLabel = getRecoveryPointRepositoryLabel(p);
+ if (repositoryLabel) return repositoryLabel;
+ const refLabel = labelForRef(p.repositoryRef);
+ if (refLabel !== 'n/a') return refLabel;
+
+ const placement = getLocalPlacementLabel(p);
+ const stage = getPointChainStage(p);
+ if (stage === 'snapshot') return placement ? `Local snapshot on ${placement}` : 'Local snapshot';
+ if (stage === 'local') return placement ? `Local copy on ${placement}` : 'Local copy';
+ if (stage === 'remote') return 'Remote target not recorded';
+ return 'Target not recorded';
+};
+
+const formatChainPointDetail = (p: RecoveryPoint): string => {
+ const timestamp = getPointTimestampMs(p);
+ const platform = getSourcePlatformLabel(
+ normalizeSourcePlatformQueryValue(getRecoveryPointPlatform(p)) || getRecoveryPointPlatform(p),
+ );
+ const target = getTargetSummaryLabel(p);
+ const verification =
+ p.verified === true ? 'Verified' : p.verified === false ? 'Verification failed' : '';
+ return [
+ target,
+ platform,
+ timestamp > 0 ? formatAbsoluteTime(timestamp) : '',
+ verification,
+ ]
+ .filter(Boolean)
+ .join(' · ');
+};
+
const computeDatastoreUsagePercent = (datastore: PBSDatastore): number => {
if (Number.isFinite(datastore.total) && datastore.total > 0 && Number.isFinite(datastore.used)) {
const calculated = (datastore.used / datastore.total) * 100;
@@ -187,12 +285,7 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
if (refLabel !== 'n/a') return refLabel;
return point().itemResourceId || point().id;
});
- const targetLabel = createMemo(() => {
- const repositoryLabel = getRecoveryPointRepositoryLabel(point());
- if (repositoryLabel) return repositoryLabel;
- const refLabel = labelForRef(point().repositoryRef);
- return refLabel === 'n/a' ? 'No target recorded' : refLabel;
- });
+ const targetLabel = createMemo(() => getTargetSummaryLabel(point()));
const normalizedOutcome = createMemo(() => normalizeRecoveryOutcome(point().outcome));
const outcomeLabel = createMemo(() => getRecoveryPointOutcomeLabel(point().outcome));
const readiness = createMemo(() => {
@@ -239,12 +332,81 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
};
});
const failureDetail = createMemo(() => {
- const error = detailString(point(), 'error');
- if (error) return error;
- const status = detailString(point(), 'status');
- if (normalizedOutcome() === 'failed' && status) return status;
+ const p = point();
+ const directKeys = [
+ 'error',
+ 'errorMessage',
+ 'failure',
+ 'failureReason',
+ 'message',
+ 'taskError',
+ 'taskStatus',
+ 'statusMessage',
+ 'lastError',
+ ];
+ for (const key of directKeys) {
+ const value = detailString(p, key);
+ if (value) return value;
+ }
+
+ const errors = p.details?.errors;
+ if (Array.isArray(errors)) {
+ const joined = errors
+ .map((entry) => normalizeDetailText(entry))
+ .filter(Boolean)
+ .slice(0, 3)
+ .join('; ');
+ if (joined) return joined;
+ }
+
+ const status = detailString(p, 'status');
+ if (normalizedOutcome() === 'failed' && status) {
+ const genericJobErrors = status.toLowerCase() === 'job errors';
+ if (genericJobErrors) {
+ const taskName = detailString(p, 'taskName');
+ const upid = detailString(p, 'upid') || detailString(p, 'taskId');
+ return [
+ 'Source task reported job errors.',
+ taskName ? `Task: ${taskName}.` : '',
+ upid ? `UPID: ${upid}.` : '',
+ 'Inspect the platform task log for the failing step.',
+ ]
+ .filter(Boolean)
+ .join(' ');
+ }
+ return status;
+ }
return '';
});
+ const protectionChain = createMemo(() => {
+ const selected = point();
+ const selectedIdentity = getPointItemIdentity(selected);
+ const byId = new Map<string, RecoveryPoint>();
+ byId.set(selected.id, selected);
+ for (const related of props.relatedPoints || []) {
+ if (getPointItemIdentity(related) !== selectedIdentity) continue;
+ byId.set(related.id, related);
+ }
+
+ const candidates = [...byId.values()];
+ return CHAIN_STAGES.map((stage) => {
+ const stagePoint =
+ candidates
+ .filter((candidate) => getPointChainStage(candidate) === stage.id)
+ .sort((left, right) => getPointTimestampMs(right) - getPointTimestampMs(left))[0] || null;
+ const outcome = stagePoint ? normalizeRecoveryOutcome(stagePoint.outcome) : null;
+ return {
+ ...stage,
+ point: stagePoint,
+ outcome,
+ outcomeLabel: stagePoint ? getRecoveryPointOutcomeLabel(stagePoint.outcome) : '',
+ detail: stagePoint ? formatChainPointDetail(stagePoint) : 'Not shown in current result set',
+ };
+ });
+ });
+ const hasProtectionChain = createMemo(() =>
+ protectionChain().some((stage) => stage.point !== null),
+ );
const operatorSummaryPairs = createMemo(() => [
{
k: 'Outcome',
@@ -254,7 +416,7 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
},
{
k: 'Artifact',
- v: `${getRecoveryPointKindLabel(point().kind)} / ${getRecoveryPointModeLabel(point().mode)}`,
+ v: getArtifactSummaryLabel(point()),
valueClass: 'text-base-content',
detail: itemLabel(),
},
@@ -319,7 +481,10 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
for (const k of commonDetailKeys) {
const v = p.details?.[k];
if (v == null) continue;
- pairs.push({ k: COMMON_DETAIL_LABELS[k] || k, v: String(v) });
+ const displayValue = normalizeDetailText(v);
+ if (!displayValue) continue;
+ if (k === 'vmid' && displayValue === '0') continue;
+ pairs.push({ k: COMMON_DETAIL_LABELS[k] || k, v: displayValue });
}
return pairs;
@@ -403,6 +568,46 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
<div class="mt-1 break-words font-mono text-[11px]">{failureDetail()}</div>
</div>
</Show>
+ <Show when={hasProtectionChain()}>
+ <div class="mt-3 rounded border border-border bg-surface px-3 py-2 text-xs">
+ <div class="flex flex-wrap items-start justify-between gap-2">
+ <div>
+ <div class="font-semibold text-base-content">Protection chain</div>
+ <div class="mt-0.5 text-[11px] text-muted">
+ Matching stages for this item in the current result set.
+ </div>
+ </div>
+ </div>
+ <div class="mt-2 grid gap-2 md:grid-cols-3">
+ <For each={protectionChain()}>
+ {(stage) => (
+ <div class="rounded border border-border bg-surface-alt/45 px-2.5 py-2">
+ <div class="flex items-center justify-between gap-2">
+ <span class="font-medium text-base-content">{stage.label}</span>
+ <Show
+ when={stage.outcome}
+ fallback={<span class="text-[10px] text-muted">Missing</span>}
+ >
+ {(outcome) => (
+ <span
+ class={`text-[10px] font-medium ${getRecoveryOutcomeTextClass(
+ outcome(),
+ )}`}
+ >
+ {stage.outcomeLabel}
+ </span>
+ )}
+ </Show>
+ </div>
+ <div class="mt-1 text-[11px] leading-4 text-muted break-words">
+ {stage.detail}
+ </div>
+ </div>
+ )}
+ </For>
+ </div>
+ </div>
+ </Show>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index 76d966a71e..c8743227c9 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -11,10 +11,9 @@ import { getSourcePlatformBadge } from '@/components/shared/sourcePlatformBadges
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/shared/Table';
import { STORAGE_KEYS } from '@/utils/localStorage';
import { formatAbsoluteTime, formatRelativeTime } from '@/utils/format';
-import type { ProtectionRollup, RecoveryOutcome } from '@/types/recovery';
+import type { ProtectionRollup } from '@/types/recovery';
import type { Resource } from '@/types/resource';
import {
- getRecoveryProtectedToggleClass,
getRecoveryRollupInventoryStatusLabel,
getRecoveryRollupInventoryStatusTextClass,
getRecoveryRollupInventoryStatusVariant,
@@ -39,47 +38,44 @@ import {
getRecoverySearchHistoryEmptyMessage,
getRecoveryRollupTimestampMs,
STALE_ISSUE_THRESHOLD_MS,
+ type RecoveryRollupInventoryStatus,
} from '@/utils/recoveryTablePresentation';
-import {
- normalizeRecoveryOutcome,
-} from '@/utils/recoveryOutcomePresentation';
+import { normalizeRecoveryOutcome } from '@/utils/recoveryOutcomePresentation';
import { getRecoveryRollupPlatforms } from '@/utils/recoveryPlatformModel';
import {
getRecoveryRollupItemLabel,
getRecoveryRollupItemSecondaryLabel,
} from '@/utils/recoveryRecordPresentation';
import { getSourcePlatformLabel, normalizeSourcePlatformQueryValue } from '@/utils/sourcePlatforms';
-import { titleCaseDelimitedLabel } from '@/utils/textPresentation';
type VerificationFilter = 'all' | 'verified' | 'unverified' | 'unknown';
+type ProtectedStateFilter = 'all' | RecoveryRollupInventoryStatus;
type ProtectedSortCol = 'item' | 'type' | 'platform' | 'lastBackup' | 'outcome';
type SortDir = 'asc' | 'desc';
interface RecoveryRollupSummary {
total: number;
- counts: Record<RecoveryOutcome, number>;
+ counts: Record<string, number>;
stale: number;
neverSucceeded: number;
}
interface RecoveryProtectedInventorySectionProps {
filteredRollups: Accessor<ProtectionRollup[]>;
- historyOutcomeFilter: Accessor<'all' | RecoveryOutcome>;
itemTypeFilter: Accessor<string>;
itemTypeOptions: Accessor<string[]>;
isMobile: boolean;
kioskMode: boolean;
onSelectRollup: (rollupId: string) => void;
- protectedStaleOnly: Accessor<boolean>;
+ protectedStateFilter: Accessor<ProtectedStateFilter>;
platformFilter: Accessor<string>;
platformOptions: Accessor<string[]>;
queryFilter: Accessor<string>;
resourcesById: Accessor<Map<string, Resource>>;
rollups: Accessor<ProtectionRollup[]>;
rollupsSummary: Accessor<RecoveryRollupSummary>;
- setHistoryOutcomeFilter: (value: 'all' | RecoveryOutcome) => void;
setItemTypeFilter: (value: string) => void;
- setProtectedStaleOnly: (value: boolean | ((prev: boolean) => boolean)) => void;
+ setProtectedStateFilter: (value: ProtectedStateFilter) => void;
setPlatformFilter: (value: string) => void;
setQueryFilter: (value: string) => void;
setVerificationFilter: (value: VerificationFilter) => void;
@@ -87,7 +83,16 @@ interface RecoveryProtectedInventorySectionProps {
error: Accessor<unknown>;
}
-const availableOutcomes = ['all', 'success', 'warning', 'failed', 'running'] as const;
+const availableProtectionStates = [
+ 'all',
+ 'healthy',
+ 'stale',
+ 'never-succeeded',
+ 'failed',
+ 'warning',
+ 'running',
+ 'unknown',
+] as const satisfies readonly ProtectedStateFilter[];
const STALE_THRESHOLD_DAYS = Math.max(
1,
Math.round(STALE_ISSUE_THRESHOLD_MS / (24 * 60 * 60 * 1000)),
@@ -103,24 +108,32 @@ const getProtectionInsight = (
if (inventoryStatus === 'never-succeeded') {
return attemptMs > 0
- ? `No successful point recorded after ${formatRelativeTime(attemptMs)}`
- : 'No successful point recorded yet';
+ ? `No successful point recorded after ${formatRelativeTime(attemptMs)}; open events to inspect attempts`
+ : 'No successful point recorded yet; open events to confirm the first attempt';
}
if (inventoryStatus === 'stale') {
if (successMs > 0 && Number.isFinite(successMs)) {
const ageDays = Math.max(1, Math.floor((nowMs - successMs) / (24 * 60 * 60 * 1000)));
- return `Last success is ${ageDays} days old; expected within ${STALE_THRESHOLD_DAYS} days`;
+ return `Last success is ${ageDays} days old; open events to inspect the latest point`;
}
- return `No successful point within ${STALE_THRESHOLD_DAYS} days`;
+ return `No successful point within ${STALE_THRESHOLD_DAYS} days; open events to inspect attempts`;
}
- if (inventoryStatus === 'failed') return 'Latest protection event failed';
- if (inventoryStatus === 'warning') return 'Latest protection event completed with warnings';
- if (inventoryStatus === 'running') return 'Protection event in progress';
+ if (inventoryStatus === 'failed') return 'Latest protection event failed; open event details';
+ if (inventoryStatus === 'warning') return 'Latest event completed with warnings; review details';
+ if (inventoryStatus === 'running') return 'Protection event in progress; check events for completion';
return '';
};
+const normalizeProtectedStateFilter = (value: string): ProtectedStateFilter => {
+ const normalized = value.trim().toLowerCase();
+ if (normalized === 'success') return 'healthy';
+ return availableProtectionStates.includes(normalized as ProtectedStateFilter)
+ ? (normalized as ProtectedStateFilter)
+ : 'all';
+};
+
export const RecoveryProtectedInventorySection: Component<
RecoveryProtectedInventorySectionProps
> = (props) => {
@@ -142,8 +155,7 @@ export const RecoveryProtectedInventorySection: Component<
if (props.queryFilter().trim() !== '') count += 1;
if (props.platformFilter() !== 'all') count += 1;
if (props.itemTypeFilter() !== 'all') count += 1;
- if (props.historyOutcomeFilter() !== 'all') count += 1;
- if (props.protectedStaleOnly()) count += 1;
+ if (props.protectedStateFilter() !== 'all') count += 1;
return count;
});
@@ -218,8 +230,7 @@ export const RecoveryProtectedInventorySection: Component<
props.queryFilter();
props.platformFilter();
props.itemTypeFilter();
- props.historyOutcomeFilter();
- props.protectedStaleOnly();
+ props.protectedStateFilter();
protectedSortCol();
protectedSortDir();
});
@@ -228,9 +239,8 @@ export const RecoveryProtectedInventorySection: Component<
props.setQueryFilter('');
props.setPlatformFilter('all');
props.setItemTypeFilter('all');
- props.setHistoryOutcomeFilter('all');
props.setVerificationFilter('all');
- props.setProtectedStaleOnly(false);
+ props.setProtectedStateFilter('all');
};
return (
@@ -315,34 +325,25 @@ export const RecoveryProtectedInventorySection: Component<
<LabeledFilterSelect
id="recovery-protected-status-filter"
label="Protection state"
- value={props.historyOutcomeFilter()}
+ value={props.protectedStateFilter()}
onChange={(event) => {
- const value = event.currentTarget.value as 'all' | RecoveryOutcome;
- props.setHistoryOutcomeFilter(value);
- if (value !== 'all') props.setVerificationFilter('all');
+ const value = normalizeProtectedStateFilter(event.currentTarget.value);
+ props.setProtectedStateFilter(value);
+ props.setVerificationFilter('all');
}}
groupClass="gap-1.5 px-1.5 py-0.5"
selectClass="py-1 text-xs"
>
- <For each={availableOutcomes}>
- {(outcome) => (
- <option value={outcome}>
- {outcome === 'all' ? 'Any status' : titleCaseDelimitedLabel(outcome)}
+ <For each={availableProtectionStates}>
+ {(state) => (
+ <option value={state}>
+ {state === 'all'
+ ? 'Any state'
+ : getRecoveryRollupInventoryStatusLabel(state)}
</option>
)}
</For>
</LabeledFilterSelect>
-
- <button
- type="button"
- aria-pressed={props.protectedStaleOnly()}
- onClick={() => props.setProtectedStaleOnly((value) => !value)}
- class={`rounded-md border px-2.5 py-1 text-xs font-medium transition-colors ${getRecoveryProtectedToggleClass(
- props.protectedStaleOnly(),
- )}`}
- >
- Stale only
- </button>
</PageControls>
</div>
</Card>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx
index 3cee7d1ef3..b1a10088de 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx
@@ -73,7 +73,7 @@ describe('Recovery layout guards', () => {
nodeFilter: () => 'all',
nodeOptions: () => ['all'],
overallRollupsSummary: () => ({ total: 2, stale: 0, neverSucceeded: 0 }),
- protectedStaleOnly: () => false,
+ protectedStateFilter: () => 'all',
platformFilter: () => 'all',
platformOptions: () => ['all'],
queryFilter: () => '',
@@ -114,7 +114,7 @@ describe('Recovery layout guards', () => {
setModeFilter: vi.fn(),
setNamespaceFilter: vi.fn(),
setNodeFilter: vi.fn(),
- setProtectedStaleOnly: vi.fn(),
+ setProtectedStateFilter: vi.fn(),
setPlatformFilter: vi.fn(),
setQueryFilter: vi.fn(),
setRollupId: vi.fn(),
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 7a75df9ea3..84d62a5507 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -288,7 +288,7 @@ describe('Recovery', () => {
expect(protectedSearch).toBeInTheDocument();
expect(protectedSearch.closest('div.relative')?.className).toContain('w-full');
expect(within(inventoryControls).queryByText(/^\d+ stale$/i)).not.toBeInTheDocument();
- expect(within(inventoryControls).queryByText(/never succeeded/i)).not.toBeInTheDocument();
+ expect(within(inventoryControls).queryByText(/^\d+ never succeeded$/i)).not.toBeInTheDocument();
expect(
within(workspaceTablist).getByRole('tab', { name: 'Protected items' }).className,
).toContain('border-b-2');
@@ -437,7 +437,7 @@ describe('Recovery', () => {
expect(within(historyTable).getByText('Platform')).toBeInTheDocument();
expect(within(historyTable).queryByText('ITEM TYPE')).not.toBeInTheDocument();
expect(within(historyTable).queryByText('PLATFORM')).not.toBeInTheDocument();
- expect(within(historyTable).queryByText('Target')).not.toBeInTheDocument();
+ expect(within(historyTable).getByText('Target')).toBeInTheDocument();
expect(within(historyTable).queryByText('Details')).not.toBeInTheDocument();
const historyRow = within(historyTable).getByLabelText('Healthy').closest('tr');
expect(historyRow).not.toBeNull();
@@ -1066,15 +1066,15 @@ describe('Recovery', () => {
});
});
- it('uses one canonical outcome filter across protected items and history transport', async () => {
+ it('uses canonical protection state filtering for protected inventory', async () => {
render(() => <Recovery />);
const protectedStatus = await screen.findByLabelText('Protection state');
- fireEvent.change(protectedStatus, { target: { value: 'failed' } });
+ fireEvent.change(protectedStatus, { target: { value: 'never-succeeded' } });
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?status=failed',
+ '/recovery?state=never-succeeded',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1084,22 +1084,8 @@ describe('Recovery', () => {
expect(screen.getByText('tank/apps')).toBeInTheDocument();
});
- await waitFor(() => {
- const urls = apiFetchMock.mock.calls.map((call) => String(call[0] || ''));
- const hasRollups = urls.some(
- (url) => url.includes('/api/recovery/rollups') && url.includes('outcome=failed'),
- );
- const hasPoints = urls.some(
- (url) => url.includes('/api/recovery/points') && url.includes('outcome=failed'),
- );
- const hasSeries = urls.some(
- (url) => url.includes('/api/recovery/series') && url.includes('outcome=failed'),
- );
- const hasFacets = urls.some(
- (url) => url.includes('/api/recovery/facets') && url.includes('outcome=failed'),
- );
- expect(hasRollups && hasPoints && hasSeries && hasFacets).toBe(true);
- });
+ const urls = apiFetchMock.mock.calls.map((call) => String(call[0] || ''));
+ expect(urls.some((url) => url.includes('outcome=failed'))).toBe(false);
});
it('bounds the protected inventory surface with pagination for larger estates', async () => {
@@ -1161,19 +1147,36 @@ describe('Recovery', () => {
expect(screen.queryByRole('button', { name: 'Prev' })).not.toBeInTheDocument();
});
- it('persists and restores the protected stale-only filter through the canonical recovery URL', async () => {
+ it('canonicalizes legacy stale flags into protected inventory state', async () => {
mockLocationSearch = '?stale=%20TRUE%20';
render(() => <Recovery />);
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery?stale=1', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/recovery?state=stale', ROUTE_STATE_REPLACE_OPTIONS);
});
- expect(screen.getByRole('button', { name: 'Stale only' })).toHaveAttribute(
- 'aria-pressed',
- 'true',
- );
+ expect(screen.getByLabelText('Protection state')).toHaveValue('stale');
+ });
+
+ it('drops protected-only stale state when the recovery events view owns the route', async () => {
+ mockLocationSearch = '?view=events&stale=1&range=90&status=failed';
+
+ render(() => <Recovery />);
+
+ await waitFor(() => {
+ expect(navigateSpy).toHaveBeenCalledWith(
+ '/recovery?view=events&range=90&status=failed',
+ ROUTE_STATE_REPLACE_OPTIONS,
+ );
+ });
+
+ const controls = await screen.findByRole('group', { name: /recovery events controls/i });
+ fireEvent.click(within(controls).getByRole('button', { name: 'Reset all' }));
+
+ await waitFor(() => {
+ expect(navigateSpy).toHaveBeenCalledWith('/recovery?view=events', ROUTE_STATE_REPLACE_OPTIONS);
+ });
});
it('normalizes legacy provider aliases into canonical platform route state', async () => {
diff --git a/frontend-modern/src/components/shared/ColumnPicker.test.tsx b/frontend-modern/src/components/shared/ColumnPicker.test.tsx
index 8d81449bda..eff94817d5 100644
--- a/frontend-modern/src/components/shared/ColumnPicker.test.tsx
+++ b/frontend-modern/src/components/shared/ColumnPicker.test.tsx
@@ -56,6 +56,25 @@ describe('ColumnPicker', () => {
expect(onToggle).toHaveBeenCalledWith('subject');
});
+ it('labels hidden column count with explicit context', () => {
+ render(() => (
+ <ColumnPicker
+ columns={[
+ { id: 'subject', label: 'Subject' },
+ { id: 'verified', label: 'Verified' },
+ { id: 'target', label: 'Target' },
+ ]}
+ isHidden={(columnId) => columnId !== 'subject'}
+ onToggle={vi.fn()}
+ />
+ ));
+
+ expect(
+ screen.getByRole('button', { name: /columns 2 hidden/i }),
+ ).toBeInTheDocument();
+ expect(screen.getByText('2 hidden')).toBeInTheDocument();
+ });
+
it('closes when the user clicks outside the open picker', async () => {
render(() => (
<ColumnPicker
diff --git a/frontend-modern/src/components/shared/ColumnPicker.tsx b/frontend-modern/src/components/shared/ColumnPicker.tsx
index 32fae78545..c0e9e57ee4 100644
--- a/frontend-modern/src/components/shared/ColumnPicker.tsx
+++ b/frontend-modern/src/components/shared/ColumnPicker.tsx
@@ -39,7 +39,7 @@ export const ColumnPicker: Component<ColumnPickerProps> = (props) => {
</svg>
<span>{COLUMN_PICKER_BUTTON_LABEL}</span>
<Show when={state.hiddenCount() > 0}>
- <span class={filterUtilityBadgeClass}>{state.hiddenCount()}</span>
+ <span class={filterUtilityBadgeClass}>{state.hiddenCount()} hidden</span>
</Show>
</FilterActionButton>
diff --git a/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts b/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts
index cca2acbb03..e2698f8f08 100644
--- a/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts
+++ b/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts
@@ -31,13 +31,20 @@ import {
getRecoveryItemTypePresentation,
normalizeRecoveryItemTypeQueryValue,
} from '@/utils/recoveryItemTypePresentation';
+import {
+ getRecoveryRollupInventoryStatus,
+ type RecoveryRollupInventoryStatus,
+} from '@/utils/recoveryTablePresentation';
+import { getRecoveryRollupInventoryStatusLabel } from '@/utils/recoveryStatusPresentation';
import { normalizeRecoveryOutcome as normalizeOutcome } from '@/utils/recoveryOutcomePresentation';
import type { RecoveryArtifactMode } from '@/utils/recoveryArtifactModePresentation';
import { parseRecoveryDateKey } from '@/utils/recoveryDatePresentation';
+import { formatRelativeTime } from '@/utils/format';
type ArtifactMode = RecoveryArtifactMode;
type VerificationFilter = 'all' | 'verified' | 'unverified' | 'unknown';
type RecoveryWorkspaceView = 'inventory' | 'events';
+export type ProtectedStateFilter = 'all' | RecoveryRollupInventoryStatus;
const isRecoveryDateKey = (value: string): boolean => /^\d{4}-\d{2}-\d{2}$/.test(value);
const isRecoveryRangeDays = (value: string): value is '7' | '30' | '90' | '365' =>
@@ -77,6 +84,37 @@ const normalizeRecoveryItemTypeSelection = (value: string | null | undefined): s
return normalized || 'all';
};
+const normalizeProtectedStateFilter = (
+ value: string | null | undefined,
+): ProtectedStateFilter => {
+ const normalized = normalizeRecoveryRouteValue(value).toLowerCase();
+ if (normalized === 'success') return 'healthy';
+ if (
+ normalized === 'healthy' ||
+ normalized === 'warning' ||
+ normalized === 'failed' ||
+ normalized === 'running' ||
+ normalized === 'stale' ||
+ normalized === 'never-succeeded' ||
+ normalized === 'unknown'
+ ) {
+ return normalized as ProtectedStateFilter;
+ }
+ return 'all';
+};
+
+const getRollupFreshnessLabel = (rollup: ProtectionRollup): string => {
+ const successMs = rollup.lastSuccessAt ? Date.parse(rollup.lastSuccessAt) : 0;
+ if (Number.isFinite(successMs) && successMs > 0) {
+ return `Last success ${formatRelativeTime(successMs)}`;
+ }
+ const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;
+ if (Number.isFinite(attemptMs) && attemptMs > 0) {
+ return `Last attempt ${formatRelativeTime(attemptMs)}`;
+ }
+ return 'No attempts recorded';
+};
+
export function useRecoverySurfaceState() {
const navigate = useNavigate();
const location = useLocation();
@@ -101,7 +139,8 @@ export function useRecoverySurfaceState() {
const [scopeFilter, setScopeFilter] = createSignal<'all' | 'workload'>('all');
const [nodeFilter, setNodeFilter] = createSignal('all');
const [namespaceFilter, setNamespaceFilter] = createSignal('all');
- const [protectedStaleOnly, setProtectedStaleOnly] = createSignal(false);
+ const [protectedStateFilter, setProtectedStateFilter] =
+ createSignal<ProtectedStateFilter>('all');
const [chartRangeDays, setChartRangeDays] = createSignal<7 | 30 | 90 | 365>(30);
const [selectedDateKey, setSelectedDateKey] = createSignal<string | null>(null);
const [currentPage, setCurrentPage] = createSignal(1);
@@ -218,11 +257,21 @@ export function useRecoverySurfaceState() {
.map((platform) => getSourcePlatformLabel(String(platform || '').trim()))
.filter(Boolean)
.sort((left, right) => left.localeCompare(right));
+ const stateLabel = getRecoveryRollupInventoryStatusLabel(
+ getRecoveryRollupInventoryStatus(rollup),
+ );
return {
rollupId: rollup.rollupId,
label: getRecoveryRollupItemLabel(rollup, resourceIndex),
secondaryLabel: getRecoveryRollupItemSecondaryLabel(rollup),
- contextLabel: [itemTypeLabel, platformLabels.join(', ')].filter(Boolean).join(' · '),
+ contextLabel: [
+ stateLabel,
+ getRollupFreshnessLabel(rollup),
+ itemTypeLabel,
+ platformLabels.join(', '),
+ ]
+ .filter(Boolean)
+ .join(' · '),
};
});
@@ -236,13 +285,23 @@ export function useRecoverySurfaceState() {
.map((platform) => getSourcePlatformLabel(String(platform || '').trim()))
.filter(Boolean)
.sort((left, right) => left.localeCompare(right));
+ const stateLabel = getRecoveryRollupInventoryStatusLabel(
+ getRecoveryRollupInventoryStatus(selected),
+ );
return [
{
rollupId: selected.rollupId,
label: getRecoveryRollupItemLabel(selected, resourceIndex),
secondaryLabel: getRecoveryRollupItemSecondaryLabel(selected),
- contextLabel: [itemTypeLabel, platformLabels.join(', ')].filter(Boolean).join(' · '),
+ contextLabel: [
+ stateLabel,
+ getRollupFreshnessLabel(selected),
+ itemTypeLabel,
+ platformLabels.join(', '),
+ ]
+ .filter(Boolean)
+ .join(' · '),
},
...options,
];
@@ -323,7 +382,6 @@ export function useRecoverySurfaceState() {
const nextQuery = normalizeRecoveryRouteValue(parsed.query);
const nextPlatform = normalizeRecoveryPlatformSelection(parsed.platform || '');
const nextItemType = normalizeRecoveryItemTypeSelection(parsed.itemType || '');
- const nextStaleOnly = normalizeRecoveryBooleanFlag(parsed.stale);
const normalizedRange = normalizeRecoveryRouteValue(parsed.range);
const nextRange = isRecoveryRangeDays(normalizedRange) ? Number(normalizedRange) : 30;
const nextCluster = normalizeRecoveryRouteSelection(parsed.cluster || 'all') || 'all';
@@ -334,6 +392,7 @@ export function useRecoverySurfaceState() {
const resolvedView = (nextView || derivedDefaultView) as RecoveryWorkspaceView;
const visibleRollup = resolvedView === 'events' ? nextRollup : '';
const visibleDay = resolvedView === 'events' ? nextDay : '';
+ const legacyStaleState = normalizeRecoveryBooleanFlag(parsed.stale) ? 'stale' : '';
const nextMode = normalizeRecoveryModeQueryValue(parsed.mode);
const rawScope = normalizeRecoveryRouteValue(parsed.scope).toLowerCase();
const nextScope: 'all' | 'workload' = rawScope === 'workload' ? 'workload' : 'all';
@@ -341,13 +400,19 @@ export function useRecoverySurfaceState() {
const nextNamespace = normalizeRecoveryRouteSelection(parsed.namespace || 'all') || 'all';
const verificationValue = normalizeRecoveryRouteValue(parsed.verification).toLowerCase();
const statusValue = normalizeRecoveryRouteValue(parsed.status).toLowerCase();
+ const nextProtectedState =
+ resolvedView === 'inventory'
+ ? normalizeProtectedStateFilter(parsed.state || legacyStaleState || statusValue)
+ : 'all';
if (visibleRollup !== untrack(rollupId)) setRollupId(visibleRollup);
if (resolvedView !== untrack(workspaceView)) setWorkspaceView(resolvedView);
if (nextQuery !== untrack(queryFilter)) setQueryFilter(nextQuery);
if (nextPlatform !== untrack(platformFilter)) setPlatformFilter(nextPlatform);
if (nextItemType !== untrack(itemTypeFilter)) setItemTypeFilter(nextItemType);
- if (nextStaleOnly !== untrack(protectedStaleOnly)) setProtectedStaleOnly(nextStaleOnly);
+ if (nextProtectedState !== untrack(protectedStateFilter)) {
+ setProtectedStateFilter(nextProtectedState);
+ }
if (nextRange !== untrack(chartRangeDays)) setChartRangeDays(nextRange as 7 | 30 | 90 | 365);
if (nextCluster !== untrack(clusterFilter)) setClusterFilter(nextCluster);
if ((visibleDay || null) !== untrack(selectedDateKey)) setSelectedDateKey(visibleDay || null);
@@ -356,7 +421,10 @@ export function useRecoverySurfaceState() {
if (nextNode !== untrack(nodeFilter)) setNodeFilter(nextNode);
if (nextNamespace !== untrack(namespaceFilter)) setNamespaceFilter(nextNamespace);
- if (
+ if (resolvedView === 'inventory') {
+ if (untrack(verificationFilter) !== 'all') setVerificationFilter('all');
+ if (untrack(historyOutcomeFilter) !== 'all') setHistoryOutcomeFilter('all');
+ } else if (
verificationValue === 'verified' ||
verificationValue === 'unverified' ||
verificationValue === 'unknown'
@@ -395,6 +463,7 @@ export function useRecoverySurfaceState() {
nodeFilter();
namespaceFilter();
scopeFilter();
+ protectedStateFilter();
chartRangeDays();
selectedDateKey();
if (untrack(currentPage) !== 1) setCurrentPage(1);
@@ -414,7 +483,11 @@ export function useRecoverySurfaceState() {
query: queryFilter().trim() || null,
platform: platformFilter() !== 'all' ? platformFilter() : null,
itemType: itemTypeFilter() !== 'all' ? itemTypeFilter() : null,
- stale: protectedStaleOnly() ? '1' : null,
+ state:
+ workspaceView() === 'inventory' && protectedStateFilter() !== 'all'
+ ? protectedStateFilter()
+ : null,
+ stale: null,
range: chartRangeDays() !== 30 ? String(chartRangeDays()) : null,
cluster: clusterFilter() !== 'all' ? clusterFilter() : null,
day: selectedDateKey(),
@@ -544,7 +617,7 @@ export function useRecoverySurfaceState() {
namespaceOptions,
nodeFilter,
nodeOptions,
- protectedStaleOnly,
+ protectedStateFilter,
platformFilter,
platformOptions,
queryFilter,
@@ -566,7 +639,7 @@ export function useRecoverySurfaceState() {
setModeFilter,
setNamespaceFilter,
setNodeFilter,
- setProtectedStaleOnly,
+ setProtectedStateFilter,
setPlatformFilter,
setQueryFilter,
setRollupId,
diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
index 8dce880de2..e22e1eed54 100644
--- a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
+++ b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
@@ -496,6 +496,7 @@ describe('resource link routing contract', () => {
const href = buildRecoveryPath({
view: 'events',
platform: 'proxmox-pbs',
+ state: 'stale',
stale: '1',
range: '7',
cluster: 'cluster-main',
@@ -513,6 +514,7 @@ describe('resource link routing contract', () => {
expect(url.pathname).toBe('/recovery');
expect(url.searchParams.get('view')).toBe('events');
expect(url.searchParams.get('platform')).toBe('proxmox-pbs');
+ expect(url.searchParams.get('state')).toBe('stale');
expect(url.searchParams.get('stale')).toBe('1');
expect(url.searchParams.get('range')).toBe('7');
expect(url.searchParams.get('cluster')).toBe('cluster-main');
@@ -531,6 +533,7 @@ describe('resource link routing contract', () => {
rollupId: '',
view: 'events',
platform: 'proxmox-pbs',
+ state: 'stale',
stale: '1',
range: '7',
cluster: 'cluster-main',
@@ -547,6 +550,7 @@ describe('resource link routing contract', () => {
expect(RECOVERY_QUERY_PARAMS.platform).toBe('platform');
expect(RECOVERY_QUERY_PARAMS.view).toBe('view');
+ expect(RECOVERY_QUERY_PARAMS.state).toBe('state');
expect(RECOVERY_QUERY_PARAMS.stale).toBe('stale');
expect(RECOVERY_QUERY_PARAMS.range).toBe('range');
expect(RECOVERY_QUERY_PARAMS.cluster).toBe('cluster');
diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.ts
index 2dd083dcbe..db4b637523 100644
--- a/frontend-modern/src/routing/resourceLinks.ts
+++ b/frontend-modern/src/routing/resourceLinks.ts
@@ -73,6 +73,7 @@ export const RECOVERY_QUERY_PARAMS = {
rollupId: 'rollupId',
view: 'view',
platform: 'platform',
+ state: 'state',
stale: 'stale',
range: 'range',
cluster: 'cluster',
@@ -151,6 +152,7 @@ type RecoveryLinkOptions = {
rollupId?: string | null;
view?: string | null;
platform?: string | null;
+ state?: string | null;
stale?: string | null;
range?: string | null;
cluster?: string | null;
@@ -584,6 +586,7 @@ export const parseRecoveryLinkSearch = (search: string) => {
params.get(RECOVERY_LEGACY_PLATFORM_QUERY_PARAM),
]),
),
+ state: normalizeQueryValue(params.get(RECOVERY_QUERY_PARAMS.state)),
stale: normalizeQueryBooleanFlag(params.get(RECOVERY_QUERY_PARAMS.stale)),
range: normalizeQueryValue(params.get(RECOVERY_QUERY_PARAMS.range)),
cluster: normalizeQueryValue(params.get(RECOVERY_QUERY_PARAMS.cluster)),
@@ -604,6 +607,7 @@ export const buildRecoveryPath = (options: RecoveryLinkOptions = {}): string =>
const rollupId = normalizeQueryValue(options.rollupId);
const view = normalizeQueryValue(options.view);
const platform = normalizeSourcePlatformQueryValue(options.platform);
+ const state = normalizeQueryValue(options.state);
const stale = normalizeQueryBooleanFlag(options.stale);
const range = normalizeQueryValue(options.range);
const cluster = normalizeQueryValue(options.cluster);
@@ -620,6 +624,7 @@ export const buildRecoveryPath = (options: RecoveryLinkOptions = {}): string =>
if (rollupId) params.set(RECOVERY_QUERY_PARAMS.rollupId, rollupId);
if (view) params.set(RECOVERY_QUERY_PARAMS.view, view);
if (platform) params.set(RECOVERY_QUERY_PARAMS.platform, platform);
+ if (state) params.set(RECOVERY_QUERY_PARAMS.state, state);
if (stale) params.set(RECOVERY_QUERY_PARAMS.stale, stale);
if (range) params.set(RECOVERY_QUERY_PARAMS.range, range);
if (cluster) params.set(RECOVERY_QUERY_PARAMS.cluster, cluster);