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.

fix(infrastructure): scope summary by cluster header hover

rcourtman171082e588a8
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 3af3bdb82d..5b7fd9a3e2 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -146,7 +146,7 @@ work extends shared components instead of creating new local variants.
5. 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. 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.
+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 workload group header or infrastructure cluster header must scope every card to that group without forking a page-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.
11. Keep summary-to-table coordination deliberate and reversible. Shared summary hover may highlight the matching table row when it is already visible, but transient chart hover must not auto-filter tables, auto-scroll the page, or reshuffle table ordering. When the active row is off-screen, page owners must route through `frontend-modern/src/components/shared/summaryTableFocus.ts` and surface a lightweight `Jump to row` affordance that reveals and scrolls only on explicit user action. Deliberate row focus may reveal inline detail automatically, but that reveal must be drawer-aware: preserve already-good positions, avoid hard centering, and scroll only enough to keep the row header plus the top of the inline detail visible.
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index eeac918821..58188237e7 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. 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.
+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, workload group headers and infrastructure cluster headers scope 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 Paths
@@ -218,6 +218,10 @@ active entity has no samples for one metric in the current range. Those
sibling cards should expose the synchronized value through one compact
header-level readout, not by spawning duplicate floating tooltips on every
chart.
+Infrastructure cluster-header hover now belongs to that same bounded hot path:
+hovering a grouped infrastructure header must scope the top cards to that
+cluster's unified-resource members through the shared group/entity interaction
+contract instead of inventing an infrastructure-local summary filter branch.
For shared line charts on that hot path, the shared sparkline primitive may
isolate the selected series inside the existing render budget, but that
isolation must still reuse the same summary series set and timeline data rather
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index af36993a9d..ac367331e5 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -200,18 +200,27 @@ assembly branch.
the row may highlight in place through the shared active-resource id; if it
is off-screen, the page must offer an explicit `Jump to row` affordance
rather than auto-scrolling or collapsing the table on hover.
-13. Keep infrastructure row emphasis on the shared frontend presentation
+13. Keep infrastructure cluster headers as canonical summary scope. Grouped
+ headers in `frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx`
+ must publish cluster scope from the same `ResourceGroup` / unified-resource
+ ids that power the table rows, and
+ `frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts`
+ plus `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`
+ must consume that scope through the shared page/group/entity interaction
+ contract rather than inventing infrastructure-local summary filters or
+ route-backed cluster hover state.
+14. Keep infrastructure row emphasis on the shared frontend presentation
contract. Host, PBS, and PMG table sections may decide whether a resource
is contextually active, but they must expose that state through
`data-summary-row-active` and rely on the shared row presentation owned by
`frontend-modern/src/index.css` instead of provider-specific background
classes that drift across resource tables or hide inline metric bars.
-14. Keep infrastructure search aligned with the governed display label. Shared
+15. Keep infrastructure search aligned with the governed display label. Shared
infrastructure filtering through
`frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts`
must match the user-visible safe label for governed resources instead of
reintroducing redacted hostnames through search-only fallback candidates.
-15. Preserve provider-backed storage backing-pool identity on canonical
+16. Preserve provider-backed storage backing-pool identity on canonical
storage resources. `internal/unifiedresources/types.go`,
`internal/unifiedresources/adapters.go`, `internal/unifiedresources/views.go`,
`frontend-modern/src/types/resource.ts`, and
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index 80cf066a66..8ea0f00835 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -32,6 +32,7 @@ import { ResourceDetailDrawer } from './ResourceDetailDrawer';
import { buildWorkloadsHref } from './workloadsLink';
import { ClusterDeployBanner } from './ClusterDeployBanner';
import { ResourceFacetSummary } from './ResourceFacetSummary';
+import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
import {
type UnifiedResourceTableProps,
type UnifiedResourceTableState,
@@ -145,8 +146,26 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
{(item) => {
if (item.type === 'header') {
const group = item.group;
+ const groupSummaryScope = createMemo<SummarySeriesGroupScope | null>(() =>
+ table.buildHostSummaryGroupScope(group),
+ );
+ const isSummaryGroupHighlighted = createMemo(
+ () => tableProps.activeSummaryGroupScope?.id === groupSummaryScope()?.id,
+ );
+ const handleGroupHoverChange = (next: SummarySeriesGroupScope | null) => {
+ tableProps.onGroupHoverChange?.(next);
+ };
return (
- <TableRow class="bg-surface-alt">
+ <TableRow
+ class="bg-surface-alt transition-colors duration-150 hover:bg-surface-hover"
+ data-summary-group-id={groupSummaryScope()?.id ?? undefined}
+ data-summary-group-series-count={String(
+ groupSummaryScope()?.seriesIds.length ?? 0,
+ )}
+ data-summary-row-active={isSummaryGroupHighlighted() ? 'true' : 'false'}
+ onMouseEnter={() => handleGroupHoverChange(groupSummaryScope())}
+ onMouseLeave={() => handleGroupHoverChange(null)}
+ >
<TableCell
colspan={9}
class="py-1 pr-2 pl-4 text-[12px] sm:text-sm font-semibold text-base-content"
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts
index 496896a9bf..ae1edf1fe4 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts
@@ -2,6 +2,8 @@ import { describe, expect, it } from 'vitest';
import type { Resource } from '@/types/resource';
import type { IODistributionStats } from '@/components/Infrastructure/infrastructureSelectors';
import {
+ buildInfrastructureSummaryGroupId,
+ buildInfrastructureSummaryGroupScope,
buildStatusOptions,
collectAvailableSources,
collectAvailableStatuses,
@@ -10,6 +12,7 @@ import {
getOutlierEmphasis,
getResourceSources,
groupResources,
+ infrastructureHasVisibleSummaryGroupScope,
matchesSearch,
sortResources,
splitPrimaryAndServiceResources,
@@ -270,6 +273,41 @@ describe('infrastructureSelectors', () => {
{ cluster: '', resources: [sortedResources[2], sortedResources[3]] },
]);
});
+
+ it('builds canonical summary group scopes for cluster and standalone headers', () => {
+ const [alphaGroup, standaloneGroup] = [
+ { cluster: 'alpha', resources: [sortedResources[1]] },
+ { cluster: '', resources: [sortedResources[2], sortedResources[3]] },
+ ];
+
+ expect(buildInfrastructureSummaryGroupId('alpha')).toBe('cluster:alpha');
+ expect(buildInfrastructureSummaryGroupId('')).toBe('cluster:__standalone__');
+ expect(buildInfrastructureSummaryGroupScope(alphaGroup)).toEqual({
+ id: 'cluster:alpha',
+ label: 'alpha (1 resource)',
+ seriesIds: ['resource-2'],
+ });
+ expect(buildInfrastructureSummaryGroupScope(standaloneGroup)).toEqual({
+ id: 'cluster:__standalone__',
+ label: 'Standalone (2 resources)',
+ seriesIds: ['resource-3', 'resource-4'],
+ });
+ });
+
+ it('drops stale summary group hover once none of its resources are still visible', () => {
+ const scope = buildInfrastructureSummaryGroupScope({
+ cluster: 'alpha',
+ resources: [sortedResources[1]],
+ });
+
+ expect(infrastructureHasVisibleSummaryGroupScope(sortedResources, scope)).toBe(true);
+ expect(
+ infrastructureHasVisibleSummaryGroupScope(
+ sortedResources.filter((resource) => resource.id !== 'resource-2'),
+ scope,
+ ),
+ ).toBe(false);
+ });
});
describe('computeIOScale', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts
index 415df6ea96..309b8ae5f3 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts
@@ -3,6 +3,7 @@ import useInfrastructureSummaryStateSource from '../useInfrastructureSummaryStat
import type { Resource } from '@/types/resource';
import type { InfrastructureSummarySeries } from '@/components/Infrastructure/infrastructureSummaryModel';
+import { buildInfrastructureSummaryGroupScope } from '@/components/Infrastructure/infrastructureSelectors';
import { buildDensityMapSynchronizedReadout } from '@/components/shared/densityMapModel';
import { buildInteractiveSparklineSynchronizedReadout } from '@/components/shared/interactiveSparklineModel';
import { resolveSummaryActiveSeriesId } from '@/components/shared/summaryCardInteraction';
@@ -129,6 +130,18 @@ describe('infrastructureSummaryModel', () => {
).toBe(false);
});
+ it('resolves the single displayed online resource from the filtered summary series instead of full page cardinality', () => {
+ const onlineResource = makeResource({ id: 'resource-1', lastSeen: 5_000 });
+ const secondResource = makeResource({ id: 'resource-2', displayName: 'Host 2' });
+
+ expect(
+ getSingleDisplayedOnlineInfrastructureResource(
+ [onlineResource, secondResource],
+ [makeSeries('resource-1', { name: 'Host 1' })],
+ ),
+ ).toEqual(onlineResource);
+ });
+
it('builds metric series, data checks, and empty-state copy canonically', () => {
const series = [
makeSeries('host-1', {
@@ -228,6 +241,26 @@ describe('infrastructureSummaryModel', () => {
).toBe('agent-2');
});
+ it('keeps infrastructure cluster scope separate from active entity selection', () => {
+ const clusterScope = buildInfrastructureSummaryGroupScope({
+ cluster: 'cluster-a',
+ resources: [makeResource({ id: 'agent-1' }), makeResource({ id: 'agent-2' })],
+ });
+
+ expect(
+ resolveSummaryActiveSeriesId({
+ hoveredSeriesId: 'agent-3',
+ groupScope: clusterScope,
+ }),
+ ).toBeNull();
+ expect(
+ resolveSummaryActiveSeriesId({
+ hoveredSeriesId: 'agent-2',
+ groupScope: clusterScope,
+ }),
+ ).toBe('agent-2');
+ });
+
it('builds sibling synchronized readouts from canonical infrastructure series without duplicating the source tooltip', () => {
const displayedSeries = buildInfrastructureDisplaySeries(
[
@@ -318,5 +351,7 @@ describe('infrastructureSummaryModel', () => {
expect(useInfrastructureSummaryStateSource).toContain(
'return `${INFRA_SUMMARY_IN_MEMORY_CACHE_VERSION}::${normalizeOrgScope(getOrgID())}::${range}`;',
);
+ expect(useInfrastructureSummaryStateSource).toContain('hoveredGroupScope');
+ expect(useInfrastructureSummaryStateSource).toContain('filterSeriesForActiveScope');
});
});
diff --git a/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts b/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts
index 4504882b61..8f1e89ce40 100644
--- a/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts
+++ b/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts
@@ -3,6 +3,7 @@ import { getCpuPercent, getDiskPercent, getMemoryPercent } from '@/types/resourc
import { getPreferredInfrastructureDisplayName, getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
import { normalizeSourcePlatformKey, type KnownSourcePlatform } from '@/utils/sourcePlatforms';
import { getCanonicalStatusLabel, STATUS_SORT_ORDER } from '@/utils/status';
+import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
export interface IODistributionStats {
median: number;
@@ -24,6 +25,8 @@ export interface ResourceGroup {
resources: Resource[];
}
+const INFRASTRUCTURE_STANDALONE_SUMMARY_GROUP_ID = 'cluster:__standalone__';
+
const isServiceInfrastructureResource = (resource: Resource) =>
resource.type === 'pbs' || resource.type === 'pmg';
@@ -288,6 +291,46 @@ export const groupResources = (
return entries;
};
+export const buildInfrastructureSummaryGroupId = (
+ cluster: string | null | undefined,
+): string => {
+ const normalizedCluster = (cluster ?? '').trim();
+ return normalizedCluster
+ ? `cluster:${normalizedCluster}`
+ : INFRASTRUCTURE_STANDALONE_SUMMARY_GROUP_ID;
+};
+
+export const buildInfrastructureSummaryGroupScope = (
+ group: ResourceGroup,
+): SummarySeriesGroupScope | null => {
+ const seriesIds = Array.from(
+ new Set(group.resources.map((resource) => resource.id?.trim() || '').filter(Boolean)),
+ );
+ if (seriesIds.length === 0) {
+ return null;
+ }
+
+ const clusterLabel = group.cluster.trim();
+ const resourceCountLabel = `${group.resources.length} resource${group.resources.length === 1 ? '' : 's'}`;
+
+ return {
+ id: buildInfrastructureSummaryGroupId(group.cluster),
+ label: clusterLabel ? `${clusterLabel} (${resourceCountLabel})` : `Standalone (${resourceCountLabel})`,
+ seriesIds,
+ };
+};
+
+export const infrastructureHasVisibleSummaryGroupScope = (
+ resources: Resource[],
+ scope: SummarySeriesGroupScope | null | undefined,
+): boolean => {
+ if (!scope) {
+ return false;
+ }
+ const visibleResourceIds = new Set(resources.map((resource) => resource.id?.trim() || '').filter(Boolean));
+ return scope.seriesIds.some((seriesId) => visibleResourceIds.has(seriesId.trim()));
+};
+
export const computeIOScale = (
resources: Resource[],
): { network: IODistributionStats; diskIO: IODistributionStats } => {
diff --git a/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts b/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
index 469efe10e5..06c99cfb31 100644
--- a/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
+++ b/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
@@ -17,10 +17,12 @@ import { getChartSeriesColor } from '@/utils/chartSeriesPresentation';
import type { Resource } from '@/types/resource';
import { getDiskPercent } from '@/types/resource';
import type { SummaryChartHoverSync } from '@/components/shared/contextualFocus';
+import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
export interface InfrastructureSummaryProps {
resources: Resource[];
timeRange?: TimeRange;
+ hoveredGroupScope?: SummarySeriesGroupScope | null;
hoveredResourceId?: string | null;
focusedResourceId?: string | null;
chartHoverSync?: SummaryChartHoverSync | null;
@@ -248,8 +250,10 @@ export function getSingleDisplayedOnlineInfrastructureResource(
resources: Resource[],
displaySeries: InfrastructureSummarySeries[],
): Resource | null {
- if (displaySeries.length !== 1 || resources.length !== 1) return null;
- const [resource] = resources;
+ if (displaySeries.length !== 1) return null;
+ const [displayedSeries] = displaySeries;
+ if (!displayedSeries) return null;
+ const resource = resources.find((entry) => entry.id === displayedSeries.id);
if (!resource) return null;
return resource.status?.toLowerCase() === 'online' ? resource : null;
}
diff --git a/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts b/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts
index 94edb0b664..7f355c5005 100644
--- a/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts
+++ b/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts
@@ -245,6 +245,7 @@ export function useInfrastructureSummaryState(props: InfrastructureSummaryProps)
const summaryFocus = useSummaryContextualFocusState({
chartHoveredSeriesId: () => chartHoverSync()?.seriesId ?? null,
interactiveSeries: resourceSeries,
+ hoveredGroupScope: () => props.hoveredGroupScope,
hoveredSeriesId: () => props.hoveredResourceId,
focusedSeriesId: () => props.focusedResourceId,
isSeriesInteractive: (series) =>
@@ -255,17 +256,19 @@ export function useInfrastructureSummaryState(props: InfrastructureSummaryProps)
});
const displaySeries = createMemo(() => {
- return buildInfrastructureDisplaySeries(resourceSeries(), null);
+ return summaryFocus.filterSeriesForActiveScope(
+ buildInfrastructureDisplaySeries(resourceSeries(), null),
+ );
});
const focusedResourceName = createMemo(() => {
- return summaryFocus.getActiveSeriesName(resourceSeries());
+ return summaryFocus.getActiveSeriesName(displaySeries());
});
createEffect(() => {
const hovered = chartHoverSync();
if (!hovered) return;
- if (!summaryFocus.hasInteractiveSeriesId(hovered.seriesId)) {
+ if (!summaryFocus.isSeriesIdVisibleInActiveScope(hovered.seriesId)) {
setChartHoverSync(null);
}
});
@@ -284,7 +287,9 @@ export function useInfrastructureSummaryState(props: InfrastructureSummaryProps)
});
const emptyHistoryLabel = createMemo(() =>
- buildInfrastructureEmptyHistoryLabel(isAwaitingFirstSample()),
+ summaryFocus.activeGroupScope()
+ ? 'No group history yet'
+ : buildInfrastructureEmptyHistoryLabel(isAwaitingFirstSample()),
);
const hasData = (metric: InfrastructureSummarySparkMetric) =>
diff --git a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts
index f313be12ec..9afb44ffb5 100644
--- a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts
+++ b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts
@@ -2,11 +2,13 @@ import { createMemo, createSignal } from 'solid-js';
import type { Resource } from '@/types/resource';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import {
+ buildInfrastructureSummaryGroupScope,
splitPrimaryAndServiceResources,
sortResources,
groupResources,
computeIOScale,
} from '@/components/Infrastructure/infrastructureSelectors';
+import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
import { useTableWindowing } from './useTableWindowing';
import { useUnifiedResourceTableViewportSync } from './useUnifiedResourceTableViewportSync';
import {
@@ -34,8 +36,10 @@ export interface UnifiedResourceTableProps {
highlightedResourceId?: string | null;
revealedResourceId?: string | null;
hoveredResourceId?: string | null;
+ activeSummaryGroupScope?: SummarySeriesGroupScope | null;
onExpandedResourceChange: (id: string | null) => void;
onHoverChange?: (id: string | null) => void;
+ onGroupHoverChange?: (scope: SummarySeriesGroupScope | null) => void;
groupingMode?: 'grouped' | 'flat';
onDeployCluster?: (clusterId: string, clusterName: string) => void;
setTableRootRef?: (element: HTMLDivElement | undefined) => void;
@@ -149,6 +153,7 @@ export function useUnifiedResourceTableState(props: UnifiedResourceTableProps) {
serviceHealthColumnStyle: () => columnStyles().serviceHealthColumnStyle,
serviceActionColumnStyle: () => columnStyles().serviceActionColumnStyle,
toggleExpand,
+ buildHostSummaryGroupScope: buildInfrastructureSummaryGroupScope,
getUnifiedSources,
};
}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 1673fe55da..49ea996e07 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -312,6 +312,8 @@ describe('shared primitive guardrails', () => {
expect(infrastructureSummaryStateSource).toContain('useSummaryContextualFocusState');
expect(infrastructureSummaryStateSource).toContain('chartHoverSync');
+ expect(infrastructureSummaryStateSource).toContain('hoveredGroupScope');
+ expect(infrastructureSummaryStateSource).toContain('filterSeriesForActiveScope');
expect(infrastructureSummaryStateSource).not.toContain(
'const interactiveResourceIds = createMemo',
);
diff --git a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx
index 363ec40268..6df4a9509f 100644
--- a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx
+++ b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx
@@ -43,10 +43,12 @@ export function InfrastructurePageSurface() {
groupingMode,
setGroupingMode,
activeSummaryResourceId,
+ activeSummaryResourceGroupScope,
expandedResourceId,
setExpandedResourceId,
chartHoverSync,
hoveredResourceId,
+ setHoveredResourceGroupScope,
setHoveredResourceId,
highlightedResourceId,
revealedResourceId,
@@ -143,6 +145,7 @@ export function InfrastructurePageSurface() {
resources={filteredResources()}
timeRange={infrastructureSummaryRange()}
onTimeRangeChange={setInfrastructureSummaryRange}
+ hoveredGroupScope={activeSummaryResourceGroupScope()}
hoveredResourceId={hoveredResourceId()}
focusedResourceId={expandedResourceId()}
chartHoverSync={chartHoverSync()}
@@ -314,10 +317,12 @@ export function InfrastructurePageSurface() {
<UnifiedResourceTable
resources={filteredResources()}
expandedResourceId={expandedResourceId()}
+ activeSummaryGroupScope={activeSummaryResourceGroupScope()}
hoveredResourceId={activeSummaryResourceId()}
highlightedResourceId={highlightedResourceId()}
revealedResourceId={revealedResourceId()}
onExpandedResourceChange={setExpandedResourceId}
+ onGroupHoverChange={setHoveredResourceGroupScope}
onHoverChange={setHoveredResourceId}
groupingMode={groupingMode()}
onDeployCluster={(id, name) => setDeployCluster({ id, name })}
diff --git a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts
index 7faec73f09..b6f2395dd4 100644
--- a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts
+++ b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts
@@ -43,10 +43,16 @@ describe('InfrastructurePageSurface guardrails', () => {
it('keeps summary-to-table coordination on the page-state owner', () => {
expect(infrastructurePageSurfaceSource).toContain('showJumpToActiveRow={shouldShowJumpToActiveResourceRow()}');
expect(infrastructurePageSurfaceSource).toContain('onJumpToActiveRow={jumpToActiveResourceRow}');
+ expect(infrastructurePageSurfaceSource).toContain('hoveredGroupScope={activeSummaryResourceGroupScope()}');
+ expect(infrastructurePageSurfaceSource).toContain('activeSummaryGroupScope={activeSummaryResourceGroupScope()}');
+ expect(infrastructurePageSurfaceSource).toContain('onGroupHoverChange={setHoveredResourceGroupScope}');
expect(infrastructurePageSurfaceSource).toContain('setTableRootRef={setSummaryTableRootRef}');
expect(infrastructurePageSurfaceSource).not.toContain('useSummaryPageInteractionState');
expect(infrastructurePageStateSource).toContain('useSummaryPageInteractionState');
+ expect(infrastructurePageStateSource).toContain('hoveredResourceGroupScope');
+ expect(infrastructurePageStateSource).toContain('activeSummaryResourceGroupScope');
+ expect(infrastructurePageStateSource).toContain('setHoveredResourceGroupScope');
expect(infrastructurePageStateSource).toContain('jumpToActiveResourceRow');
expect(infrastructurePageStateSource).toContain('setSummaryTableRootRef');
expect(infrastructurePageStateSource).toContain('shouldShowJumpToActiveResourceRow');
diff --git a/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts b/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts
index 8deaca7d72..e8d5ca2290 100644
--- a/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts
+++ b/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts
@@ -7,6 +7,8 @@ import { STORAGE_KEYS } from '@/utils/localStorage';
import { useKioskMode } from '@/hooks/useKioskMode';
import { useSummaryPageInteractionState } from '@/components/shared/summaryTableFocus';
import { isSummaryTimeRange } from '@/components/shared/summaryTimeRange';
+import { infrastructureHasVisibleSummaryGroupScope } from '@/components/Infrastructure/infrastructureSelectors';
+import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
import { useInfrastructurePageRouteState } from './useInfrastructurePageRouteState';
import { buildInfrastructurePageFilterDerivation } from './infrastructurePageModel';
@@ -40,6 +42,8 @@ export function useInfrastructurePageState() {
'grouped',
{ deserialize: (raw) => (raw === 'grouped' || raw === 'flat' ? raw : 'grouped') },
);
+ const [hoveredResourceGroupScope, setHoveredResourceGroupScope] =
+ createSignal<SummarySeriesGroupScope | null>(null);
const [deployCluster, setDeployCluster] = createSignal<DeployCluster | null>(null);
const [filtersOpen, setFiltersOpen] = createSignal(false);
@@ -71,6 +75,7 @@ export function useInfrastructurePageState() {
});
const summaryInteraction = useSummaryPageInteractionState({
hoveredSeriesId: routeState.hoveredResourceId,
+ hoveredGroupScope: hoveredResourceGroupScope,
focusedSeriesId: routeState.expandedResourceId,
revealActiveSeries: routeState.setRevealedResourceId,
});
@@ -87,6 +92,25 @@ export function useInfrastructurePageState() {
}
});
+ createEffect(() => {
+ if (groupingMode() === 'grouped') {
+ return;
+ }
+ if (hoveredResourceGroupScope()) {
+ setHoveredResourceGroupScope(null);
+ }
+ });
+
+ createEffect(() => {
+ const groupScope = hoveredResourceGroupScope();
+ if (!groupScope) {
+ return;
+ }
+ if (!infrastructureHasVisibleSummaryGroupScope(filteredResources(), groupScope)) {
+ setHoveredResourceGroupScope(null);
+ }
+ });
+
return {
loading,
error,
@@ -106,6 +130,7 @@ export function useInfrastructurePageState() {
groupingMode,
setGroupingMode,
activeSummaryResourceId: summaryInteraction.activeSeriesId,
+ activeSummaryResourceGroupScope: summaryInteraction.activeGroupScope,
...routeState,
chartHoverSync: summaryInteraction.chartHoverSync,
isMobile,
@@ -124,6 +149,7 @@ export function useInfrastructurePageState() {
filteredResources,
hasFilteredResources,
setChartHoverSync: summaryInteraction.setChartHoverSync,
+ setHoveredResourceGroupScope,
setSummaryTableRootRef: summaryInteraction.setTableRootRef,
shouldShowJumpToActiveResourceRow: summaryInteraction.shouldShowJumpToActiveRow,
};
diff --git a/tests/integration/tests/48-summary-hover-selection.spec.ts b/tests/integration/tests/48-summary-hover-selection.spec.ts
index 0edff0f825..2be1ca463f 100644
--- a/tests/integration/tests/48-summary-hover-selection.spec.ts
+++ b/tests/integration/tests/48-summary-hover-selection.spec.ts
@@ -906,6 +906,78 @@ test.describe.serial("Summary hover selection", () => {
.toEqual(resolvedBaselineCounts);
});
+ test("treats infrastructure cluster headers as first-class summary scope", 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 expect
+ .poll(async () => {
+ const counts = await readRenderedSeriesCounts(infrastructureSummary);
+ return counts.length === 4 && counts.every((count) => count > 1);
+ })
+ .toBe(true);
+ const resolvedBaselineCounts = await readRenderedSeriesCounts(
+ infrastructureSummary,
+ );
+
+ const baselineVisibleRows = await page.locator("tr[data-summary-series-id]").count();
+ const groupRows = page.locator("tr[data-summary-group-id]");
+ const groupRowCount = await groupRows.count();
+ expect(groupRowCount).toBeGreaterThan(0);
+
+ let matchedGroupRow: import("@playwright/test").Locator | null = null;
+ let matchedGroupSeriesCount = 0;
+ for (let index = 0; index < groupRowCount; index += 1) {
+ const row = groupRows.nth(index);
+ if (!(await row.isVisible())) {
+ continue;
+ }
+ const rawSeriesCount = await row.getAttribute("data-summary-group-series-count");
+ const seriesCount = Number.parseInt(rawSeriesCount || "0", 10);
+ if (!Number.isFinite(seriesCount) || seriesCount < 1) {
+ continue;
+ }
+ if (resolvedBaselineCounts.every((count) => count <= seriesCount)) {
+ continue;
+ }
+
+ matchedGroupRow = row;
+ matchedGroupSeriesCount = seriesCount;
+ break;
+ }
+
+ expect(matchedGroupRow).not.toBeNull();
+ expect(matchedGroupSeriesCount).toBeGreaterThan(0);
+ if (!matchedGroupRow) {
+ return;
+ }
+
+ await matchedGroupRow.hover();
+ await expect(matchedGroupRow).toHaveAttribute("data-summary-row-active", "true");
+ await expect
+ .poll(() => readRenderedSeriesCounts(infrastructureSummary))
+ .toEqual(new Array(4).fill(matchedGroupSeriesCount));
+ await expect(page.locator("tr[data-summary-series-id]")).toHaveCount(
+ baselineVisibleRows,
+ );
+
+ await page.mouse.move(1, 1);
+ await expect(matchedGroupRow).toHaveAttribute("data-summary-row-active", "false");
+ await expect
+ .poll(() => readRenderedSeriesCounts(infrastructureSummary))
+ .toEqual(resolvedBaselineCounts);
+ });
+
test("keeps density-map detail inside the hover tooltip without extra chart chrome", async ({
page,
}, testInfo) => {