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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
refactor(recovery): use compact shared summary density
rcourtman4dd33ceb315f
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 2246eaddf3..dcda5fa689 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -667,6 +667,14 @@ product copy, or external links back into the shared shell. Internal productnavigation from that shell should still route through canonical shared helperssuch as `frontend-modern/src/routing/resourceLinks.ts` rather than freezing raw`/recovery?...` route strings into the modal itself.+The shared summary strip primitives now follow that same owner split.+`frontend-modern/src/components/shared/SummaryPanel.tsx` and+`frontend-modern/src/components/shared/SummaryMetricCard.tsx` stay the render+shells for summary-frame spacing and card density, while monitoring surfaces+such as recovery, infrastructure, workloads, and storage only choose from the+owned shared density modes instead of forking summary spacing with feature-+local padding hacks. Future summary-density work should extend those shared+primitives rather than hard-coding compact card chrome inside one surface.The shared tooltip now follows that same owner split.`frontend-modern/src/components/shared/Tooltip.tsx` stays the render shell andsingleton API boundary, `frontend-modern/src/components/shared/useTooltipState.ts`diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 57f5cc0e09..a779466111 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -683,6 +683,10 @@ stale, and footprint telemetry in multiple stacked readouts inside one card.Recovery summary cards should keep one dominant metric with one short supportband so the strip scans at the same speed as infrastructure and workloadsinstead of behaving like a recovery-only executive summary.+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`.That same inventory surface should also follow the established monitoring-tablescan pattern in its first column. Protected-item rows should lead with a clearstatus cue, the primary item name, and compact badge-backed item/platformdiff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsxindex 6d5e712532..14e09eb8ba 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx@@ -1,6 +1,7 @@import { render, screen } from '@solidjs/testing-library';import { afterEach, describe, expect, it, vi } from 'vitest';import { RecoverySummary } from './RecoverySummary';+import recoverySummarySource from './RecoverySummary.tsx?raw';describe('RecoverySummary', () => {afterEach(() => {@@ -70,4 +71,9 @@ describe('RecoverySummary', () => {expect(screen.getByText('stale items')).toBeInTheDocument();expect(screen.queryByText('protected items')).not.toBeInTheDocument();});++ it('uses the shared compact summary density mode rather than local card padding forks', () => {+ expect(recoverySummarySource).toContain('density="compact"');+ expect(recoverySummarySource).not.toContain('!p-1.5 sm:!p-2');+ });});diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.tsxindex ad4a2eeaec..ceba0eafd3 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.tsx@@ -98,9 +98,10 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {timeRanges={RECOVERY_SUMMARY_TIME_RANGES}timeRangeLabels={RECOVERY_SUMMARY_TIME_RANGE_LABELS}testId="recovery-summary"- class="overflow-hidden !p-1.5 sm:!p-2.5"+ class="overflow-hidden"+ density="compact">- <SummaryMetricCard label="Recovery Posture" loaded={true} hasData={hasRollups()}>+ <SummaryMetricCard label="Recovery Posture" loaded={true} hasData={hasRollups()} density="compact"><div class="flex h-full flex-col gap-2"><div><div class={`text-xl font-semibold tabular-nums ${primaryPostureMetric().valueClass}`}>@@ -141,7 +142,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {</div></SummaryMetricCard>- <SummaryMetricCard label="Freshness" loaded={true} hasData={hasRollups()}>+ <SummaryMetricCard label="Freshness" loaded={true} hasData={hasRollups()} density="compact"><div class="flex h-full flex-col gap-2"><div class="flex items-end justify-between gap-3"><div>@@ -176,7 +177,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {</div></SummaryMetricCard>- <SummaryMetricCard label="Protected Footprint" loaded={true} hasData={hasRollups()}>+ <SummaryMetricCard label="Protected Footprint" loaded={true} hasData={hasRollups()} density="compact"><div class="flex h-full flex-col gap-2"><div class="grid grid-cols-2 gap-3"><div>@@ -215,6 +216,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {loaded={props.seriesLoaded()}hasData={activity().hasData}emptyMessage={props.seriesFailed?.() ? 'Trend data unavailable' : 'No recovery activity yet'}+ density="compact"><div class="flex h-full flex-col gap-2"><div>diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 383e363cf5..fcfa0ac9b8 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -63,6 +63,8 @@ import monitoredSystemLimitWarningBannerSource from '@/components/shared/Monitorimport monitoredSystemLimitWarningBannerModelSource from '@/components/shared/monitoredSystemLimitWarningBannerModel.ts?raw';import selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx?raw';import selectionCardGroupModelSource from '@/components/shared/selectionCardGroupModel.ts?raw';+import summaryMetricCardSource from '@/components/shared/SummaryMetricCard.tsx?raw';+import summaryPanelSource from '@/components/shared/SummaryPanel.tsx?raw';import tagBadgesSource from '@/components/shared/TagBadges.tsx?raw';import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';import activeUseTrialNudgeStateSource from '@/components/shared/useActiveUseTrialNudgeState.ts?raw';@@ -215,7 +217,7 @@ describe('shared primitive guardrails', () => {expect(activeUseTrialNudgeStateSource).toContain('createMemo');expect(activeUseTrialNudgeStateSource).toContain('window.localStorage');expect(activeUseTrialNudgeStateSource).toContain('setInterval');- expect(activeUseTrialNudgeStateSource).toContain('startProTrial');+ expect(activeUseTrialNudgeStateSource).toContain('runStartProTrialAction');expect(activeUseTrialNudgeStateSource).toContain('snoozeUpsell');expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY');@@ -820,6 +822,20 @@ describe('shared primitive guardrails', () => {expect(whatsNewModalModelSource).toContain("title: 'Infrastructure'");});+ it('keeps summary density control inside the shared summary primitives', () => {+ expect(summaryPanelSource).toContain("density?: 'default' | 'compact'");+ expect(summaryPanelSource).toContain("props.density === 'compact'");+ expect(summaryPanelSource).toContain('grid-cols-2 lg:grid-cols-4');+ expect(summaryPanelSource).not.toContain('Recovery Posture');+ expect(summaryPanelSource).not.toContain('stale items');++ expect(summaryMetricCardSource).toContain("density?: 'default' | 'compact'");+ expect(summaryMetricCardSource).toContain("props.density === 'compact'");+ expect(summaryMetricCardSource).toContain("!p-1.5 sm:!p-2");+ expect(summaryMetricCardSource).not.toContain('Recovery Posture');+ expect(summaryMetricCardSource).not.toContain('Freshness');+ });+it('keeps tooltip on shell, runtime, and model owners', () => {expect(tooltipSource).toContain('useTooltipState');expect(tooltipSource).toContain('createTooltipSystemState');diff --git a/frontend-modern/src/components/shared/SummaryMetricCard.tsx b/frontend-modern/src/components/shared/SummaryMetricCard.tsxindex ffb50de80f..80969ab0d2 100644--- a/frontend-modern/src/components/shared/SummaryMetricCard.tsx+++ b/frontend-modern/src/components/shared/SummaryMetricCard.tsx@@ -15,13 +15,20 @@ export interface SummaryMetricCardProps {emptyMessage?: string;/** Chart or visualization content. */children: JSX.Element;+ /** Optional shared density override for compact monitoring surfaces. */+ density?: 'default' | 'compact';}export function SummaryMetricCard(props: SummaryMetricCardProps) {+ const isCompact = () => props.density === 'compact';+return (- <Card padding="sm" class="h-full">+ <Card+ padding="sm"+ class={`h-full ${isCompact() ? '!p-1.5 sm:!p-2' : ''}`.trim()}+ ><div class="flex flex-col h-full">- <div class="flex items-center mb-1.5 min-w-0">+ <div class={`flex min-w-0 items-center ${isCompact() ? 'mb-1' : 'mb-1.5'}`}><span class="text-xs font-medium text-muted uppercase tracking-wide shrink-0">{props.label}</span>diff --git a/frontend-modern/src/components/shared/SummaryPanel.tsx b/frontend-modern/src/components/shared/SummaryPanel.tsxindex 6a4cca25a2..3ff3e04aba 100644--- a/frontend-modern/src/components/shared/SummaryPanel.tsx+++ b/frontend-modern/src/components/shared/SummaryPanel.tsx@@ -22,19 +22,30 @@ export interface SummaryPanelProps {testId?: string;/** Extra CSS classes on the outer container. */class?: string;+ /** Optional shared density override for compact monitoring surfaces. */+ density?: 'default' | 'compact';}export function SummaryPanel(props: SummaryPanelProps) {const ranges = () => (props.timeRanges ?? SUMMARY_TIME_RANGES) as readonly string[];const labels = () =>props.timeRangeLabels ?? (SUMMARY_TIME_RANGE_LABEL as Record<string, string>);+ const isCompact = () => props.density === 'compact';return (<divdata-testid={props.testId}- class={`rounded-md border border-border bg-surface p-2 shadow-sm sm:p-3 ${props.class ?? ''}`}+ class={`rounded-md border border-border bg-surface shadow-sm ${+ isCompact() ? 'p-1.5 sm:p-2.5' : 'p-2 sm:p-3'+ } ${props.class ?? ''}`}>- <div class="mb-2 flex flex-wrap items-center justify-between gap-2 border-b border-border-subtle px-1 pb-2 text-[11px]">+ <div+ class={`flex flex-wrap items-center justify-between border-b border-border-subtle text-[11px] ${+ isCompact()+ ? 'mb-1.5 gap-1.5 px-0.5 pb-1.5'+ : 'mb-2 gap-2 px-1 pb-2'+ }`}+ ><div class="flex items-center gap-3">{props.headerLeft}</div><Show when={props.onTimeRangeChange}><div class="inline-flex shrink-0 rounded border border-border bg-surface p-0.5 text-xs">@@ -57,7 +68,9 @@ export function SummaryPanel(props: SummaryPanelProps) {</Show></div>- <div class="grid gap-2 sm:gap-3 grid-cols-2 lg:grid-cols-4">{props.children}</div>+ <div class={`grid grid-cols-2 lg:grid-cols-4 ${isCompact() ? 'gap-2' : 'gap-2 sm:gap-3'}`}>+ {props.children}+ </div></div>);}