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): quiet supporting table columns

rcourtman420ff365e724
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 39b968227f..2269f0c514 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -754,6 +754,11 @@ That same row contract should avoid duplicating context that already has a
dedicated column. When `Item Type` and `Platform` columns are visible, the
primary item cell should not restate those same badges on desktop; duplicate
context belongs only as a small-screen fallback when those columns collapse.
+That same scan rule applies to the supporting columns themselves. Recovery
+tables should keep one dominant identity cue and one canonical platform cue,
+while `Item Type`, `Method`, and similar supporting fields stay on restrained
+metadata text instead of turning every adjacent column into another colored
+badge.
That same item-identity contract also applies to synthetic Proxmox task
recovery points. When the persisted subject label is just a raw
`pve-task:*`/`UPID:*` identifier or `vmid=0`, the canonical recovery index
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
index a5ff913d38..4bdea9a746 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
@@ -16,13 +16,11 @@ import {
import type { ColumnDef } from '@/hooks/useColumnVisibility';
import { formatBytes } from '@/utils/format';
import { getRecoveryDrawerCloseButtonClass, getRecoveryEmptyStateActionClass } from '@/utils/recoveryActionPresentation';
-import { getRecoveryArtifactModePresentation, type RecoveryArtifactMode } from '@/utils/recoveryArtifactModePresentation';
import {
getRecoveryHistoryEmptyState,
getRecoveryPointsLoadingState,
} from '@/utils/recoveryEmptyStatePresentation';
import {
- getRecoveryOutcomeBadgeClass,
getRecoveryOutcomeLabel,
} from '@/utils/recoveryOutcomePresentation';
import {
@@ -37,9 +35,10 @@ import {
import { getRecoveryPointPlatform } from '@/utils/recoveryPlatformModel';
import {
getRecoveryArtifactColumnHeaderClass,
+ getRecoveryArtifactMetadataTextClass,
+ getRecoveryArtifactOutcomeTextClass,
getRecoveryArtifactRowClass,
getRecoveryEventTimeTextClass,
- getRecoveryPointItemTypeBadgeClass,
getRecoveryPointItemTypeLabel,
RECOVERY_GROUP_HEADER_ROW_CLASS,
RECOVERY_GROUP_HEADER_TEXT_CLASS,
@@ -50,8 +49,6 @@ import type { RecoveryOutcome, RecoveryPoint } from '@/types/recovery';
import type { Resource } from '@/types/resource';
import { formatRecoveryTimeOnly } from '@/utils/recoveryDatePresentation';
-type ArtifactMode = RecoveryArtifactMode;
-
export interface RecoveryPointGroup {
key: string;
label: string;
@@ -227,11 +224,7 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
return (
<TableCell class="whitespace-nowrap px-3 py-1 text-center">
<Show when={itemType} fallback={<span class="text-muted">—</span>}>
- <span
- class={`inline-flex min-w-[2.9rem] justify-center rounded px-1.5 py-px text-[10px] font-medium leading-none ${getRecoveryPointItemTypeBadgeClass(
- point,
- )}`}
- >
+ <span class={getRecoveryArtifactMetadataTextClass()}>
{itemType}
</span>
</Show>
@@ -359,11 +352,7 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
case 'method':
return (
<TableCell class="whitespace-nowrap px-3 py-1 text-center">
- <span
- class={`inline-flex min-w-[3.25rem] justify-center rounded px-1.5 py-px text-[9px] font-medium ${getRecoveryArtifactModePresentation(
- mode as ArtifactMode,
- ).badgeClassName}`}
- >
+ <span class={getRecoveryArtifactMetadataTextClass()}>
{getRecoveryPointModeLabel(point.mode)}
</span>
</TableCell>
@@ -390,9 +379,8 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
return (
<TableCell class="whitespace-nowrap px-3 py-1 text-center">
<span
- class={`inline-flex min-w-[4.5rem] justify-center rounded px-1.5 py-px text-[9px] font-medium ${getRecoveryOutcomeBadgeClass(
- outcome,
- )}`}
+ class={getRecoveryArtifactOutcomeTextClass(outcome)}
+ title={getRecoveryOutcomeLabel(outcome)}
>
{titleCaseDelimitedLabel(outcome)}
</span>
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index 25e2eff85a..c579f3b9d4 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -31,13 +31,14 @@ import {
} from '@/utils/recoveryItemTypePresentation';
import {
getRecoveryArtifactColumnLabel,
+ getRecoveryArtifactMetadataTextClass,
getRecoveryRollupAgeTextClass,
getRecoveryProtectedSearchPlaceholder,
getRecoverySearchHistoryEmptyMessage,
isRecoveryRollupStale,
} from '@/utils/recoveryTablePresentation';
import {
- getRecoveryOutcomeBadgeClass,
+ getRecoveryOutcomeTextClass,
getRecoveryOutcomeLabel,
normalizeRecoveryOutcome,
} from '@/utils/recoveryOutcomePresentation';
@@ -470,7 +471,7 @@ export const RecoveryProtectedInventorySection: Component<
</div>
<div class="flex flex-wrap items-center gap-1.5 text-[10px] md:hidden">
<Show when={itemTypePresentation?.label}>
- <span class={itemTypePresentation?.badgeClasses || 'inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-surface-alt text-base-content'}>
+ <span class={getRecoveryArtifactMetadataTextClass('muted')}>
{itemTypePresentation?.label}
</span>
</Show>
@@ -495,7 +496,7 @@ export const RecoveryProtectedInventorySection: Component<
when={itemTypePresentation}
fallback={<span class="text-muted">—</span>}
>
- <span class={itemTypePresentation?.badgeClasses || 'inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-surface-alt text-base-content'}>
+ <span class={getRecoveryArtifactMetadataTextClass()}>
{itemTypePresentation?.label}
</span>
</Show>
@@ -539,11 +540,7 @@ export const RecoveryProtectedInventorySection: Component<
</TableCell>
<TableCell class="whitespace-nowrap px-3 py-1.5">
- <span
- class={`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${getRecoveryOutcomeBadgeClass(
- outcome,
- )}`}
- >
+ <span class={`text-[11px] font-medium ${getRecoveryOutcomeTextClass(outcome)}`}>
{titleCaseDelimitedLabel(outcome)}
</span>
</TableCell>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index e910c00e25..72b9e831f1 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -268,6 +268,8 @@ describe('Recovery', () => {
expect(within(vmRow!).getByText('VMID 123').parentElement?.className).toContain(
'items-baseline',
);
+ expect(within(vmRow!).getAllByText('VM')[0].className).not.toContain('bg-');
+ expect(within(vmRow!).getByText('Success').className).not.toContain('rounded');
expect(screen.queryByText('Backups By Date')).not.toBeInTheDocument();
expect(screen.queryByText('Recovery Activity')).not.toBeInTheDocument();
@@ -345,6 +347,9 @@ describe('Recovery', () => {
expect(within(historyRow!).getByText('VMID 123').parentElement?.className).toContain(
'items-baseline',
);
+ expect(within(historyRow!).getByText('VM').className).not.toContain('bg-');
+ expect(within(historyRow!).getByText('Local Copy').className).not.toContain('rounded');
+ expect(within(historyRow!).getByText('Success').className).not.toContain('rounded');
expect(activityHeading).toBeInTheDocument();
});
diff --git a/frontend-modern/src/utils/recoveryTablePresentation.ts b/frontend-modern/src/utils/recoveryTablePresentation.ts
index d485cfe34c..92bc5ef962 100644
--- a/frontend-modern/src/utils/recoveryTablePresentation.ts
+++ b/frontend-modern/src/utils/recoveryTablePresentation.ts
@@ -5,7 +5,10 @@ import {
getRecoveryPointItemTypeKey,
} from '@/utils/recoveryItemTypePresentation';
import { getRecoveryLocationFacetLabel } from '@/utils/recoveryLocationPresentation';
-import { normalizeRecoveryOutcome } from '@/utils/recoveryOutcomePresentation';
+import {
+ getRecoveryOutcomeTextClass,
+ normalizeRecoveryOutcome,
+} from '@/utils/recoveryOutcomePresentation';
import type { RecoveryIssueTone } from '@/utils/recoveryIssuePresentation';
export const STALE_ISSUE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1000;
@@ -21,6 +24,8 @@ export const RECOVERY_GROUP_NO_TIMESTAMP_LABEL = 'No Timestamp';
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_METADATA_TEXT_CLASS =
+ 'text-[11px] font-medium text-base-content/80';
export const RECOVERY_ARTIFACT_COLUMN_LABELS: Record<string, string> = {
cluster: getRecoveryLocationFacetLabel('cluster'),
nodeAgent: getRecoveryLocationFacetLabel('node'),
@@ -87,6 +92,18 @@ export function getRecoveryPointItemTypeLabel(point: RecoveryPoint): string {
return getRecoveryItemTypeLabel(getRecoveryPointItemTypeKey(point));
}
+export function getRecoveryArtifactMetadataTextClass(
+ tone: 'default' | 'muted' = 'default',
+): string {
+ return tone === 'muted'
+ ? `${RECOVERY_ARTIFACT_METADATA_TEXT_CLASS} text-muted`
+ : RECOVERY_ARTIFACT_METADATA_TEXT_CLASS;
+}
+
+export function getRecoveryArtifactOutcomeTextClass(outcome: RecoveryOutcome): string {
+ return `text-[11px] font-medium ${getRecoveryOutcomeTextClass(outcome)}`;
+}
+
export function getRecoverySubjectTypeBadgeClass(point: RecoveryPoint): string {
return getRecoveryPointItemTypeBadgeClass(point);
}