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): remove duplicate posture cues

rcourtmanf372cd680e04
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 71f57bcd23..f3a659ee28 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -701,8 +701,9 @@ freshness card should emphasize recent successful coverage such as fresh-in-24h
reach, while posture owns the attention-state headline.
That same density rule should route through the shared summary primitives
instead of feature-local spacing overrides. Recovery may select the shared
-compact `SummaryPanel` / `SummaryMetricCard` density mode, but it should not
-reintroduce one-off padding hacks inside `RecoverySummary.tsx`.
+default `SummaryPanel` / `SummaryMetricCard` density mode, and it should not
+reintroduce one-off padding hacks or right-side duplicate KPI blocks inside
+`RecoverySummary.tsx`.
That same scan-first rule applies to the workspace strip. Recovery should not
show tab labels and then repeat the same workspace count as standalone text in
the same strip; the workspace tabs should carry their own counts, while the
@@ -746,6 +747,10 @@ status strip above the control bar. Protected-items and recovery-events should
surface their tabs, counts, and issue cues through the shared page-controls
search row so the page hands from summary directly into one canonical control
surface, the same way other Pulse monitoring pages do.
+That same strip should not repeat the broad stale or never-succeeded posture
+counts once the summary already owns those signals. The protected-items control
+row should stay focused on workspace navigation, drill-in context, and active
+filters instead of echoing page-wide posture pills above the same table.
That same workspace handoff should stay on shared primitive styling too. When
recovery embeds its workspace tabs inside the page-controls row, the switcher
should use the shared `Subtabs.tsx` control-surface variant instead of stacking
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index d0f66f6192..428b17eb4b 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -212,16 +212,6 @@ export const RecoveryProtectedInventorySection: Component<
<Show when={props.workspaceControls}>
<div class="shrink-0">{props.workspaceControls}</div>
</Show>
- <Show when={props.rollupsSummary().stale > 0}>
- <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 py-0.5`}>
- {props.rollupsSummary().neverSucceeded} never succeeded
- </span>
- </Show>
</div>
}
search={
diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
index 9cd4f277c8..4fed4cf8c2 100644
--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
@@ -66,10 +66,10 @@ describe('RecoverySummary', () => {
expect(screen.getByText('Avg / Day')).toBeInTheDocument();
expect(screen.getByText('Healthy')).toBeInTheDocument();
expect(screen.getByText('Failed')).toBeInTheDocument();
+ expect(screen.getByText('<1h')).toBeInTheDocument();
expect(screen.getByText('<24h')).toBeInTheDocument();
expect(screen.getByText('>7d')).toBeInTheDocument();
expect(screen.getByText('fresh in 24h')).toBeInTheDocument();
- expect(screen.getByText('stale items')).toBeInTheDocument();
expect(screen.getByText('Latest Activity')).toBeInTheDocument();
expect(screen.getByText('2 protected')).toBeInTheDocument();
expect(screen.getAllByText(/Never Succeeded/i).length).toBeGreaterThan(0);
@@ -78,6 +78,7 @@ describe('RecoverySummary', () => {
expect(screen.queryByText('Running')).not.toBeInTheDocument();
expect(screen.queryByText('<7d')).not.toBeInTheDocument();
expect(screen.queryByText('Peak Throughput')).not.toBeInTheDocument();
+ expect(screen.queryByText('stale items')).not.toBeInTheDocument();
});
it('uses the shared default summary density rather than a recovery-only compact override', () => {
diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.tsx
index 745c8c676c..0d93600fb4 100644
--- a/frontend-modern/src/components/Recovery/RecoverySummary.tsx
+++ b/frontend-modern/src/components/Recovery/RecoverySummary.tsx
@@ -100,6 +100,9 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
(freshnessBuckets().find((bucket) => bucket.key === 'under1h')?.count ?? 0) +
(freshnessBuckets().find((bucket) => bucket.key === 'under24h')?.count ?? 0),
);
+ const freshWithin1hCount = createMemo(
+ () => freshnessBuckets().find((bucket) => bucket.key === 'under1h')?.count ?? 0,
+ );
const MetricRows = (rowProps: {
rows: Array<{ label: string; value: string | number; valueClass?: string }>;
@@ -133,17 +136,11 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
>
<SummaryMetricCard label="Recovery Posture" loaded={true} hasData={hasRollups()}>
<div class="flex h-full flex-col gap-2">
- <div class="flex items-end justify-between gap-3">
- <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="text-right text-[11px]">
- <div class="font-semibold tabular-nums text-base-content">{summary().total}</div>
- <div class="text-muted">protected</div>
+ <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="border-t border-border-subtle pt-1.5">
<MetricRows rows={postureRows()} />
@@ -153,22 +150,19 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
<SummaryMetricCard label="Freshness" loaded={true} hasData={hasRollups()}>
<div class="flex h-full flex-col gap-2">
- <div class="flex items-end justify-between gap-3">
- <div>
- <div class="text-xl font-semibold tabular-nums text-emerald-600 dark:text-emerald-400">
- {freshWithin24hCount()}
- </div>
- <div class="text-[11px] text-muted">fresh in 24h</div>
- </div>
- <div class="text-right text-[11px]">
- <div class="font-semibold tabular-nums text-amber-600 dark:text-amber-400">
- {summary().stale}
- </div>
- <div class="text-muted">stale items</div>
+ <div>
+ <div class="text-xl font-semibold tabular-nums text-emerald-600 dark:text-emerald-400">
+ {freshWithin24hCount()}
</div>
+ <div class="text-[11px] text-muted">fresh in 24h</div>
</div>
<div class="border-t border-border-subtle pt-1.5">
- <MetricRows rows={freshnessRows()} />
+ <MetricRows
+ rows={[
+ { label: '<1h', value: freshWithin1hCount() },
+ ...freshnessRows(),
+ ]}
+ />
</div>
</div>
</SummaryMetricCard>
@@ -223,24 +217,17 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
emptyMessage={props.seriesFailed?.() ? 'Trend data unavailable' : 'No recovery activity yet'}
>
<div class="flex h-full flex-col gap-2">
- <div class="flex items-end justify-between gap-3">
- <div>
- <div class="text-xl font-semibold tabular-nums text-base-content">
- {activity().totalEvents}
- </div>
- <div class="text-[11px] text-muted">recovery points</div>
- </div>
- <div class="text-right text-[11px]">
- <div class="font-semibold tabular-nums text-base-content">
- {activity().averagePerDay.toFixed(1)}
- </div>
- <div class="text-muted">Avg / Day</div>
+ <div>
+ <div class="text-xl font-semibold tabular-nums text-base-content">
+ {activity().totalEvents}
</div>
+ <div class="text-[11px] text-muted">recovery points</div>
</div>
<div class="border-t border-border-subtle pt-1.5">
<MetricRows
rows={[
{ label: 'Days Active', value: activity().activeDays },
+ { label: 'Avg / Day', value: activity().averagePerDay.toFixed(1) },
{ label: 'Peak Day', value: activity().busiestLabel ?? 'n/a' },
{ label: 'Latest Activity', value: activity().latestLabel ?? 'n/a' },
]}
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index d400474e90..272f50fbc9 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -221,6 +221,8 @@ describe('Recovery', () => {
expect(
within(inventoryControls).getByRole('tab', { name: /recovery events 0/i }),
).toBeInTheDocument();
+ expect(within(inventoryControls).queryByText(/^\d+ stale$/i)).not.toBeInTheDocument();
+ expect(within(inventoryControls).queryByText(/never succeeded/i)).not.toBeInTheDocument();
expect(
within(inventoryControls)
.getByRole('tab', { name: /protected items 2/i })