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): align recovery scan density

rcourtman3558ef9db34c
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 5e4ff6f2e7..57f5cc0e09 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -678,6 +678,11 @@ That same summary-card rule should also avoid inset mini-panels inside the
cards themselves. Recovery summary cards should prefer direct metric rows,
lists, and badge-backed counts over "cards inside cards", which make the strip
feel heavier than the equivalent infrastructure and workloads telemetry.
+That same compact-summary rule should also avoid repeating the same attention,
+stale, and footprint telemetry in multiple stacked readouts inside one card.
+Recovery summary cards should keep one dominant metric with one short support
+band so the strip scans at the same speed as infrastructure and workloads
+instead of behaving like a recovery-only executive summary.
That same inventory surface should also follow the established monitoring-table
scan pattern in its first column. Protected-item rows should lead with a clear
status cue, the primary item name, and compact badge-backed item/platform
@@ -707,6 +712,11 @@ The protected-items status row should surface the active workspace, protected
item count, and issue cues, but page-number and sort-direction bookkeeping
belongs in the table chrome itself rather than competing with the primary scan
path before operators even reach the rows.
+That same table density rule also applies to recovery table chrome and filter
+rows. Recovery inventory and event tables should use the same restrained
+title-case header typography, compact control heights, and thin row density as
+the established Pulse monitoring tables instead of drifting into report-style
+uppercase headers or oversized filter chrome.
That same workspace rule also means the protected-items versus recovery-events
switcher should live inside the active workspace header strip, not in its own
separate band above the cards, so the page hands off from summary directly into
diff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsx
index d656411444..9a0d70e1a8 100644
--- a/frontend-modern/src/components/Recovery/Recovery.tsx
+++ b/frontend-modern/src/components/Recovery/Recovery.tsx
@@ -474,7 +474,7 @@ const Recovery: Component = () => {
};
return (
- <div data-testid="recovery-page" class="flex flex-col gap-4">
+ <div data-testid="recovery-page" class="flex flex-col gap-3">
<RecoverySummary
rollups={rollups}
series={() => recoverySeries.series() || []}
@@ -484,7 +484,7 @@ const Recovery: Component = () => {
timeRange={summaryRange}
/>
- <div ref={historySectionRef} class="flex flex-col gap-4">
+ <div ref={historySectionRef} class="flex flex-col gap-3">
{(() => {
const workspaceControls = (
<div class="flex flex-wrap items-center gap-2">
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
index f5b6a72296..e4d54b4338 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
@@ -129,7 +129,7 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
<For each={props.mobileVisibleArtifactColumns()}>
{(column) => (
<TableHead
- class={`px-3 py-1.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider whitespace-nowrap ${getRecoveryArtifactColumnHeaderClass(
+ class={`px-3 py-1.5 text-left text-[11px] font-medium whitespace-nowrap ${getRecoveryArtifactColumnHeaderClass(
column.id,
)}`}
>
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index 43c10630a3..c941cba12f 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -202,13 +202,13 @@ export const RecoveryProtectedInventorySection: Component<
tone="card"
class="overflow-hidden border-border-subtle bg-surface"
>
- <div class="border-b border-border-subtle/80 bg-surface px-4 py-2">
+ <div class="border-b border-border-subtle/80 bg-surface px-4 py-1.5">
<div class="flex flex-col gap-2 lg:flex-row lg:items-center lg:justify-between">
<div class="flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:gap-3">
<Show when={props.workspaceControls}>
<div class="shrink-0">{props.workspaceControls}</div>
</Show>
- <div class="flex flex-wrap items-center gap-3 text-[11px] text-muted">
+ <div class="flex flex-wrap items-center gap-2.5 text-[11px] text-muted">
<span class="font-medium text-base-content">
{sortedRollups().length}{' '}
{sortedRollups().length === 1 ? 'protected item' : 'protected items'}
@@ -217,12 +217,12 @@ export const RecoveryProtectedInventorySection: Component<
</div>
<div class="flex flex-wrap items-center gap-2 text-xs">
<Show when={props.rollupsSummary().stale > 0}>
- <span class={`${getRecoveryRollupStatusPillClass('stale')} px-2.5 py-1`}>
+ <span class={`${getRecoveryRollupStatusPillClass('stale')} px-2 py-0.5`}>
{props.rollupsSummary().stale} stale
</span>
</Show>
<Show when={props.rollupsSummary().neverSucceeded > 0}>
- <span class={`${getRecoveryRollupStatusPillClass('never-succeeded')} px-2.5 py-1`}>
+ <span class={`${getRecoveryRollupStatusPillClass('never-succeeded')} px-2 py-0.5`}>
{props.rollupsSummary().neverSucceeded} never succeeded
</span>
</Show>
@@ -231,7 +231,7 @@ export const RecoveryProtectedInventorySection: Component<
</div>
<Show when={!props.kioskMode}>
- <div class="border-b border-border-subtle/80 bg-surface px-4 py-2.5">
+ <div class="border-b border-border-subtle/80 bg-surface px-4 py-2">
<PageControls
search={
<SearchInput
@@ -239,7 +239,7 @@ export const RecoveryProtectedInventorySection: Component<
onChange={(value) => props.setQueryFilter(value)}
placeholder={getRecoveryProtectedSearchPlaceholder()}
class="w-full"
- inputClass="py-2 text-sm"
+ inputClass="py-1.5 text-sm"
clearOnEscape
history={{
storageKey: STORAGE_KEYS.RECOVERY_SEARCH_HISTORY,
@@ -265,8 +265,8 @@ export const RecoveryProtectedInventorySection: Component<
normalizeRecoveryItemTypeQueryValue(event.currentTarget.value) || 'all',
)
}
- groupClass="gap-2 px-1.5 py-1"
- selectClass="min-w-[10rem] max-w-[14rem] py-2 text-sm"
+ groupClass="gap-1.5 px-1.5 py-0.5"
+ selectClass="min-w-[10rem] max-w-[14rem] py-1.5 text-sm"
>
<For each={props.itemTypeOptions()}>
{(itemType) => (
@@ -288,8 +288,8 @@ export const RecoveryProtectedInventorySection: Component<
normalizeSourcePlatformQueryValue(event.currentTarget.value),
)
}
- groupClass="gap-2 px-1.5 py-1"
- selectClass="min-w-[10rem] max-w-[14rem] py-2 text-sm"
+ groupClass="gap-1.5 px-1.5 py-0.5"
+ selectClass="min-w-[10rem] max-w-[14rem] py-1.5 text-sm"
>
<For each={props.platformOptions()}>
{(platform) => (
@@ -309,8 +309,8 @@ export const RecoveryProtectedInventorySection: Component<
props.setHistoryOutcomeFilter(value);
if (value !== 'all') props.setVerificationFilter('all');
}}
- groupClass="gap-2 px-1.5 py-1"
- selectClass="min-w-[9rem] py-2 text-sm"
+ groupClass="gap-1.5 px-1.5 py-0.5"
+ selectClass="min-w-[9rem] py-1.5 text-sm"
>
<For each={availableOutcomes}>
{(outcome) => (
@@ -325,7 +325,7 @@ export const RecoveryProtectedInventorySection: Component<
type="button"
aria-pressed={props.protectedStaleOnly()}
onClick={() => props.setProtectedStaleOnly((value) => !value)}
- class={`rounded-md border px-3 py-2 text-sm font-medium transition-colors ${getRecoveryProtectedToggleClass(
+ class={`rounded-md border px-3 py-1.5 text-sm font-medium transition-colors ${getRecoveryProtectedToggleClass(
props.protectedStaleOnly(),
)}`}
>
@@ -376,7 +376,7 @@ export const RecoveryProtectedInventorySection: Component<
] as const
).map(([column, label]) => (
<TableHead
- class={`sticky top-0 z-[1] bg-surface-alt/95 px-3 py-2.5 whitespace-nowrap text-left text-[11px] sm:text-xs font-semibold uppercase tracking-[0.14em] cursor-pointer select-none hover:text-base-content transition-colors${
+ class={`sticky top-0 z-[1] bg-surface-alt/95 px-3 py-2 whitespace-nowrap text-left text-[11px] font-medium cursor-pointer select-none hover:text-base-content transition-colors${
column === 'type'
? ' hidden md:table-cell w-[96px]'
: column === 'platform'
@@ -446,7 +446,7 @@ export const RecoveryProtectedInventorySection: Component<
onClick={() => props.onSelectRollup(rollup.rollupId)}
>
<TableCell
- class="max-w-[420px] px-3 py-1.5 text-base-content"
+ class="max-w-[420px] px-3 py-1 text-base-content"
title={label}
>
<div class="flex min-w-0 flex-col gap-1">
@@ -492,7 +492,7 @@ export const RecoveryProtectedInventorySection: Component<
</div>
</TableCell>
- <TableCell class="hidden md:table-cell whitespace-nowrap px-3 py-1.5">
+ <TableCell class="hidden md:table-cell whitespace-nowrap px-3 py-1">
<Show
when={itemTypePresentation}
fallback={<span class="text-muted">—</span>}
@@ -503,7 +503,7 @@ export const RecoveryProtectedInventorySection: Component<
</Show>
</TableCell>
- <TableCell class="hidden lg:table-cell whitespace-nowrap px-3 py-1.5">
+ <TableCell class="hidden lg:table-cell whitespace-nowrap px-3 py-1">
<div class="flex flex-wrap gap-1.5">
<For each={platforms}>
{(platform) => {
@@ -519,7 +519,7 @@ export const RecoveryProtectedInventorySection: Component<
</TableCell>
<TableCell
- class={`whitespace-nowrap px-3 py-1.5 ${getRecoveryRollupAgeTextClass(
+ class={`whitespace-nowrap px-3 py-1 ${getRecoveryRollupAgeTextClass(
rollup,
nowMs,
)}`}
@@ -540,7 +540,7 @@ export const RecoveryProtectedInventorySection: Component<
)}
</TableCell>
- <TableCell class="whitespace-nowrap px-3 py-1.5">
+ <TableCell class="whitespace-nowrap px-3 py-1">
<span
class={`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${getRecoveryOutcomeBadgeClass(
outcome,
diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
index c329224ad5..6d5e712532 100644
--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
@@ -68,5 +68,6 @@ describe('RecoverySummary', () => {
expect(screen.getAllByText(/Never Succeeded/i).length).toBeGreaterThan(0);
expect(screen.getByText('need attention')).toBeInTheDocument();
expect(screen.getByText('stale items')).toBeInTheDocument();
+ expect(screen.queryByText('protected items')).not.toBeInTheDocument();
});
});
diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.tsx
index c0740e3ec9..ad4a2eeaec 100644
--- a/frontend-modern/src/components/Recovery/RecoverySummary.tsx
+++ b/frontend-modern/src/components/Recovery/RecoverySummary.tsx
@@ -1,5 +1,4 @@
import { Component, For, Show, createMemo } from 'solid-js';
-import { getSourcePlatformBadge } from '@/components/shared/sourcePlatformBadges';
import { SummaryPanel } from '@/components/shared/SummaryPanel';
import { SummaryMetricCard } from '@/components/shared/SummaryMetricCard';
import type { ProtectionRollup, RecoveryOutcome, RecoveryPointsSeriesBucket } from '@/types/recovery';
@@ -99,86 +98,77 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
timeRanges={RECOVERY_SUMMARY_TIME_RANGES}
timeRangeLabels={RECOVERY_SUMMARY_TIME_RANGE_LABELS}
testId="recovery-summary"
- class="overflow-hidden"
+ class="overflow-hidden !p-1.5 sm:!p-2.5"
>
<SummaryMetricCard label="Recovery Posture" loaded={true} hasData={hasRollups()}>
- <div class="flex h-full flex-col gap-2.5">
- <div class="flex items-start justify-between gap-3">
- <div>
- <div class={`text-2xl font-semibold tabular-nums ${primaryPostureMetric().valueClass}`}>
- {primaryPostureMetric().value}
- </div>
- <div class="text-xs text-muted">{primaryPostureMetric().label}</div>
- </div>
- <div class="text-right">
- <div class="text-sm font-semibold tabular-nums text-base-content">
- {summary().total}
- </div>
- <div class="text-[11px] text-muted">protected items</div>
+ <div class="flex h-full flex-col gap-2">
+ <div>
+ <div class={`text-xl font-semibold tabular-nums ${primaryPostureMetric().valueClass}`}>
+ {primaryPostureMetric().value}
</div>
+ <div class="text-[11px] text-muted">{primaryPostureMetric().label}</div>
</div>
- <div class="space-y-1.5">
- <div class="h-1.5 overflow-hidden rounded-full bg-surface-alt">
- <div class="flex h-full">
- <For each={visiblePostureSegments()}>
- {(segment) => (
- <div
- class={segment.color}
- style={{ width: `${Math.max(segment.percent, segment.count > 0 ? 4 : 0)}%` }}
- title={`${segment.label}: ${segment.count}`}
- />
- )}
- </For>
- </div>
- </div>
- <div class="grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11px]">
+ <div class="h-1.5 overflow-hidden rounded-full bg-surface-alt">
+ <div class="flex h-full">
<For each={visiblePostureSegments()}>
{(segment) => (
- <div class="flex items-center justify-between gap-3">
- <div class="flex items-center gap-2 text-base-content">
- <span class={`h-2 w-2 rounded-full ${segment.color}`} />
- <span>{segment.label}</span>
- </div>
- <span class={`font-semibold tabular-nums ${segment.textColor}`}>
- {segment.count}
- </span>
- </div>
+ <div
+ class={segment.color}
+ style={{ width: `${Math.max(segment.percent, segment.count > 0 ? 4 : 0)}%` }}
+ title={`${segment.label}: ${segment.count}`}
+ />
)}
</For>
</div>
</div>
+
+ <div class="grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]">
+ <For each={visiblePostureSegments()}>
+ {(segment) => (
+ <div class="flex items-center justify-between gap-2">
+ <div class="flex min-w-0 items-center gap-1.5 text-base-content">
+ <span class={`h-1.5 w-1.5 rounded-full ${segment.color}`} />
+ <span class="truncate">{segment.label}</span>
+ </div>
+ <span class={`shrink-0 font-semibold tabular-nums ${segment.textColor}`}>
+ {segment.count}
+ </span>
+ </div>
+ )}
+ </For>
+ </div>
</div>
</SummaryMetricCard>
<SummaryMetricCard label="Freshness" loaded={true} hasData={hasRollups()}>
- <div class="flex h-full flex-col gap-2.5">
- <div class="flex items-start justify-between gap-3">
+ <div class="flex h-full flex-col gap-2">
+ <div class="flex items-end justify-between gap-3">
<div>
- <div class="text-2xl font-semibold tabular-nums text-amber-600 dark:text-amber-400">
+ <div class="text-xl font-semibold tabular-nums text-amber-600 dark:text-amber-400">
{summary().stale}
</div>
- <div class="text-xs text-muted">stale items</div>
+ <div class="text-[11px] text-muted">stale items</div>
</div>
<div class="text-right text-[11px]">
- <div>
- <span class="font-semibold text-rose-600 dark:text-rose-400">
- {summary().neverSucceeded}
- </span>{' '}
- <span class="text-muted">never succeeded</span>
+ <div class="font-semibold tabular-nums text-rose-600 dark:text-rose-400">
+ {summary().neverSucceeded}
</div>
+ <div class="text-muted">Never Succeeded</div>
</div>
</div>
- <div class="grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11px]">
+ <div class="grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]">
<For each={freshnessBuckets()}>
{(bucket) => (
- <div class="flex items-center justify-between gap-3">
- <div class="flex items-center gap-2 text-base-content">
- <span class={`h-2 w-2 rounded-full ${bucket.color}`} />
- <span>{bucket.label}</span>
+ <div class="flex items-center justify-between gap-2">
+ <div class="flex min-w-0 items-center gap-1.5 text-base-content">
+ <span class={`h-1.5 w-1.5 rounded-full ${bucket.color}`} />
+ <span class="truncate">{bucket.label}</span>
</div>
- <span class="tabular-nums font-semibold text-base-content">{bucket.count}</span>
+ <span class="shrink-0 tabular-nums font-semibold text-base-content">
+ {bucket.count}
+ </span>
</div>
)}
</For>
@@ -187,24 +177,24 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
</SummaryMetricCard>
<SummaryMetricCard label="Protected Footprint" loaded={true} hasData={hasRollups()}>
- <div class="flex h-full flex-col gap-2.5">
- <div class="flex items-start justify-between gap-3">
+ <div class="flex h-full flex-col gap-2">
+ <div class="grid grid-cols-2 gap-3">
<div>
- <div class="text-2xl font-semibold tabular-nums text-base-content">
+ <div class="text-xl font-semibold tabular-nums text-base-content">
{itemCoverage().itemTypeCount}
</div>
- <div class="text-xs text-muted">item types</div>
+ <div class="text-[11px] text-muted">item types</div>
</div>
<div class="text-right">
- <div class="text-sm font-semibold tabular-nums text-base-content">
+ <div class="text-xl font-semibold tabular-nums text-base-content">
{platformCoverage().platformCount}
</div>
<div class="text-[11px] text-muted">platforms</div>
</div>
</div>
- <dl class="space-y-1 text-[11px]">
- <div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-1">
+ <dl class="space-y-1 border-t border-border-subtle pt-1.5 text-[11px]">
+ <div class="flex items-center justify-between gap-3">
<dt class="text-muted">Primary Item</dt>
<dd class="font-medium text-base-content">
{itemCoverage().primaryItemLabel ?? 'n/a'}
@@ -217,37 +207,6 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
</dd>
</div>
</dl>
-
- <div class="grid gap-1.5 border-t border-border-subtle pt-2">
- <Show when={itemCoverage().items.length > 0}>
- <div class="flex flex-wrap gap-1.5">
- <For each={itemCoverage().items.slice(0, 3)}>
- {(item) => (
- <div class="inline-flex items-center gap-1.5 text-[11px]">
- <span class={item.toneClass}>{item.label}</span>
- <span class="tabular-nums text-base-content">{item.count}</span>
- </div>
- )}
- </For>
- </div>
- </Show>
-
- <div class="flex flex-wrap gap-1.5">
- <For each={platformCoverage().items.slice(0, 3)}>
- {(item) => {
- const badge = getSourcePlatformBadge(item.key);
- return (
- <div class="inline-flex items-center gap-1.5 text-[11px]">
- <span class={badge?.classes || 'inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-surface-alt text-base-content'}>
- {badge?.label || item.label}
- </span>
- <span class="tabular-nums text-base-content">{item.count}</span>
- </div>
- );
- }}
- </For>
- </div>
- </div>
</div>
</SummaryMetricCard>
@@ -257,12 +216,12 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
hasData={activity().hasData}
emptyMessage={props.seriesFailed?.() ? 'Trend data unavailable' : 'No recovery activity yet'}
>
- <div class="flex h-full flex-col gap-2.5">
+ <div class="flex h-full flex-col gap-2">
<div>
- <div class="text-2xl font-semibold tabular-nums text-base-content">
+ <div class="text-xl font-semibold tabular-nums text-base-content">
{activity().totalEvents}
</div>
- <div class="text-xs text-muted">recovery points</div>
+ <div class="text-[11px] text-muted">recovery points</div>
</div>
<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px]">
@@ -276,7 +235,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
<span class="font-semibold text-base-content">{activity().busiestCount}</span>
</div>
- <div class="border-t border-border-subtle pt-2 text-[11px]">
+ <div class="border-t border-border-subtle pt-1.5 text-[11px]">
<div class="flex flex-wrap items-center gap-x-3 gap-y-1">
<span class="text-muted">Peak Day</span>
<span class="font-medium text-base-content">{activity().busiestLabel ?? 'n/a'}</span>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 5ee651ffef..95372e1f30 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -220,6 +220,8 @@ describe('Recovery', () => {
expect(within(inventoryTable).getByText('Item')).toBeInTheDocument();
expect(within(inventoryTable).getByText('Item Type')).toBeInTheDocument();
expect(within(inventoryTable).getByText('Platform')).toBeInTheDocument();
+ expect(within(inventoryTable).queryByText('ITEM TYPE')).not.toBeInTheDocument();
+ expect(within(inventoryTable).queryByText('PLATFORM')).not.toBeInTheDocument();
expect(within(inventoryTable).getAllByText('VM').length).toBeGreaterThan(0);
const vmRow = screen.getByText('VM 123').closest('tr');
expect(vmRow).not.toBeNull();
@@ -251,6 +253,8 @@ describe('Recovery', () => {
expect(within(historyTable).getByText('Item Type')).toBeInTheDocument();
expect(within(historyTable).getByText('Item')).toBeInTheDocument();
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).queryByText('Details')).not.toBeInTheDocument();
const historyRow = within(historyTable).getByLabelText('Healthy').closest('tr');