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): move summary support into card headers

rcourtmance7e0df379aa
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 1260f1d0e3..1b1074d576 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -760,10 +760,12 @@ instead of feature-local spacing overrides. Recovery may select the shared
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 one-headline rule applies to the footprint card too. `Protected
-Footprint` should lead with one dominant item-type count and carry platform
-coverage as a support row instead of presenting dual headline counts plus mix
-chips inside the same card.
+That same one-headline rule applies to the footprint and activity cards too.
+`Coverage` should lead with one dominant item-type count and route platform
+count through the shared card-header secondary label path instead of another
+body row, and `Activity` should route latest-activity context through that same
+secondary-label path instead of adding recovery-only support text under the
+metric.
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
diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
index acf4d374c7..dc58737288 100644
--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx
@@ -61,11 +61,11 @@ describe('RecoverySummary', () => {
expect(screen.getAllByText(/attention/i).length).toBeGreaterThan(0);
expect(screen.getByText(/recovery points/i)).toBeInTheDocument();
expect(screen.getByText(/item types/i)).toBeInTheDocument();
- expect(screen.getByText('Platforms 2')).toBeInTheDocument();
+ expect(screen.getByText('2 platforms')).toBeInTheDocument();
expect(screen.getByText('Healthy 1 · Failed 1')).toBeInTheDocument();
expect(screen.getByText('>7d 1 · Never Succeeded 1')).toBeInTheDocument();
expect(screen.getByText('fresh in 24h')).toBeInTheDocument();
- expect(screen.getByText('Latest Activity Mar 9')).toBeInTheDocument();
+ expect(screen.getByText('Mar 9')).toBeInTheDocument();
expect(screen.getByText('2 protected items')).toBeInTheDocument();
expect(screen.getByText('need attention')).toBeInTheDocument();
expect(screen.queryByText('protected items')).not.toBeInTheDocument();
@@ -81,6 +81,8 @@ describe('RecoverySummary', () => {
expect(screen.queryByText('Peak Throughput')).not.toBeInTheDocument();
expect(screen.queryByText('Peak Day')).not.toBeInTheDocument();
expect(screen.queryByText('stale items')).not.toBeInTheDocument();
+ expect(screen.queryByText('Platforms 2')).not.toBeInTheDocument();
+ expect(screen.queryByText('Latest Activity Mar 9')).not.toBeInTheDocument();
expect(screen.queryByText(/^Platforms$/)).not.toBeInTheDocument();
expect(screen.queryByText(/^Healthy$/)).not.toBeInTheDocument();
expect(screen.queryByText(/^Failed$/)).not.toBeInTheDocument();
diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.tsx
index b12c43e8cd..18dc285e8b 100644
--- a/frontend-modern/src/components/Recovery/RecoverySummary.tsx
+++ b/frontend-modern/src/components/Recovery/RecoverySummary.tsx
@@ -142,13 +142,21 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
.join(' · '),
);
- const footprintSupportLine = createMemo(() => `Platforms ${platformCoverage().platformCount}`);
+ const coverageSecondaryLabel = createMemo(() => {
+ const platformCount = platformCoverage().platformCount;
+ if (platformCount <= 0) return undefined;
+ return (
+ <span class="ml-auto truncate text-xs text-muted">
+ {platformCount} {platformCount === 1 ? 'platform' : 'platforms'}
+ </span>
+ );
+ });
- const historySupportLine = createMemo(() =>
- activity().latestLabel
- ? `Latest Activity ${activity().latestLabel}`
- : `Days Active ${activity().activeDays}`,
- );
+ const activitySecondaryLabel = createMemo(() => {
+ const latestLabel = activity().latestLabel;
+ if (!latestLabel) return undefined;
+ return <span class="ml-auto truncate text-xs text-muted">{latestLabel}</span>;
+ });
return (
<Show when={hasRollups()}>
@@ -191,7 +199,12 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
</div>
</SummaryMetricCard>
- <SummaryMetricCard label="Coverage" loaded={true} hasData={hasRollups()}>
+ <SummaryMetricCard
+ label="Coverage"
+ secondaryLabel={coverageSecondaryLabel()}
+ loaded={true}
+ hasData={hasRollups()}
+ >
<div class="flex h-full flex-col gap-1.5">
<div>
<div class="text-xl font-semibold tabular-nums text-base-content">
@@ -199,12 +212,12 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
</div>
<div class="text-[11px] text-muted">item types</div>
</div>
- <div class="text-[11px] text-muted">{footprintSupportLine()}</div>
</div>
</SummaryMetricCard>
<SummaryMetricCard
label="Activity"
+ secondaryLabel={activitySecondaryLabel()}
loaded={props.seriesLoaded()}
hasData={activity().hasData}
emptyMessage={props.seriesFailed?.() ? 'Trend data unavailable' : 'No recovery activity yet'}
@@ -216,7 +229,6 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {
</div>
<div class="text-[11px] text-muted">recovery points</div>
</div>
- <div class="text-[11px] text-muted">{historySupportLine()}</div>
</div>
</SummaryMetricCard>
</SummaryPanel>