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.

Unify mock chart continuity across live ticks

rcourtmanafc7a11ceaf2
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 37280762c2..546cff3eff 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -148,6 +148,7 @@ work extends shared components instead of creating new local variants.
8. Keep summary chart interaction identity on one shared helper. Summary surfaces that expose row-hover, chart-hover, or route-focus-driven chart emphasis must derive the active series ID through `frontend-modern/src/components/shared/summaryCardInteraction.ts` and pass the same resolved ID 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.
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, and local scroll preservation instead of rebuilding page-local `Set` filters, focused-label scans, 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.
## Forbidden Paths
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 3283d14ddc..c9329f09f1 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -210,6 +210,12 @@ isolate the selected series inside the existing render budget, but that
isolation must still reuse the same summary series set and timeline data rather
than triggering a second page-local chart recomputation.
That same hot-path rule now covers contextual row focus on those pages.
+That same hot-path ownership now also forbids hover-driven table movement.
+When a summary chart promotes one active entity, the matching row may highlight
+in place if it is already mounted and visible, but the hot path must not
+auto-scroll the page or rebuild the table into a one-row filtered view on
+transient hover. Off-screen reveal must stay behind an explicit `Jump to row`
+action routed through the shared summary-table focus bridge.
`frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts` must
write workload selection back into the workloads route through the shared
same-path route-state scheduler so opening a focused workload preserves scroll
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 32cf4a4f90..226fad0159 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -254,6 +254,13 @@ interactive-series filtering, focused-label lookup, and active-series
resolution through `frontend-modern/src/components/shared/contextualFocus.ts`
so storage keeps the same page-scoped focus semantics as infrastructure and
workloads instead of preserving a storage-local hover/focus branch.
+That same storage ownership now also governs summary-to-table reveal. Hovering
+pool or disk charts may highlight the matching row when the active view already
+shows it, but storage hover must not auto-filter or auto-scroll the table.
+When the active chart entity is off-screen or hidden behind the other storage
+view, the page must use the shared summary-table focus bridge and reveal the
+target row only through an explicit `Jump to row` action, switching views or
+expanding the owning group only for that deliberate reveal path.
The recovery backend is a real product boundary, not just a helper package:
`internal/recovery/` owns per-tenant SQLite persistence, rollup derivation,
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 57fdc00794..e1253ed59b 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -190,6 +190,12 @@ assembly branch.
must still resolve through the same unified-resource id that powers the
table row, line charts, density maps, and drawer route state instead of
dropping the highlight or inventing a metric-local summary identity when
+12. Keep infrastructure chart hover non-destructive to the unified-resource
+ table. If the hovered resource row is already visible in
+ `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx`,
+ 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.
disk or network data is missing in range.
## Current State
diff --git a/frontend-modern/src/components/Dashboard/Dashboard.tsx b/frontend-modern/src/components/Dashboard/Dashboard.tsx
index fc3ed8ecd1..011b7513a6 100644
--- a/frontend-modern/src/components/Dashboard/Dashboard.tsx
+++ b/frontend-modern/src/components/Dashboard/Dashboard.tsx
@@ -3,6 +3,7 @@ import { InfrastructureSelector } from '@/components/shared/InfrastructureSelect
import { DashboardFilter } from './DashboardFilter';
import { WorkloadsSummary } from '@/components/Workloads/WorkloadsSummary';
import { ScrollToTopButton } from '@/components/shared/ScrollToTopButton';
+import { StickySummarySection } from '@/components/shared/StickySummarySection';
import { DashboardStateCards } from './DashboardStateCards';
import { DashboardStatsStrip } from './DashboardStatsStrip';
import { DashboardWorkloadTable } from './DashboardWorkloadTable';
@@ -14,7 +15,7 @@ export function Dashboard(props: DashboardProps) {
return (
<div class="space-y-3">
<Show when={state.isWorkloadsRoute() && !state.workloadsSummaryCollapsed()}>
- <div class="hidden lg:block sticky-shield sticky top-0 z-20 bg-surface">
+ <StickySummarySection>
<WorkloadsSummary
timeRange={state.workloadsSummaryRange()}
onTimeRangeChange={state.setWorkloadsSummaryRange}
@@ -22,10 +23,14 @@ export function Dashboard(props: DashboardProps) {
fallbackGuestCounts={state.workloadsSummaryFallbackCounts()}
fallbackSnapshots={state.workloadsSummaryFallbackSnapshots()}
visibleWorkloadIds={state.workloadsSummaryVisibleIds()}
+ chartHoverSync={state.chartHoverSync()}
hoveredWorkloadId={state.hoveredWorkloadId()}
focusedWorkloadId={state.selectedGuestId()}
+ onChartHoverSyncChange={state.setChartHoverSync}
+ showJumpToActiveRow={state.shouldShowJumpToActiveWorkloadRow()}
+ onJumpToActiveRow={state.jumpToActiveWorkloadRow}
/>
- </div>
+ </StickySummarySection>
</Show>
<InfrastructureSelector
@@ -107,6 +112,7 @@ export function Dashboard(props: DashboardProps) {
handleCustomUrlUpdate={state.handleCustomUrlUpdate}
handleSort={state.handleSort}
handleTagClick={state.handleTagClick}
+ activeSummaryWorkloadId={state.activeSummaryWorkloadId}
isMobile={state.isMobile}
mobileVisibleColumnIds={state.mobileVisibleColumnIds}
mobileVisibleColumns={state.mobileVisibleColumns}
diff --git a/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx b/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
index 6cf4d8a784..848381b5db 100644
--- a/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
+++ b/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
@@ -20,6 +20,7 @@ type DashboardWorkloadTableProps = Pick<
| 'handleCustomUrlUpdate'
| 'handleSort'
| 'handleTagClick'
+ | 'activeSummaryWorkloadId'
| 'isMobile'
| 'mobileVisibleColumnIds'
| 'mobileVisibleColumns'
@@ -76,6 +77,7 @@ export function DashboardWorkloadTable(props: DashboardWorkloadTableProps) {
groupingMode={props.groupingMode}
handleCustomUrlUpdate={props.handleCustomUrlUpdate}
handleTagClick={props.handleTagClick}
+ activeSummaryWorkloadId={props.activeSummaryWorkloadId}
mobileVisibleColumnIds={props.mobileVisibleColumnIds}
nodeByInstance={props.nodeByInstance}
search={props.search}
diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx
index bbce639f2a..c9e4b6c944 100644
--- a/frontend-modern/src/components/Dashboard/GuestRow.tsx
+++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx
@@ -96,6 +96,8 @@ export function GuestRow(props: GuestRowProps) {
class={`${rowClass()} ${props.onClick ? 'cursor-pointer group' : ''}`}
style={rowStyle()}
data-guest-id={guestId()}
+ data-summary-series-id={guestId()}
+ data-summary-row-active={props.isSummaryHighlighted ? 'true' : 'false'}
onClick={props.onClick}
onMouseEnter={() => props.onHoverChange?.(guestId())}
onMouseLeave={() => props.onHoverChange?.(null)}
diff --git a/frontend-modern/src/components/Dashboard/WorkloadPanel.tsx b/frontend-modern/src/components/Dashboard/WorkloadPanel.tsx
index bd2e850b33..914dfcbe79 100644
--- a/frontend-modern/src/components/Dashboard/WorkloadPanel.tsx
+++ b/frontend-modern/src/components/Dashboard/WorkloadPanel.tsx
@@ -24,6 +24,7 @@ type WorkloadPanelProps = Pick<
| 'groupingMode'
| 'handleCustomUrlUpdate'
| 'handleTagClick'
+ | 'activeSummaryWorkloadId'
| 'mobileVisibleColumnIds'
| 'nodeByInstance'
| 'search'
@@ -120,6 +121,7 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
)
}
isExpanded={props.selectedGuestId() === guestId()}
+ isSummaryHighlighted={props.activeSummaryWorkloadId() === guestId()}
ioEmphasis={props.workloadIOEmphasis()}
onHoverChange={props.setHoveredWorkloadId}
/>
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts b/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts
index da1084b8cf..7b11f92abf 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts
+++ b/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts
@@ -158,4 +158,53 @@ describe('useDashboardSelectionState', () => {
ROUTE_STATE_REPLACE_OPTIONS,
);
});
+
+ it('shows a deliberate jump affordance when the active workload row is off-screen', () => {
+ locationSearch = '?type=app-container&platform=truenas&agent=truenas-main';
+ const [filteredGuests] = createSignal<WorkloadGuest[]>([
+ {
+ id: 'app-container:truenas-main:nextcloud',
+ name: 'nextcloud',
+ status: 'running',
+ instance: 'truenas-main',
+ node: 'truenas-main',
+ } as unknown as WorkloadGuest,
+ ]);
+
+ const { result } = renderHook(() =>
+ useDashboardSelectionState({
+ filteredGuests,
+ setSelectedNode: vi.fn(),
+ }),
+ );
+
+ const tableWrapper = document.createElement('div');
+ const row = document.createElement('div');
+ row.dataset.summarySeriesId = 'app-container:truenas-main:nextcloud';
+ row.scrollIntoView = vi.fn();
+ row.getBoundingClientRect = vi.fn(() => ({
+ top: window.innerHeight + 120,
+ bottom: window.innerHeight + 160,
+ left: 0,
+ right: 240,
+ width: 240,
+ height: 40,
+ x: 0,
+ y: window.innerHeight + 120,
+ toJSON: () => ({}),
+ })) as unknown as typeof row.getBoundingClientRect;
+ tableWrapper.appendChild(row);
+ document.body.appendChild(tableWrapper);
+
+ result.setTableWrapperRef(tableWrapper as HTMLDivElement);
+ result.setSelectedGuestId('app-container:truenas-main:nextcloud');
+
+ expect(result.activeSummaryWorkloadId()).toBe('app-container:truenas-main:nextcloud');
+ expect(result.shouldShowJumpToActiveWorkloadRow()).toBe(true);
+
+ result.jumpToActiveWorkloadRow();
+
+ expect(result.revealedGuestId()).toBe('app-container:truenas-main:nextcloud');
+ expect(row.scrollIntoView).toHaveBeenCalledWith({ behavior: 'smooth', block: 'center' });
+ });
});
diff --git a/frontend-modern/src/components/Dashboard/guestRowModel.tsx b/frontend-modern/src/components/Dashboard/guestRowModel.tsx
index fa758bbcbc..0b93d29f2a 100644
--- a/frontend-modern/src/components/Dashboard/guestRowModel.tsx
+++ b/frontend-modern/src/components/Dashboard/guestRowModel.tsx
@@ -41,6 +41,7 @@ export interface GuestRowProps {
visibleColumnIds?: string[];
onClick?: () => void;
isExpanded?: boolean;
+ isSummaryHighlighted?: boolean;
ioEmphasis?: WorkloadIOEmphasis;
onHoverChange?: (guestId: string | null) => void;
}
diff --git a/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts b/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts
index da734d3e35..9d846d4104 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts
+++ b/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts
@@ -2,6 +2,7 @@ import { useLocation, useNavigate } from '@solidjs/router';
import { createEffect, createSignal, onCleanup, untrack, type Accessor } from 'solid-js';
import { preserveScrollableAncestorVerticalOffset } from '@/components/shared/contextualFocus';
+import { useSummaryPageInteractionState } from '@/components/shared/summaryTableFocus';
import type { WorkloadGuest } from '@/types/workloads';
import { createRouteStateNavigateScheduler } from '@/utils/routeStateNavigation';
import {
@@ -26,12 +27,19 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
const [selectedGuestId, setSelectedGuestIdRaw] = createSignal<string | null>(null);
const [hoveredWorkloadId, setHoveredWorkloadId] = createSignal<string | null>(null);
const [handledResourceId, setHandledResourceId] = createSignal<string | null>(null);
+ const [revealedGuestId, setRevealedGuestId] = createSignal<string | null>(null);
let tableRef: HTMLDivElement | undefined;
const [tableBodyRef, setTableBodyRef] = createSignal<HTMLTableSectionElement | null>(null);
+ const summaryInteraction = useSummaryPageInteractionState({
+ hoveredSeriesId: hoveredWorkloadId,
+ focusedSeriesId: selectedGuestId,
+ revealActiveSeries: setRevealedGuestId,
+ });
const setTableWrapperRef = (element: HTMLDivElement | undefined) => {
tableRef = element;
+ summaryInteraction.setTableRootRef(element);
};
const setSelectedGuestIdState = (id: string | null) => {
@@ -80,17 +88,31 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
}
});
+ createEffect(() => {
+ const revealedId = revealedGuestId();
+ if (!revealedId) return;
+ if (!dashboardHasHoveredWorkload(options.filteredGuests(), revealedId)) {
+ setRevealedGuestId(null);
+ }
+ });
+
onCleanup(() => {
routeStateNavigate.cleanup();
});
return {
+ activeSummaryWorkloadId: summaryInteraction.activeSeriesId,
+ chartHoverSync: summaryInteraction.chartHoverSync,
hoveredWorkloadId,
+ jumpToActiveWorkloadRow: summaryInteraction.jumpToActiveRow,
+ revealedGuestId,
selectedGuestId,
+ setChartHoverSync: summaryInteraction.setChartHoverSync,
setHoveredWorkloadId,
setSelectedGuestId,
setTableBodyRef,
setTableWrapperRef,
+ shouldShowJumpToActiveWorkloadRow: summaryInteraction.shouldShowJumpToActiveRow,
tableBodyRef,
} as const;
}
diff --git a/frontend-modern/src/components/Dashboard/useDashboardState.ts b/frontend-modern/src/components/Dashboard/useDashboardState.ts
index a06aad2c55..af3832c2f8 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardState.ts
+++ b/frontend-modern/src/components/Dashboard/useDashboardState.ts
@@ -200,12 +200,18 @@ export function useDashboardState(props: DashboardProps) {
});
const {
+ activeSummaryWorkloadId,
+ chartHoverSync,
hoveredWorkloadId,
+ jumpToActiveWorkloadRow,
+ revealedGuestId,
selectedGuestId,
+ setChartHoverSync,
setHoveredWorkloadId,
setSelectedGuestId,
setTableBodyRef,
setTableWrapperRef,
+ shouldShowJumpToActiveWorkloadRow,
tableBodyRef,
} = useDashboardSelectionState({
filteredGuests,
@@ -233,6 +239,7 @@ export function useDashboardState(props: DashboardProps) {
groupingMode,
guestSortComparator,
nodes: () => props.nodes,
+ revealedGuestId,
selectedGuestId,
tableBodyRef,
});
@@ -241,7 +248,9 @@ export function useDashboardState(props: DashboardProps) {
activeAlerts,
alertsEnabled,
allGuests,
+ activeSummaryWorkloadId,
bottomSpacerHeight,
+ chartHoverSync,
columnVisibility,
connected,
containerRuntime,
@@ -269,6 +278,7 @@ export function useDashboardState(props: DashboardProps) {
isMobile,
isSearchLocked,
isWorkloadsRoute,
+ jumpToActiveWorkloadRow,
kioskMode,
kubernetesContextOptions,
kubernetesNamespaceOptions,
@@ -289,6 +299,7 @@ export function useDashboardState(props: DashboardProps) {
selectedKubernetesNamespace,
selectedNode,
setContainerRuntime,
+ setChartHoverSync,
setGroupingMode,
setHoveredWorkloadId,
setSearch,
@@ -304,6 +315,7 @@ export function useDashboardState(props: DashboardProps) {
setViewMode,
setWorkloadsSummaryCollapsed,
setWorkloadsSummaryRange,
+ shouldShowJumpToActiveWorkloadRow,
sortDirection,
sortKey,
statusMode,
diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts b/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts
index 522a358cb8..11a44cb713 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts
+++ b/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts
@@ -37,6 +37,7 @@ interface DashboardWorkloadDerivedStateOptions {
guestSortComparator: Accessor<((a: WorkloadGuest, b: WorkloadGuest) => number) | null>;
nodes: Accessor<Node[]>;
selectedGuestId: Accessor<string | null>;
+ revealedGuestId: Accessor<string | null>;
tableBodyRef: Accessor<HTMLTableSectionElement | null>;
}
@@ -156,8 +157,12 @@ export function useDashboardWorkloadDerivedState(
const revealGuestIndex = createMemo<number | null>(() => {
const selectedId = options.selectedGuestId();
- if (!selectedId) return null;
- return guestGlobalIndexById().get(selectedId) ?? null;
+ if (selectedId) {
+ return guestGlobalIndexById().get(selectedId) ?? null;
+ }
+ const revealedId = options.revealedGuestId();
+ if (!revealedId) return null;
+ return guestGlobalIndexById().get(revealedId) ?? null;
});
const groupedWindowing = useGroupedTableWindowing({
diff --git a/frontend-modern/src/components/Dashboard/useGuestRowState.ts b/frontend-modern/src/components/Dashboard/useGuestRowState.ts
index 8b12b983fa..6b2295f1a9 100644
--- a/frontend-modern/src/components/Dashboard/useGuestRowState.ts
+++ b/frontend-modern/src/components/Dashboard/useGuestRowState.ts
@@ -235,10 +235,15 @@ export function useGuestRowState(props: GuestRowProps) {
? 'bg-red-50 dark:bg-red-950'
: 'bg-yellow-50 dark:bg-yellow-950'
: '';
+ const summaryHighlight = props.isSummaryHighlighted
+ ? 'bg-sky-50/70 dark:bg-sky-950/40 ring-1 ring-inset ring-sky-400/25'
+ : '';
const defaultHover = hasUnacknowledgedAlert() ? '' : 'hover:bg-surface-hover';
const stoppedDimming = !isRunning() ? 'opacity-60' : '';
- return [base, hover, defaultHover, alertBg, stoppedDimming].filter(Boolean).join(' ');
+ return [base, hover, defaultHover, alertBg, summaryHighlight, stoppedDimming]
+ .filter(Boolean)
+ .join(' ');
});
const rowStyle = createMemo(() => {
diff --git a/frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx b/frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx
index e878893511..0ceaa85a4b 100644
--- a/frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx
+++ b/frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx
@@ -3,6 +3,7 @@ import { Show } from 'solid-js';
import { Card } from '@/components/shared/Card';
import { InteractiveSparkline } from '@/components/shared/InteractiveSparkline';
import { DensityMap } from '@/components/shared/DensityMap';
+import { SummaryJumpToRowButton } from '@/components/shared/SummaryJumpToRowButton';
import { SummaryPanel } from '@/components/shared/SummaryPanel';
import { SummaryMetricCard } from '@/components/shared/SummaryMetricCard';
import { formatThroughputRate } from '@/utils/throughputPresentation';
@@ -39,6 +40,9 @@ export const InfrastructureSummary: Component<InfrastructureSummaryProps> = (pro
<Show when={state.resourceCounts().offline > 0}>
<span class="text-muted">{state.resourceCounts().offline} offline</span>
</Show>
+ <Show when={props.showJumpToActiveRow && props.onJumpToActiveRow}>
+ <SummaryJumpToRowButton onClick={() => props.onJumpToActiveRow?.()} />
+ </Show>
</>
}
timeRange={state.selectedRange()}
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index 34f9c04fa4..5271436edf 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -272,6 +272,10 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
<TableRow
ref={(el) => table.registerRowRef(resource.id, el)}
data-row-id={resource.id}
+ data-summary-series-id={resource.id}
+ data-summary-row-active={
+ tableProps.hoveredResourceId === resource.id ? 'true' : 'false'
+ }
class={rowClass()}
style={{ 'min-height': '32px' }}
onClick={() => table.toggleExpand(resource.id)}
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
index 25a61bda43..46df347560 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
@@ -140,6 +140,10 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
<>
<TableRow
ref={(el) => table.registerRowRef(resource.id, el)}
+ data-summary-series-id={resource.id}
+ data-summary-row-active={
+ tableProps.hoveredResourceId === resource.id ? 'true' : 'false'
+ }
class={rowClass()}
style={{ 'min-height': '32px' }}
onClick={() => table.toggleExpand(resource.id)}
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
index 9e5340a969..1e6a667fe0 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
@@ -157,6 +157,10 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
<>
<TableRow
ref={(el) => table.registerRowRef(resource.id, el)}
+ data-summary-series-id={resource.id}
+ data-summary-row-active={
+ tableProps.hoveredResourceId === resource.id ? 'true' : 'false'
+ }
class={rowClass()}
style={{ 'min-height': '32px' }}
onClick={() => table.toggleExpand(resource.id)}
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx
index 2701c42e1e..d09a422780 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx
@@ -10,7 +10,7 @@ export const UnifiedResourceTable: Component<UnifiedResourceTableProps> = (props
const table = useUnifiedResourceTableState(props);
return (
- <div class="space-y-4">
+ <div ref={props.setTableRootRef} class="space-y-4">
<UnifiedResourceHostTableCard table={table} tableProps={props} />
<UnifiedResourceServiceInfrastructureCard table={table} tableProps={props} />
</div>
diff --git a/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts b/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
index 768879c635..469efe10e5 100644
--- a/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
+++ b/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
@@ -16,13 +16,18 @@ import { asTrimmedString } from '@/utils/stringUtils';
import { getChartSeriesColor } from '@/utils/chartSeriesPresentation';
import type { Resource } from '@/types/resource';
import { getDiskPercent } from '@/types/resource';
+import type { SummaryChartHoverSync } from '@/components/shared/contextualFocus';
export interface InfrastructureSummaryProps {
resources: Resource[];
timeRange?: TimeRange;
hoveredResourceId?: string | null;
focusedResourceId?: string | null;
+ chartHoverSync?: SummaryChartHoverSync | null;
onTimeRangeChange?: (range: TimeRange) => void;
+ onChartHoverSyncChange?: (value: SummaryChartHoverSync | null) => void;
+ showJumpToActiveRow?: boolean;
+ onJumpToActiveRow?: () => void;
}
export interface InfrastructureSummarySeries {
diff --git a/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts b/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
index de369a7829..8d14f8351f 100644
--- a/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
+++ b/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
@@ -76,8 +76,9 @@ export const getHostRevealTargetIndex = (
rowIndexById: Map<string, number>,
expandedResourceId: string | null,
highlightedResourceId: string | null | undefined,
+ revealedResourceId?: string | null,
): number | null => {
- const targetId = expandedResourceId ?? highlightedResourceId ?? null;
+ const targetId = expandedResourceId ?? revealedResourceId ?? highlightedResourceId ?? null;
if (!targetId) return null;
return rowIndexById.get(targetId) ?? null;
};
diff --git a/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts b/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts
index 86642ccb7c..f61a2d51a3 100644
--- a/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts
+++ b/frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts
@@ -62,7 +62,16 @@ export function useInfrastructureSummaryState(props: InfrastructureSummaryProps)
const [loadedRange, setLoadedRange] = createSignal<TimeRange | null>(null);
const [oldestDataTimestamp, setOldestDataTimestamp] = createSignal<number | null>(null);
const [fetchFailed, setFetchFailed] = createSignal(false);
- const [chartHoverSync, setChartHoverSync] = createSignal<SummaryChartHoverSync | null>(null);
+ const [localChartHoverSync, setLocalChartHoverSync] = createSignal<SummaryChartHoverSync | null>(
+ null,
+ );
+ const chartHoverSync = () => props.chartHoverSync ?? localChartHoverSync();
+ const setChartHoverSync = (value: SummaryChartHoverSync | null) => {
+ if (props.chartHoverSync === undefined) {
+ setLocalChartHoverSync(value);
+ }
+ props.onChartHoverSyncChange?.(value);
+ };
const selectedRange = createMemo<TimeRange>(() => props.timeRange || '1h');
const hasCurrentRangeCharts = createMemo(() => chartRange() === selectedRange());
const isCurrentRangeLoaded = createMemo(() => loadedRange() === selectedRange());
diff --git a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts
index df261074d7..69695fbff3 100644
--- a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts
+++ b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts
@@ -32,11 +32,13 @@ export interface UnifiedResourceTableProps {
resources: Resource[];
expandedResourceId: string | null;
highlightedResourceId?: string | null;
+ revealedResourceId?: string | null;
hoveredResourceId?: string | null;
onExpandedResourceChange: (id: string | null) => void;
onHoverChange?: (id: string | null) => void;
groupingMode?: 'grouped' | 'flat';
onDeployCluster?: (clusterId: string, clusterName: string) => void;
+ setTableRootRef?: (element: HTMLDivElement | undefined) => void;
}
export function useUnifiedResourceTableState(props: UnifiedResourceTableProps) {
@@ -65,6 +67,7 @@ export function useUnifiedResourceTableState(props: UnifiedResourceTableProps) {
hostRowIndexById(),
props.expandedResourceId,
props.highlightedResourceId,
+ props.revealedResourceId,
),
);
diff --git a/frontend-modern/src/components/Storage/DiskList.tsx b/frontend-modern/src/components/Storage/DiskList.tsx
index de882feaa3..13a6756bc4 100644
--- a/frontend-modern/src/components/Storage/DiskList.tsx
+++ b/frontend-modern/src/components/Storage/DiskList.tsx
@@ -77,6 +77,7 @@ interface DiskListProps {
selectedNode: string | null;
searchTerm: string;
selectedDiskId: string | null;
+ highlightedSummarySeriesId?: string | null;
onSelectedDiskChange: (diskId: string | null) => void;
onHoverChange?: (diskId: string | null) => void;
}
@@ -167,16 +168,26 @@ export const DiskList: Component<DiskListProps> = (props) => {
const healthSummary = getPhysicalDiskHealthSummary(status);
const sourceBadge = getPhysicalDiskSourceBadgePresentation(disk);
const isSelected = () => model.selectedDisk()?.id === disk.id;
+ const summarySeriesId = resolvePhysicalDiskMetricResourceId(disk);
+ const isSummaryHighlighted = () =>
+ props.highlightedSummarySeriesId === summarySeriesId;
return (
<>
<TableRow
data-row-id={disk.id}
- data-summary-series-id={resolvePhysicalDiskMetricResourceId(disk)}
+ data-summary-series-id={summarySeriesId}
+ data-summary-row-active={
+ isSummaryHighlighted() ? 'true' : 'false'
+ }
class={`${PHYSICAL_DISK_TABLE_ROW_CLASS} ${
isSelected()
? PHYSICAL_DISK_TABLE_ROW_SELECTED_CLASS
: PHYSICAL_DISK_TABLE_ROW_HOVER_CLASS
+ } ${
+ isSummaryHighlighted() && !isSelected()
+ ? 'bg-sky-50/70 ring-1 ring-inset ring-sky-400/25 dark:bg-sky-950/40'
+ : ''
}`}
style={PHYSICAL_DISK_TABLE_ROW_STYLE}
onMouseEnter={() => props.onHoverChange?.(disk.id)}
diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsx
index 2956a542d8..3d3e7464b6 100644
--- a/frontend-modern/src/components/Storage/Storage.tsx
+++ b/frontend-modern/src/components/Storage/Storage.tsx
@@ -34,6 +34,7 @@ const Storage: Component = () => {
activeBannerKind,
cephSummaryStats,
filteredRecords,
+ activeSummaryStorageResourceId,
nodeOptions,
physicalDisks,
nodes,
@@ -45,12 +46,17 @@ const Storage: Component = () => {
nodeOnlineByLabel,
highlightedRecordId,
getRecordAlertState,
+ chartHoverSync,
hoveredStorageResourceId,
isLoadingPools,
focusedStorageResourceId,
+ jumpToActiveStorageRow,
selectedDiskId,
+ setChartHoverSync,
setHoveredStorageResourceId,
setSelectedDiskId,
+ setSummaryTableRootRef,
+ shouldShowJumpToActiveStorageRow,
} = useStoragePageModel();
return (
@@ -63,6 +69,10 @@ const Storage: Component = () => {
physicalDisks={physicalDisks}
hoveredResourceId={hoveredStorageResourceId}
focusedResourceId={focusedStorageResourceId}
+ chartHoverSync={chartHoverSync}
+ onChartHoverSyncChange={setChartHoverSync}
+ showJumpToActiveRow={shouldShowJumpToActiveStorageRow}
+ onJumpToActiveRow={jumpToActiveStorageRow}
/>
</StickySummarySection>
@@ -114,7 +124,9 @@ const Storage: Component = () => {
highlightedRecordId={highlightedRecordId}
getRecordAlertState={getRecordAlertState}
isLoadingPools={isLoadingPools}
+ highlightedSummaryResourceId={activeSummaryStorageResourceId}
hoveredStorageResourceId={hoveredStorageResourceId}
+ setTableRootRef={setSummaryTableRootRef}
setHoveredStorageResourceId={setHoveredStorageResourceId}
selectedDiskId={selectedDiskId}
setSelectedDiskId={setSelectedDiskId}
diff --git a/frontend-modern/src/components/Storage/StorageContentCard.tsx b/frontend-modern/src/components/Storage/StorageContentCard.tsx
index 3f8720b561..c4bb1783b1 100644
--- a/frontend-modern/src/components/Storage/StorageContentCard.tsx
+++ b/frontend-modern/src/components/Storage/StorageContentCard.tsx
@@ -28,7 +28,9 @@ type StorageContentCardProps = {
highlightedRecordId: () => string | null;
getRecordAlertState: (recordId: string) => StorageAlertRowState;
isLoadingPools: () => boolean;
+ highlightedSummaryResourceId: () => string | null;
hoveredStorageResourceId: () => string | null;
+ setTableRootRef: (element: HTMLDivElement | undefined) => void;
setHoveredStorageResourceId: (value: string | null) => void;
selectedDiskId: () => string | null;
setSelectedDiskId: (value: string | null) => void;
@@ -41,7 +43,7 @@ export const StorageContentCard: Component<StorageContentCardProps> = (props) =>
});
return (
- <Card padding="none" tone="card" class="overflow-hidden">
+ <Card ref={props.setTableRootRef} padding="none" tone="card" class="overflow-hidden">
<div class={STORAGE_CONTENT_CARD_HEADER_CLASS}>{model.heading()}</div>
<Show when={model.showDisks()}>
<div class={STORAGE_CONTENT_CARD_BODY_CLASS}>
@@ -51,6 +53,7 @@ export const StorageContentCard: Component<StorageContentCardProps> = (props) =>
selectedNode={model.selectedDiskNodeId()}
searchTerm={props.search()}
selectedDiskId={props.selectedDiskId()}
+ highlightedSummarySeriesId={props.highlightedSummaryResourceId()}
onSelectedDiskChange={props.setSelectedDiskId}
onHoverChange={props.setHoveredStorageResourceId}
/>
@@ -69,6 +72,7 @@ export const StorageContentCard: Component<StorageContentCardProps> = (props) =>
highlightedRecordId={props.highlightedRecordId()}
getRecordAlertState={props.getRecordAlertState}
isLoading={props.isLoadingPools()}
+ highlightedSummarySeriesId={props.highlightedSummaryResourceId()}
onHoverChange={props.setHoveredStorageResourceId}
/>
</Show>
diff --git a/frontend-modern/src/components/Storage/StoragePageSummary.tsx b/frontend-modern/src/components/Storage/StoragePageSummary.tsx
index bbbda86d2f..ca3c37f6ee 100644
--- a/frontend-modern/src/components/Storage/StoragePageSummary.tsx
+++ b/frontend-modern/src/components/Storage/StoragePageSummary.tsx
@@ -3,6 +3,7 @@ import StorageSummary from '@/components/Storage/StorageSummary';
import type { Resource } from '@/types/resource';
import type { StoragePageNodeOption } from './storagePageState';
import { useStoragePageSummary } from './useStoragePageSummary';
+import type { SummaryChartHoverSync } from '@/components/shared/contextualFocus';
type StoragePageSummaryProps = {
filteredRecordCount: () => number;
@@ -11,6 +12,10 @@ type StoragePageSummaryProps = {
physicalDisks: () => Resource[];
hoveredResourceId: () => string | null;
focusedResourceId: () => string | null;
+ chartHoverSync: () => SummaryChartHoverSync | null;
+ onChartHoverSyncChange: (value: SummaryChartHoverSync | null) => void;
+ showJumpToActiveRow: () => boolean;
+ onJumpToActiveRow: () => void;
};
export const StoragePageSummary: Component<StoragePageSummaryProps> = (props) => {
@@ -30,6 +35,10 @@ export const StoragePageSummary: Component<StoragePageSummaryProps> = (props) =>
nodeId={props.selectedNodeId()}
hoveredResourceId={props.hoveredResourceId()}
focusedResourceId={props.focusedResourceId()}
+ chartHoverSync={props.chartHoverSync()}
+ onChartHoverSyncChange={props.onChartHoverSyncChange}
+ showJumpToActiveRow={props.showJumpToActiveRow()}
+ onJumpToActiveRow={props.onJumpToActiveRow}
/>
);
};
diff --git a/frontend-modern/src/components/Storage/StoragePoolRow.tsx b/frontend-modern/src/components/Storage/StoragePoolRow.tsx
index 3a88b2ee12..b3cda0a216 100644
--- a/frontend-modern/src/components/Storage/StoragePoolRow.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolRow.tsx
@@ -39,6 +39,7 @@ interface StoragePoolRowProps {
record: StorageRecord;
summarySeriesId: string;
expanded: boolean;
+ summaryHighlighted?: boolean;
onToggleExpand: () => void;
onHoverChange?: (recordId: string | null) => void;
rowClass: string;
@@ -58,12 +59,17 @@ export const StoragePoolRow: Component<StoragePoolRowProps> = (props) => {
return (
<>
<tr
- class={`${STORAGE_POOL_ROW_CLASS} ${props.rowClass} ${props.expanded ? STORAGE_POOL_ROW_EXPANDED_CLASS : ''}`}
+ class={`${STORAGE_POOL_ROW_CLASS} ${props.rowClass} ${props.expanded ? STORAGE_POOL_ROW_EXPANDED_CLASS : ''} ${
+ props.summaryHighlighted && !props.expanded
+ ? 'bg-sky-50/70 ring-1 ring-inset ring-sky-400/25 dark:bg-sky-950/40'
+ : ''
+ }`}
style={{ ...props.rowStyle, ...STORAGE_POOL_ROW_STYLE }}
onClick={props.onToggleExpand}
onMouseEnter={() => props.onHoverChange?.(props.summarySeriesId)}
onMouseLeave={() => props.onHoverChange?.(null)}
data-summary-series-id={props.summarySeriesId}
+ data-summary-row-active={props.summaryHighlighted ? 'true' : 'false'}
{...props.alertDataAttrs}
>
<td class={STORAGE_POOL_ROW_NAME_CELL_CLASS}>
diff --git a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
index a8cfa8ad24..bec17f448d 100644
--- a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
@@ -31,6 +31,7 @@ type StoragePoolsTableProps = {
highlightedRecordId: string | null;
getRecordAlertState: (recordId: string) => StorageAlertRowState;
isLoading: boolean;
+ highlightedSummarySeriesId?: string | null;
onHoverChange?: (recordId: string | null) => void;
};
@@ -87,6 +88,10 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
record={record()}
summarySeriesId={resolveStorageRecordMetricResourceId(record())}
expanded={rowModel().expanded}
+ summaryHighlighted={
+ props.highlightedSummarySeriesId ===
+ resolveStorageRecordMetricResourceId(record())
+ }
onToggleExpand={() => model.togglePool(record().id)}
onHoverChange={props.onHoverChange}
rowClass={rowModel().rowClass}
diff --git a/frontend-modern/src/components/Storage/StorageSummary.tsx b/frontend-modern/src/components/Storage/StorageSummary.tsx
index 6b55a96670..22c0dc2323 100644
--- a/frontend-modern/src/components/Storage/StorageSummary.tsx
+++ b/frontend-modern/src/components/Storage/StorageSummary.tsx
@@ -5,6 +5,7 @@ import {
useSummaryContextualFocusState,
type SummaryChartHoverSync,
} from '@/components/shared/contextualFocus';
+import { SummaryJumpToRowButton } from '@/components/shared/SummaryJumpToRowButton';
import { SummaryPanel } from '@/components/shared/SummaryPanel';
import { SummaryMetricCard } from '@/components/shared/SummaryMetricCard';
import {
@@ -57,6 +58,10 @@ interface StorageSummaryProps {
nodeId?: string;
hoveredResourceId?: string | null;
focusedResourceId?: string | null;
+ chartHoverSync?: SummaryChartHoverSync | null;
+ onChartHoverSyncChange?: (value: SummaryChartHoverSync | null) => void;
+ showJumpToActiveRow?: boolean;
+ onJumpToActiveRow?: () => void;
}
// ---------------------------------------------------------------------------
@@ -67,7 +72,16 @@ const StorageSummary: Component<StorageSummaryProps> = (props) => {
const [data, setData] = createSignal<StorageSummaryChartsResponse | null>(null);
const [loaded, setLoaded] = createSignal(false);
const [fetchFailed, setFetchFailed] = createSignal(false);
- const [chartHoverSync, setChartHoverSync] = createSignal<SummaryChartHoverSync | null>(null);
+ const [localChartHoverSync, setLocalChartHoverSync] = createSignal<SummaryChartHoverSync | null>(
+ null,
+ );
+ const chartHoverSync = () => props.chartHoverSync ?? localChartHoverSync();
+ const setChartHoverSync = (value: SummaryChartHoverSync | null) => {
+ if (props.chartHoverSync === undefined) {
+ setLocalChartHoverSync(value);
+ }
+ props.onChartHoverSyncChange?.(value);
+ };
// Track org switches so the effect re-runs when the org changes.
const [orgVersion, setOrgVersion] = createSignal(0);
@@ -283,6 +297,9 @@ const StorageSummary: Component<StorageSummaryProps> = (props) => {
{props.diskCount} {props.diskCount === 1 ? 'disk' : 'disks'}
</span>
</Show>
+ <Show when={props.showJumpToActiveRow && props.onJumpToActiveRow}>
+ <SummaryJumpToRowButton onClick={() => props.onJumpToActiveRow?.()} />
+ </Show>
</>
}
timeRange={props.timeRange}
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index dc08971e3f..984aaf91f5 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -984,6 +984,75 @@ describe('Storage', () => {
storageSummarySpy.mockRestore();
});
+ it('offers a deliberate jump affordance when the focused storage row is off-screen', async () => {
+ const storageSummarySpy = vi.spyOn(ChartsAPI, 'getStorageSummaryCharts').mockResolvedValue({
+ pools: {
+ 'pool:alpha': {
+ name: 'Alpha-Store',
+ usage: [
+ { timestamp: Date.now() - 60_000, value: 45 },
+ { timestamp: Date.now(), value: 47 },
+ ],
+ used: [
+ { timestamp: Date.now() - 60_000, value: 450 },
+ { timestamp: Date.now(), value: 470 },
+ ],
+ avail: [
+ { timestamp: Date.now() - 60_000, value: 550 },
+ { timestamp: Date.now(), value: 530 },
+ ],
+ },
+ },
+ disks: {},
+ stats: {
+ oldestDataTimestamp: Date.now() - 60_000,
+ },
+ });
+
+ hookResources = [
+ buildStorageResource('storage-display-alpha', 'Alpha-Store', 'pve1', {
+ metricsTarget: {
+ resourceType: 'storage',
+ resourceId: 'pool:alpha',
+ },
+ }),
+ ];
+
+ render(() => <Storage />);
+
+ await screen.findByTestId('storage-summary');
+ const alphaRow = screen.getByText('Alpha-Store').closest('tr') as HTMLTableRowElement;
+ expect(alphaRow).toBeTruthy();
+
+ alphaRow.getBoundingClientRect = vi.fn(() => ({
+ top: window.innerHeight + 120,
+ bottom: window.innerHeight + 168,
+ left: 0,
+ right: 480,
+ width: 480,
+ height: 48,
+ x: 0,
+ y: window.innerHeight + 120,
+ toJSON: () => ({}),
+ })) as unknown as typeof alphaRow.getBoundingClientRect;
+ alphaRow.scrollIntoView = vi.fn();
+
+ fireEvent.click(screen.getByRole('button', { name: 'Toggle details for Alpha-Store' }));
+
+ await waitFor(() => {
+ expect(screen.getByRole('button', { name: 'Jump to row' })).toBeInTheDocument();
+ });
+
+ fireEvent.click(screen.getByRole('button', { name: 'Jump to row' }));
+
+ expect(alphaRow.scrollIntoView).toHaveBeenCalledWith({
+ behavior: 'smooth',
+ block: 'center',
+ });
+
+ storageSummarySpy.mockRestore();
+ });
+
it('restores canonical TrueNAS source filters from the storage route', async () => {
nodeResources = [
{
diff --git a/frontend-modern/src/components/Storage/useStoragePageModel.ts b/frontend-modern/src/components/Storage/useStoragePageModel.ts
index 014c638c5a..fd1ef2fc48 100644
--- a/frontend-modern/src/components/Storage/useStoragePageModel.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageModel.ts
@@ -5,6 +5,7 @@ import {
resolveStorageRecordMetricResourceId,
} from '@/features/storageBackups/storageMetricsIdentity';
import { useKioskMode } from '@/hooks/useKioskMode';
+import { useSummaryPageInteractionState } from '@/components/shared/summaryTableFocus';
import { useStorageExpansionState } from './useStorageExpansionState';
import { useStorageFilterState } from './useStorageFilterState';
import { useStoragePageData } from './useStoragePageData';
@@ -135,6 +136,22 @@ export const useStoragePageModel = () => {
if (!expandedId) return null;
return storageRecordMetricIds().get(expandedId) ?? expandedId;
});
+ const storageGroupKeyByMetricSeriesId = createMemo(() => {
+ const keys = new Map<string, string>();
+ for (const group of groupedRecords()) {
+ for (const record of group.items) {
+ keys.set(resolveStorageRecordMetricResourceId(record), group.key);
+ }
+ }
+ return keys;
+ });
+ const physicalDiskSeriesIds = createMemo(() => {
+ const ids = new Set<string>();
+ for (const disk of physicalDisks()) {
+ ids.add(resolvePhysicalDiskMetricResourceId(disk));
+ }
+ return ids;
+ });
createEffect(() => {
view();
@@ -177,8 +194,32 @@ export const useStoragePageModel = () => {
isStorageRecordCeph,
setExpandedPoolId,
});
+ const summaryInteraction = useSummaryPageInteractionState({
+ hoveredSeriesId: hoveredStorageResourceId,
+ focusedSeriesId: focusedStorageResourceId,
+ revealActiveSeries: (seriesId) => {
+ if (physicalDiskSeriesIds().has(seriesId)) {
+ if (view() !== 'disks') {
+ setView('disks');
+ }
+ return;
+ }
+
+ const groupKey = storageGroupKeyByMetricSeriesId().get(seriesId);
+ if (!groupKey) {
+ return;
+ }
+ if (view() !== 'pools') {
+ setView('pools');
+ }
+ if (!expandedGroups().has(groupKey)) {
+ toggleGroup(groupKey);
+ }
+ },
+ });
return {
+ activeSummaryStorageResourceId: summaryInteraction.activeSeriesId,
kioskMode,
reconnect: reconnectSurface,
selectedNodeId,
@@ -213,14 +254,19 @@ export const useStoragePageModel = () => {
toggleGroup,
expandedPoolId,
setExpandedPoolId,
+ chartHoverSync: summaryInteraction.chartHoverSync,
focusedStorageResourceId,
nodeOnlineByLabel,
highlightedRecordId,
getRecordAlertState,
hoveredStorageResourceId,
isLoadingPools,
+ jumpToActiveStorageRow: summaryInteraction.jumpToActiveRow,
selectedDiskId,
+ setChartHoverSync: summaryInteraction.setChartHoverSync,
setHoveredStorageResourceId,
setSelectedDiskId,
+ setSummaryTableRootRef: summaryInteraction.setTableRootRef,
+ shouldShowJumpToActiveStorageRow: summaryInteraction.shouldShowJumpToActiveRow,
};
};
diff --git a/frontend-modern/src/components/Workloads/WorkloadsSummary.test.tsx b/frontend-modern/src/components/Workloads/WorkloadsSummary.test.tsx
index c6ca84e3ea..ad015137d9 100644
--- a/frontend-modern/src/components/Workloads/WorkloadsSummary.test.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsSummary.test.tsx
@@ -544,4 +544,22 @@ describe('WorkloadsSummary performance behavior', () => {
const call = mockGetWorkloadCharts.mock.calls[0];
expect(call[2]).toMatchObject({ maxPoints: 48 });
});
+
+ it('renders a deliberate jump affordance when the active workload row is off-screen', () => {
+ const onJumpToActiveRow = vi.fn();
+
+ render(() => (
+ <WorkloadsSummary
+ timeRange="1h"
+ fallbackGuestCounts={{ total: 0, running: 0, stopped: 0 }}
+ fallbackSnapshots={[]}
+ showJumpToActiveRow
+ onJumpToActiveRow={onJumpToActiveRow}
+ />
+ ));
+
+ screen.getByRole('button', { name: 'Jump to row' }).click();
+
+ expect(onJumpToActiveRow).toHaveBeenCalledTimes(1);
+ });
});
diff --git a/frontend-modern/src/components/Workloads/WorkloadsSummary.tsx b/frontend-modern/src/components/Workloads/WorkloadsSummary.tsx
index 86b3f612af..e36ccd58a2 100644
--- a/frontend-modern/src/components/Workloads/WorkloadsSummary.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsSummary.tsx
@@ -8,6 +8,7 @@ import {
type SummaryChartHoverSync,
} from '@/components/shared/contextualFocus';
import { DensityMap } from '@/components/shared/DensityMap';
+import { SummaryJumpToRowButton } from '@/components/shared/SummaryJumpToRowButton';
import { SummaryPanel } from '@/components/shared/SummaryPanel';
import { SummaryMetricCard } from '@/components/shared/SummaryMetricCard';
import {
@@ -34,7 +35,11 @@ interface WorkloadsSummaryProps {
fallbackSnapshots?: WorkloadSummarySnapshot[];
hoveredWorkloadId?: string | null;
focusedWorkloadId?: string | null;
+ chartHoverSync?: SummaryChartHoverSync | null;
onTimeRangeChange?: (range: TimeRange) => void;
+ onChartHoverSyncChange?: (value: SummaryChartHoverSync | null) => void;
+ showJumpToActiveRow?: boolean;
+ onJumpToActiveRow?: () => void;
}
export interface WorkloadSummarySnapshot {
@@ -408,7 +413,16 @@ export const WorkloadsSummary: Component<WorkloadsSummaryProps> = (props) => {
const [loadedScopeKey, setLoadedScopeKey] = createSignal<string | null>(null);
const [fetchFailed, setFetchFailed] = createSignal(false);
const [orgScope, setOrgScope] = createSignal(normalizeOrgScope(getOrgID()));
- const [chartHoverSync, setChartHoverSync] = createSignal<SummaryChartHoverSync | null>(null);
+ const [localChartHoverSync, setLocalChartHoverSync] = createSignal<SummaryChartHoverSync | null>(
+ null,
+ );
+ const chartHoverSync = () => props.chartHoverSync ?? localChartHoverSync();
+ const setChartHoverSync = (value: SummaryChartHoverSync | null) => {
+ if (props.chartHoverSync === undefined) {
+ setLocalChartHoverSync(value);
+ }
+ props.onChartHoverSyncChange?.(value);
+ };
const selectedRange = createMemo<TimeRange>(() => props.timeRange || '1h');
const selectedNodeScope = createMemo(() => props.selectedNodeId?.trim() || '');
const activeScopeKey = createMemo(
@@ -743,6 +757,9 @@ export const WorkloadsSummary: Component<WorkloadsSummaryProps> = (props) => {
<Show when={guestCounts().stopped > 0}>
<span class="text-muted">{guestCounts().stopped} stopped</span>
</Show>
+ <Show when={props.showJumpToActiveRow && props.onJumpToActiveRow}>
+ <SummaryJumpToRowButton onClick={() => props.onJumpToActiveRow?.()} />
+ </Show>
</>
}
timeRange={selectedRange()}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 8eb7140c81..a84f175163 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -57,6 +57,8 @@ import interactiveSparklineSource from '@/components/shared/InteractiveSparkline
import interactiveSparklineModelSource from '@/components/shared/interactiveSparklineModel.ts?raw';
import contextualFocusSource from '@/components/shared/contextualFocus.ts?raw';
import summaryCardInteractionSource from '@/components/shared/summaryCardInteraction.ts?raw';
+import summaryJumpToRowButtonSource from '@/components/shared/SummaryJumpToRowButton.tsx?raw';
+import summaryTableFocusSource from '@/components/shared/summaryTableFocus.ts?raw';
import infrastructureSummaryTableSource from '@/components/shared/InfrastructureSummaryTable.tsx?raw';
import infrastructureSummaryTableRowSource from '@/components/shared/InfrastructureSummaryTableRow.tsx?raw';
import infrastructureSelectorModelSource from '@/components/shared/infrastructureSelectorModel.ts?raw';
@@ -255,6 +257,20 @@ describe('shared primitive guardrails', () => {
expect(dashboardSelectionStateSource).toContain('preserveScrollableAncestorVerticalOffset');
expect(dashboardSelectionStateSource).not.toContain('const scrollTop = scroller?.scrollTop');
+ expect(summaryJumpToRowButtonSource).toContain('<span>Jump to row</span>');
+ expect(summaryJumpToRowButtonSource).toContain('props.onClick');
+ expect(summaryJumpToRowButtonSource).not.toContain('querySelector');
+ expect(summaryJumpToRowButtonSource).not.toContain('scrollIntoView');
+
+ expect(summaryTableFocusSource).toContain('export function useSummaryTableFocusBridge');
+ expect(summaryTableFocusSource).toContain('export function useSummaryPageInteractionState');
+ expect(summaryTableFocusSource).toContain('resolveSummaryActiveSeriesId');
+ expect(summaryTableFocusSource).toContain('querySelector<HTMLElement>(');
+ expect(summaryTableFocusSource).toContain(
+ "row.scrollIntoView({ behavior: 'smooth', block: 'center' })",
+ );
+ expect(summaryTableFocusSource).not.toContain('useNavigate(');
+
expect(infrastructureSummaryStateSource).toContain('useSummaryContextualFocusState');
expect(infrastructureSummaryStateSource).toContain('chartHoverSync');
expect(infrastructureSummaryStateSource).not.toContain(
diff --git a/frontend-modern/src/components/shared/SummaryJumpToRowButton.tsx b/frontend-modern/src/components/shared/SummaryJumpToRowButton.tsx
new file mode 100644
index 0000000000..e81fb87765
--- /dev/null
+++ b/frontend-modern/src/components/shared/SummaryJumpToRowButton.tsx
@@ -0,0 +1,25 @@
+import type { Component } from 'solid-js';
+
+interface SummaryJumpToRowButtonProps {
+ onClick: () => void;
+}
+
+export const SummaryJumpToRowButton: Component<SummaryJumpToRowButtonProps> = (props) => {
+ return (
+ <button
+ type="button"
+ onClick={props.onClick}
+ class="inline-flex items-center gap-1 rounded-full border border-border-subtle bg-surface-alt/70 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted transition-colors hover:bg-surface-hover hover:text-base-content"
+ >
+ <span>Jump to row</span>
+ <svg class="h-3 w-3" viewBox="0 0 16 16" fill="none" stroke="currentColor">
+ <path
+ d="M8 3v10m0 0-3-3m3 3 3-3"
+ stroke-width="1.5"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ </svg>
+ </button>
+ );
+};
diff --git a/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsx b/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsx
new file mode 100644
index 0000000000..13f600e50a
--- /dev/null
+++ b/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsx
@@ -0,0 +1,121 @@
+import { renderHook } from '@solidjs/testing-library';
+import { createSignal } from 'solid-js';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { useSummaryPageInteractionState } from '@/components/shared/summaryTableFocus';
+
+const buildRect = (top: number, height = 32): DOMRect =>
+ ({
+ x: 0,
+ y: top,
+ width: 240,
+ height,
+ top,
+ bottom: top + height,
+ left: 0,
+ right: 240,
+ toJSON: () => ({}),
+ }) as DOMRect;
+
+describe('useSummaryPageInteractionState', () => {
+ beforeEach(() => {
+ vi.stubGlobal('innerHeight', 800);
+ vi.stubGlobal('requestAnimationFrame', (cb: FrameRequestCallback) => {
+ cb(0);
+ return 1;
+ });
+ });
+
+ afterEach(() => {
+ document.body.innerHTML = '';
+ vi.unstubAllGlobals();
+ });
+
+ it('prefers chart hover over row hover and route focus for the active series id', () => {
+ const [hoveredSeriesId] = createSignal<string | null>('row-hovered');
+ const [focusedSeriesId] = createSignal<string | null>('route-focused');
+
+ const { result } = renderHook(() =>
+ useSummaryPageInteractionState({
+ hoveredSeriesId,
+ focusedSeriesId,
+ }),
+ );
+
+ expect(result.activeSeriesId()).toBe('row-hovered');
+
+ result.setChartHoverSync({
+ sourceKey: 'cpu',
+ seriesId: 'chart-hovered',
+ timestamp: 123,
+ });
+
+ expect(result.activeSeriesId()).toBe('chart-hovered');
+ });
+
+ it('shows a jump affordance when the active row is mounted but outside the viewport', () => {
+ const [hoveredSeriesId] = createSignal<string | null>('workload-a');
+ const scrollIntoView = vi.fn();
+ const root = document.createElement('div');
+ const row = document.createElement('div');
+ row.setAttribute('data-summary-series-id', 'workload-a');
+ Object.defineProperty(row, 'getBoundingClientRect', {
+ configurable: true,
+ value: () => buildRect(1200),
+ });
+ Object.defineProperty(row, 'scrollIntoView', {
+ configurable: true,
+ value: scrollIntoView,
+ });
+ root.appendChild(row);
+ document.body.appendChild(root);
+
+ const { result } = renderHook(() =>
+ useSummaryPageInteractionState({
+ hoveredSeriesId,
+ }),
+ );
+
+ result.setTableRootRef(root);
+
+ expect(result.shouldShowJumpToActiveRow()).toBe(true);
+
+ result.jumpToActiveRow();
+
+ expect(scrollIntoView).toHaveBeenCalledWith({ behavior: 'smooth', block: 'center' });
+ });
+
+ it('reveals an unmapped row before attempting to scroll to it', () => {
+ const [hoveredSeriesId] = createSignal<string | null>('pool-alpha');
+ const scrollIntoView = vi.fn();
+ const root = document.createElement('div');
+ const row = document.createElement('div');
+ row.setAttribute('data-summary-series-id', 'pool-alpha');
+ Object.defineProperty(row, 'getBoundingClientRect', {
+ configurable: true,
+ value: () => buildRect(64),
+ });
+ Object.defineProperty(row, 'scrollIntoView', {
+ configurable: true,
+ value: scrollIntoView,
+ });
+
+ const revealActiveSeries = vi.fn(() => {
+ root.appendChild(row);
+ });
+
+ const { result } = renderHook(() =>
+ useSummaryPageInteractionState({
+ hoveredSeriesId,
+ revealActiveSeries,
+ }),
+ );
+
+ result.setTableRootRef(root);
+ expect(result.shouldShowJumpToActiveRow()).toBe(true);
+
+ result.jumpToActiveRow();
+
+ expect(revealActiveSeries).toHaveBeenCalledWith('pool-alpha');
+ expect(scrollIntoView).toHaveBeenCalledWith({ behavior: 'smooth', block: 'center' });
+ });
+});
diff --git a/frontend-modern/src/components/shared/summaryTableFocus.ts b/frontend-modern/src/components/shared/summaryTableFocus.ts
new file mode 100644
index 0000000000..c06be5db83
--- /dev/null
+++ b/frontend-modern/src/components/shared/summaryTableFocus.ts
@@ -0,0 +1,141 @@
+import { createMemo, createSignal, type Accessor } from 'solid-js';
+import type { SummaryChartHoverSync } from './contextualFocus';
+import { resolveSummaryActiveSeriesId } from './summaryCardInteraction';
+
+const normalizeSeriesId = (value: string | null | undefined): string => value?.trim() || '';
+
+const escapeAttributeSelectorValue = (value: string): string =>
+ value.split('\\').join('\\\\').split('"').join('\\"');
+
+const isElementVisibleWithinViewport = (element: HTMLElement): boolean => {
+ const rect = element.getBoundingClientRect();
+ if (rect.height <= 0 || rect.width <= 0) {
+ return false;
+ }
+ if (typeof window === 'undefined') {
+ return true;
+ }
+
+ if (rect.bottom <= 0 || rect.top >= window.innerHeight) {
+ return false;
+ }
+
+ let current: HTMLElement | null = element.parentElement;
+ while (current) {
+ const style = getComputedStyle(current);
+ const clipsVertically =
+ (style.overflowY === 'auto' || style.overflowY === 'scroll' || style.overflowY === 'hidden') &&
+ current.scrollHeight > current.clientHeight;
+ if (clipsVertically) {
+ const containerRect = current.getBoundingClientRect();
+ if (rect.bottom <= containerRect.top || rect.top >= containerRect.bottom) {
+ return false;
+ }
+ }
+ current = current.parentElement;
+ }
+
+ return true;
+};
+
+export interface UseSummaryTableFocusBridgeOptions {
+ activeSeriesId: Accessor<string | null | undefined>;
+ revealActiveSeries?: (seriesId: string) => void;
+}
+
+export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOptions) {
+ const [tableRoot, setTableRoot] = createSignal<HTMLElement | null>(null);
+
+ const normalizedActiveSeriesId = createMemo<string | null>(() => {
+ const normalized = normalizeSeriesId(options.activeSeriesId());
+ return normalized || null;
+ });
+
+ const activeRow = (): HTMLElement | null => {
+ const root = tableRoot();
+ const activeSeriesId = normalizedActiveSeriesId();
+ if (!root || !activeSeriesId) {
+ return null;
+ }
+ return root.querySelector<HTMLElement>(
+ `[data-summary-series-id="${escapeAttributeSelectorValue(activeSeriesId)}"]`,
+ );
+ };
+
+ const isActiveRowVisible = createMemo<boolean>(() => {
+ const row = activeRow();
+ if (!row) {
+ return false;
+ }
+ return isElementVisibleWithinViewport(row);
+ });
+
+ const shouldShowJumpToActiveRow = createMemo<boolean>(() => {
+ return Boolean(normalizedActiveSeriesId()) && !isActiveRowVisible();
+ });
+
+ const jumpToActiveRow = () => {
+ const activeSeriesId = normalizedActiveSeriesId();
+ if (!activeSeriesId) {
+ return;
+ }
+
+ options.revealActiveSeries?.(activeSeriesId);
+
+ const attemptScroll = (remainingFrames: number) => {
+ const row = activeRow();
+ if (row) {
+ row.scrollIntoView({ behavior: 'smooth', block: 'center' });
+ return;
+ }
+ if (remainingFrames <= 0 || typeof window === 'undefined') {
+ return;
+ }
+ window.requestAnimationFrame(() => attemptScroll(remainingFrames - 1));
+ };
+
+ attemptScroll(6);
+ };
+
+ return {
+ activeRow,
+ isActiveRowVisible,
+ jumpToActiveRow,
+ setTableRootRef: (element: HTMLElement | undefined) => setTableRoot(element ?? null),
+ shouldShowJumpToActiveRow,
+ } as const;
+}
+
+export interface UseSummaryPageInteractionStateOptions {
+ hoveredSeriesId?: Accessor<string | null | undefined>;
+ focusedSeriesId?: Accessor<string | null | undefined>;
+ revealActiveSeries?: (seriesId: string) => void;
+}
+
+export function useSummaryPageInteractionState(options: UseSummaryPageInteractionStateOptions) {
+ const [chartHoverSync, setChartHoverSync] = createSignal<SummaryChartHoverSync | null>(null);
+ const hoveredSeriesId = options.hoveredSeriesId ?? (() => null);
+ const focusedSeriesId = options.focusedSeriesId ?? (() => null);
+
+ const activeSeriesId = createMemo<string | null>(() =>
+ resolveSummaryActiveSeriesId({
+ chartHoveredSeriesId: chartHoverSync()?.seriesId ?? null,
+ hoveredSeriesId: hoveredSeriesId(),
+ focusedSeriesId: focusedSeriesId(),
+ }),
+ );
+
+ const tableFocus = useSummaryTableFocusBridge({
+ activeSeriesId,
+ revealActiveSeries: options.revealActiveSeries,
+ });
+
+ return {
+ activeSeriesId,
+ chartHoverSync,
+ jumpToActiveRow: tableFocus.jumpToActiveRow,
+ setChartHoverSync,
+ setTableRootRef: tableFocus.setTableRootRef,
+ shouldShowJumpToActiveRow: tableFocus.shouldShowJumpToActiveRow,
+ } as const;
+}
diff --git a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx
index 965d9b5800..363ec40268 100644
--- a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx
+++ b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx
@@ -42,12 +42,16 @@ export function InfrastructurePageSurface() {
setSummaryCollapsed,
groupingMode,
setGroupingMode,
+ activeSummaryResourceId,
expandedResourceId,
setExpandedResourceId,
+ chartHoverSync,
hoveredResourceId,
setHoveredResourceId,
highlightedResourceId,
+ revealedResourceId,
isMobile,
+ jumpToActiveResourceRow,
deployCluster,
setDeployCluster,
filtersOpen,
@@ -60,6 +64,9 @@ export function InfrastructurePageSurface() {
clearFilters,
filteredResources,
hasFilteredResources,
+ setChartHoverSync,
+ setSummaryTableRootRef,
+ shouldShowJumpToActiveResourceRow,
} = useInfrastructurePageState();
const infrastructureEmptyState = () => getInfrastructureEmptyState();
@@ -138,6 +145,10 @@ export function InfrastructurePageSurface() {
onTimeRangeChange={setInfrastructureSummaryRange}
hoveredResourceId={hoveredResourceId()}
focusedResourceId={expandedResourceId()}
+ chartHoverSync={chartHoverSync()}
+ onChartHoverSyncChange={setChartHoverSync}
+ showJumpToActiveRow={shouldShowJumpToActiveResourceRow()}
+ onJumpToActiveRow={jumpToActiveResourceRow}
/>
</StickySummarySection>
</Show>
@@ -303,12 +314,14 @@ export function InfrastructurePageSurface() {
<UnifiedResourceTable
resources={filteredResources()}
expandedResourceId={expandedResourceId()}
- hoveredResourceId={hoveredResourceId()}
+ hoveredResourceId={activeSummaryResourceId()}
highlightedResourceId={highlightedResourceId()}
+ revealedResourceId={revealedResourceId()}
onExpandedResourceChange={setExpandedResourceId}
onHoverChange={setHoveredResourceId}
groupingMode={groupingMode()}
onDeployCluster={(id, name) => setDeployCluster({ id, name })}
+ setTableRootRef={setSummaryTableRootRef}
/>
</Show>
</div>
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 29928cde57..1bdf2b3aa9 100644
--- a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts
+++ b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts
@@ -37,4 +37,21 @@ describe('InfrastructurePageSurface guardrails', () => {
expect(infrastructurePageModelSource).toContain('tokenizeSearch');
expect(infrastructurePageModelSource).toContain('filterResources');
});
+
+ it('keeps summary-to-table coordination on the page-state owner', () => {
+ expect(infrastructurePageSurfaceSource).toContain('showJumpToActiveRow={shouldShowJumpToActiveResourceRow()}');
+ expect(infrastructurePageSurfaceSource).toContain('onJumpToActiveRow={jumpToActiveResourceRow}');
+ expect(infrastructurePageSurfaceSource).toContain('setTableRootRef={setSummaryTableRootRef}');
+ expect(infrastructurePageSurfaceSource).not.toContain('useSummaryPageInteractionState');
+
+ expect(infrastructurePageStateSource).toContain('useSummaryPageInteractionState');
+ expect(infrastructurePageStateSource).toContain('jumpToActiveResourceRow');
+ expect(infrastructurePageStateSource).toContain('setSummaryTableRootRef');
+ expect(infrastructurePageStateSource).toContain('shouldShowJumpToActiveResourceRow');
+ expect(infrastructurePageStateSource).not.toContain('querySelector<HTMLElement>(');
+ expect(infrastructurePageStateSource).not.toContain('scrollIntoView({ behavior: \'smooth\', block: \'center\' })');
+
+ expect(infrastructurePageRouteStateSource).not.toContain('useSummaryPageInteractionState');
+ expect(infrastructurePageRouteStateSource).not.toContain('setSummaryTableRootRef');
+ });
});
diff --git a/frontend-modern/src/features/infrastructure/useInfrastructurePageRouteState.ts b/frontend-modern/src/features/infrastructure/useInfrastructurePageRouteState.ts
index 68a45c418f..40fd1ed3dd 100644
--- a/frontend-modern/src/features/infrastructure/useInfrastructurePageRouteState.ts
+++ b/frontend-modern/src/features/infrastructure/useInfrastructurePageRouteState.ts
@@ -1,4 +1,11 @@
-import { createEffect, createSignal, onCleanup, type Accessor, type Setter, untrack } from 'solid-js';
+import {
+ createEffect,
+ createSignal,
+ onCleanup,
+ type Accessor,
+ type Setter,
+ untrack,
+} from 'solid-js';
import { useLocation, useNavigate } from '@solidjs/router';
import type { Resource } from '@/types/resource';
import { normalizeSourcePlatformKey } from '@/utils/sourcePlatforms';
@@ -8,6 +15,7 @@ import {
INFRASTRUCTURE_QUERY_PARAMS,
parseInfrastructureLinkSearch,
} from '@/routing/resourceLinks';
+import { createRouteStateNavigateScheduler } from '@/utils/routeStateNavigation';
import { areSearchParamsEquivalent } from '@/utils/searchParams';
interface InfrastructurePageRouteStateOptions {
@@ -32,32 +40,20 @@ export function useInfrastructurePageRouteState(options: InfrastructurePageRoute
} = options;
const location = useLocation();
const navigate = useNavigate();
+ const routeStateNavigate = createRouteStateNavigateScheduler(
+ navigate,
+ () => `${untrack(() => location.pathname)}${untrack(() => location.search)}`,
+ );
const [expandedResourceId, setExpandedResourceId] = createSignal<string | null>(null);
const [hoveredResourceId, setHoveredResourceId] = createSignal<string | null>(null);
const [highlightedResourceId, setHighlightedResourceId] = createSignal<string | null>(null);
+ const [revealedResourceId, setRevealedResourceId] = createSignal<string | null>(null);
const [handledResourceId, setHandledResourceId] = createSignal<string | null>(null);
const [handledSourceParam, setHandledSourceParam] = createSignal<string | null>(null);
const [handledQueryParam, setHandledQueryParam] = createSignal('');
let highlightTimer: number | undefined;
- let pendingUrlSyncHandle: number | null = null;
- let pendingUrlSyncPath: string | null = null;
-
- const scheduleUrlSyncNavigate = (nextPath: string) => {
- pendingUrlSyncPath = nextPath;
- if (pendingUrlSyncHandle !== null) return;
- pendingUrlSyncHandle = window.setTimeout(() => {
- pendingUrlSyncHandle = null;
- const target = pendingUrlSyncPath;
- pendingUrlSyncPath = null;
- if (!target) return;
- const current = `${untrack(() => location.pathname)}${untrack(() => location.search)}`;
- if (current === target) return;
- navigate(target, { replace: true });
- }, 0);
- };
-
createEffect(() => {
const { resource: resourceId } = parseInfrastructureLinkSearch(location.search);
if (!resourceId || resourceId === handledResourceId()) return;
@@ -156,7 +152,7 @@ export function useInfrastructurePageRouteState(options: InfrastructurePageRoute
if (!areSearchParamsEquivalent(currentParams, nextParams)) {
const nextSearch = nextParams.toString();
const nextPath = nextSearch ? `${INFRASTRUCTURE_PATH}?${nextSearch}` : INFRASTRUCTURE_PATH;
- scheduleUrlSyncNavigate(nextPath);
+ routeStateNavigate.schedule(nextPath);
}
});
@@ -169,12 +165,17 @@ export function useInfrastructurePageRouteState(options: InfrastructurePageRoute
}
});
- onCleanup(() => {
- if (pendingUrlSyncHandle !== null) {
- window.clearTimeout(pendingUrlSyncHandle);
- pendingUrlSyncHandle = null;
- pendingUrlSyncPath = null;
+ createEffect(() => {
+ const revealedId = revealedResourceId();
+ if (!revealedId) return;
+ const exists = filteredResources().some((resource) => resource.id === revealedId);
+ if (!exists) {
+ setRevealedResourceId(null);
}
+ });
+
+ onCleanup(() => {
+ routeStateNavigate.cleanup();
if (highlightTimer) {
window.clearTimeout(highlightTimer);
}
@@ -186,6 +187,8 @@ export function useInfrastructurePageRouteState(options: InfrastructurePageRoute
hoveredResourceId,
setHoveredResourceId,
highlightedResourceId,
+ revealedResourceId,
+ setRevealedResourceId,
};
}
diff --git a/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts b/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts
index 140a3460b5..8deaca7d72 100644
--- a/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts
+++ b/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts
@@ -5,6 +5,7 @@ import { usePersistentSignal } from '@/hooks/usePersistentSignal';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { STORAGE_KEYS } from '@/utils/localStorage';
import { useKioskMode } from '@/hooks/useKioskMode';
+import { useSummaryPageInteractionState } from '@/components/shared/summaryTableFocus';
import { isSummaryTimeRange } from '@/components/shared/summaryTimeRange';
import { useInfrastructurePageRouteState } from './useInfrastructurePageRouteState';
import { buildInfrastructurePageFilterDerivation } from './infrastructurePageModel';
@@ -68,6 +69,11 @@ export function useInfrastructurePageState() {
searchQuery,
setSearchQuery,
});
+ const summaryInteraction = useSummaryPageInteractionState({
+ hoveredSeriesId: routeState.hoveredResourceId,
+ focusedSeriesId: routeState.expandedResourceId,
+ revealActiveSeries: routeState.setRevealedResourceId,
+ });
const clearFilters = () => {
setSelectedSource('');
@@ -99,8 +105,11 @@ export function useInfrastructurePageState() {
setSummaryCollapsed,
groupingMode,
setGroupingMode,
+ activeSummaryResourceId: summaryInteraction.activeSeriesId,
...routeState,
+ chartHoverSync: summaryInteraction.chartHoverSync,
isMobile,
+ jumpToActiveResourceRow: summaryInteraction.jumpToActiveRow,
deployCluster,
setDeployCluster,
filtersOpen,
@@ -114,5 +123,8 @@ export function useInfrastructurePageState() {
clearFilters,
filteredResources,
hasFilteredResources,
+ setChartHoverSync: summaryInteraction.setChartHoverSync,
+ 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 27adaf1b31..09e49ab4e3 100644
--- a/tests/integration/tests/48-summary-hover-selection.spec.ts
+++ b/tests/integration/tests/48-summary-hover-selection.spec.ts
@@ -638,4 +638,64 @@ test.describe.serial("Summary hover selection", () => {
await expectSummaryHoverTimestampsAligned(storageSummary, 4);
await expectActiveIsolatedLineCards(storageSummary, 3);
});
+
+ test("keeps table coordination non-destructive and reversible", 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();
+ const infrastructureChartId = await hoverSummaryChartUntilActiveId(
+ page,
+ infrastructureSummary,
+ infrastructureSummary
+ .locator('[data-active-series-display="isolate"]')
+ .first(),
+ );
+ const highlightedInfrastructureRow = page.locator(
+ `tr[data-summary-series-id="${infrastructureChartId}"]`,
+ );
+ const infrastructureJumpButton = page.getByRole("button", {
+ name: "Jump to row",
+ });
+ if (await highlightedInfrastructureRow.first().isVisible()) {
+ await expect(highlightedInfrastructureRow.first()).toHaveAttribute(
+ "data-summary-row-active",
+ "true",
+ );
+ } else {
+ await expect(infrastructureJumpButton).toBeVisible();
+ await infrastructureJumpButton.click();
+ await expect(highlightedInfrastructureRow.first()).toBeVisible();
+ }
+
+ await page.goto("/workloads", { waitUntil: "domcontentloaded" });
+ const workloadsSummary = page.getByTestId("workloads-summary");
+ await expect(workloadsSummary).toBeVisible();
+ const focusedWorkloadRow = page.locator("tr[data-guest-id]").first();
+ const focusedWorkloadId = await readSummarySeriesId(
+ focusedWorkloadRow,
+ "data-guest-id",
+ );
+ expect(focusedWorkloadId).not.toBe("");
+ await focusedWorkloadRow.click();
+ await scrollPrimaryViewportToBottom(page);
+ const jumpButton = page.getByRole("button", { name: "Jump to row" });
+ const focusedSummaryRow = page
+ .locator(`tr[data-summary-series-id="${focusedWorkloadId}"]`)
+ .first();
+ if (await jumpButton.isVisible()) {
+ await jumpButton.click();
+ await expect(focusedSummaryRow).toBeVisible();
+ } else {
+ await expect(focusedSummaryRow).toBeVisible();
+ }
+ });
});