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
fix(frontend): stabilize summary hover card geometry
rcourtmandd1fdac3692d
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 8759f3b375..3af3bdb82d 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -145,7 +145,7 @@ work extends shared components instead of creating new local variants.4. Add guardrail tests when a new shared pattern is introduced5. Keep shared platform-connections shell state on the reusable settings boundary: `frontend-modern/src/components/Settings/useSettingsInfrastructurePanelProps.ts`, `frontend-modern/src/components/Settings/InfrastructurePlatformConnectionsSummaryCard.tsx`, and `frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx` must continue to derive provider counts, availability, and shared subtab copy from one infrastructure-settings source instead of creating provider-local summary fetches or VMware-only shell vocabulary.6. Keep shared storage feature presenters on canonical platform truth. When reusable storage presenters under `frontend-modern/src/features/storageBackups/` classify canonical resources for the shared storage route, API-backed virtualization datastores such as VMware must stay inventory-only datastores instead of inheriting PBS-specific backup-repository or protected-target copy from older fallback branches.-7. Keep top-of-page summary interaction on shared primitives. Infrastructure, workloads, and storage summary cards must route sticky-shell behavior through `frontend-modern/src/components/shared/StickySummarySection.tsx` and route row-hover or focused-series rendering through shared chart primitives such as `frontend-modern/src/components/shared/InteractiveSparkline.tsx` and `frontend-modern/src/components/shared/DensityMap.tsx`, rather than page-local sticky wrappers or metric-card-specific hover logic.+7. Keep top-of-page summary interaction on shared primitives. Infrastructure, workloads, and storage summary cards must route sticky-shell behavior through `frontend-modern/src/components/shared/StickySummarySection.tsx` and route row-hover or focused-series rendering through shared chart primitives such as `frontend-modern/src/components/shared/InteractiveSparkline.tsx` and `frontend-modern/src/components/shared/DensityMap.tsx`, rather than page-local sticky wrappers or metric-card-specific hover logic. The shared summary-card contract must also own stable summary-card geometry for chart-backed cards so row hover, focus, synchronized readouts, or idle header metadata cannot ratchet the sticky summary taller across rerenders.8. Keep summary chart interaction identity on one shared helper. Summary surfaces that expose row-hover, group-hover, chart-hover, or route-focus-driven chart emphasis must derive page/group/entity scope through `frontend-modern/src/components/shared/summaryCardInteraction.ts` and pass that same resolved scope into card-state, sparkline, and density-map primitives, rather than letting cards read `hovered || focused` while charts listen to a different page-local ID source. Hovering one summary chart must promote that series into the shared active entity so sibling cards highlight the same object instead of keeping chart-local hover islands, and hovering a grouped header must scope every card to that group without forking a workloads-local summary filter path. Sibling cards should surface that synchronized hover as one compact header readout through the shared summary-card contract, while the chart under the pointer keeps the only floating tooltip.9. Keep page summaries page-scoped when table rows enter contextual focus. Route-backed row selection may add a focused label and shared series emphasis, but infrastructure, workloads, and storage summary cards must continue to render the page-level series set instead of collapsing the summary down to the selected row or replacing the global trend view with row-local empty states.10. Keep contextual row focus on the shared summary primitive. Summary surfaces and same-route table drill-ins must reuse `frontend-modern/src/components/shared/contextualFocus.ts` for interactive-series filtering, focused-name lookup, active-series derivation, local scroll preservation, and deliberate inline-detail reveal instead of rebuilding page-local `Set` filters, focused-label scans, drawer-aware scroll math, or ad hoc scroll restoration in each surface.diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex 03d1769b6d..eeac918821 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -166,7 +166,7 @@ regression protection.24. Extend dashboard shell rendering through `frontend-modern/src/components/Dashboard/DashboardStateCards.tsx`, `frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`, and `frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx` rather than accreting loading cards, workload table markup, or stats-strip presentation back into `frontend-modern/src/components/Dashboard/Dashboard.tsx`25. Extend dashboard workload table shell ownership through `frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx` and `frontend-modern/src/components/Dashboard/WorkloadPanel.tsx` rather than rebuilding sortable header markup, grouped node rows, row expansion, or guest-drawer rendering inside `frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`26. Keep long-range workload chart capping time-proportional across `frontend-modern/src/components/Workloads/WorkloadsSummary.tsx`, `frontend-modern/src/api/charts.ts`, and `internal/api/router.go`: when the workload hot path caps mixed-cadence history for top cards, it must bucket by time window rather than raw point index so 7-day and 30-day workload cards stay visually even without relaxing the protected payload budget.-27. Keep summary hover/focus and sticky-card behavior on shared hot paths: infrastructure, workloads, and storage summary shells must reuse one page/group/entity scope model plus `frontend-modern/src/components/shared/StickySummarySection.tsx` inside the app scroll shell instead of per-page scroll listeners or per-card hover derivations, so row scrubbing highlights all cards, grouped-header hover scopes the summary coherently, and the hot path does not multiply render or scroll work.+27. Keep summary hover/focus and sticky-card behavior on shared hot paths: infrastructure, workloads, and storage summary shells must reuse one page/group/entity scope model plus `frontend-modern/src/components/shared/StickySummarySection.tsx` inside the app scroll shell instead of per-page scroll listeners or per-card hover derivations, so row scrubbing highlights all cards, grouped-header hover scopes the summary coherently, and the hot path does not multiply render or scroll work. That same hot path must keep chart-backed summary-card geometry explicit and stable so hover rerenders, synchronized readouts, or idle header metadata cannot feed layout loops that grow or shrink the top cards over time.28. Keep summary-card hover emphasis on one bounded rendering budget: when a summary row is active, shared sparkline and density-map primitives must promote the selected series and demote background series through the same active-series ID rather than layering a second page-local highlight pass, so zoom-range and hover scrubbing stay visually coherent without reintroducing multi-series overdraw on the hot summary cards. Density maps on that hot path must stay overview-first under focus: preserve the multi-entity heatmap rows, layer focused-entity detail inside the card, and avoid swapping transient hover into a separate single-series chart path.## Forbidden Pathsdiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex f97171628b..d27fa55251 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -1043,6 +1043,10 @@ instead of feature-local spacing overrides. Recovery may select the shareddefault `SummaryPanel` / `SummaryMetricCard` density mode, and it should notreintroduce one-off padding hacks or right-side duplicate KPI blocks inside`RecoverySummary.tsx`.+That same shared summary-card contract must also keep recovery on the+auto-sized card path while chart-backed monitoring summaries use the explicit+chart slot, so recovery cards stay compact and the shared hover geometry fix+does not reintroduce recovery-only whitespace or summary-height drift.That same one-headline rule applies to the footprint and activity cards too.`Coverage` should lead with one dominant item-type count and route platformcount through the shared card-header secondary label path instead of anotherdiff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsxindex 37b8f2df98..8958e0aaa6 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx@@ -95,5 +95,6 @@ describe('RecoverySummary', () => {it('uses the shared default summary density rather than a recovery-only compact override', () => {expect(recoverySummarySource).not.toContain('density="compact"');expect(recoverySummarySource).not.toContain('!p-1.5 sm:!p-2');+ expect(recoverySummarySource.match(/bodyLayout="auto"/g) ?? []).toHaveLength(4);});});diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.tsxindex acf743ae4d..32d3777ed0 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.tsx@@ -124,6 +124,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {<SummaryMetricCardlabel="Posture"secondaryLabel={postureSecondaryLabel()}+ bodyLayout="auto"loaded={true}hasData={hasRollups()}>@@ -140,6 +141,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {<SummaryMetricCardlabel="Freshness"secondaryLabel={freshnessSecondaryLabel()}+ bodyLayout="auto"loaded={true}hasData={hasRollups()}>@@ -156,6 +158,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {<SummaryMetricCardlabel="Coverage"secondaryLabel={coverageSecondaryLabel()}+ bodyLayout="auto"loaded={true}hasData={hasRollups()}>@@ -172,6 +175,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {<SummaryMetricCardlabel="Activity"secondaryLabel={activitySecondaryLabel()}+ bodyLayout="auto"loaded={props.seriesLoaded()}hasData={activity().hasData}emptyMessage={props.seriesFailed?.() ? 'Trend data unavailable' : 'No recovery activity yet'}diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 6f65b7d792..1673fe55da 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -329,6 +329,7 @@ describe('shared primitive guardrails', () => {it('keeps synchronized summary values on one shared card/readout contract', () => {expect(summaryMetricCardSource).toContain('headerValue?: JSX.Element');+ expect(summaryMetricCardSource).toContain("bodyLayout?: 'chart' | 'auto'");expect(summaryMetricCardSource).toContain('props.headerValue');expect(summaryMetricCardSource).not.toContain('data-summary-sync-readout');@@ -1012,6 +1013,9 @@ describe('shared primitive guardrails', () => {expect(summaryMetricCardSource).toContain("density?: 'default' | 'compact'");expect(summaryMetricCardSource).toContain("props.density === 'compact'");+ expect(summaryMetricCardSource).toContain("props.bodyLayout ?? 'chart'");+ expect(summaryMetricCardSource).toContain("isCompact() ? 'mb-1 min-h-[20px]' : 'mb-1.5 min-h-[24px]'");+ expect(summaryMetricCardSource).toContain("isCompact() ? 'h-[108px] sm:h-[120px]' : 'h-[136px] sm:h-[150px]'");expect(summaryMetricCardSource).toContain('!p-1.5 sm:!p-2');expect(summaryMetricCardSource).not.toContain('Recovery Posture');expect(summaryMetricCardSource).not.toContain('Freshness');diff --git a/frontend-modern/src/components/shared/SummaryMetricCard.tsx b/frontend-modern/src/components/shared/SummaryMetricCard.tsxindex 9e17a66bc7..3b64de7f0a 100644--- a/frontend-modern/src/components/shared/SummaryMetricCard.tsx+++ b/frontend-modern/src/components/shared/SummaryMetricCard.tsx@@ -10,6 +10,8 @@ export interface SummaryMetricCardProps {secondaryLabel?: JSX.Element;/** Optional compact readout aligned to the header right edge. */headerValue?: JSX.Element;+ /** Shared summary cards default to chart-backed bodies unless explicitly auto-sized. */+ bodyLayout?: 'chart' | 'auto';/** Whether data has loaded at least once. Drives skeleton vs empty state. */loaded: boolean;/** Whether there is renderable data. When false, shows the fallback. */@@ -26,7 +28,10 @@ export interface SummaryMetricCardProps {export function SummaryMetricCard(props: SummaryMetricCardProps) {const isCompact = () => props.density === 'compact';+ const bodyLayout = () => props.bodyLayout ?? 'chart';const interactionState = () => props.interactionState ?? 'default';+ const chartSlotClass = () =>+ isCompact() ? 'h-[108px] sm:h-[120px]' : 'h-[136px] sm:h-[150px]';const interactionClass = () => {switch (interactionState()) {case 'active':@@ -49,9 +54,9 @@ export function SummaryMetricCard(props: SummaryMetricCardProps) {><div class="flex flex-col h-full"><div- class={`flex min-w-0 items-center gap-2 ${isCompact() ? 'mb-1' : 'mb-1.5'}`.trim()}+ class={`flex min-w-0 items-center gap-2 ${isCompact() ? 'mb-1 min-h-[20px]' : 'mb-1.5 min-h-[24px]'}`.trim()}>- <div class="flex min-w-0 items-center">+ <div class="flex min-w-0 flex-1 items-center"><span class="text-xs font-medium text-muted uppercase tracking-wide shrink-0">{props.label}</span>@@ -73,7 +78,13 @@ export function SummaryMetricCard(props: SummaryMetricCardProps) {)}>- <div class="flex-1 min-h-0">{props.children}</div>+ <div+ class={`min-h-0 ${+ bodyLayout() === 'chart' ? `${chartSlotClass()} shrink-0` : 'flex-1'+ }`.trim()}+ >+ {props.children}+ </div></Show></div></Card>diff --git a/tests/integration/tests/48-summary-hover-selection.spec.ts b/tests/integration/tests/48-summary-hover-selection.spec.tsindex ff2edbcb58..0edff0f825 100644--- a/tests/integration/tests/48-summary-hover-selection.spec.ts+++ b/tests/integration/tests/48-summary-hover-selection.spec.ts@@ -17,7 +17,7 @@ type WorkerFixtures = {let mockModeWasEnabled: boolean | null = null;-const test = base.extend<{}, WorkerFixtures>({+const test = base.extend<Record<string, never>, WorkerFixtures>({storageState: async ({ authStorageStatePath }, use) => {await use(authStorageStatePath);},@@ -424,6 +424,59 @@ async function readRenderedSeriesCounts();}+async function readSummaryCardHeights(+ summary: import("@playwright/test").Locator,+): Promise<number[]> {+ return summary.locator("[data-summary-card-state]").evaluateAll((nodes) =>+ nodes.map((node) => node.getBoundingClientRect().height),+ );+}++async function expectSummaryCardHeightsStableAcrossRowHover(+ page: import("@playwright/test").Page,+ summary: import("@playwright/test").Locator,+ rows: import("@playwright/test").Locator,+ sampleCount = 8,+ expectedCardCount = 4,+): Promise<void> {+ await expect+ .poll(async () => {+ const heights = await readSummaryCardHeights(summary);+ return (+ heights.length === expectedCardCount &&+ heights.every((height) => Number.isFinite(height) && height >= 180)+ );+ })+ .toBe(true);++ const baselineHeights = await readSummaryCardHeights(summary);+ expect(baselineHeights.length).toBeGreaterThan(0);++ const rowCount = await rows.count();+ let exercisedRows = 0;+ for (let index = 0; index < rowCount && exercisedRows < sampleCount; index += 1) {+ const row = rows.nth(index);+ if (!(await row.isVisible())) {+ continue;+ }+ await row.hover();+ await page.waitForTimeout(120);+ const currentHeights = await readSummaryCardHeights(summary);+ expect(currentHeights).toHaveLength(baselineHeights.length);+ currentHeights.forEach((height, cardIndex) => {+ expect(height).toBeCloseTo(baselineHeights[cardIndex], 0);+ });+ exercisedRows += 1;+ }++ expect(exercisedRows).toBeGreaterThan(0);+ await page.mouse.move(1, 1);+ const settledHeights = await readSummaryCardHeights(summary);+ settledHeights.forEach((height, cardIndex) => {+ expect(height).toBeCloseTo(baselineHeights[cardIndex], 0);+ });+}+async function scrollPrimaryViewportToBottom(page: import("@playwright/test").Page,): Promise<void> {@@ -696,6 +749,35 @@ test.describe.serial("Summary hover selection", () => {await expectOnlyOneSummaryHoverTooltip(page);});+ test("keeps summary card geometry stable while row hover changes active series", async ({+ page,+ }, testInfo) => {+ test.skip(+ testInfo.project.name.startsWith("mobile-"),+ "Desktop runtime proof",+ );++ await ensureMockModeEnabled(page);++ await page.goto("/infrastructure", { waitUntil: "domcontentloaded" });+ const infrastructureSummary = page.getByTestId("infrastructure-summary");+ await expect(infrastructureSummary).toBeVisible();+ await expectSummaryCardHeightsStableAcrossRowHover(+ page,+ infrastructureSummary,+ page.locator("tr[data-summary-series-id]"),+ );++ await page.goto("/workloads", { waitUntil: "domcontentloaded" });+ const workloadsSummary = page.getByTestId("workloads-summary");+ await expect(workloadsSummary).toBeVisible();+ await expectSummaryCardHeightsStableAcrossRowHover(+ page,+ workloadsSummary,+ page.locator("tr[data-guest-id]"),+ );+ });+test("keeps table coordination non-destructive and reversible", async ({page,}, testInfo) => {