Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix(frontend): limit summary scope chrome to off-screen fallback
rcourtman65111a78541c
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 9231e68657..305d31b50c 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -154,7 +154,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, 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 or pinning a workload group header, infrastructure cluster header, or storage pool-group header must scope the matching summary cards through that same shared contract instead of 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. `frontend-modern/src/components/Recovery/RecoverySummary.tsx` is explicitly outside this interaction dialect: recovery posture cards may share summary framing, but they must not silently grow row/group/chart hover behavior without a separate governed product decision.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, explicit, 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 a page/group/entity scope is active on workloads, infrastructure, or storage, the page shell must surface that state through the shared `frontend-modern/src/components/shared/SummaryScopeBar.tsx` plus `frontend-modern/src/components/shared/summaryScopePresentation.ts` contract instead of inventing page-local chips, breadcrumbs, or hidden route-only focus. That shared scope presenter must read like native page context, not a pill/badge widget: it should distinguish transient preview from pinned focus with quiet inline language, keep the current scope visible even when the sticky summary is collapsed or off-screen, and expose a clear reset path for pinned scope so touch-only operators do not depend on hover or “click the same row again” discovery. When the active row is off-screen, page owners must still 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: infrastructure and workload row toggles that already have the row in view must hand the current `.app-scroll-shell` position through `frontend-modern/src/utils/appShellScrollRestoration.ts` so the remounted shell in `frontend-modern/src/App.tsx` can reopen the inline detail without looking like a page refresh, and then still route through the shared reveal helper whenever the opened drawer would otherwise land below the fold. Same-route drawers must therefore scroll only enough to keep the row header plus the top of the inline detail visible, never hard-center the row just because the route state changed.+11. Keep summary-to-table coordination deliberate, explicit, 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. Pinned page/group/entity scope on workloads, infrastructure, or storage must stay row-first: the pinned row or group header is the primary visible state while it remains on-screen, and the shared `frontend-modern/src/components/shared/SummaryScopeBar.tsx` plus `frontend-modern/src/components/shared/summaryScopePresentation.ts` contract may appear only as a compact fallback when that pinned target scrolls out of view. Page shells therefore must not reintroduce always-on scope banners, preview bars, page-local chips, breadcrumbs, or hidden route-only focus. When the active row is off-screen, page owners must still 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: infrastructure and workload row toggles that already have the row in view must hand the current `.app-scroll-shell` position through `frontend-modern/src/utils/appShellScrollRestoration.ts` so the remounted shell in `frontend-modern/src/App.tsx` can reopen the inline detail without looking like a page refresh, and then still route through the shared reveal helper whenever the opened drawer would otherwise land below the fold. Same-route drawers must therefore scroll only enough to keep the row header plus the top of the inline detail visible, never hard-center the row just because the route state changed.Shared summary-linked rows and group headers must also route their previewsemantics through`frontend-modern/src/components/shared/summaryInteractionA11y.ts`.@@ -166,7 +166,7 @@ work extends shared components instead of creating new local variants.table-row shims. Group headers are different: they may use the header rowitself as the deliberate pin target when that keeps the table chromenative, but they must not grow separate scope/pinned pill buttons beyond- the shared `SummaryScopeBar.tsx` reset path. Workloads, infrastructure,+ the shared off-screen `SummaryScopeBar.tsx` fallback. Workloads, infrastructure,and storage must not rebuild row-as-button keyboard handling or trailingone-off expand columns once the shared action primitive exists.12. Keep summary-linked table row emphasis on the shared primitive contract. Workloads, infrastructure, and storage rows that mirror the active summary entity must expose that state through `data-summary-row-active` and let the shared presentation in `frontend-modern/src/index.css` render the row emphasis, rather than carrying page-local sky or blue fill classes inside each row renderer. Group-scoped preview and pin must use that same shared presentation boundary: child rows that belong to a hovered or pinned summary group should expose `data-summary-group-member-active="preview|pinned"` so the block-level emphasis stays subtle, consistent, and reversible instead of each table inventing its own outline, badge, or full-strength fill treatment.diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex 25e1f5645d..62bf0dc6fa 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, workload group headers, infrastructure cluster headers, and storage pool-group headers scope the summary coherently, pinned group focus remains route-backed and reversible, and the hot path does not multiply render or scroll work. The explicit scope affordance for that hot path must also stay shared: `frontend-modern/src/components/shared/SummaryScopeBar.tsx` and `frontend-modern/src/components/shared/summaryScopePresentation.ts` own the visible page/group/entity scope label, preview-vs-pinned distinction, and reset affordance so touch-safe reversibility does not fork per-page banner logic. That affordance must stay visually quiet and inline with the summary shell rather than reintroducing chip, badge, or banner chrome that competes with the charts themselves. That same hot path must keep chart-backed summary-card geometry explicit and stable so hover rerenders, synchronized readouts, idle header metadata, or the scope bar itself cannot feed layout loops that grow or shrink the top cards over time. Recovery’s summary rail is not part of this interactive hot path; it may share summary-card framing, but it must remain non-interactive until a separately governed model says otherwise.+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, infrastructure cluster headers, and storage pool-group headers scope the summary coherently, pinned group focus remains route-backed and reversible, and the hot path does not multiply render or scroll work. The explicit scope affordance for that hot path must also stay shared, but it is now row-first rather than always-on chrome: `frontend-modern/src/components/shared/SummaryScopeBar.tsx` and `frontend-modern/src/components/shared/summaryScopePresentation.ts` own the compact off-screen pinned-scope fallback and clear affordance, while the on-screen row or group header remains the primary visible pinned state. That affordance must stay visually quiet and inline with the summary shell rather than reintroducing chip, badge, or banner chrome that competes with the charts themselves. That same hot path must keep chart-backed summary-card geometry explicit and stable so hover rerenders, synchronized readouts, idle header metadata, or the scope bar itself cannot feed layout loops that grow or shrink the top cards over time. Recovery’s summary rail is not part of this interactive hot path; it may share summary-card framing, but it must remain non-interactive until a separately governed model says otherwise.The input path for that hot summary contract must stay shared too:`frontend-modern/src/components/shared/summaryInteractionA11y.ts` ownsfine-pointer preview and focus-preview continuity, whilediff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex b353af2fd3..69cd0d0529 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -201,15 +201,16 @@ querying, and the operator-facing storage health presentation layer.disk-temperature cards demote cleanly during pool focus, instead ofleaving stale row-local IDs or storage-local hover branches on the page.Any page, group, or entity scope that becomes pinned through storage- interaction must also surface through the shared+ interaction must stay row-first and only fall back to the shared`frontend-modern/src/components/shared/SummaryScopeBar.tsx` plus`frontend-modern/src/components/shared/summaryScopePresentation.ts`- contract so touch users and mouse users see the same explicit, reversible- scope state instead of relying on hidden route state or storage-local- badges. When that scope is a storage pool group, member pool rows should- expose shared `data-summary-group-member-active="preview|pinned"` state so- the grouped block reads as one scoped set without adding storage-local- outlines, pill buttons, or heavy full-row fills.+ contract once the pinned row or group scrolls off-screen, so touch users+ and mouse users keep the same explicit, reversible scope state without+ adding an always-on storage-local banner. When that scope is a storage+ pool group, member pool rows should expose shared+ `data-summary-group-member-active="preview|pinned"` state so the grouped+ block reads as one scoped set without adding storage-local outlines, pill+ buttons, or heavy full-row fills.14. Keep storage summary remount caches versioned with the chart contract.`frontend-modern/src/components/Storage/StorageSummary.tsx` may keep abounded in-memory cache for same-tab remounts, but its cache key must carrydiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 174c9559d3..6846d6d8d3 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -214,12 +214,13 @@ assembly branch.route-backed cluster hover state. Deliberate cluster focus must also stayon the canonical infrastructure route through the shared `summaryGroup`query state, so pinned scope is shareable, reversible, and owned by the- same route-backed summary contract as row focus. That pinned or previewed- scope must be surfaced through the shared+ same route-backed summary contract as row focus. Infrastructure must stay+ row-first here: the pinned cluster header remains the primary visible+ state while it is on-screen, and the shared`frontend-modern/src/components/shared/SummaryScopeBar.tsx` plus`frontend-modern/src/components/shared/summaryScopePresentation.ts`- contract so infrastructure does not hide active scope in route params or- hover-only table affordances. Cluster headers themselves should stay+ contract should appear only as the compact off-screen fallback when that+ pinned cluster scrolls away. Cluster headers themselves should stayheader-like: use the row as the deliberate pin target and do not add asecond scope/pinned pill button inside the cluster row chrome.14. Keep infrastructure row emphasis on the shared frontend presentationdiff --git a/frontend-modern/src/components/Dashboard/Dashboard.tsx b/frontend-modern/src/components/Dashboard/Dashboard.tsxindex 932c6d23c2..33fd29f4f2 100644--- a/frontend-modern/src/components/Dashboard/Dashboard.tsx+++ b/frontend-modern/src/components/Dashboard/Dashboard.tsx@@ -99,15 +99,14 @@ export function Dashboard(props: DashboardProps) {when={state.surfaceConnected() &&state.surfaceInitialDataReceived() &&- state.filteredGuests().length > 0+ state.hasPinnedSummaryScope() &&+ state.shouldShowPinnedSummaryScopeFallback()}><SummaryScopeBartestId="workloads-summary-scope"- active={state.summaryScopePresentation()}- pinned={state.hasPinnedSummaryScope() ? state.pinnedSummaryScopePresentation() : null}- idleHint={state.isMobile() ? 'Tap a group or row to pin scope.' : undefined}- onReset={state.hasPinnedSummaryScope() ? state.clearPinnedSummaryScope : undefined}+ scope={state.pinnedSummaryScopePresentation()}+ onClear={state.clearPinnedSummaryScope}/></Show>diff --git a/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts b/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.tsindex 0789a0b6d1..b645756ae9 100644--- a/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts@@ -356,6 +356,66 @@ describe('useDashboardSelectionState', () => {expect(result.activeSummaryWorkloadId()).toBeNull();});+ it('shows the pinned-scope fallback only after a pinned workload group scrolls out of view', () => {+ locationSearch = '?summaryGroup=cluster-a';+ const [filteredGuests] = createSignal<WorkloadGuest[]>([+ {+ id: 'cluster-a:node-1:101',+ name: 'guest-1',+ status: 'running',+ instance: 'cluster-a',+ node: 'node-1',+ vmid: 101,+ } as unknown as WorkloadGuest,+ ]);+ const summaryScopes = () =>+ new Map<string, SummarySeriesGroupScope>([+ [+ 'cluster-a',+ {+ id: 'cluster-a',+ label: 'Cluster A (1 workload)',+ seriesIds: ['cluster-a:node-1:101'],+ },+ ],+ ]);++ let top = 120;+ const { result } = renderHook(() =>+ useDashboardSelectionState({+ filteredGuests,+ summaryGroupScopes: summaryScopes,+ }),+ );++ const tableWrapper = document.createElement('div');+ const groupRow = document.createElement('div');+ groupRow.dataset.summaryGroupId = 'cluster-a';+ groupRow.getBoundingClientRect = vi.fn(() => ({+ top,+ bottom: top + 40,+ left: 0,+ right: 320,+ width: 320,+ height: 40,+ x: 0,+ y: top,+ toJSON: () => ({}),+ })) as unknown as typeof groupRow.getBoundingClientRect;+ tableWrapper.appendChild(groupRow);+ document.body.appendChild(tableWrapper);++ result.setTableWrapperRef(tableWrapper as HTMLDivElement);++ expect(result.focusedSummaryWorkloadGroupId()).toBe('cluster-a');+ expect(result.shouldShowPinnedSummaryScopeFallback()).toBe(false);++ top = window.innerHeight + 120;+ window.dispatchEvent(new Event('scroll'));++ expect(result.shouldShowPinnedSummaryScopeFallback()).toBe(true);+ });+it('clears row focus without leaving behind an inferred agent filter', () => {locationSearch = '?resource=cluster-a:node-1:101';const [filteredGuests] = createSignal<WorkloadGuest[]>([]);diff --git a/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts b/frontend-modern/src/components/Dashboard/useDashboardSelectionState.tsindex 024ee036bf..823f9acbc5 100644--- a/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts@@ -55,6 +55,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOphoveredSeriesId: hoveredWorkloadId,hoveredGroupScope: hoveredWorkloadGroupScope,focusedSeriesId: selectedGuestId,+ focusedGroupId: selectedWorkloadGroupId,focusedGroupScope: focusedWorkloadGroupScope,revealActiveSeries: setRevealedGuestId,});@@ -229,6 +230,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOpsetSelectedGuestId,setTableBodyRef,setTableWrapperRef,+ shouldShowPinnedSummaryScopeFallback: summaryInteraction.shouldShowPinnedScopeFallback,shouldShowJumpToActiveWorkloadRow: summaryInteraction.shouldShowJumpToActiveRow,tableBodyRef,} as const;diff --git a/frontend-modern/src/components/Dashboard/useDashboardState.ts b/frontend-modern/src/components/Dashboard/useDashboardState.tsindex 3529a9bf40..5f5f5cbd87 100644--- a/frontend-modern/src/components/Dashboard/useDashboardState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardState.ts@@ -7,8 +7,8 @@ import { useAlertsActivation } from '@/stores/alertsActivation';import { usePersistentSignal } from '@/hooks/usePersistentSignal';import { useWorkloads } from '@/hooks/useWorkloads';import { useKioskMode } from '@/hooks/useKioskMode';-import { buildSummaryScopePresentation } from '@/components/shared/summaryScopePresentation';import { resolveSummaryScopeState } from '@/components/shared/summaryCardInteraction';+import { buildSummaryScopePresentation } from '@/components/shared/summaryScopePresentation';import {getDashboardDisconnectedState,getDashboardGuestsEmptyState,@@ -210,7 +210,6 @@ export function useDashboardState(props: DashboardProps) {);const {- activeSummaryScopeState,activeSummaryWorkloadGroupScope,activeSummaryWorkloadId,chartHoverSync,@@ -230,6 +229,7 @@ export function useDashboardState(props: DashboardProps) {setTableBodyRef,setTableWrapperRef,shouldShowJumpToActiveWorkloadRow,+ shouldShowPinnedSummaryScopeFallback,tableBodyRef,} = useDashboardSelectionState({filteredGuests,@@ -254,13 +254,6 @@ export function useDashboardState(props: DashboardProps) {focusedGroupScope: focusedSummaryWorkloadGroupScope(),}),);- const summaryScopePresentation = createMemo(() =>- buildSummaryScopePresentation({- allLabel: 'All workloads',- resolveEntityLabel: (seriesId) => workloadNamesById().get(seriesId) ?? seriesId,- state: activeSummaryScopeState(),- }),- );const pinnedSummaryScopePresentation = createMemo(() =>buildSummaryScopePresentation({allLabel: 'All workloads',@@ -376,9 +369,9 @@ export function useDashboardState(props: DashboardProps) {setViewMode,setWorkloadsSummaryCollapsed,setWorkloadsSummaryRange,- summaryScopePresentation,pinnedSummaryScopePresentation,hasPinnedSummaryScope,+ shouldShowPinnedSummaryScopeFallback,shouldShowJumpToActiveWorkloadRow,sortDirection,sortKey,diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsxindex 1f23eb4793..67cf3aa98c 100644--- a/frontend-modern/src/components/Storage/Storage.tsx+++ b/frontend-modern/src/components/Storage/Storage.tsx@@ -66,7 +66,7 @@ const Storage: Component = () => {setSummaryTableRootRef,hasPinnedSummaryScope,pinnedSummaryScopePresentation,- summaryScopePresentation,+ shouldShowPinnedSummaryScopeFallback,shouldShowJumpToActiveStorageRow,} = useStoragePageModel();@@ -121,13 +121,11 @@ const Storage: Component = () => {<StoragePageBanners kind={activeBannerKind} reconnect={reconnect} />- <Show when={filteredRecords().length > 0 || physicalDisks().length > 0}>+ <Show when={hasPinnedSummaryScope() && shouldShowPinnedSummaryScopeFallback()}><SummaryScopeBartestId="storage-summary-scope"- active={summaryScopePresentation()}- pinned={hasPinnedSummaryScope() ? pinnedSummaryScopePresentation() : null}- idleHint={groupBy() !== 'none' ? 'Tap a group or row to pin scope.' : 'Tap a row to pin scope.'}- onReset={hasPinnedSummaryScope() ? clearPinnedSummaryScope : undefined}+ scope={pinnedSummaryScopePresentation()}+ onClear={clearPinnedSummaryScope}/></Show>diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsxindex 7882c26d0b..fa3a34bfb7 100644--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx@@ -8,6 +8,19 @@ import type { Resource, ResourceType } from '@/types/resource';import Storage from '@/components/Storage/Storage';import { ROUTE_STATE_REPLACE_OPTIONS } from '@/utils/routeStateNavigation';+const buildVisibleRect = (): DOMRect =>+ ({+ x: 0,+ y: 120,+ width: 960,+ height: 32,+ top: 120,+ bottom: 152,+ left: 0,+ right: 960,+ toJSON: () => ({}),+ }) as DOMRect;+// Stub ResizeObserver for jsdom (used by HistoryChart in pool detail panels)if (typeof globalThis.ResizeObserver === 'undefined') {globalThis.ResizeObserver = class ResizeObserver {@@ -765,6 +778,10 @@ describe('Storage', () => {if (!groupRow) {return;}+ Object.defineProperty(groupRow, 'getBoundingClientRect', {+ configurable: true,+ value: () => buildVisibleRect(),+ });fireEvent.click(groupRow);@@ -775,8 +792,7 @@ describe('Storage', () => {);});- expect(screen.getByTestId('storage-summary-scope')).toHaveTextContent('Pinned');- expect(screen.getByRole('button', { name: 'Reset pinned scope' })).toBeInTheDocument();+ expect(screen.queryByTestId('storage-summary-scope')).not.toBeInTheDocument();expect(screen.queryByRole('button', { name: 'Unpin summary scope for pve1' }),).not.toBeInTheDocument();diff --git a/frontend-modern/src/components/Storage/useStoragePageModel.ts b/frontend-modern/src/components/Storage/useStoragePageModel.tsindex 9be31ec042..4bad051def 100644--- a/frontend-modern/src/components/Storage/useStoragePageModel.ts+++ b/frontend-modern/src/components/Storage/useStoragePageModel.ts@@ -332,6 +332,7 @@ export const useStoragePageModel = () => {hoveredGroupScope: hoveredStorageGroupScope,hoveredSeriesId: hoveredStorageResourceId,focusedGroupScope: focusedStorageGroupScope,+ focusedGroupId: selectedStorageGroupId,focusedSeriesId: focusedStorageResourceId,revealActiveSeries: (seriesId) => {if (physicalDiskSeriesIds().has(seriesId)) {@@ -374,13 +375,6 @@ export const useStoragePageModel = () => {focusedGroupScope: focusedStorageGroupScope(),}),);- const summaryScopePresentation = createMemo(() =>- buildSummaryScopePresentation({- allLabel: 'All storage',- resolveEntityLabel: (seriesId) => storageNamesByMetricSeriesId().get(seriesId) ?? seriesId,- state: summaryInteraction.activeScopeState(),- }),- );const pinnedSummaryScopePresentation = createMemo(() =>buildSummaryScopePresentation({allLabel: 'All storage',@@ -451,7 +445,7 @@ export const useStoragePageModel = () => {setHoveredStorageResourceId,setSelectedDiskId,setSummaryTableRootRef: summaryInteraction.setTableRootRef,- summaryScopePresentation,+ shouldShowPinnedSummaryScopeFallback: summaryInteraction.shouldShowPinnedScopeFallback,shouldShowJumpToActiveStorageRow: summaryInteraction.shouldShowJumpToActiveRow,};};diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 9eaf4bc4f0..f54201563a 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -343,10 +343,12 @@ describe('shared primitive guardrails', () => {expect(summaryScopePresentationSource).toContain('buildSummaryScopePresentation');expect(summaryScopePresentationSource).toContain("mode: 'all'");expect(summaryScopeBarSource).toContain('SummaryScopeBar');- expect(summaryScopeBarSource).toContain('Previewing');- expect(summaryScopeBarSource).toContain('Showing');- expect(summaryScopeBarSource).toContain('Pinned to');- expect(summaryScopeBarSource).toContain('Reset pinned scope');+ expect(summaryScopeBarSource).toContain('Scoped to');+ expect(summaryScopeBarSource).toContain('Clear pinned scope');+ expect(summaryScopeBarSource).not.toContain('Previewing');+ expect(summaryScopeBarSource).not.toContain('Showing');+ expect(summaryScopeBarSource).not.toContain('Pinned to');+ expect(summaryScopeBarSource).not.toContain('Reset pinned scope');expect(summaryScopeBarSource).not.toContain('rounded-full');expect(summaryScopeBarSource).not.toContain('bg-surface-alt/60');expect(summaryScopeBarSource).not.toContain('useLocation(');diff --git a/frontend-modern/src/components/shared/SummaryScopeBar.tsx b/frontend-modern/src/components/shared/SummaryScopeBar.tsxindex 3fba11884d..90bffae1d8 100644--- a/frontend-modern/src/components/shared/SummaryScopeBar.tsx+++ b/frontend-modern/src/components/shared/SummaryScopeBar.tsx@@ -2,47 +2,17 @@ import { Show, type Component } from 'solid-js';import type { SummaryScopePresentation } from './summaryScopePresentation';interface SummaryScopeBarProps {- active: SummaryScopePresentation;class?: string;- idleHint?: string;- pinned?: SummaryScopePresentation | null;- resetLabel?: string;+ clearLabel?: string;+ onClear?: () => void;+ scope: SummaryScopePresentation;testId?: string;- onReset?: () => void;}-const leadClassForMode = (mode: SummaryScopePresentation['mode']) => {- switch (mode) {- case 'preview':- return 'text-amber-700 dark:text-amber-300';- case 'pinned':- return 'text-sky-700 dark:text-sky-300';- default:- return 'text-muted';- }-};--const leadLabelForMode = (mode: SummaryScopePresentation['mode']) => {- switch (mode) {- case 'preview':- return 'Previewing';- case 'pinned':- return 'Pinned to';- default:- return 'Showing';- }-};-export const SummaryScopeBar: Component<SummaryScopeBarProps> = (props) => {const helperText = () => {- if (props.active.mode === 'preview' && props.pinned?.mode === 'pinned') {- return `Pinned to ${props.pinned.label}`;- }- if (props.active.contextLabel) {- return `Within ${props.active.contextLabel}`;- }- if (props.active.mode === 'all') {- return props.idleHint ?? null;+ if (props.scope.contextLabel) {+ return `Within ${props.scope.contextLabel}`;}return null;};@@ -50,37 +20,39 @@ export const SummaryScopeBar: Component<SummaryScopeBarProps> = (props) => {return (<divdata-testid={props.testId}- data-summary-scope-mode={props.active.mode}- class={`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 px-1 py-1 ${props.class ?? ''}`.trim()}+ data-summary-scope-mode={props.scope.mode}+ data-summary-scope-variant="fallback"+ class={`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 px-0 py-0.5 ${props.class ?? ''}`.trim()}>+ <span class="shrink-0 text-[11px] font-semibold tracking-[0.01em] text-muted">+ Scoped to+ </span><span- class={`shrink-0 text-[11px] font-semibold tracking-[0.01em] ${leadClassForMode(props.active.mode)}`.trim()}+ class="min-w-0 truncate text-xs font-medium text-base-content"+ title={props.scope.label}>- {leadLabelForMode(props.active.mode)}- </span>- <span class="min-w-0 truncate text-sm font-medium text-base-content" title={props.active.label}>- {props.active.label}+ {props.scope.label}</span><Show when={helperText()}>{(text) => (<>- <span aria-hidden="true" class="shrink-0 text-xs text-muted/70">+ <span aria-hidden="true" class="shrink-0 text-[11px] text-muted/70">•</span>- <span class="min-w-0 truncate text-xs text-muted" title={text()}>+ <span class="min-w-0 truncate text-[11px] text-muted" title={text()}>{text()}</span></>)}</Show>- <Show when={props.onReset}>+ <Show when={props.onClear}><buttontype="button"- aria-label={props.resetLabel ?? 'Reset pinned scope'}- class="ml-auto shrink-0 text-xs font-medium text-muted transition-colors hover:text-base-content focus-visible:text-base-content"- onClick={() => props.onReset?.()}+ aria-label={props.clearLabel ?? 'Clear pinned scope'}+ class="ml-auto shrink-0 text-[11px] font-medium text-muted transition-colors hover:text-base-content focus-visible:text-base-content"+ onClick={() => props.onClear?.()}>- Reset+ Clear</button></Show></div>diff --git a/frontend-modern/src/components/shared/__tests__/SummaryScopeBar.test.tsx b/frontend-modern/src/components/shared/__tests__/SummaryScopeBar.test.tsxindex 7869461d4d..79446afed4 100644--- a/frontend-modern/src/components/shared/__tests__/SummaryScopeBar.test.tsx+++ b/frontend-modern/src/components/shared/__tests__/SummaryScopeBar.test.tsx@@ -3,67 +3,50 @@ import { describe, expect, it, vi } from 'vitest';import { SummaryScopeBar } from '@/components/shared/SummaryScopeBar';import type { SummaryScopePresentation } from '@/components/shared/summaryScopePresentation';-const renderScopeBar = (active: SummaryScopePresentation, options?: {- idleHint?: string;- onReset?: () => void;- pinned?: SummaryScopePresentation | null;+const renderScopeBar = (scope: SummaryScopePresentation, options?: {+ onClear?: () => void;}) =>render(() => (<SummaryScopeBartestId="summary-scope"- active={active}- idleHint={options?.idleHint}- onReset={options?.onReset}- pinned={options?.pinned ?? null}+ scope={scope}+ onClear={options?.onClear}/>));describe('SummaryScopeBar', () => {- it('renders all scope as a quiet context line without a scope badge', () => {+ it('renders pinned scope as a compact fallback context line', () => {renderScopeBar({- kind: 'page',- label: 'All workloads',+ kind: 'group',+ label: 'Production cluster',contextLabel: null,- mode: 'all',- }, {- idleHint: 'Tap a group or row to pin scope.',+ mode: 'pinned',});const scope = screen.getByTestId('summary-scope');- expect(scope).toHaveTextContent('Showing');- expect(scope).toHaveTextContent('All workloads');- expect(scope).toHaveTextContent('Tap a group or row to pin scope.');- expect(screen.queryByText('Scope')).not.toBeInTheDocument();- expect(scope.querySelector('.rounded-full')).toBeNull();+ expect(scope).toHaveTextContent('Scoped to');+ expect(scope).toHaveTextContent('Production cluster');+ expect(scope).not.toHaveTextContent('Previewing');+ expect(scope).not.toHaveTextContent('Pinned to');+ expect(scope).not.toHaveTextContent('Showing');});- it('distinguishes preview from a pinned fallback without reintroducing chrome', () => {- renderScopeBar(- {- kind: 'entity',- label: 'finance-jump-01',- contextLabel: 'Production cluster',- mode: 'preview',- },- {- pinned: {- kind: 'group',- label: 'Production cluster',- contextLabel: null,- mode: 'pinned',- },- },- );+ it('keeps contextual group labels as secondary helper text', () => {+ renderScopeBar({+ kind: 'entity',+ label: 'finance-jump-01',+ contextLabel: 'Production cluster',+ mode: 'pinned',+ });const scope = screen.getByTestId('summary-scope');- expect(scope).toHaveTextContent('Previewing');+ expect(scope).toHaveTextContent('Scoped to');expect(scope).toHaveTextContent('finance-jump-01');- expect(scope).toHaveTextContent('Pinned to Production cluster');- expect(scope.querySelector('.rounded-full')).toBeNull();+ expect(scope).toHaveTextContent('Within Production cluster');});- it('keeps the reset affordance explicit but visually quiet', () => {- const onReset = vi.fn();+ it('keeps the clear affordance explicit but quiet', () => {+ const onClear = vi.fn();renderScopeBar({kind: 'group',@@ -71,13 +54,13 @@ describe('SummaryScopeBar', () => {contextLabel: null,mode: 'pinned',},- { onReset },+ { onClear },);- const button = screen.getByRole('button', { name: 'Reset pinned scope' });- expect(button).toHaveTextContent('Reset');+ const button = screen.getByRole('button', { name: 'Clear pinned scope' });+ expect(button).toHaveTextContent('Clear');fireEvent.click(button);- expect(onReset).toHaveBeenCalledTimes(1);+ expect(onClear).toHaveBeenCalledTimes(1);});});diff --git a/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsx b/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsxindex 65e7497a39..d9838b0c21 100644--- a/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsx+++ b/frontend-modern/src/components/shared/__tests__/summaryTableFocus.test.tsx@@ -152,4 +152,78 @@ describe('useSummaryPageInteractionState', () => {expect(revealActiveSeries).toHaveBeenCalledWith('workload-a');expect(scrollTo).toHaveBeenCalledWith({ top: 456, behavior: 'smooth' });});++ it('shows the pinned-scope fallback when a focused row is mounted outside the viewport', () => {+ const [focusedSeriesId] = createSignal<string | null>('workload-a');+ 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),+ });+ root.appendChild(row);+ document.body.appendChild(root);++ const { result } = renderHook(() =>+ useSummaryPageInteractionState({+ focusedSeriesId,+ }),+ );++ result.setTableRootRef(root);++ expect(result.shouldShowPinnedScopeFallback()).toBe(true);+ });++ it('keeps the pinned-scope fallback hidden while the focused group row is visible', () => {+ const [focusedGroupId] = createSignal<string | null>('group-a');+ const root = document.createElement('div');+ const row = document.createElement('div');+ row.setAttribute('data-summary-group-id', 'group-a');+ Object.defineProperty(row, 'getBoundingClientRect', {+ configurable: true,+ value: () => buildRect(120),+ });+ root.appendChild(row);+ document.body.appendChild(root);++ const { result } = renderHook(() =>+ useSummaryPageInteractionState({+ focusedGroupId,+ }),+ );++ result.setTableRootRef(root);++ expect(result.shouldShowPinnedScopeFallback()).toBe(false);+ });++ it('recomputes pinned-scope fallback visibility when scrolling moves the pinned row off-screen', () => {+ const [focusedSeriesId] = createSignal<string | null>('workload-a');+ let top = 120;+ 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(top),+ });+ root.appendChild(row);+ document.body.appendChild(root);++ const { result } = renderHook(() =>+ useSummaryPageInteractionState({+ focusedSeriesId,+ }),+ );++ result.setTableRootRef(root);+ expect(result.shouldShowPinnedScopeFallback()).toBe(false);++ top = 1200;+ window.dispatchEvent(new Event('scroll'));++ expect(result.shouldShowPinnedScopeFallback()).toBe(true);+ });});diff --git a/frontend-modern/src/components/shared/summaryTableFocus.ts b/frontend-modern/src/components/shared/summaryTableFocus.tsindex ae439d63ed..2fc67b1629 100644--- a/frontend-modern/src/components/shared/summaryTableFocus.ts+++ b/frontend-modern/src/components/shared/summaryTableFocus.ts@@ -51,12 +51,15 @@ const isElementVisibleWithinViewport = (element: HTMLElement): boolean => {export interface UseSummaryTableFocusBridgeOptions {activeSeriesId: Accessor<string | null | undefined>;focusedSeriesId?: Accessor<string | null | undefined>;+ focusedGroupId?: Accessor<string | null | undefined>;revealActiveSeries?: (seriesId: string) => void;}export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOptions) {const [tableRoot, setTableRoot] = createSignal<HTMLElement | null>(null);+ const [viewportVersion, setViewportVersion] = createSignal(0);const focusedSeriesId = options.focusedSeriesId ?? (() => null);+ const focusedGroupId = options.focusedGroupId ?? (() => null);const normalizedActiveSeriesId = createMemo<string | null>(() => {const normalized = normalizeSeriesId(options.activeSeriesId());@@ -85,7 +88,19 @@ export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOp);};+ const focusedGroupRow = (): HTMLElement | null => {+ const root = tableRoot();+ const focusedId = normalizeSeriesId(focusedGroupId());+ if (!root || !focusedId) {+ return null;+ }+ return root.querySelector<HTMLElement>(+ `[data-summary-group-id="${escapeAttributeSelectorValue(focusedId)}"]`,+ );+ };+const isActiveRowVisible = createMemo<boolean>(() => {+ viewportVersion();const row = activeRow();if (!row) {return false;@@ -97,6 +112,30 @@ export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOpreturn Boolean(normalizedActiveSeriesId()) && !isActiveRowVisible();});+ const isPinnedScopeVisible = createMemo<boolean>(() => {+ viewportVersion();+ const focusedId = normalizeSeriesId(focusedSeriesId());+ if (focusedId) {+ const row = focusedRow();+ return row ? isElementVisibleWithinViewport(row) : false;+ }++ const focusedGroup = normalizeSeriesId(focusedGroupId());+ if (focusedGroup) {+ const row = focusedGroupRow();+ return row ? isElementVisibleWithinViewport(row) : false;+ }++ return false;+ });++ const shouldShowPinnedScopeFallback = createMemo<boolean>(() => {+ return (+ Boolean(normalizeSeriesId(focusedSeriesId()) || normalizeSeriesId(focusedGroupId())) &&+ !isPinnedScopeVisible()+ );+ });+const jumpToActiveRow = () => {const activeSeriesId = normalizedActiveSeriesId();if (!activeSeriesId) {@@ -120,6 +159,35 @@ export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOpattemptScroll(6);};+ createEffect(() => {+ const root = tableRoot();+ if (!root || typeof window === 'undefined') {+ return;+ }++ let rafId: number | undefined;+ const scheduleViewportRefresh = () => {+ if (rafId !== undefined) {+ return;+ }+ rafId = window.requestAnimationFrame(() => {+ rafId = undefined;+ setViewportVersion((current) => current + 1);+ });+ };++ window.addEventListener('scroll', scheduleViewportRefresh, true);+ window.addEventListener('resize', scheduleViewportRefresh);++ onCleanup(() => {+ window.removeEventListener('scroll', scheduleViewportRefresh, true);+ window.removeEventListener('resize', scheduleViewportRefresh);+ if (rafId !== undefined) {+ window.cancelAnimationFrame(rafId);+ }+ });+ });+createEffect(() => {const focusedId = normalizeSeriesId(focusedSeriesId());const root = tableRoot();@@ -218,15 +286,18 @@ export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOpreturn {activeRow,isActiveRowVisible,+ isPinnedScopeVisible,jumpToActiveRow,setTableRootRef: (element: HTMLElement | undefined) => setTableRoot(element ?? null),shouldShowJumpToActiveRow,+ shouldShowPinnedScopeFallback,} as const;}export interface UseSummaryPageInteractionStateOptions {hoveredSeriesId?: Accessor<string | null | undefined>;focusedSeriesId?: Accessor<string | null | undefined>;+ focusedGroupId?: Accessor<string | null | undefined>;hoveredGroupScope?: Accessor<SummarySeriesGroupScope | null | undefined>;focusedGroupScope?: Accessor<SummarySeriesGroupScope | null | undefined>;revealActiveSeries?: (seriesId: string) => void;@@ -236,6 +307,7 @@ export function useSummaryPageInteractionState(options: UseSummaryPageInteractioconst [chartHoverSync, setChartHoverSync] = createSignal<SummaryChartHoverSync | null>(null);const hoveredSeriesId = options.hoveredSeriesId ?? (() => null);const focusedSeriesId = options.focusedSeriesId ?? (() => null);+ const focusedGroupId = options.focusedGroupId ?? (() => null);const hoveredGroupScope = options.hoveredGroupScope ?? (() => null);const focusedGroupScope = options.focusedGroupScope ?? (() => null);@@ -269,6 +341,7 @@ export function useSummaryPageInteractionState(options: UseSummaryPageInteractioconst tableFocus = useSummaryTableFocusBridge({activeSeriesId,focusedSeriesId,+ focusedGroupId,revealActiveSeries: options.revealActiveSeries,});@@ -281,5 +354,6 @@ export function useSummaryPageInteractionState(options: UseSummaryPageInteractiosetChartHoverSync,setTableRootRef: tableFocus.setTableRootRef,shouldShowJumpToActiveRow: tableFocus.shouldShowJumpToActiveRow,+ shouldShowPinnedScopeFallback: tableFocus.shouldShowPinnedScopeFallback,} as const;}diff --git a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsxindex 1da6823126..355b942a20 100644--- a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx+++ b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx@@ -68,9 +68,9 @@ export function InfrastructurePageSurface() {kioskMode,sourceOptions,statusOptions,- summaryScopePresentation,pinnedSummaryScopePresentation,hasPinnedSummaryScope,+ shouldShowPinnedSummaryScopeFallback,hasActiveFilters,clearFilters,filteredResources,@@ -325,15 +325,13 @@ export function InfrastructurePageSurface() {}><div class="space-y-3">- <SummaryScopeBar- testId="infrastructure-summary-scope"- active={summaryScopePresentation()}- pinned={- hasPinnedSummaryScope() ? pinnedSummaryScopePresentation() : null- }- idleHint={isMobile() ? 'Tap a cluster or row to pin scope.' : undefined}- onReset={hasPinnedSummaryScope() ? clearPinnedSummaryScope : undefined}- />+ <Show when={hasPinnedSummaryScope() && shouldShowPinnedSummaryScopeFallback()}>+ <SummaryScopeBar+ testId="infrastructure-summary-scope"+ scope={pinnedSummaryScopePresentation()}+ onClear={clearPinnedSummaryScope}+ />+ </Show><UnifiedResourceTableresources={filteredResources()}expandedResourceId={expandedResourceId()}diff --git a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.tsindex 20260c62db..8fbe9166d5 100644--- a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts+++ b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts@@ -51,7 +51,8 @@ describe('InfrastructurePageSurface guardrails', () => {expect(infrastructurePageSurfaceSource).toContain('onGroupHoverChange={setHoveredResourceGroupScope}');expect(infrastructurePageSurfaceSource).toContain('setTableRootRef={setSummaryTableRootRef}');expect(infrastructurePageSurfaceSource).toContain('SummaryScopeBar');- expect(infrastructurePageSurfaceSource).toContain('summaryScopePresentation()');+ expect(infrastructurePageSurfaceSource).toContain('hasPinnedSummaryScope() && shouldShowPinnedSummaryScopeFallback()');+ expect(infrastructurePageSurfaceSource).toContain('scope={pinnedSummaryScopePresentation()}');expect(infrastructurePageSurfaceSource).toContain('clearPinnedSummaryScope');expect(infrastructurePageSurfaceSource).not.toContain('useSummaryPageInteractionState');@@ -59,8 +60,8 @@ describe('InfrastructurePageSurface guardrails', () => {expect(infrastructurePageStateSource).toContain('hoveredSummaryResourceGroupScope');expect(infrastructurePageStateSource).toContain('activeSummaryResourceGroupScope');expect(infrastructurePageStateSource).toContain('focusedSummaryResourceGroupScope');- expect(infrastructurePageStateSource).toContain('summaryScopePresentation');expect(infrastructurePageStateSource).toContain('pinnedSummaryScopePresentation');+ expect(infrastructurePageStateSource).toContain('shouldShowPinnedSummaryScopeFallback');expect(infrastructurePageStateSource).toContain('clearPinnedSummaryScope');expect(infrastructurePageStateSource).toContain('setHoveredResourceGroupScope');expect(infrastructurePageStateSource).toContain('jumpToActiveResourceRow');diff --git a/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts b/frontend-modern/src/features/infrastructure/useInfrastructurePageState.tsindex d288f1644d..1947e09a40 100644--- a/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts+++ b/frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts@@ -107,6 +107,7 @@ export function useInfrastructurePageState() {hoveredSeriesId: routeState.hoveredResourceId,hoveredGroupScope: hoveredResourceGroupScope,focusedSeriesId: routeState.expandedResourceId,+ focusedGroupId: routeState.focusedResourceGroupId,focusedGroupScope: focusedResourceGroupScope,revealActiveSeries: routeState.setRevealedResourceId,});@@ -218,13 +219,6 @@ export function useInfrastructurePageState() {focusedGroupScope: focusedResourceGroupScope(),}),);- const summaryScopePresentation = createMemo(() =>- buildSummaryScopePresentation({- allLabel: 'All resources',- resolveEntityLabel: (seriesId) => resourceNamesById().get(seriesId) ?? seriesId,- state: summaryInteraction.activeScopeState(),- }),- );const pinnedSummaryScopePresentation = createMemo(() =>buildSummaryScopePresentation({allLabel: 'All resources',@@ -284,7 +278,7 @@ export function useInfrastructurePageState() {setChartHoverSync: summaryInteraction.setChartHoverSync,setHoveredResourceGroupScope,setSummaryTableRootRef,- summaryScopePresentation,+ shouldShowPinnedSummaryScopeFallback: summaryInteraction.shouldShowPinnedScopeFallback,shouldShowJumpToActiveResourceRow: summaryInteraction.shouldShowJumpToActiveRow,setFocusedResourceGroupId,};diff --git a/tests/integration/tests/48-summary-hover-selection.spec.ts b/tests/integration/tests/48-summary-hover-selection.spec.tsindex 6abab2d936..08a7ce23c5 100644--- a/tests/integration/tests/48-summary-hover-selection.spec.ts+++ b/tests/integration/tests/48-summary-hover-selection.spec.ts@@ -1014,7 +1014,7 @@ test.describe.serial("Summary hover selection", () => {const summary = page.getByTestId(surface.summaryTestId);const scopeBar = page.getByTestId(surface.scopeBarTestId);await expect(summary).toBeVisible();- await expect(scopeBar).toContainText("All");+ await expect(scopeBar).toHaveCount(0);await expect.poll(async () => {@@ -1049,7 +1049,6 @@ test.describe.serial("Summary hover selection", () => {matchedGroupRow = row;matchedGroupSeriesCount = seriesCount;matchedGroupId = groupId;- break;}expect(matchedGroupRow).not.toBeNull();@@ -1060,25 +1059,22 @@ test.describe.serial("Summary hover selection", () => {}await matchedGroupRow.hover();- await expect(scopeBar).toContainText("Preview");+ await expect(scopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="preview"]')).toHaveCount(matchedGroupSeriesCount,);await page.mouse.move(1, 1);- await expect(scopeBar).toContainText("All");+ await expect(scopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="preview"]')).toHaveCount(0);await matchedGroupRow.click();await expect.poll(() => new URL(page.url()).searchParams.get("summaryGroup")).toBe(matchedGroupId);- await expect(scopeBar).toContainText("Pinned");+ await expect(scopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="preview"]')).toHaveCount(matchedGroupSeriesCount,);- await expect(- scopeBar.getByRole("button", { name: "Reset pinned scope" }),- ).toBeVisible();await expect.poll(() => readRenderedSeriesCounts(summary)).toEqual(new Array(4).fill(matchedGroupSeriesCount));@@ -1095,11 +1091,36 @@ test.describe.serial("Summary hover selection", () => {.poll(() => readRenderedSeriesCounts(summary)).toEqual(new Array(4).fill(matchedGroupSeriesCount));- await scopeBar.getByRole("button", { name: "Reset pinned scope" }).click();+ await page.evaluate(() => {+ const shell = document.querySelector<HTMLElement>(".app-scroll-shell");+ if (shell) {+ shell.scrollTo({ top: 0 });+ return;+ }+ window.scrollTo(0, 0);+ });+ await expect+ .poll(async () =>+ page.evaluate((groupId) => {+ const row = document.querySelector<HTMLElement>(+ `tr[data-summary-group-id="${groupId}"]`,+ );+ if (!row) {+ return false;+ }+ const rect = row.getBoundingClientRect();+ return rect.bottom <= 0 || rect.top >= window.innerHeight;+ }, matchedGroupId),+ )+ .toBe(true);+ await expect(scopeBar).toHaveCount(1);+ await expect(scopeBar).toContainText("Scoped to");++ await scopeBar.getByRole("button", { name: "Clear pinned scope" }).click();await expect.poll(() => new URL(page.url()).searchParams.get("summaryGroup")).toBeNull();- await expect(scopeBar).toContainText("All");+ await expect(scopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="pinned"]')).toHaveCount(0);await page.mouse.move(1, 1);await expect@@ -1122,7 +1143,7 @@ test.describe.serial("Summary hover selection", () => {const storageSummary = page.getByTestId("storage-summary");const storageScopeBar = page.getByTestId("storage-summary-scope");await expect(storageSummary).toBeVisible();- await expect(storageScopeBar).toContainText("All");+ await expect(storageScopeBar).toHaveCount(0);await expect.poll(async () => {@@ -1157,7 +1178,6 @@ test.describe.serial("Summary hover selection", () => {matchedGroupRow = row;matchedGroupId = groupId;matchedGroupSeriesCount = seriesCount;- break;}expect(matchedGroupRow).not.toBeNull();@@ -1168,19 +1188,19 @@ test.describe.serial("Summary hover selection", () => {}await matchedGroupRow.hover();- await expect(storageScopeBar).toContainText("Preview");+ await expect(storageScopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="preview"]')).toHaveCount(matchedGroupSeriesCount,);await page.mouse.move(1, 1);- await expect(storageScopeBar).toContainText("All");+ await expect(storageScopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="preview"]')).toHaveCount(0);await matchedGroupRow.click();await expect.poll(() => new URL(page.url()).searchParams.get("summaryGroup")).toBe(matchedGroupId);- await expect(storageScopeBar).toContainText("Pinned");+ await expect(storageScopeBar).toHaveCount(0);await expect(page.locator('tr[data-summary-group-member-active="preview"]')).toHaveCount(matchedGroupSeriesCount,);@@ -1197,14 +1217,39 @@ test.describe.serial("Summary hover selection", () => {);await expect(page.locator("tr[data-row-id]")).toHaveCount(baselineVisibleRows);+ await page.evaluate(() => {+ const shell = document.querySelector<HTMLElement>(".app-scroll-shell");+ if (shell) {+ shell.scrollTo({ top: 0 });+ return;+ }+ window.scrollTo(0, 0);+ });+ await expect+ .poll(async () =>+ page.evaluate((groupId) => {+ const row = document.querySelector<HTMLElement>(+ `tr[data-summary-group-id="${groupId}"]`,+ );+ if (!row) {+ return false;+ }+ const rect = row.getBoundingClientRect();+ return rect.bottom <= 0 || rect.top >= window.innerHeight;+ }, matchedGroupId),+ )+ .toBe(true);+ await expect(storageScopeBar).toHaveCount(1);+ await expect(storageScopeBar).toContainText("Scoped to");+await storageScopeBar- .getByRole("button", { name: "Reset pinned scope" })+ .getByRole("button", { name: "Clear pinned scope" }).click();await expect(page.locator('tr[data-summary-group-member-active="pinned"]')).toHaveCount(0);await expect.poll(() => new URL(page.url()).searchParams.get("summaryGroup")).toBeNull();- await expect(storageScopeBar).toContainText("All");+ await expect(storageScopeBar).toHaveCount(0);await page.mouse.move(1, 1);await expect.poll(() => readRenderedSeriesCounts(storageSummary))