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.

refactor(recovery): default history to item type

rcourtmanb6378558761c
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index d56fda2e7c..c180d28ed8 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -350,6 +350,11 @@ first-class column in the main inventory grid rather than leaving platform as
the only structural classifier beside the item label. Platform badges remain
important supporting operator context, especially for Proxmox-heavy fleets,
but the table frame itself must make protected item class explicit.
+The same owned vocabulary applies to recovery events as well:
+`frontend-modern/src/utils/recoveryTablePresentation.ts` must keep the
+history-table `type` column labeled as `Item Type` within recovery surfaces so
+event history does not fall back to a generic shared `Type` header once the
+recovery lane has already established item-first operator vocabulary.
The recovery table presentation helper now owns the canonical subject-type
label fallback for recovery rows and delegates its title-casing to the shared
`frontend-modern/src/utils/textPresentation.ts` helper rather than keeping a
diff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsx
index 22ac015e5f..389794c5d4 100644
--- a/frontend-modern/src/components/Recovery/Recovery.tsx
+++ b/frontend-modern/src/components/Recovery/Recovery.tsx
@@ -39,7 +39,7 @@ import {
STALE_ISSUE_THRESHOLD_MS,
} from '@/utils/recoveryTablePresentation';
import { getRecoveryTimelineLabelEvery } from '@/utils/recoveryTimelineChartPresentation';
-import { createHiddenCanonicalTypeColumn } from '@/utils/typeColumnDefinition';
+import { createVisibleCanonicalTypeColumn } from '@/utils/typeColumnDefinition';
const MOBILE_RECOVERY_COLUMNS = new Set(['time', 'subject', 'outcome']);
type RecoveryWorkspaceView = 'inventory' | 'events';
@@ -291,7 +291,7 @@ const Recovery: Component = () => {
const artifactColumns: ColumnDef[] = [
{ id: 'time', label: 'Time' },
- createHiddenCanonicalTypeColumn(),
+ { ...createVisibleCanonicalTypeColumn(), label: getRecoveryArtifactColumnLabel('type', 'Type') },
{ id: 'subject', label: getRecoveryArtifactColumnLabel('subject', 'Subject') },
{ id: 'entityId', label: 'ID', toggleable: true },
{ id: 'cluster', label: 'Cluster', toggleable: true },
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 9c6d6a023a..290b8844dd 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -210,6 +210,7 @@ describe('Recovery', () => {
expect(screen.getAllByRole('table')).toHaveLength(1);
});
const historyTable = screen.getAllByRole('table')[0];
+ expect(within(historyTable).getByText('Item Type')).toBeInTheDocument();
expect(within(historyTable).getByText('Item')).toBeInTheDocument();
expect(within(historyTable).getByText('Platform')).toBeInTheDocument();
});
@@ -306,7 +307,7 @@ describe('Recovery', () => {
const tables = await screen.findAllByRole('table');
const historyTable = tables.find((table) => within(table).queryByText('Local Copy'));
expect(historyTable).toBeDefined();
- expect(historyTable).toHaveStyle({ 'min-width': '1046px', 'table-layout': 'fixed' });
+ expect(historyTable).toHaveStyle({ 'min-width': '1142px', 'table-layout': 'fixed' });
});
it('focuses history when a rollup is clicked', async () => {
diff --git a/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts b/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts
index 69201df96b..97a679328e 100644
--- a/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts
@@ -40,8 +40,10 @@ describe('recoveryTablePresentation', () => {
expect(getRecoveryProtectedSearchPlaceholder()).toBe('Search protected items...');
expect(getRecoveryHistorySearchPlaceholder()).toBe('Search recovery history...');
expect(getRecoverySearchHistoryEmptyMessage()).toBe('Recent searches appear here.');
+ expect(RECOVERY_ARTIFACT_COLUMN_LABELS.type).toBe('Item Type');
expect(RECOVERY_ARTIFACT_COLUMN_LABELS.subject).toBe('Item');
expect(RECOVERY_ARTIFACT_COLUMN_LABELS.source).toBe('Platform');
+ expect(getRecoveryArtifactColumnLabel('type', 'Type')).toBe('Item Type');
expect(getRecoveryArtifactColumnLabel('subject', 'Subject')).toBe('Item');
expect(getRecoveryArtifactColumnLabel('source', 'Source')).toBe('Platform');
expect(getRecoveryArtifactColumnLabel('outcome', 'Outcome')).toBe('Outcome');
@@ -97,7 +99,7 @@ describe('recoveryTablePresentation', () => {
it('derives artifact header and row classes', () => {
expect(getRecoveryArtifactColumnHeaderClass('time')).toContain('text-right');
- expect(getRecoveryArtifactColumnHeaderClass('type')).toContain('w-[72px]');
+ expect(getRecoveryArtifactColumnHeaderClass('type')).toContain('w-[96px]');
expect(getRecoveryArtifactColumnHeaderClass('subject')).toContain('w-[248px]');
expect(getRecoveryArtifactTableMinWidth(['time', 'subject', 'outcome'])).toBe('980px');
expect(
@@ -113,7 +115,7 @@ describe('recoveryTablePresentation', () => {
'details',
'outcome',
]),
- ).toBe('1174px');
+ ).toBe('1198px');
expect(getRecoveryArtifactRowClass(true)).toContain('outline-blue-200/80');
expect(getRecoveryArtifactRowClass(false)).toBe('hover:bg-surface-hover');
});
diff --git a/frontend-modern/src/utils/recoveryTablePresentation.ts b/frontend-modern/src/utils/recoveryTablePresentation.ts
index 16538eca70..5bf93d5ece 100644
--- a/frontend-modern/src/utils/recoveryTablePresentation.ts
+++ b/frontend-modern/src/utils/recoveryTablePresentation.ts
@@ -20,13 +20,14 @@ export const RECOVERY_PROTECTED_SEARCH_PLACEHOLDER = 'Search protected items...'
export const RECOVERY_HISTORY_SEARCH_PLACEHOLDER = 'Search recovery history...';
export const RECOVERY_SEARCH_HISTORY_EMPTY_MESSAGE = 'Recent searches appear here.';
export const RECOVERY_ARTIFACT_COLUMN_LABELS: Record<string, string> = {
+ type: 'Item Type',
subject: 'Item',
source: 'Platform',
};
const RECOVERY_ARTIFACT_COLUMN_SPECS: Record<string, { headerClass: string; minWidthPx: number }> = {
time: { headerClass: 'w-[76px] text-right', minWidthPx: 76 },
- type: { headerClass: 'w-[72px] text-center', minWidthPx: 72 },
+ type: { headerClass: 'w-[96px] text-center', minWidthPx: 96 },
subject: { headerClass: 'w-[248px]', minWidthPx: 248 },
entityId: { headerClass: 'w-[84px]', minWidthPx: 84 },
cluster: { headerClass: 'w-[120px]', minWidthPx: 120 },