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.

Scale large-estate rendering and navigation

rcourtman17bb2b3b7da6
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index f253ccb890..c4196981c8 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -1744,6 +1744,18 @@ and `pulse-no-alerts` bulk rules remain compatible inputs and do not create a
second per-resource state store. `internal/alerts/intent_policy_test.go` pins
factory operator-state evaluation, writer gating, and active reconciliation.
+### Large alert collections stay continuously scrollable
+
+Resource alert tables, active-alert lists, incident timelines, and resolved
+history must preserve full filter, group, count, selection, and action semantics
+without mounting the full estate. Desktop tables use the shared
+`PlatformWindowedRows` owner; phone cards use `PlatformWindowedList` with
+feature budgets no larger than 32 items. Native scroll extent comes from spacer
+geometry, and wheel/touch projection must maintain a mounted directional runway
+so rapid scrolling never exposes a loading-looking blank section. Alert
+windowing is presentation-only and must not change alert truth, grouping,
+acknowledgement, resolution, or delivery state.
+
### Destinations tab carries delivery evidence
The alert destinations tab is where the belief "delivery works" is formed, so
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index a389455f84..0a49b5df03 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -66,6 +66,17 @@ four-row phone node preview before the guest list instead of visually moving
the nodes after the guest list's full virtual scroll extent; revealing the full
node estate remains an explicit table-preview action.
+Estate-sized table and card rendering routes through the shared
+`PlatformWindowedRows`, `PlatformWindowedList`, and
+`usePlatformWindowedItems` primitives. They preserve the complete filtered and
+sorted result plus native scroll extent while bounding mounted DOM to 140 items
+on wider layouts and 36 on phones unless a feature declares a smaller budget.
+Wheel and vertical touch projection must move a directional keyed-row runway
+before native scrolling can expose it. Spacer geometry is structural only: no
+feature may present it as loading, pagination, or an intentionally blank data
+region. Settings resource pickers, Availability target lists, Actions, alerts,
+and every provider-native platform table share this contract.
+
Shared workload, node, Docker-host, and resource-drawer history presentation
keeps current readings separate from stored samples. A current metric may
populate the legend while history is still being collected, but it must never
@@ -573,6 +584,7 @@ attention/running/other filters so large bridge or overlay networks remain
scan-friendly without hiding any container from drilldown.
1. `frontend-modern/src/components/CommercialMigrationBanner.tsx` shared with `cloud-paid`: the global commercial migration notice is both a cloud-paid entitlement recovery surface and a shared app-shell notice primitive consumer.
+2. `frontend-modern/src/components/Infrastructure/useTableWindowing.ts` shared with `performance-and-scalability`: the shared bounded table-window controller is both a canonical frontend rendering primitive and a fleet-scale scrolling hot-path boundary.
2. `frontend-modern/src/components/Settings/AgentIntegrationsPanel.tsx` shared with `ai-runtime`, `api-contracts`: the External agents settings panel is the optional settings-shell projection of Pulse MCP onboarding, the AI runtime connected-agent onboarding surface, and a presentation consumer of the shared agent capabilities frontend client.
3. `frontend-modern/src/components/Settings/APIAccessPanel.tsx` shared with `security-privacy`: the API Access settings intro is both a security/privacy token-management trust surface and a canonical settings-shell presentation boundary.
The panel may own shell placement and local action layout, but
@@ -684,6 +696,9 @@ AGENT_SURFACE_ID_PULSE_MCP)` and `getAgentSurfaceToolPosturePresentation`,
settings shell derives posture summaries or hardening actions. The first-run
shell must use generic host, Docker, and LXC bootstrap commands rather than
probing public status for deployment identity.
+10. `frontend-modern/src/features/platformPage/PlatformWindowedList.tsx` shared with `performance-and-scalability`: the shared bounded list renderer is both a canonical platform-page primitive and a fleet-scale mounted-DOM performance boundary.
+11. `frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx` shared with `performance-and-scalability`: the shared bounded table-row renderer is both a canonical platform-page primitive and a fleet-scale mounted-DOM performance boundary.
+12. `frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts` shared with `performance-and-scalability`: the platform windowing controller is both a canonical frontend scroll primitive and a directional-runway performance hot path.
9. `frontend-modern/src/routing/routePreload.ts` shared with `performance-and-scalability`, `unified-resources`: the app-shell route preload registry is a canonical frontend shell boundary, an authenticated hot-path performance boundary, and the entry point for the unified-resource Actions workspace.
10. `frontend-modern/src/stores/aiChat.ts` shared with `ai-runtime`: the assistant drawer and session store is both an AI runtime control surface and a canonical app-shell presentation boundary.
Assistant session pickers and reloads must restore only safe
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 84594a909e..b5ad96a510 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -165,9 +165,14 @@ start a goroutine, timer, or notification lifecycle per target.
7. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx` shared with `unified-resources`: the unified resource table is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.
8. `frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts` shared with `unified-resources`: unified resource service row shaping and I/O emphasis are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.
9. `frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts` shared with `unified-resources`: unified resource table state derivation, sort-cycle policy, service sorting, and responsive column layout are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.
+10. `frontend-modern/src/components/Infrastructure/useTableWindowing.ts` shared with `frontend-primitives`: the shared bounded table-window controller is both a canonical frontend rendering primitive and a fleet-scale scrolling hot-path boundary.
10. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts` shared with `unified-resources`: unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.
11. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts` shared with `unified-resources`: unified resource table viewport sync and selected-row reveal are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.
+12. `frontend-modern/src/features/platformPage/PlatformWindowedList.tsx` shared with `frontend-primitives`: the shared bounded list renderer is both a canonical platform-page primitive and a fleet-scale mounted-DOM performance boundary.
+13. `frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx` shared with `frontend-primitives`: the shared bounded table-row renderer is both a canonical platform-page primitive and a fleet-scale mounted-DOM performance boundary.
+14. `frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts` shared with `frontend-primitives`: the platform windowing controller is both a canonical frontend scroll primitive and a directional-runway performance hot path.
15. `frontend-modern/src/routing/routePreload.ts` shared with `frontend-primitives`, `unified-resources`: the app-shell route preload registry is a canonical frontend shell boundary, an authenticated hot-path performance boundary, and the entry point for the unified-resource Actions workspace.
+18. `frontend-modern/src/stores/websocket-global.ts` shared with `unified-resources`: the process-wide realtime store owner is both a unified-resource state boundary and a fleet-scale connection and reconciliation hot path.
19. `frontend-modern/src/stores/websocket.ts` shared with `alerts`: the connection-owned realtime store is both the canonical alert truth boundary and the fleet-scale resource reconciliation hot path.
16. `frontend-modern/src/useAppRuntimeState.ts` shared with `cloud-paid`: the authenticated app runtime bootstrap is both a hosted commercial org-context boundary and a protected app-shell performance boundary.
Security-status SSO display labels are part of the existing authenticated
@@ -204,6 +209,14 @@ every tick.
The browser applies resource deltas to its connection-scoped raw baseline, but
canonicalizes and reconciles only changed resources plus the bounded
host-coalescing set. Unchanged non-host display resources retain object identity.
+`frontend-modern/src/stores/websocket.ts` publishes the changed-ID set and a
+monotonic resource revision with each reconciliation. The shared
+`useUnifiedResources` owner applies that revision to the process-wide canonical
+cache once, then projects route filters from the already-canonical result;
+route-scoped consumers must not independently canonicalize the full estate.
+Retained or prefetched tabs may keep fetched snapshots, but only the visible tab
+consumes realtime projection work. Re-entering an inactive tab must catch up
+from the shared canonical cache rather than replaying every missed delta.
Hidden tabs continue advancing the raw baseline without reconciling the estate;
all hidden changes are materialized once when the document becomes visible.
These rules must be proved against a 50-node fixture and may not be replaced by
@@ -1820,18 +1833,27 @@ before the keyed guest window moves; they do not cancel native input, while the
ordinary scroll-position listener remains passive. This preserves continuous
rapid scrolling without increasing the bounded mounted-row budget.
The canonical public demo intentionally exercises this production hot path:
-its default Proxmox estate contains 900 guests, crossing the 250-row windowing
-threshold while retaining the hook's 140-row mounted-window budget. The demo
+its default Proxmox estate contains 50 nodes and more than 900 guests, crossing
+the mounted-row threshold while retaining the hook's 140-row desktop and
+36-row phone mounted-window budgets. The demo
curation integration proof must assert both the 800-plus guest total and the
bounded mounted-row count. That same default estate produces more than 500
backup coverage targets and recoverable artifacts; the coverage and By date
tables must route through `useProxmoxBackupTableWindowing.ts`, retain full-set
-filter/sort/count semantics, and mount at most 140 row or day-header items
+filter/sort/count semantics, and mount at most 140 desktop or 36 phone row or day-header items
without pagination chrome. `internal/mock/demo_scenarios_benchmark_test.go`
records the corresponding graph-build, recurring sampler-update, and unified
resource projection costs, and the mock storage topology must stay linear in
node count so a realistic multi-cluster fixture cannot reintroduce quadratic
projection work.
+All platform-native tables and long card lists use
+`PlatformWindowedRows`, `PlatformWindowedList`, and
+`usePlatformWindowedItems` over the same `useTableWindowing` controller. Those
+owners preserve native scrollbar geometry with measured spacers, project wheel
+and vertical touch movement before native scroll advances, and retain a
+directional runway around the viewport. A feature may choose a smaller bounded
+budget, but it must not restore an unbounded `<For>` over estate-sized data or
+show a blank viewport while the keyed window catches up.
The workload guest-row path now follows the same pattern: the render shell
stays in `frontend-modern/src/components/Workloads/GuestRow.tsx`, tooltip-backed
cell presentation lives in `frontend-modern/src/components/Workloads/GuestRowCells.tsx`,
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 2dd69bf180..2afeb05d34 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -201,6 +201,14 @@
"unified-resources"
]
},
+ {
+ "path": "frontend-modern/src/components/Infrastructure/useTableWindowing.ts",
+ "rationale": "the shared bounded table-window controller is both a canonical frontend rendering primitive and a fleet-scale scrolling hot-path boundary",
+ "subsystems": [
+ "frontend-primitives",
+ "performance-and-scalability"
+ ]
+ },
{
"path": "frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts",
"rationale": "unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",
@@ -426,6 +434,30 @@
"security-privacy"
]
},
+ {
+ "path": "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx",
+ "rationale": "the shared bounded list renderer is both a canonical platform-page primitive and a fleet-scale mounted-DOM performance boundary",
+ "subsystems": [
+ "frontend-primitives",
+ "performance-and-scalability"
+ ]
+ },
+ {
+ "path": "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx",
+ "rationale": "the shared bounded table-row renderer is both a canonical platform-page primitive and a fleet-scale mounted-DOM performance boundary",
+ "subsystems": [
+ "frontend-primitives",
+ "performance-and-scalability"
+ ]
+ },
+ {
+ "path": "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts",
+ "rationale": "the platform windowing controller is both a canonical frontend scroll primitive and a directional-runway performance hot path",
+ "subsystems": [
+ "frontend-primitives",
+ "performance-and-scalability"
+ ]
+ },
{
"path": "frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx",
"subsystems": [
@@ -467,6 +499,14 @@
"frontend-primitives"
]
},
+ {
+ "path": "frontend-modern/src/stores/websocket-global.ts",
+ "rationale": "the process-wide realtime store owner is both a unified-resource state boundary and a fleet-scale connection and reconciliation hot path",
+ "subsystems": [
+ "performance-and-scalability",
+ "unified-resources"
+ ]
+ },
{
"path": "frontend-modern/src/stores/websocket.ts",
"rationale": "the connection-owned realtime store is both the canonical alert truth boundary and the fleet-scale resource reconciliation hot path",
@@ -4749,6 +4789,7 @@
"frontend-modern/src/components/CommercialMigrationBanner.tsx",
"frontend-modern/src/components/GitHubStarBanner.tsx",
"frontend-modern/src/components/Infrastructure/resourceDetailDrawerMetricsHistoryModel.ts",
+ "frontend-modern/src/components/Infrastructure/useTableWindowing.ts",
"frontend-modern/src/components/Login.tsx",
"frontend-modern/src/components/Settings/AgentIntegrationsPanel.tsx",
"frontend-modern/src/components/Settings/AIChatMaintenanceSection.tsx",
@@ -4762,6 +4803,7 @@
"frontend-modern/src/components/Settings/APIAccessPanel.tsx",
"frontend-modern/src/components/Settings/AuditLogPanel.tsx",
"frontend-modern/src/components/Settings/AuditWebhookPanel.tsx",
+ "frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx",
"frontend-modern/src/components/Settings/CopyCommandBlock.tsx",
"frontend-modern/src/components/Settings/DataHandlingPanel.tsx",
"frontend-modern/src/components/Settings/dataHandlingPanelModel.ts",
@@ -4822,7 +4864,10 @@
"frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx",
"frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx",
"frontend-modern/src/features/platformPage/platformSearchSuggestions.ts",
+ "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx",
"frontend-modern/src/features/platformPage/sharedPlatformPage.tsx",
+ "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts",
"frontend-modern/src/hooks/createNonSuspendingQuery.ts",
"frontend-modern/src/i18n/index.ts",
"frontend-modern/src/i18n/messages.de.ts",
@@ -5069,6 +5114,7 @@
"match_prefixes": [],
"match_files": [
"frontend-modern/scripts/header-audit.mjs",
+ "frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx",
"frontend-modern/src/components/Settings/ReportingPanel.tsx",
"frontend-modern/src/components/Settings/reportingPanelModel.ts",
"frontend-modern/src/components/Settings/ResourcePicker.tsx",
@@ -5084,6 +5130,7 @@
"test_prefixes": [],
"exact_files": [
"frontend-modern/src/__tests__/App.architecture.test.ts",
+ "frontend-modern/src/components/Settings/__tests__/AvailabilitySettingsPanel.test.tsx",
"frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts",
"frontend-modern/src/components/Settings/__tests__/reportingResourceTypes.test.ts",
"frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx",
@@ -5354,13 +5401,19 @@
"label": "data grid and summary proof",
"match_prefixes": [],
"match_files": [
+ "frontend-modern/src/components/Infrastructure/useTableWindowing.ts",
"frontend-modern/src/components/shared/PulseDataGrid.tsx",
- "frontend-modern/src/components/shared/Table.tsx"
+ "frontend-modern/src/components/shared/Table.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx",
+ "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/shared/__tests__/PulseDataGrid.test.tsx"
+ "frontend-modern/src/components/Infrastructure/__tests__/useTableWindowing.test.ts",
+ "frontend-modern/src/components/shared/__tests__/PulseDataGrid.test.tsx",
+ "frontend-modern/src/features/platformPage/__tests__/PlatformWindowedRows.test.tsx"
]
},
{
@@ -6436,6 +6489,7 @@
"frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",
"frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts",
"frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts",
+ "frontend-modern/src/components/Infrastructure/useTableWindowing.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts",
"frontend-modern/src/components/Workloads/DiskList.tsx",
@@ -6491,8 +6545,12 @@
"frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx",
"frontend-modern/src/components/Workloads/workloadTopology.ts",
"frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts",
+ "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx",
+ "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts",
"frontend-modern/src/hooks/useWorkloads.ts",
"frontend-modern/src/routing/routePreload.ts",
+ "frontend-modern/src/stores/websocket-global.ts",
"frontend-modern/src/stores/websocket.ts",
"frontend-modern/src/types/workloads.ts",
"frontend-modern/src/useAppRuntimeState.ts",
@@ -6580,6 +6638,7 @@
"label": "large-estate realtime state update proof",
"match_prefixes": [],
"match_files": [
+ "frontend-modern/src/stores/websocket-global.ts",
"frontend-modern/src/stores/websocket.ts",
"frontend-modern/src/utils/resourceStateAdapters.ts",
"internal/mock/fixture_graph.go",
@@ -6625,6 +6684,7 @@
"frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",
"frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts",
"frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts",
+ "frontend-modern/src/components/Infrastructure/useTableWindowing.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts",
"frontend-modern/src/components/Workloads/DiskList.tsx",
@@ -6680,6 +6740,9 @@
"frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx",
"frontend-modern/src/components/Workloads/workloadTopology.ts",
"frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts",
+ "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx",
+ "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts",
"frontend-modern/src/hooks/useWorkloads.ts",
"frontend-modern/src/types/workloads.ts",
"frontend-modern/src/utils/searchQuery.ts",
@@ -6692,6 +6755,7 @@
"exact_files": [
"frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx",
"frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts",
+ "frontend-modern/src/components/Infrastructure/__tests__/useTableWindowing.test.ts",
"frontend-modern/src/components/Workloads/__tests__/AvailabilityProbeStatusCard.test.tsx",
"frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx",
@@ -6723,6 +6787,7 @@
"frontend-modern/src/components/Workloads/MetricBar.test.tsx",
"frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx",
"frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx",
+ "frontend-modern/src/features/platformPage/__tests__/PlatformWindowedRows.test.tsx",
"frontend-modern/src/hooks/__tests__/useWorkloads.test.ts",
"frontend-modern/src/utils/__tests__/searchQuery.test.ts",
"frontend-modern/src/utils/__tests__/thresholdSliderPresentation.test.ts",
@@ -7498,6 +7563,7 @@
"frontend-modern/src/routing/navigation.ts",
"frontend-modern/src/routing/resourceLinks.ts",
"frontend-modern/src/routing/routePreload.ts",
+ "frontend-modern/src/stores/websocket-global.ts",
"frontend-modern/src/types/resource.ts",
"frontend-modern/src/utils/actionAuditPresentation.ts",
"frontend-modern/src/utils/agentResources.ts",
@@ -7567,6 +7633,7 @@
"label": "read-state and adapter proof",
"match_prefixes": [],
"match_files": [
+ "frontend-modern/src/stores/websocket-global.ts",
"internal/unifiedresources/adapters.go",
"internal/unifiedresources/host_storage_cleanup.go",
"internal/unifiedresources/monitor_adapter.go",
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 118bcee065..2bac1d3925 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -524,12 +524,20 @@ explicit uncovered and failed-latest-task states, rather than from source-detail
row counts alone. Large-estate rendering must preserve that same full result
set without mounting every row. `useProxmoxBackupTableWindowing.ts` routes both
the coverage table and dated artifact feed through the shared table-window math
-once the result set crosses 500 items, keeps at most 140 row/header items
-mounted, and preserves continuous scroll height with table spacers. Filtering,
+once the result set exceeds the mounted budget, keeps at most 140 desktop or 36
+phone row/header items mounted, and preserves continuous scroll height with
+table spacers. Filtering,
sorting, health counts, and day-group counts continue to operate over the
complete client-side result set; windowing must not become pagination, a partial
count, or a recovery-local `Next` / `Load more` control. Expanded coverage
evidence remains owned by the visible workload row.
+The Proxmox shell hydrates Overview, Storage, Replication, Backups, Ceph, and
+Mail from route-scoped resource families. Background hydration is staggered on
+phones, only the visible tab consumes realtime reconciliation, and the phone
+shell retains at most the two most-recent tab trees. Storage is prewarmed for
+the common Overview/Storage transition; hidden route-state effects remain
+dormant and a forced Proxmox storage scope is not serialized as redundant URL
+state.
PBS server/datastore rows may display backup counts, but the
counts must come from the PBS backup API artifact identity, not from a
datastore-capacity approximation. The table owns which PBS artifact count is
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index ab8da841e3..ef3dbd1055 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -797,6 +797,7 @@ container inventory table.
13. `frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx` shared with `storage-recovery`: Proxmox workload coverage rows are both a storage/recovery protection-posture surface and a unified-resource identity consumer boundary.
14. `frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx` shared with `storage-recovery`: Proxmox recoverable workload table rows are both a storage/recovery coverage surface and a unified-resource platform-table consumer boundary.
15. `frontend-modern/src/routing/routePreload.ts` shared with `frontend-primitives`, `performance-and-scalability`: the app-shell route preload registry is a canonical frontend shell boundary, an authenticated hot-path performance boundary, and the entry point for the unified-resource Actions workspace.
+16. `frontend-modern/src/stores/websocket-global.ts` shared with `performance-and-scalability`: the process-wide realtime store owner is both a unified-resource state boundary and a fleet-scale connection and reconciliation hot path.
16. `frontend-modern/src/utils/platformSupportManifest.generated.ts` shared with `frontend-primitives`: the generated platform support projection is both a canonical unified-resource platform union boundary and a shared frontend source/platform vocabulary boundary.
It must carry the manifest `surface_kind` distinction so `docker` remains
machine-readable as a `runtime-lens` while owning infrastructure sources
@@ -1159,6 +1160,15 @@ AI-only summary payloads, or page-local heuristics.
and always recompute the bounded agent/host coalescing set. Incremental and
full-snapshot paths must therefore produce the same canonical host identity,
labels, and compatibility fields without cloning the entire estate per tick.
+ The connection store publishes each reconciliation's changed IDs and resource
+ revision. `useUnifiedResources` applies that revision to the shared
+ all-resources cache once and derives type-filtered route projections from the
+ canonical result. Route-prefetch and route-realtime activation are separate:
+ a prefetched hidden surface may retain REST data without subscribing its full
+ projection to every realtime tick, and activation catches up from the shared
+ cache. Richer REST-only facets are promoted into that cache before thinner
+ realtime deltas are applied, so the optimization cannot discard disk I/O,
+ PBS, policy, or provider metadata.
That same unified-resource owner also defines the canonical transport
projection for operator-facing resources: `/api/resources` and websocket
`state.resources` must share `ContractResourceType`, canonical display
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 356c123351..079e548ff0 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,13 +1,185 @@
{
"version": 1,
- "base_sha": "fd7f4156ca887c57b16ac506479102f95582c7aa",
- "verified_at": "2026-08-23T21:23:10Z",
+ "base_sha": "87ee3cd449e47b8c9f2214c64f46e0ee92bc1ed8",
+ "verified_at": "2026-08-23T23:27:15Z",
"result": "passed",
- "changed_paths": ["frontend-modern/src/components/Storage/useStorageSummaryCharts.ts"],
+ "changed_paths": [
+ "frontend-modern/src/components/Alerts/AlertResourceTableDesktop.tsx",
+ "frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx",
+ "frontend-modern/src/components/Alerts/IncidentTimelinePanel.tsx",
+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx",
+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx",
+ "frontend-modern/src/components/Infrastructure/useTableWindowing.ts",
+ "frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts",
+ "frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx",
+ "frontend-modern/src/components/Settings/ResourcePicker.tsx",
+ "frontend-modern/src/components/Storage/DiskList.tsx",
+ "frontend-modern/src/components/Storage/Storage.tsx",
+ "frontend-modern/src/components/Storage/useStoragePageFilters.ts",
+ "frontend-modern/src/components/Storage/useStoragePageModel.ts",
+ "frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadRouteState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsState.ts",
+ "frontend-modern/src/features/alerts/AlertHistoryMobileList.tsx",
+ "frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx",
+ "frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx",
+ "frontend-modern/src/features/docker/DockerAlertsTable.tsx",
+ "frontend-modern/src/features/docker/DockerConfigsTable.tsx",
+ "frontend-modern/src/features/docker/DockerContainersTable.tsx",
+ "frontend-modern/src/features/docker/DockerHostsTable.tsx",
+ "frontend-modern/src/features/docker/DockerImagesTable.tsx",
+ "frontend-modern/src/features/docker/DockerNetworksTable.tsx",
+ "frontend-modern/src/features/docker/DockerSecretsTable.tsx",
+ "frontend-modern/src/features/docker/DockerServicesTable.tsx",
+ "frontend-modern/src/features/docker/DockerStorageUsageTable.tsx",
+ "frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx",
+ "frontend-modern/src/features/docker/DockerTasksTable.tsx",
+ "frontend-modern/src/features/docker/DockerVolumesTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx",
+ "frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx",
+ "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx",
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx",
+ "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts",
+ "frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxMailGatewayTable.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx",
+ "frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts",
+ "frontend-modern/src/features/proxmox/proxmoxPageModel.ts",
+ "frontend-modern/src/features/proxmox/useProxmoxBackupTableWindowing.ts",
+ "frontend-modern/src/features/standalone/AgentsMachinesTable.tsx",
+ "frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASAlertsTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASAppsTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASServicesTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereActivityTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereAlertsTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereHostsTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereNetworksTable.tsx",
+ "frontend-modern/src/hooks/useUnifiedResources.ts",
+ "frontend-modern/src/pages/Actions.tsx",
+ "frontend-modern/src/stores/websocket-global.ts",
+ "frontend-modern/src/stores/websocket.ts"
+ ],
"content_sha256": {
- "frontend-modern/src/components/Storage/useStorageSummaryCharts.ts": "3590301d2e7edf5d2672a3c4bd5b910cb457c936c586a1ec66a0abb2895a63e3"
+ "frontend-modern/src/components/Alerts/AlertResourceTableDesktop.tsx": "40114f8ba34db502cdb8d3c8f09ad2795a0b90b597aa460914837163afdde8a4",
+ "frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx": "9a6ec90c00a42e382dd17e2354f8b2f1eded6bf9ebb7a26a1d2fe5ebef1c36d8",
+ "frontend-modern/src/components/Alerts/IncidentTimelinePanel.tsx": "4bcec4a652819d14108b44f06be61ab89fc3236d9c675fc1e0e73b60e3277547",
+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx": "b418b76eda65c263fb412aba11927661eadad857f980c95621cb6bf2adf96aee",
+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx": "38060d74c672adca17da8568413bc0eaba21075931f3e9982f8345e1d9dc8056",
+ "frontend-modern/src/components/Infrastructure/useTableWindowing.ts": "823b301ee9e689e4d64f43a2b9b884fb442e9c73c2a6b216311641b5a389b951",
+ "frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts": "9cb8b31f22c197d21dba3ac2a7b8ef6ce9ed7a1bddbc11450df88071ab07fd16",
+ "frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx": "38a6b14f30438a829af79af90e9770d812c0d60af3e6eebce5dd2da3c2b656cb",
+ "frontend-modern/src/components/Settings/ResourcePicker.tsx": "33333088aa85b02ce4d4ee301a59228d9bd20703beaf651efb5621d8237fc87f",
+ "frontend-modern/src/components/Storage/DiskList.tsx": "378fe6dca7f082a7192d4a3bed4e5ec8b13e458a64a798c7b5da8c6134fdccde",
+ "frontend-modern/src/components/Storage/Storage.tsx": "49f95343a8327ec756fe9a0e17dfafacc4ca65146fc198befe7d028815f0b90f",
+ "frontend-modern/src/components/Storage/useStoragePageFilters.ts": "454ce14da247b92ae27ea12a9ecbeaa9841d1ae582fafef79baa5ca4f65e8dca",
+ "frontend-modern/src/components/Storage/useStoragePageModel.ts": "c60e1769f4d4811dd1682dfba7763d90777066f69034f1c5e44304bf767bcd9b",
+ "frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts": "9412934e95eb2e1f273383aa69169b762ca2c14037ff586393d7d86374e5f6e4",
+ "frontend-modern/src/components/Workloads/useWorkloadRouteState.ts": "4a12717b73c8e836dd9fd5d049d772134bb53c19e3acc88b6bb88592291b975d",
+ "frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts": "e441a35aeeae2c73845bb28bcfc1242dcfa49630d885b9506a0fb57bf1325653",
+ "frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts": "1e3432b4df8635bf1234f049169c8249b7dc7afb5d91af5b47886d3ec25eee45",
+ "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts": "acad7b727086a684b5f92c7bb015752cbd31d0d88324fb396eec7179ea8b9e45",
+ "frontend-modern/src/components/Workloads/useWorkloadsState.ts": "bf360d72d68b02ac240ce4818d5d39d7308802405ff74592a99f9fe821c6d8ef",
+ "frontend-modern/src/features/alerts/AlertHistoryMobileList.tsx": "264c55150cb49e23d104783b01dc39e7f0563c061c1633faba143b431dd0d247",
+ "frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx": "8e875db1ff66291b4d688bd6e3a2fcba644bafca8e97a313560b151104f5ec4c",
+ "frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx": "4de3198bb6d9a499cbdff530f117115db8e40c8bfa356bcbe9c2f94ab6fdd823",
+ "frontend-modern/src/features/docker/DockerAlertsTable.tsx": "63aa2e31c66f3219facbc94ac7dd6439eabcb382189c13278da9d553b892764d",
+ "frontend-modern/src/features/docker/DockerConfigsTable.tsx": "6a1827fc0a1811531991f6f97201c71b4b2085cca7f889e4e57840068176654d",
+ "frontend-modern/src/features/docker/DockerContainersTable.tsx": "36bdf1cf9b6b2af627c7e521bb18e48a120af175af29f03edcf86dcf903e67b8",
+ "frontend-modern/src/features/docker/DockerHostsTable.tsx": "c60d3f9287348b5cdaea75f0d8e257f60c212ec39439dc4c515f67dc9cf6c4fe",
+ "frontend-modern/src/features/docker/DockerImagesTable.tsx": "ebb0d0808902f6c9d1dd8d0ad3d97742fc1ad1cedf4706e84dd24db4a9bef612",
+ "frontend-modern/src/features/docker/DockerNetworksTable.tsx": "0770e6ccb02ef037f9ebe22aead174ff5a01c36613db3ac330e0f3aed04d82a3",
+ "frontend-modern/src/features/docker/DockerSecretsTable.tsx": "5fab73a3182425e742f1b3a6c1e6068ee9d676aedf20b7ac05783b7e071d773d",
+ "frontend-modern/src/features/docker/DockerServicesTable.tsx": "6b3c96bff27489495504fd67a7e07d127a1830326ebd5b4b16186c258aa46e1d",
+ "frontend-modern/src/features/docker/DockerStorageUsageTable.tsx": "fce8b016818e3eafe55fe3f3571c9f8c0a88d10001e158dfbd5a787e6409cb10",
+ "frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx": "1e434e500f9d87b0eea678531e5bfa4c8219974514a6bb4011301abbf77b0f04",
+ "frontend-modern/src/features/docker/DockerTasksTable.tsx": "ececb440bc03ddc4428ebd9fd86a859115caaaf1b2d7c3483c252f7e5923ae67",
+ "frontend-modern/src/features/docker/DockerVolumesTable.tsx": "437bcca202cdbc515a6be94826c2f052e2887a259b3e74b95314180668b97843",
+ "frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx": "d6af4dc0cefd2a9bc60168cd1211d4e910c034084e19d8627f90a44527725090",
+ "frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx": "72003df3088df2ea0b86119adf98340d4911a10ea06d2429b836ad10b4f9c1ab",
+ "frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx": "5c35fdfbff731047380d5e80d266c40d1d9b9993e5df9e4807b802aa24dcf261",
+ "frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx": "2a0f5f8c6d05465580393769c15ac8b5aab3502a1442b5fce6d9e269585ee8e8",
+ "frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx": "0a76f4fe2a71a1f3e5f22e2f39dab09a69bd534dd88934b40cf5dc066271dced",
+ "frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx": "464d5bc4e4465f306c2ab733fd5217ef27197ac831ff8e1d954bca1c9f033210",
+ "frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx": "7e116f050ddf9d159808104d4e533fa640a72260a2bc46c405cfc771c0551346",
+ "frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx": "6c3cb5fb8bc391b01677030df93f1fd0027f0fdd1ff080d5d23820a017843305",
+ "frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx": "d3d5051b3706f4187b69e238c6151cdb63a676f774f980f1e0c2092ffba4212d",
+ "frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx": "8dae4fe798edb6f7517ba5b96894686795bcb52a9187685a361f099ff11f5cb1",
+ "frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx": "c721ea951e1725842a2e2ae02465ffebd1d8e41db089d7e596d271892d5249fa",
+ "frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx": "c07de4d4c861eced421ec0b9b1aef666e30b8a4da193d1b77465c7b440c4033d",
+ "frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx": "587a5f3f3ba69d1014b4160bb2a817284e2fb9208cd168571deb328f28277972",
+ "frontend-modern/src/features/platformPage/PlatformWindowedList.tsx": "5865c9596ce43c8040f950fdd8944da117c8a60af304552563a30295cd75d836",
+ "frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx": "e9994d44b67683aafb0e2d5563b7c426967cb4812df959fb68a4cd3d71bec532",
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx": "775abbe122738028deeed06087332fac15b6d24bcecd01490a6b05554db53da8",
+ "frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts": "03f7e9e5a6ca8ced24ee3f01e84b447c16904c8953e4325e56e144f10fa9a78c",
+ "frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx": "c450ec312fc1b66b3cd04d31ef4382b958bd39dc9d6c491fea4907f59b7901b3",
+ "frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx": "d6f14908dd53e34022d67cee24c0afd586c425a334b910fc5a7b0542fce2ec72",
+ "frontend-modern/src/features/proxmox/ProxmoxMailGatewayTable.tsx": "734d4f845ca31a58a2751469288b90e1171477bf7811fe7e71e56994e9176838",
+ "frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx": "50006f6baf423f85ee084cdfe57674e31a7fe383508f500f19d48c0edfc6fb65",
+ "frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx": "ade892e9efb6917324b30d77462df02cd412bf872ab0a5ac011d2e8a7a1c94ae",
+ "frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx": "ae7f2a35b0e393049212d4cdc1933a030f242f85292f840e14d457d499838e6b",
+ "frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts": "9a74e09268cba15df0aa72af3fb45c6b3f66a59c02f36f5d56ed949458ec138d",
+ "frontend-modern/src/features/proxmox/proxmoxPageModel.ts": "353aa4917e189d35a74a2619e841aef21403ed828426a76e12ba38c3db47df62",
+ "frontend-modern/src/features/proxmox/useProxmoxBackupTableWindowing.ts": "ede175b264335ac7028a312e7cf5209e80a02398376d6e845dbb60809f153e7f",
+ "frontend-modern/src/features/standalone/AgentsMachinesTable.tsx": "b923a5c901c980e9a0e4b15a27ed4e193bd437d7b564cd8dbba0309cf3c223a8",
+ "frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx": "c3e1be90961dc6c645ba35727e1cb9b3781e16ebce1ef1155e2a2739fc652135",
+ "frontend-modern/src/features/truenas/TrueNASAlertsTable.tsx": "4428e41210224f0c474e8a1f332bd94380bd98ab5c55317657ce613d2621082d",
+ "frontend-modern/src/features/truenas/TrueNASAppsTable.tsx": "f5041219fa5042253833980ad45d1d4cca4362df68e1766df8319f101a9395b8",
+ "frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx": "848490290134fe1d09d42b95af49b7fc7a4f876d783099f152340d98328681b6",
+ "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx": "8df07ae67c13130bc1b55e8efb5841cdf95f20adb47545aadc769d25a0be17eb",
+ "frontend-modern/src/features/truenas/TrueNASServicesTable.tsx": "ab8cf7f11017e5acbf0d748e5f2fd134e01e0bc1949030d0df6b089f7fd519d7",
+ "frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx": "57521f1d655d1b8d724cf2ff50e4d9af0414f2b60f1b95463e91fab30da621b9",
+ "frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx": "91df11b1896c9de71f7d0b1f8c21bf00b108088fb908dc00809784b945688250",
+ "frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx": "1f15e2ea7b223ad21470a745a859a1eca64e39d9b4ff5c85f457b29351f22bd3",
+ "frontend-modern/src/features/vmware/VsphereActivityTable.tsx": "64fccea6ff56fc418916564887814fcfd61c3117ab517e164cc20aacf40440f0",
+ "frontend-modern/src/features/vmware/VsphereAlertsTable.tsx": "8c1d5c367c54d1471110b1d0756aff97dae1f36592179fcf27607731f35998fb",
+ "frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx": "acd0e88c8942dc4a526c20dcaa0a0931d8f01a1cd9ce1167216ccf1e9c710ca3",
+ "frontend-modern/src/features/vmware/VsphereHostsTable.tsx": "063fc1821dbeafad2c2695f2595f157974bf65953a12ca5a75751a41197d5fa8",
+ "frontend-modern/src/features/vmware/VsphereNetworksTable.tsx": "3a066da054edf2f6e5e0aefd21107c785b24962a17cc4238fabb0db9eeb7aa9e",
+ "frontend-modern/src/hooks/useUnifiedResources.ts": "5e1435128cc11d56ce27927340e333796dfc0f4281edc8c127621ea0105de1fc",
+ "frontend-modern/src/pages/Actions.tsx": "05ecf553ac62334b2323c980436f919c13bed96a988bc15bc63e8e1dc5a684de",
+ "frontend-modern/src/stores/websocket-global.ts": "a6b8d424423e296dd7a5c560c1d012982cbf2377c1e420189ee4465563a4eb7e",
+ "frontend-modern/src/stores/websocket.ts": "aec7a7a5ed0b05b315d2eb613e199b8d7a17aa7c2b6f4e810d5d6a05c4a76741"
},
- "routes": ["/proxmox/overview", "/proxmox/storage?source=proxmox-all"],
+ "routes": [
+ "/proxmox/overview",
+ "/proxmox/storage",
+ "/proxmox/replication",
+ "/proxmox/backups/date",
+ "/proxmox/ceph",
+ "/proxmox/mail",
+ "/docker/overview",
+ "/kubernetes/overview",
+ "/truenas/overview",
+ "/vmware/overview",
+ "/standalone/machines",
+ "/alerts/overview",
+ "/actions"
+ ],
"viewports": [
{
"width": 1280,
@@ -19,17 +191,21 @@
}
],
"states": [
- "The connected mock estate contained 50 Proxmox nodes, 929 guests, and 209 storage pool rows",
- "The Storage table mounted 72 pool rows, one virtual spacer, 152 table SVGs, and 2307 total DOM nodes at 1280x720 instead of mounting all 209 pool rows",
- "A fast jump through the storage estate retained all 72 bounded rows and painted the visible middle-of-estate rows without an empty table section",
- "At 390x844 the Storage table remained present with 72 mounted rows and 2288 total DOM nodes",
- "The browser console contained no warnings or errors after desktop and narrow transition and scrolling checks"
+ "The connected mock estate contained 50 Proxmox nodes, 929 guests, and 209 storage rows.",
+ "At 1280x720 the Overview node and guest regions and the Storage table rendered populated rows immediately after settling, with platform tab content retained for fast return navigation.",
+ "At 390x844 the Overview rendered the 50-node summary and 929-guest table with bounded mounted rows; Storage rendered 73 body rows including its virtual spacer instead of mounting all 209 records.",
+ "A direct 6200px jump through the narrow Proxmox guest estate retained 23 visible table rows in every one of 12 consecutive samples, with zero blank frames and the jump-to-top control visible.",
+ "Docker, Kubernetes, TrueNAS, vSphere, Machines, Alerts, and Actions all completed their narrow route render with their expected table or list content and no loading state left behind.",
+ "A clean phone-sized performance profile measured settled Proxmox section transitions at 48-341ms and browser heap at roughly 225-239MB, down from multi-second transitions and roughly 386MB before the realtime reconciliation fix.",
+ "Browser diagnostics contained no warnings or errors after the desktop, narrow, rapid-scroll, platform-route, and Proxmox section checks."
],
"interactions": [
- "Loaded /proxmox/overview against the connected 50-node and 929-guest mock estate and switched to Storage repeatedly",
- "Counted the mounted Storage rows, spacer rows, SVGs, and complete document DOM after the transition",
- "Jumped through the virtualized estate and visually inspected the populated middle-of-estate viewport for blank regions",
- "Applied a 390x844 viewport override, repeated the Overview to Storage transition, and confirmed the table and rows remained visible",
- "Read browser warning and error logs, reset the temporary viewport override, and left the demo at its normal viewport"
+ "Loaded /proxmox/overview against the 50-node, 929-guest mock estate at desktop width and visually inspected the rendered Nodes and Guests regions.",
+ "Clicked Storage, Backups, Replication, Ceph, Mail Gateway, and Overview, then visually inspected Overview and Storage at 1280x720.",
+ "Applied a 390x844 viewport override, reloaded Overview, and confirmed nodes, guests, mobile navigation, and the fixed bottom navigation remained present.",
+ "Jumped the active app scroll surface directly through 6200px of guest rows, sampled visible rows across 12 consecutive frames, and visually inspected the populated middle-of-estate viewport.",
+ "Loaded narrow Docker, Kubernetes, TrueNAS, vSphere, Machines, Alerts, and Actions routes and confirmed each completed with expected estate content.",
+ "Loaded narrow Proxmox Storage directly, waited for first hydration, and confirmed the bounded table was visible with populated rows.",
+ "Read browser diagnostics, restored the temporary viewport override to 1280x720, and left the demo browser in its normal viewport."
]
}
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableDesktop.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableDesktop.tsx
index 6d9a9cedcf..ed9e33fac5 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableDesktop.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableDesktop.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createEffect } from 'solid-js';
+import { For, Show, createEffect, createMemo } from 'solid-js';
import ChevronDown from 'lucide-solid/icons/chevron-down';
import Trash2 from 'lucide-solid/icons/trash-2';
@@ -24,6 +24,7 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import { PlatformWindowedRows } from '@/features/platformPage/PlatformWindowedRows';
import { AlertResourceTableRow } from './AlertResourceTableRow';
import { AlertResourceGroupHeader } from './AlertResourceGroupHeader';
import {
@@ -49,7 +50,10 @@ import {
isAlertResourceMetricOff,
normalizeAlertResourceMetricKey,
} from './alertResourceTableModel';
-import type { OfflineState, ResourceTableProps } from './ResourceTable';
+import type { OfflineState, Resource, ResourceTableProps } from './ResourceTable';
+
+type AlertResourceRenderItem =
+ { kind: 'group'; key: string } | { kind: 'resource'; key: string; resource: Resource };
const OFFLINE_ALERTS_TOOLTIP =
'Toggle default behavior for powered-off or connectivity alerts for this resource type.';
@@ -117,6 +121,59 @@ export function AlertResourceTableDesktop(props: AlertResourceTableDesktopProps)
titleWhenDisabled?: string;
}) => <StatusBadge {...config} />;
+ const resourceRows = createMemo<AlertResourceRenderItem[]>(() => {
+ if (props.table.groupedResources) {
+ const rows: AlertResourceRenderItem[] = [];
+ for (const [groupKey, resources] of Object.entries(props.table.groupedResources).sort(
+ ([left], [right]) => left.localeCompare(right),
+ )) {
+ rows.push({ kind: 'group', key: `group:${groupKey}` });
+ for (const resource of resources) {
+ rows.push({ kind: 'resource', key: `resource:${resource.id}`, resource });
+ }
+ }
+ return rows;
+ }
+ return (props.table.resources ?? []).map((resource) => ({
+ kind: 'resource' as const,
+ key: `resource:${resource.id}`,
+ resource,
+ }));
+ });
+
+ const renderResourceRow = (resource: Resource) => (
+ <AlertResourceTableRow
+ resource={resource}
+ columns={props.table.columns}
+ editingId={props.table.editingId}
+ editingThresholds={props.table.editingThresholds}
+ setEditingThresholds={props.table.setEditingThresholds}
+ formatMetricValue={props.table.formatMetricValue}
+ hasActiveAlert={props.table.hasActiveAlert}
+ onEdit={props.table.onEdit}
+ onSaveEdit={props.table.onSaveEdit}
+ onCancelEdit={props.table.onCancelEdit}
+ onRemoveOverride={props.table.onRemoveOverride}
+ onToggleDisabled={props.table.onToggleDisabled}
+ onToggleNodeConnectivity={props.table.onToggleNodeConnectivity}
+ showOfflineAlertsColumn={props.table.showOfflineAlertsColumn}
+ globalOfflineSeverity={props.table.globalOfflineSeverity}
+ onSetOfflineState={props.table.onSetOfflineState}
+ onToggleBackup={props.table.onToggleBackup}
+ onToggleSnapshot={props.table.onToggleSnapshot}
+ onConfigureResourceIntent={props.table.onConfigureResourceIntent}
+ globalDisableFlag={props.table.globalDisableFlag}
+ globalDisableOfflineFlag={props.table.globalDisableOfflineFlag}
+ editingNote={props.table.editingNote}
+ setEditingNote={props.table.setEditingNote}
+ activeMetricInput={props.activeMetricInput}
+ setActiveMetricInput={props.setActiveMetricInput}
+ showBulkSelection={Boolean(props.table.onBulkEdit)}
+ selected={props.selectedIds().has(resource.id)}
+ onToggleSelection={(checked) => props.toggleSelection(resource.id, checked)}
+ />
+ );
+
return (
<Card padding="none" class="overflow-hidden border border-border" border={false} tone="card">
<div class="px-4 py-3 border-b border-border">
@@ -485,109 +542,39 @@ export function AlertResourceTableDesktop(props: AlertResourceTableDesktopProps)
</TableCell>
</TableRow>
</Show>
- <Show when={props.table.groupedResources}>
- <For
- each={Object.entries(props.table.groupedResources || {}).sort(([a], [b]) =>
- a.localeCompare(b),
- )}
- >
- {([nodeName, resources]) => (
- <>
+ <Show when={resourceRows().length > 0}>
+ <PlatformWindowedRows items={resourceRows} estimatedRowHeight={40}>
+ {(item) =>
+ item.kind === 'group' ? (
<TableRow class={getGroupedTableRowClass()}>
<TableCell colspan={totalColumnCount()} class={getGroupedTableRowCellClass()}>
<AlertResourceGroupHeader
- groupKey={nodeName}
- meta={props.table.groupHeaderMeta?.[nodeName]}
+ groupKey={item.key.slice('group:'.length)}
+ meta={props.table.groupHeaderMeta?.[item.key.slice('group:'.length)]}
/>
</TableCell>
</TableRow>
- <For each={resources}>
- {(resource) => (
- <AlertResourceTableRow
- resource={resource}
- columns={props.table.columns}
- editingId={props.table.editingId}
- editingThresholds={props.table.editingThresholds}
- setEditingThresholds={props.table.setEditingThresholds}
- formatMetricValue={props.table.formatMetricValue}
- hasActiveAlert={props.table.hasActiveAlert}
- onEdit={props.table.onEdit}
- onSaveEdit={props.table.onSaveEdit}
- onCancelEdit={props.table.onCancelEdit}
- onRemoveOverride={props.table.onRemoveOverride}
- onToggleDisabled={props.table.onToggleDisabled}
- onToggleNodeConnectivity={props.table.onToggleNodeConnectivity}
- showOfflineAlertsColumn={props.table.showOfflineAlertsColumn}
- globalOfflineSeverity={props.table.globalOfflineSeverity}
- onSetOfflineState={props.table.onSetOfflineState}
- onToggleBackup={props.table.onToggleBackup}
- onToggleSnapshot={props.table.onToggleSnapshot}
- onConfigureResourceIntent={props.table.onConfigureResourceIntent}
- globalDisableFlag={props.table.globalDisableFlag}
- globalDisableOfflineFlag={props.table.globalDisableOfflineFlag}
- editingNote={props.table.editingNote}
- setEditingNote={props.table.setEditingNote}
- activeMetricInput={props.activeMetricInput}
- setActiveMetricInput={props.setActiveMetricInput}
- showBulkSelection={Boolean(props.table.onBulkEdit)}
- selected={props.selectedIds().has(resource.id)}
- onToggleSelection={(checked) => props.toggleSelection(resource.id, checked)}
- />
- )}
- </For>
- </>
- )}
- </For>
- </Show>
- <Show when={!props.table.groupedResources && props.table.resources}>
- <Show
- when={props.table.resources && props.table.resources.length === 0}
- fallback={
- <For each={props.table.resources}>
- {(resource) => (
- <AlertResourceTableRow
- resource={resource}
- columns={props.table.columns}
- editingId={props.table.editingId}
- editingThresholds={props.table.editingThresholds}
- setEditingThresholds={props.table.setEditingThresholds}
- formatMetricValue={props.table.formatMetricValue}
- hasActiveAlert={props.table.hasActiveAlert}
- onEdit={props.table.onEdit}
- onSaveEdit={props.table.onSaveEdit}
- onCancelEdit={props.table.onCancelEdit}
- onRemoveOverride={props.table.onRemoveOverride}
- onToggleDisabled={props.table.onToggleDisabled}
- onToggleNodeConnectivity={props.table.onToggleNodeConnectivity}
- showOfflineAlertsColumn={props.table.showOfflineAlertsColumn}
- globalOfflineSeverity={props.table.globalOfflineSeverity}
- onSetOfflineState={props.table.onSetOfflineState}
- onToggleBackup={props.table.onToggleBackup}
- onToggleSnapshot={props.table.onToggleSnapshot}
- onConfigureResourceIntent={props.table.onConfigureResourceIntent}
- globalDisableFlag={props.table.globalDisableFlag}
- globalDisableOfflineFlag={props.table.globalDisableOfflineFlag}
- editingNote={props.table.editingNote}
- setEditingNote={props.table.setEditingNote}
- activeMetricInput={props.activeMetricInput}
- setActiveMetricInput={props.setActiveMetricInput}
- showBulkSelection={Boolean(props.table.onBulkEdit)}
- selected={props.selectedIds().has(resource.id)}
- onToggleSelection={(checked) => props.toggleSelection(resource.id, checked)}
- />
- )}
- </For>
+ ) : (
+ renderResourceRow(item.resource)
+ )
}
- >
- <TableRow>
- <TableCell
- colspan={totalColumnCount()}
- class={`${getPlatformTableCellClassForKind('badge')} px-4 py-8 text-sm text-muted`}
- >
- {getAlertResourceTableNoResultsState(props.table.title)}
- </TableCell>
- </TableRow>
- </Show>
+ </PlatformWindowedRows>
+ </Show>
+ <Show
+ when={
+ !props.table.groupedResources &&
+ props.table.resources &&
+ props.table.resources.length === 0
+ }
+ >
+ <TableRow>
+ <TableCell
+ colspan={totalColumnCount()}
+ class={`${getPlatformTableCellClassForKind('badge')} px-4 py-8 text-sm text-muted`}
+ >
+ {getAlertResourceTableNoResultsState(props.table.title)}
+ </TableCell>
+ </TableRow>
</Show>
<Show when={props.hasRows() === false}>
<TableRow>
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
index 6731040e2b..19958916ac 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
@@ -1,4 +1,4 @@
-import { For, Show } from 'solid-js';
+import { For, Show, createMemo } from 'solid-js';
import Check from 'lucide-solid/icons/check';
import Pencil from 'lucide-solid/icons/pencil';
import RotateCcw from 'lucide-solid/icons/rotate-ccw';
@@ -11,6 +11,7 @@ import { FormTextarea } from '@/components/shared/FormTextarea';
import { TogglePrimitive } from '@/components/shared/Toggle';
import { StatusBadge } from '@/components/shared/StatusBadge';
import { AlertResourceGroupHeader } from './AlertResourceGroupHeader';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
import {
getAlertResourceTableCustomBadgeLabel,
getAlertResourceTableEditNotePlaceholder,
@@ -45,7 +46,32 @@ interface AlertResourceTableMobileProps {
setActiveMetricInput: (value: { resourceId: string; metric: string } | null) => void;
}
+type AlertResourceMobileItem =
+ | { kind: 'group'; key: string; groupName: string }
+ | { kind: 'resource'; key: string; resource: Resource };
+
export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
+ const mobileItems = createMemo<AlertResourceMobileItem[]>(() => {
+ if (!props.table.groupedResources) {
+ return (props.table.resources ?? []).map((resource) => ({
+ kind: 'resource' as const,
+ key: `resource:${resource.id}`,
+ resource,
+ }));
+ }
+
+ const items: AlertResourceMobileItem[] = [];
+ for (const [groupName, resources] of Object.entries(props.table.groupedResources).sort(
+ ([left], [right]) => left.localeCompare(right),
+ )) {
+ items.push({ kind: 'group', key: `group:${groupName}`, groupName });
+ for (const resource of resources) {
+ items.push({ kind: 'resource', key: `resource:${resource.id}`, resource });
+ }
+ }
+ return items;
+ });
+
const getThresholds = (resource: Resource, isEditing: boolean) =>
isEditing ? props.table.editingThresholds() : (resource.thresholds ?? {});
@@ -309,337 +335,324 @@ export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
</Card>
</Show>
- <For
- each={
- props.table.groupedResources
- ? Object.entries(props.table.groupedResources).sort(([a], [b]) => a.localeCompare(b))
- : [['default', props.table.resources || []] as [string, Resource[]]]
- }
+ <PlatformWindowedList
+ items={mobileItems}
+ estimatedItemHeight={240}
+ enableThreshold={18}
+ windowSize={24}
>
- {([groupName, resources]) => (
- <div class="space-y-2">
- <Show when={props.table.groupedResources}>
- <div class="px-1 font-medium text-xs text-slate-500 uppercase mt-4 mb-1">
+ {(item) => {
+ if (item.kind === 'group') {
+ return (
+ <div class="px-1 pt-4 pb-1 font-medium text-xs text-slate-500 uppercase">
<AlertResourceGroupHeader
- groupKey={groupName}
- meta={props.table.groupHeaderMeta?.[groupName]}
+ groupKey={item.groupName}
+ meta={props.table.groupHeaderMeta?.[item.groupName]}
/>
</div>
- </Show>
- <For each={resources as Resource[]}>
- {(resource) => {
- const isEditing = () => props.table.editingId() === resource.id;
- const thresholds = () => getThresholds(resource, isEditing());
- const displayValue = (metric: string) =>
- getDisplayValue(resource, metric, isEditing());
- const isOverridden = (metric: string) =>
- isAlertResourceMetricOverridden(resource, metric);
+ );
+ }
- return (
- <Card
- padding="sm"
- class={`flex flex-col gap-3 transition-opacity ${resource.disabled || props.table.globalDisableFlag?.() ? 'opacity-60' : ''}`}
+ const resource = item.resource;
+ const isEditing = () => props.table.editingId() === resource.id;
+ const thresholds = () => getThresholds(resource, isEditing());
+ const displayValue = (metric: string) => getDisplayValue(resource, metric, isEditing());
+ const isOverridden = (metric: string) =>
+ isAlertResourceMetricOverridden(resource, metric);
+
+ return (
+ <Card
+ padding="sm"
+ class={`flex flex-col gap-3 transition-opacity ${resource.disabled || props.table.globalDisableFlag?.() ? 'opacity-60' : ''}`}
+ >
+ <div class="flex items-center justify-between">
+ <div class="flex items-center gap-3 min-w-0">
+ <Show when={props.table.onToggleDisabled}>
+ <div class="shrink-0 scale-90 origin-left">
+ <TogglePrimitive
+ size="sm"
+ checked={
+ !(props.table.globalDisableFlag?.() ?? false) && !resource.disabled
+ }
+ disabled={props.table.globalDisableFlag?.() ?? false}
+ onToggle={() =>
+ !(props.table.globalDisableFlag?.() ?? false) &&
+ props.table.onToggleDisabled?.(resource.id)
+ }
+ />
+ </div>
+ </Show>
+
+ <div class="min-w-0 truncate">
+ <div class="font-medium text-sm truncate">
+ {getAlertResourceLabel(resource)}
+ </div>
+ <Show when={resource.subtitle}>
+ <div class="text-xs text-slate-500 truncate">{resource.subtitle}</div>
+ </Show>
+ </div>
+ </div>
+
+ <div class="flex gap-1 shrink-0">
+ <Show when={!isEditing() && resource.type !== 'dockerHost'}>
+ <ActionIconButton
+ onClick={() => startEditing(resource)}
+ label={`Edit thresholds for ${getAlertResourceLabel(resource)}`}
+ tone="accent"
+ size="sm"
+ class="min-h-11 min-w-11"
+ >
+ <Pencil class="w-4 h-4" aria-hidden="true" />
+ </ActionIconButton>
+ </Show>
+ <Show when={!isEditing() && props.table.onConfigureResourceIntent}>
+ <ActionIconButton
+ onClick={() => {
+ const preferredMetric = ['cpu', 'memory', 'disk'].find(
+ (metric) =>
+ props.table.columns.some(
+ (column) => normalizeAlertResourceMetricKey(column) === metric,
+ ) && alertResourceSupportsMetric(resource.type, metric),
+ );
+ props.table.onConfigureResourceIntent?.(
+ resource.id,
+ preferredMetric ? `metric.${preferredMetric}` : 'state.offline',
+ );
+ }}
+ label={`Configure alert delay for ${getAlertResourceLabel(resource)}`}
+ title="Configure individual alert delay"
+ tone="neutral"
+ size="sm"
+ class="min-h-11 min-w-11"
+ >
+ <Timer class="w-4 h-4" aria-hidden="true" />
+ </ActionIconButton>
+ </Show>
+ <Show when={isEditing()}>
+ <ActionIconButton
+ onClick={cancelEditing}
+ label="Cancel threshold edits"
+ tone="muted"
+ size="sm"
+ class="min-h-11 min-w-11"
+ >
+ <X class="w-4 h-4" aria-hidden="true" />
+ </ActionIconButton>
+ <ActionIconButton
+ onClick={() => saveEditing(resource.id)}
+ label={`Save threshold edits for ${getAlertResourceLabel(resource)}`}
+ tone="success"
+ size="sm"
+ class="min-h-11 min-w-11"
+ >
+ <Check class="w-4 h-4" aria-hidden="true" />
+ </ActionIconButton>
+ </Show>
+ <Show
+ when={
+ resource.hasOverride ||
+ (resource.type === 'agent' && resource.disableConnectivity)
+ }
>
- <div class="flex items-center justify-between">
- <div class="flex items-center gap-3 min-w-0">
- <Show when={props.table.onToggleDisabled}>
- <div class="shrink-0 scale-90 origin-left">
- <TogglePrimitive
- size="sm"
- checked={
- !(props.table.globalDisableFlag?.() ?? false) && !resource.disabled
- }
- disabled={props.table.globalDisableFlag?.() ?? false}
+ <ActionIconButton
+ onClick={() => props.table.onRemoveOverride(resource.id)}
+ label={`Revert to defaults for ${getAlertResourceLabel(resource)}`}
+ title={getAlertResourceTableRevertToDefaultsLabel()}
+ tone="neutral"
+ size="sm"
+ class="min-h-11 min-w-11"
+ >
+ <RotateCcw class="w-4 h-4" aria-hidden="true" />
+ </ActionIconButton>
+ </Show>
+ </div>
+ </div>
+
+ <Show when={isEditing()}>
+ <FormTextarea
+ label="Override note"
+ labelClass="sr-only"
+ fieldBaseClass="w-full"
+ textareaBaseClass="w-full text-xs p-2 rounded border border-border bg-surface-alt"
+ rows={2}
+ placeholder={getAlertResourceTableEditNotePlaceholder()}
+ value={props.table.editingNote()}
+ onInput={(e) => props.table.setEditingNote(e.currentTarget.value)}
+ />
+ </Show>
+
+ <div
+ class={`grid gap-2 text-sm border-t pt-2 ${isEditing() ? 'grid-cols-1' : 'grid-cols-2'}`}
+ >
+ <For each={props.table.columns}>
+ {(column) => {
+ const metric = normalizeAlertResourceMetricKey(column);
+ if (!alertResourceSupportsMetric(resource.type, metric)) return null;
+
+ // Backup and snapshot carry day-based configs, not
+ // trigger/clear thresholds. Routing them through the
+ // numeric editor persisted {trigger, clear} into the
+ // backup block, which the backend reads as an all-zero
+ // disabled config (#1126). Render the same on/off
+ // toggle the desktop rows use instead.
+ if (metric === 'backup' || metric === 'snapshot') {
+ const config = metric === 'backup' ? resource.backup : resource.snapshot;
+ const onToggle =
+ metric === 'backup'
+ ? props.table.onToggleBackup
+ : props.table.onToggleSnapshot;
+ if (!onToggle) return null;
+ const titlePrefix = metric === 'backup' ? 'Backup' : 'Snapshot';
+
+ return (
+ <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
+ <span class="text-[10px] uppercase font-bold tracking-wider">
+ {column}
+ </span>
+ <StatusBadge
+ isEnabled={config?.enabled ?? true}
+ onToggle={() => onToggle(resource.id)}
+ titleEnabled={`${titlePrefix} alerts enabled. Click to disable for this resource.`}
+ titleDisabled={`${titlePrefix} alerts disabled. Click to enable for this resource.`}
+ />
+ </div>
+ );
+ }
+
+ const isDisabled = () => isAlertResourceMetricOff(thresholds()?.[metric]);
+ const inheritedDefault = () => resource.defaults?.[metric];
+ const bounds = getAlertResourceMetricBounds(metric);
+
+ return (
+ <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
+ <span class="text-[10px] uppercase font-bold tracking-wider">
+ {column.replace(/mb\/s|%|°c/gi, '').trim()}
+ </span>
+
+ <Show
+ when={isEditing()}
+ fallback={
+ <button
+ type="button"
+ onClick={(e) => startEditing(resource, metric, e)}
+ class="min-h-11 min-w-11 font-mono text-xs font-medium cursor-pointer rounded px-1 -mx-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400"
+ aria-label={`Edit ${column} threshold for ${getAlertResourceLabel(resource)}`}
+ >
+ <MetricValueWithHeat
+ resourceId={resource.id}
+ metric={metric}
+ value={displayValue(metric)}
+ isOverridden={isOverridden(metric)}
+ />
+ </button>
+ }
+ >
+ <div class="flex items-center gap-1.5 [&_button]:min-h-11">
+ <input
+ type="number"
+ min={bounds.min}
+ max={bounds.max}
+ value={isDisabled() ? '' : (thresholds()?.[metric] ?? '')}
+ placeholder={getAlertResourceTableMetricPlaceholder(isDisabled())}
+ class="min-h-11 w-16 text-right text-xs p-1 rounded border border-border bg-surface"
+ onInput={(e) => {
+ const nextValue = parseFloat(e.currentTarget.value);
+ if (
+ !Number.isNaN(nextValue) &&
+ (nextValue < bounds.min || nextValue > bounds.max)
+ ) {
+ return;
+ }
+ props.table.setEditingThresholds({
+ ...props.table.editingThresholds(),
+ [metric]: Number.isNaN(nextValue) ? undefined : nextValue,
+ });
+ }}
+ />
+ <StatusBadge
+ isEnabled={!isDisabled()}
onToggle={() =>
- !(props.table.globalDisableFlag?.() ?? false) &&
- props.table.onToggleDisabled?.(resource.id)
+ props.table.setEditingThresholds({
+ ...props.table.editingThresholds(),
+ [metric]: isDisabled()
+ ? resolveAlertResourceMetricEnableValue(
+ inheritedDefault(),
+ metric,
+ )
+ : ALERT_RESOURCE_METRIC_OFF_VALUE,
+ })
}
+ {...getAlertResourceTableMetricOffToggleProps()}
/>
</div>
</Show>
-
- <div class="min-w-0 truncate">
- <div class="font-medium text-sm truncate">
- {getAlertResourceLabel(resource)}
- </div>
- <Show when={resource.subtitle}>
- <div class="text-xs text-slate-500 truncate">{resource.subtitle}</div>
- </Show>
- </div>
</div>
+ );
+ }}
+ </For>
+ <Show when={props.table.showOfflineAlertsColumn}>
+ {(() => {
+ const supportsTriState =
+ typeof props.table.onSetOfflineState === 'function' &&
+ (resource.type === 'guest' || resource.type === 'dockerContainer');
+ if (!supportsTriState && !props.table.onToggleNodeConnectivity) {
+ return null;
+ }
+ const disabledGlobally = () => props.table.globalDisableFlag?.() ?? false;
- <div class="flex gap-1 shrink-0">
- <Show when={!isEditing() && resource.type !== 'dockerHost'}>
- <ActionIconButton
- onClick={() => startEditing(resource)}
- label={`Edit thresholds for ${getAlertResourceLabel(resource)}`}
- tone="accent"
- size="sm"
- class="min-h-11 min-w-11"
- >
- <Pencil class="w-4 h-4" aria-hidden="true" />
- </ActionIconButton>
- </Show>
- <Show when={!isEditing() && props.table.onConfigureResourceIntent}>
- <ActionIconButton
- onClick={() => {
- const preferredMetric = ['cpu', 'memory', 'disk'].find(
- (metric) =>
- props.table.columns.some(
- (column) => normalizeAlertResourceMetricKey(column) === metric,
- ) && alertResourceSupportsMetric(resource.type, metric),
- );
- props.table.onConfigureResourceIntent?.(
- resource.id,
- preferredMetric ? `metric.${preferredMetric}` : 'state.offline',
- );
- }}
- label={`Configure alert delay for ${getAlertResourceLabel(resource)}`}
- title="Configure individual alert delay"
- tone="neutral"
- size="sm"
- class="min-h-11 min-w-11"
- >
- <Timer class="w-4 h-4" aria-hidden="true" />
- </ActionIconButton>
- </Show>
- <Show when={isEditing()}>
- <ActionIconButton
- onClick={cancelEditing}
- label="Cancel threshold edits"
- tone="muted"
- size="sm"
- class="min-h-11 min-w-11"
- >
- <X class="w-4 h-4" aria-hidden="true" />
- </ActionIconButton>
- <ActionIconButton
- onClick={() => saveEditing(resource.id)}
- label={`Save threshold edits for ${getAlertResourceLabel(resource)}`}
- tone="success"
- size="sm"
- class="min-h-11 min-w-11"
- >
- <Check class="w-4 h-4" aria-hidden="true" />
- </ActionIconButton>
- </Show>
+ return (
+ <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
+ <span class="text-[10px] uppercase font-bold tracking-wider">Offline</span>
<Show
- when={
- resource.hasOverride ||
- (resource.type === 'agent' && resource.disableConnectivity)
+ when={supportsTriState}
+ fallback={
+ <StatusBadge
+ isEnabled={
+ !(props.table.globalDisableOfflineFlag?.() ?? false) &&
+ !resource.disableConnectivity
+ }
+ disabled={disabledGlobally()}
+ onToggle={() => {
+ if (disabledGlobally()) return;
+ props.table.onToggleNodeConnectivity?.(resource.id);
+ }}
+ titleEnabled="Offline alerts enabled. Click to disable for this resource."
+ titleDisabled="Offline alerts disabled. Click to enable for this resource."
+ titleWhenDisabled="Offline alerts controlled globally"
+ />
}
>
- <ActionIconButton
- onClick={() => props.table.onRemoveOverride(resource.id)}
- label={`Revert to defaults for ${getAlertResourceLabel(resource)}`}
- title={getAlertResourceTableRevertToDefaultsLabel()}
- tone="neutral"
- size="sm"
- class="min-h-11 min-w-11"
- >
- <RotateCcw class="w-4 h-4" aria-hidden="true" />
- </ActionIconButton>
- </Show>
- </div>
- </div>
-
- <Show when={isEditing()}>
- <FormTextarea
- label="Override note"
- labelClass="sr-only"
- fieldBaseClass="w-full"
- textareaBaseClass="w-full text-xs p-2 rounded border border-border bg-surface-alt"
- rows={2}
- placeholder={getAlertResourceTableEditNotePlaceholder()}
- value={props.table.editingNote()}
- onInput={(e) => props.table.setEditingNote(e.currentTarget.value)}
- />
- </Show>
+ {(() => {
+ const defaultDisabled =
+ props.table.globalDisableOfflineFlag?.() ?? false;
+ const defaultSeverity = props.table.globalOfflineSeverity ?? 'warning';
- <div
- class={`grid gap-2 text-sm border-t pt-2 ${isEditing() ? 'grid-cols-1' : 'grid-cols-2'}`}
- >
- <For each={props.table.columns}>
- {(column) => {
- const metric = normalizeAlertResourceMetricKey(column);
- if (!alertResourceSupportsMetric(resource.type, metric)) return null;
-
- // Backup and snapshot carry day-based configs, not
- // trigger/clear thresholds. Routing them through the
- // numeric editor persisted {trigger, clear} into the
- // backup block, which the backend reads as an all-zero
- // disabled config (#1126). Render the same on/off
- // toggle the desktop rows use instead.
- if (metric === 'backup' || metric === 'snapshot') {
- const config =
- metric === 'backup' ? resource.backup : resource.snapshot;
- const onToggle =
- metric === 'backup'
- ? props.table.onToggleBackup
- : props.table.onToggleSnapshot;
- if (!onToggle) return null;
- const titlePrefix = metric === 'backup' ? 'Backup' : 'Snapshot';
-
- return (
- <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
- <span class="text-[10px] uppercase font-bold tracking-wider">
- {column}
- </span>
- <StatusBadge
- isEnabled={config?.enabled ?? true}
- onToggle={() => onToggle(resource.id)}
- titleEnabled={`${titlePrefix} alerts enabled. Click to disable for this resource.`}
- titleDisabled={`${titlePrefix} alerts disabled. Click to enable for this resource.`}
- />
- </div>
- );
- }
+ let state: OfflineState;
+ if (resource.disableConnectivity) {
+ state = 'off';
+ } else if (resource.poweredOffSeverity) {
+ state = resource.poweredOffSeverity;
+ } else if (defaultDisabled) {
+ state = 'off';
+ } else {
+ state = defaultSeverity === 'critical' ? 'critical' : 'warning';
+ }
- const isDisabled = () => isAlertResourceMetricOff(thresholds()?.[metric]);
- const inheritedDefault = () => resource.defaults?.[metric];
- const bounds = getAlertResourceMetricBounds(metric);
-
- return (
- <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
- <span class="text-[10px] uppercase font-bold tracking-wider">
- {column.replace(/mb\/s|%|°c/gi, '').trim()}
- </span>
-
- <Show
- when={isEditing()}
- fallback={
- <button
- type="button"
- onClick={(e) => startEditing(resource, metric, e)}
- class="min-h-11 min-w-11 font-mono text-xs font-medium cursor-pointer rounded px-1 -mx-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400"
- aria-label={`Edit ${column} threshold for ${getAlertResourceLabel(resource)}`}
- >
- <MetricValueWithHeat
- resourceId={resource.id}
- metric={metric}
- value={displayValue(metric)}
- isOverridden={isOverridden(metric)}
- />
- </button>
- }
- >
- <div class="flex items-center gap-1.5 [&_button]:min-h-11">
- <input
- type="number"
- min={bounds.min}
- max={bounds.max}
- value={isDisabled() ? '' : (thresholds()?.[metric] ?? '')}
- placeholder={getAlertResourceTableMetricPlaceholder(
- isDisabled(),
- )}
- class="min-h-11 w-16 text-right text-xs p-1 rounded border border-border bg-surface"
- onInput={(e) => {
- const nextValue = parseFloat(e.currentTarget.value);
- if (
- !Number.isNaN(nextValue) &&
- (nextValue < bounds.min || nextValue > bounds.max)
- ) {
- return;
- }
- props.table.setEditingThresholds({
- ...props.table.editingThresholds(),
- [metric]: Number.isNaN(nextValue) ? undefined : nextValue,
- });
- }}
- />
- <StatusBadge
- isEnabled={!isDisabled()}
- onToggle={() =>
- props.table.setEditingThresholds({
- ...props.table.editingThresholds(),
- [metric]: isDisabled()
- ? resolveAlertResourceMetricEnableValue(
- inheritedDefault(),
- metric,
- )
- : ALERT_RESOURCE_METRIC_OFF_VALUE,
- })
- }
- {...getAlertResourceTableMetricOffToggleProps()}
- />
- </div>
- </Show>
- </div>
- );
- }}
- </For>
- <Show when={props.table.showOfflineAlertsColumn}>
- {(() => {
- const supportsTriState =
- typeof props.table.onSetOfflineState === 'function' &&
- (resource.type === 'guest' || resource.type === 'dockerContainer');
- if (!supportsTriState && !props.table.onToggleNodeConnectivity) {
- return null;
- }
- const disabledGlobally = () => props.table.globalDisableFlag?.() ?? false;
-
- return (
- <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
- <span class="text-[10px] uppercase font-bold tracking-wider">
- Offline
- </span>
- <Show
- when={supportsTriState}
- fallback={
- <StatusBadge
- isEnabled={
- !(props.table.globalDisableOfflineFlag?.() ?? false) &&
- !resource.disableConnectivity
- }
- disabled={disabledGlobally()}
- onToggle={() => {
- if (disabledGlobally()) return;
- props.table.onToggleNodeConnectivity?.(resource.id);
- }}
- titleEnabled="Offline alerts enabled. Click to disable for this resource."
- titleDisabled="Offline alerts disabled. Click to enable for this resource."
- titleWhenDisabled="Offline alerts controlled globally"
- />
- }
- >
- {(() => {
- const defaultDisabled =
- props.table.globalDisableOfflineFlag?.() ?? false;
- const defaultSeverity =
- props.table.globalOfflineSeverity ?? 'warning';
-
- let state: OfflineState;
- if (resource.disableConnectivity) {
- state = 'off';
- } else if (resource.poweredOffSeverity) {
- state = resource.poweredOffSeverity;
- } else if (defaultDisabled) {
- state = 'off';
- } else {
- state = defaultSeverity === 'critical' ? 'critical' : 'warning';
- }
-
- return renderOfflineStateButton(state, disabledGlobally(), () => {
- if (disabledGlobally()) return;
- props.table.onSetOfflineState?.(
- resource.id,
- nextOfflineState(state),
- );
- });
- })()}
- </Show>
- </div>
- );
- })()}
- </Show>
- </div>
- </Card>
- );
- }}
- </For>
- </div>
- )}
- </For>
+ return renderOfflineStateButton(state, disabledGlobally(), () => {
+ if (disabledGlobally()) return;
+ props.table.onSetOfflineState?.(resource.id, nextOfflineState(state));
+ });
+ })()}
+ </Show>
+ </div>
+ );
+ })()}
+ </Show>
+ </div>
+ </Card>
+ );
+ }}
+ </PlatformWindowedList>
<Show when={props.hasRows() === false}>
<div class="text-center p-8 text-slate-500 text-sm italic bg-surface-alt rounded-md">
{getAlertResourceTableEmptyState(props.table.emptyMessage)}
diff --git a/frontend-modern/src/components/Alerts/IncidentTimelinePanel.tsx b/frontend-modern/src/components/Alerts/IncidentTimelinePanel.tsx
index 39b3c6468e..a4c853c5fe 100644
--- a/frontend-modern/src/components/Alerts/IncidentTimelinePanel.tsx
+++ b/frontend-modern/src/components/Alerts/IncidentTimelinePanel.tsx
@@ -1,10 +1,11 @@
-import { Show, For, createMemo, type Accessor } from 'solid-js';
+import { Show, createMemo, type Accessor } from 'solid-js';
import type { Incident } from '@/types/api';
import { filterIncidentEvents } from '@/features/alerts/types';
import { IncidentEventFilters } from '@/components/Alerts/IncidentEventFilters';
import { IncidentAssistantHandoffButton } from '@/components/Alerts/IncidentAssistantHandoffButton';
import { IncidentTimelineEventCard } from '@/components/Alerts/IncidentTimelineEventCard';
import { FormTextarea } from '@/components/shared/FormTextarea';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
import {
getAlertTimelineEmptyState,
getAlertTimelineAcknowledgedLabel,
@@ -94,11 +95,16 @@ export function IncidentTimelinePanel(props: IncidentTimelinePanelProps) {
</Show>
<Show when={filteredEvents().length > 0}>
<div class="space-y-2">
- <For each={filteredEvents()}>
+ <PlatformWindowedList
+ items={filteredEvents}
+ estimatedItemHeight={120}
+ enableThreshold={18}
+ windowSize={24}
+ >
{(event) => (
<IncidentTimelineEventCard event={event} variant={props.eventCardVariant} />
)}
- </For>
+ </PlatformWindowedList>
</div>
</Show>
<Show when={events().length > 0 && filteredEvents().length === 0}>
diff --git a/frontend-modern/src/components/Alerts/ResourceTable.test.tsx b/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
index 2a47419723..65ded2ac25 100644
--- a/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
+++ b/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
@@ -330,11 +330,13 @@ describe('ResourceTable', () => {
expect(alertResourceTableDesktopSource).toContain(
'export function AlertResourceTableDesktop',
);
+ expect(alertResourceTableDesktopSource).toContain('PlatformWindowedRows');
expect(alertResourceTableDesktopSource).toContain('AlertResourceTableRow');
expect(alertResourceTableDesktopSource).toContain('AlertResourceGroupHeader');
expect(alertResourceTableDesktopSource).toContain('ActionIconButton');
expect(alertResourceTableDesktopSource).not.toContain(rawSvgTag);
expect(alertResourceTableMobileSource).toContain('export function AlertResourceTableMobile');
+ expect(alertResourceTableMobileSource).toContain('PlatformWindowedList');
expect(alertResourceTableMobileSource).toContain('AlertResourceGroupHeader');
expect(alertResourceTableMobileSource).toContain('FormTextarea');
expect(alertResourceTableMobileSource).toContain('ActionIconButton');
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
index 1fb2ef0673..a1f5708b6e 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo } from 'solid-js';
+import { Show, createMemo } from 'solid-js';
import type { Component } from 'solid-js';
import { formatUptime } from '@/utils/format';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
@@ -37,6 +37,7 @@ import {
import { getPBSTableRow, isResourceOnline } from './unifiedResourceTableModel';
import { buildServiceDetailLinks } from './serviceDetailLinks';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
+import { PlatformWindowedRows } from '@/features/platformPage/PlatformWindowedRows';
interface UnifiedResourcePBSTableSectionProps {
tableProps: UnifiedResourceTableProps;
@@ -107,7 +108,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
</TableRow>
</TableHeader>
<TableBody>
- <For each={table.sortedPBSResources()}>
+ <PlatformWindowedRows items={table.sortedPBSResources} estimatedRowHeight={40}>
{(resource) => {
const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
const isHighlighted = createMemo(
@@ -343,7 +344,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</TableBody>
</Table>
</Show>
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
index 46ed2a4cdf..9862704706 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo } from 'solid-js';
+import { Show, createMemo } from 'solid-js';
import type { Component } from 'solid-js';
import { formatUptime } from '@/utils/format';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
@@ -37,6 +37,7 @@ import {
import { getPMGTableRow, isResourceOnline } from './unifiedResourceTableModel';
import { buildServiceDetailLinks } from './serviceDetailLinks';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
+import { PlatformWindowedRows } from '@/features/platformPage/PlatformWindowedRows';
interface UnifiedResourcePMGTableSectionProps {
tableProps: UnifiedResourceTableProps;
@@ -121,7 +122,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</TableRow>
</TableHeader>
<TableBody>
- <For each={table.sortedPMGResources()}>
+ <PlatformWindowedRows items={table.sortedPMGResources} estimatedRowHeight={40}>
{(resource) => {
const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
const isHighlighted = createMemo(
@@ -383,7 +384,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</TableBody>
</Table>
</Show>
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
index 55a73733dc..109591435e 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
@@ -144,7 +144,7 @@ describe('UnifiedResourceTable performance contract', () => {
});
describe('Baseline structural contracts', () => {
- it('renders Profile S table structure and all rows', async () => {
+ it('renders Profile S table structure within the mounted-row budget', async () => {
const resources = makeResources(PROFILES.S);
const { container } = render(() => (
<UnifiedResourceTable
@@ -162,7 +162,8 @@ describe('UnifiedResourceTable performance contract', () => {
expect(getBodyRowCount(container)).toBeGreaterThan(0);
});
await waitFor(() => {
- expect(getBodyRowCount(container)).toBe(PROFILES.S);
+ expect(getBodyRowCount(container)).toBeGreaterThan(0);
+ expect(getBodyRowCount(container)).toBeLessThanOrEqual(140);
});
});
@@ -934,7 +935,7 @@ describe('UnifiedResourceTable performance contract', () => {
it('renders facet summary badges without changing the Profile S row budget', async () => {
const resources = makeResources(PROFILES.S, (i) =>
- i === 0
+ i === 1
? {
capabilities: [
{
@@ -946,7 +947,7 @@ describe('UnifiedResourceTable performance contract', () => {
],
relationships: [
{
- sourceId: 'resource-0',
+ sourceId: 'resource-1',
targetId: 'storage-1',
type: 'depends_on',
confidence: 0.91,
@@ -994,7 +995,8 @@ describe('UnifiedResourceTable performance contract', () => {
});
expect(container.querySelector('tbody')?.textContent).not.toContain('Config update 1');
await waitFor(() => {
- expect(getBodyRowCount(container)).toBe(PROFILES.S);
+ expect(getBodyRowCount(container)).toBeGreaterThan(0);
+ expect(getBodyRowCount(container)).toBeLessThanOrEqual(140);
});
});
@@ -1237,7 +1239,8 @@ describe('UnifiedResourceTable performance contract', () => {
);
await waitFor(
() => {
- expect(getBodyRowCount(container)).toBe(PROFILES.S + 2);
+ expect(getBodyRowCount(container)).toBeGreaterThan(0);
+ expect(getBodyRowCount(container)).toBeLessThanOrEqual(140);
},
{ timeout: 15000 },
);
@@ -1264,7 +1267,8 @@ describe('UnifiedResourceTable performance contract', () => {
);
await waitFor(
() => {
- expect(getBodyRowCount(container)).toBe(PROFILES.S);
+ expect(getBodyRowCount(container)).toBeGreaterThan(0);
+ expect(getBodyRowCount(container)).toBeLessThanOrEqual(140);
},
{ timeout: 15000 },
);
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/useTableWindowing.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/useTableWindowing.test.ts
index c8e6ba88b9..a5df3bf8ca 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/useTableWindowing.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/useTableWindowing.test.ts
@@ -43,18 +43,18 @@ describe('useTableWindowing', () => {
// isWindowed
// ──────────────────────────────────────────────────────────────
describe('isWindowed', () => {
- it('returns false when total count is below default threshold (500)', () => {
- const hook = setup({ totalCount: () => 200 });
+ it('returns false when total count is below the mounted-row budget', () => {
+ const hook = setup({ totalCount: () => 140 });
expect(hook.isWindowed()).toBe(false);
});
it('returns true when total count exceeds default threshold', () => {
- const hook = setup({ totalCount: () => 600 });
+ const hook = setup({ totalCount: () => 141 });
expect(hook.isWindowed()).toBe(true);
});
it('returns false when total count equals threshold (not exceeded)', () => {
- const hook = setup({ totalCount: () => 500 });
+ const hook = setup({ totalCount: () => 140 });
expect(hook.isWindowed()).toBe(false);
});
@@ -181,12 +181,12 @@ describe('useTableWindowing', () => {
enabled: () => true,
windowSize: 100,
});
- // Scroll: firstVisible=50, overscan=20, start=30, end=130
- hook.onScroll(2000, 400, 40);
- expect(hook.isVisible(29)).toBe(false);
- expect(hook.isVisible(30)).toBe(true);
- expect(hook.isVisible(129)).toBe(true);
- expect(hook.isVisible(130)).toBe(false);
+ // A jump beyond the initial runway moves the window with 24 rows ahead.
+ hook.onScroll(4000, 400, 40);
+ expect(hook.isVisible(75)).toBe(false);
+ expect(hook.isVisible(76)).toBe(true);
+ expect(hook.isVisible(175)).toBe(true);
+ expect(hook.isVisible(176)).toBe(false);
});
});
@@ -201,13 +201,10 @@ describe('useTableWindowing', () => {
windowSize: 100,
});
- // scrollTop=2000, containerHeight=400, rowHeight=40
- // firstVisibleRow = floor(2000/40) = 50
- // overscan = min(20, max(0, 100 - ceil(400/40))) = min(20, 90) = 20
- // start = 50 - 20 = 30
- hook.onScroll(2000, 400, 40);
- expect(hook.startIndex()).toBe(30);
- expect(hook.endIndex()).toBe(130);
+ // firstVisibleRow=100 and the directional runway keeps 24 rows ahead.
+ hook.onScroll(4000, 400, 40);
+ expect(hook.startIndex()).toBe(76);
+ expect(hook.endIndex()).toBe(176);
});
it('clamps start to 0 when scrolled near top', () => {
@@ -250,8 +247,8 @@ describe('useTableWindowing', () => {
windowSize: 100,
});
// rowHeight=0 → safeRowHeight=40, same calc as normal
- hook.onScroll(2000, 400, 0);
- expect(hook.startIndex()).toBe(30);
+ hook.onScroll(4000, 400, 0);
+ expect(hook.startIndex()).toBe(76);
});
it('handles negative scrollTop gracefully', () => {
@@ -284,9 +281,9 @@ describe('useTableWindowing', () => {
enabled: () => true,
windowSize: 100,
});
- hook.onScroll(2000, 400, -10);
+ hook.onScroll(4000, 400, -10);
// safeRowHeight = 40 (negative not > 0)
- expect(hook.startIndex()).toBe(30);
+ expect(hook.startIndex()).toBe(76);
});
it('handles large scrollTop values without error', () => {
@@ -521,7 +518,7 @@ describe('useTableWindowing', () => {
disposers.push(dispose);
// Scroll somewhere
- result.onScroll(4000, 400, 40);
+ result.onScroll(8000, 400, 40);
expect(result.startIndex()).toBeGreaterThan(0);
// Disable windowing
@@ -594,7 +591,7 @@ describe('useTableWindowing', () => {
expect(result.isWindowed()).toBe(true);
// Scroll to a non-zero position first
- result.onScroll(4000, 400, 40);
+ result.onScroll(8000, 400, 40);
expect(result.startIndex()).toBeGreaterThan(0);
// Drop below threshold — windowing off
diff --git a/frontend-modern/src/components/Infrastructure/useTableWindowing.ts b/frontend-modern/src/components/Infrastructure/useTableWindowing.ts
index f6fb6d8abf..e39a138d9f 100644
--- a/frontend-modern/src/components/Infrastructure/useTableWindowing.ts
+++ b/frontend-modern/src/components/Infrastructure/useTableWindowing.ts
@@ -7,6 +7,8 @@ export interface UseTableWindowingOptions {
windowSize?: number;
/** Whether windowing is enabled (disabled for small datasets) */
enabled?: () => boolean;
+ /** Row count above which the default bounded window activates */
+ enableThreshold?: number;
/** Index to ensure is visible (for deep-link/highlight reveal) */
revealIndex?: () => number | null;
}
@@ -27,8 +29,13 @@ export interface UseTableWindowingResult {
}
const DEFAULT_WINDOW_SIZE = 140;
-const DEFAULT_ENABLE_THRESHOLD = 500;
+// A few hundred rich platform rows are already enough to produce long style,
+// layout, and paint tasks on phones. Keep the default aligned with the mounted
+// row budget so consumers cannot accidentally leave a 200-500 row gap between
+// "small table" and "large estate" behaviour.
+const DEFAULT_ENABLE_THRESHOLD = DEFAULT_WINDOW_SIZE;
const DEFAULT_OVERSCAN_ROWS = 20;
+const DEFAULT_EDGE_RUNWAY_ROWS = 24;
export const useTableWindowing = (options: UseTableWindowingOptions): UseTableWindowingResult => {
const [windowStart, setWindowStart] = createSignal(0);
@@ -39,10 +46,13 @@ export const useTableWindowing = (options: UseTableWindowingOptions): UseTableWi
const isWindowed = createMemo(() => {
const total = options.totalCount();
- const enabled = options.enabled?.() ?? total > DEFAULT_ENABLE_THRESHOLD;
+ const threshold = Math.max(0, Math.floor(options.enableThreshold ?? DEFAULT_ENABLE_THRESHOLD));
+ const enabled = options.enabled?.() ?? total > threshold;
return enabled && total > 0;
});
+ let lastFirstVisibleRow = 0;
+
const maxStart = createMemo(() => Math.max(0, options.totalCount() - normalizedWindowSize()));
const startIndex = createMemo(() => {
@@ -74,12 +84,36 @@ export const useTableWindowing = (options: UseTableWindowingOptions): UseTableWi
const safeRowHeight = rowHeight > 0 ? rowHeight : 40;
const safeContainerHeight = containerHeight > 0 ? containerHeight : safeRowHeight;
const rowsInView = Math.max(1, Math.ceil(safeContainerHeight / safeRowHeight));
- const overscan = Math.min(
- DEFAULT_OVERSCAN_ROWS,
- Math.max(0, normalizedWindowSize() - rowsInView),
- );
const firstVisibleRow = Math.floor(Math.max(0, scrollTop) / safeRowHeight);
- setClampedStart(firstVisibleRow - overscan);
+ const visibleEnd = Math.min(options.totalCount(), firstVisibleRow + rowsInView);
+ const availableBuffer = Math.max(0, normalizedWindowSize() - rowsInView);
+ const edgeRunway = Math.min(
+ Math.floor(availableBuffer / 2),
+ Math.max(DEFAULT_EDGE_RUNWAY_ROWS, rowsInView),
+ );
+ const direction = Math.sign(firstVisibleRow - lastFirstVisibleRow);
+ lastFirstVisibleRow = firstVisibleRow;
+
+ const leadingRunway = firstVisibleRow - startIndex();
+ const trailingRunway = endIndex() - visibleEnd;
+ const viewportIsMounted = leadingRunway >= 0 && trailingRunway >= 0;
+ if (
+ viewportIsMounted &&
+ ((direction > 0 && trailingRunway > edgeRunway) ||
+ (direction < 0 && leadingRunway > edgeRunway) ||
+ (direction === 0 && leadingRunway >= edgeRunway && trailingRunway >= edgeRunway))
+ ) {
+ return;
+ }
+
+ const directionalRunway = Math.max(edgeRunway, availableBuffer - edgeRunway);
+ const rowsBeforeViewport =
+ direction < 0
+ ? directionalRunway
+ : direction > 0
+ ? edgeRunway
+ : Math.min(DEFAULT_OVERSCAN_ROWS, availableBuffer);
+ setClampedStart(firstVisibleRow - rowsBeforeViewport);
};
const isVisible = (index: number) => {
diff --git a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts
index 77e311f144..4df66d8d10 100644
--- a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts
+++ b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts
@@ -1,6 +1,31 @@
-import { createEffect, createSignal, onCleanup, type Accessor } from 'solid-js';
+import { createEffect, createSignal, onCleanup, untrack, type Accessor } from 'solid-js';
import { useTableWindowing } from './useTableWindowing';
+const SCROLLABLE_OVERFLOW_PATTERN = /(?:auto|scroll|overlay)/;
+const WHEEL_LINE_HEIGHT_PX = 16;
+
+const findScrollContainer = (element: HTMLElement): HTMLElement | null => {
+ let parent = element.parentElement;
+ while (parent && parent !== document.body && parent !== document.documentElement) {
+ const styles = getComputedStyle(parent);
+ const hasVerticalScrollRange = parent.scrollHeight - parent.clientHeight > 1;
+ if (
+ SCROLLABLE_OVERFLOW_PATTERN.test(styles.overflowY) &&
+ (styles.overflowY === 'scroll' || hasVerticalScrollRange)
+ ) {
+ return parent;
+ }
+ parent = parent.parentElement;
+ }
+ return null;
+};
+
+const wheelDeltaInPixels = (event: WheelEvent, viewportHeight: number): number => {
+ if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) return event.deltaY * WHEEL_LINE_HEIGHT_PX;
+ if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) return event.deltaY * viewportHeight;
+ return event.deltaY;
+};
+
interface UseUnifiedResourceTableViewportSyncOptions {
totalCount: Accessor<number>;
estimatedRowHeight: number;
@@ -13,13 +38,26 @@ export function useUnifiedResourceTableViewportSync(
const { totalCount, estimatedRowHeight, hostWindowing } = options;
const [hostBodyRef, setHostBodyRef] = createSignal<HTMLTableSectionElement | null>(null);
- const syncHostWindowToViewport = () => {
+ const syncHostWindowToViewport = (projectedScrollDelta = 0) => {
if (!hostWindowing.isWindowed() || typeof window === 'undefined') return;
const body = hostBodyRef();
if (!body) return;
const rect = body.getBoundingClientRect();
- const scrollTop = Math.max(0, -rect.top);
- hostWindowing.onScroll(scrollTop, window.innerHeight, estimatedRowHeight);
+ const scrollContainer = findScrollContainer(body);
+ if (scrollContainer) {
+ const containerRect = scrollContainer.getBoundingClientRect();
+ hostWindowing.onScroll(
+ Math.max(0, containerRect.top - rect.top + projectedScrollDelta),
+ scrollContainer.clientHeight || window.innerHeight,
+ estimatedRowHeight,
+ );
+ return;
+ }
+ hostWindowing.onScroll(
+ Math.max(0, -rect.top + projectedScrollDelta),
+ window.innerHeight,
+ estimatedRowHeight,
+ );
};
createEffect(() => {
@@ -28,15 +66,53 @@ export function useUnifiedResourceTableViewportSync(
if (!hostWindowing.isWindowed()) return;
if (!hostBodyRef()) return;
- const handleViewportChange = () => {
- syncHostWindowToViewport();
+ let lastTouchY: number | null = null;
+ const body = hostBodyRef()!;
+ const scrollContainer = findScrollContainer(body);
+ const scrollTarget: HTMLElement | Window = scrollContainer ?? window;
+ const viewportHeight = () => scrollContainer?.clientHeight || window.innerHeight;
+ const handleViewportChange = () => syncHostWindowToViewport();
+ const handleWheel = (event: Event) => {
+ const wheelEvent = event as WheelEvent;
+ if (wheelEvent.deltaY === 0) return;
+ syncHostWindowToViewport(wheelDeltaInPixels(wheelEvent, viewportHeight()));
+ };
+ const handleTouchStart = (event: Event) => {
+ lastTouchY = (event as TouchEvent).touches.item(0)?.clientY ?? null;
+ };
+ const handleTouchMove = (event: Event) => {
+ const nextTouchY = (event as TouchEvent).touches.item(0)?.clientY ?? null;
+ if (nextTouchY == null || lastTouchY == null) {
+ lastTouchY = nextTouchY;
+ return;
+ }
+ const deltaY = lastTouchY - nextTouchY;
+ lastTouchY = nextTouchY;
+ if (deltaY !== 0) syncHostWindowToViewport(deltaY);
+ };
+ const handleTouchEnd = () => {
+ lastTouchY = null;
};
- handleViewportChange();
- window.addEventListener('scroll', handleViewportChange, { passive: true });
+ // The initial measurement reads the current window bounds and may move the
+ // window. Keep those reads outside this setup effect's dependency graph;
+ // otherwise a far-away reveal target and the viewport can repeatedly move
+ // the window back and forth until Solid exhausts the call stack.
+ untrack(handleViewportChange);
+ scrollTarget.addEventListener('scroll', handleViewportChange, { passive: true });
+ scrollTarget.addEventListener('wheel', handleWheel, { passive: false });
+ scrollTarget.addEventListener('touchstart', handleTouchStart, { passive: true });
+ scrollTarget.addEventListener('touchmove', handleTouchMove, { passive: false });
+ scrollTarget.addEventListener('touchend', handleTouchEnd, { passive: true });
+ scrollTarget.addEventListener('touchcancel', handleTouchEnd, { passive: true });
window.addEventListener('resize', handleViewportChange);
onCleanup(() => {
- window.removeEventListener('scroll', handleViewportChange);
+ scrollTarget.removeEventListener('scroll', handleViewportChange);
+ scrollTarget.removeEventListener('wheel', handleWheel);
+ scrollTarget.removeEventListener('touchstart', handleTouchStart);
+ scrollTarget.removeEventListener('touchmove', handleTouchMove);
+ scrollTarget.removeEventListener('touchend', handleTouchEnd);
+ scrollTarget.removeEventListener('touchcancel', handleTouchEnd);
window.removeEventListener('resize', handleViewportChange);
});
});
diff --git a/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx b/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx
index 5e4e46d512..fe7471cb64 100644
--- a/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx
@@ -1,12 +1,4 @@
-import {
- For,
- Show,
- createEffect,
- createMemo,
- createSignal,
- onMount,
- type Component,
-} from 'solid-js';
+import { Show, createEffect, createMemo, createSignal, onMount, type Component } from 'solid-js';
import { useLocation, useNavigate } from '@solidjs/router';
import Plus from 'lucide-solid/icons/plus';
import RotateCw from 'lucide-solid/icons/rotate-cw';
@@ -17,6 +9,7 @@ import { EmptyState } from '@/components/shared/EmptyState';
import SettingsPanel from '@/components/shared/SettingsPanel';
import { Dialog } from '@/components/shared/Dialog';
import { MetadataBadge } from '@/components/shared/MetadataBadge';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
import { useResources } from '@/hooks/useResources';
import { buildProbeAgentOptions } from '@/utils/availabilityProbeAgents';
import {
@@ -263,7 +256,12 @@ export const AvailabilitySettingsPanel: Component = () => {
/>
}
>
- <For each={sortedTargets()}>
+ <PlatformWindowedList
+ items={sortedTargets}
+ estimatedItemHeight={92}
+ enableThreshold={24}
+ windowSize={32}
+ >
{(target) => {
const pending = () => pendingActionId() === target.id;
return (
@@ -338,7 +336,7 @@ export const AvailabilitySettingsPanel: Component = () => {
</div>
);
}}
- </For>
+ </PlatformWindowedList>
</Show>
</div>
</SettingsPanel>
diff --git a/frontend-modern/src/components/Settings/ResourcePicker.tsx b/frontend-modern/src/components/Settings/ResourcePicker.tsx
index c324640169..aebe33ee97 100644
--- a/frontend-modern/src/components/Settings/ResourcePicker.tsx
+++ b/frontend-modern/src/components/Settings/ResourcePicker.tsx
@@ -22,6 +22,7 @@ import {
import { showWarning } from '@/utils/toast';
import { getResourceTypePresentation } from '@/utils/resourceTypePresentation';
import { getSimpleStatusIndicator } from '@/utils/status';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
const DEFAULT_MAX_SELECTION = 50;
@@ -199,7 +200,12 @@ export function ResourcePicker(props: ResourcePickerProps) {
}
>
<div class="max-h-[300px] overflow-y-auto">
- <For each={filteredResources()}>
+ <PlatformWindowedList
+ items={filteredResources}
+ estimatedItemHeight={56}
+ enableThreshold={16}
+ windowSize={20}
+ >
{(resource) => {
const badge = getResourceTypePresentation(resource.type) || {
label: resource.type,
@@ -303,7 +309,7 @@ export function ResourcePicker(props: ResourcePickerProps) {
</button>
);
}}
- </For>
+ </PlatformWindowedList>
</div>
</Show>
</Show>
diff --git a/frontend-modern/src/components/Settings/__tests__/AvailabilitySettingsPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/AvailabilitySettingsPanel.test.tsx
index 63dc90b257..197d60a8ae 100644
--- a/frontend-modern/src/components/Settings/__tests__/AvailabilitySettingsPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/AvailabilitySettingsPanel.test.tsx
@@ -1,6 +1,7 @@
import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { AvailabilityTargetsAPI, type AvailabilityTarget } from '@/api/availabilityTargets';
+import availabilitySettingsPanelSource from '../AvailabilitySettingsPanel.tsx?raw';
import { AvailabilitySettingsPanel } from '../AvailabilitySettingsPanel';
const routeState = vi.hoisted(() => ({
@@ -102,6 +103,11 @@ describe('AvailabilitySettingsPanel', () => {
afterEach(() => cleanup());
+ it('keeps large target inventories on the shared bounded list renderer', () => {
+ expect(availabilitySettingsPanelSource).toContain('PlatformWindowedList');
+ expect(availabilitySettingsPanelSource).toContain('estimatedItemHeight={92}');
+ });
+
it('lists monitor-only MQTT and HTTP endpoint checks in the monitoring home', async () => {
render(() => <AvailabilitySettingsPanel />);
diff --git a/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx b/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx
index 9a42a62f6f..739b5717ec 100644
--- a/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx
@@ -2,6 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
import { createSignal } from 'solid-js';
import type { Resource } from '@/types/resource';
+import resourcePickerSource from '../ResourcePicker.tsx?raw';
import { ResourcePicker, type SelectedResource } from '../ResourcePicker';
let mockResources: Resource[] = [];
@@ -74,6 +75,11 @@ afterEach(() => {
});
describe('ResourcePicker', () => {
+ it('keeps large resource inventories on the shared bounded list renderer', () => {
+ expect(resourcePickerSource).toContain('PlatformWindowedList');
+ expect(resourcePickerSource).toContain('estimatedItemHeight={56}');
+ });
+
it('renders reportable resources from useResources()', async () => {
mockResources = [
makeResource({
diff --git a/frontend-modern/src/components/Storage/DiskList.tsx b/frontend-modern/src/components/Storage/DiskList.tsx
index 93a48922ce..6f25d92d79 100644
--- a/frontend-modern/src/components/Storage/DiskList.tsx
+++ b/frontend-modern/src/components/Storage/DiskList.tsx
@@ -86,6 +86,7 @@ import {
type PhysicalDiskTableColumnId,
} from '@/features/storageBackups/diskPresentation';
import { useObservedElementWidth } from '@/hooks/useObservedElementWidth';
+import { PlatformWindowedRows } from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
import type { StorageHealthFilter } from '@/features/storageBackups/models';
import { getStorageSourceOption } from '@/utils/storageSources';
@@ -317,7 +318,7 @@ export const DiskList: Component<DiskListProps> = (props) => {
</TableRow>
</TableHeader>
<TableBody class={PHYSICAL_DISK_TABLE_BODY_CLASS}>
- <For each={model.filteredDisks()}>
+ <PlatformWindowedRows items={model.filteredDisks} estimatedRowHeight={32}>
{(disk) => {
const data = model.getDiskData(disk);
const status = getPhysicalDiskHealthStatus(data);
@@ -521,7 +522,7 @@ export const DiskList: Component<DiskListProps> = (props) => {
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</TableBody>
</Table>
</Show>
diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsx
index d747f157ff..a009bfac75 100644
--- a/frontend-modern/src/components/Storage/Storage.tsx
+++ b/frontend-modern/src/components/Storage/Storage.tsx
@@ -79,14 +79,6 @@ const Storage: Component<StorageProps> = (props) => {
forcedSourceFilter: () => props.forcedSourceFilter,
});
- createEffect(() => {
- const forcedSource = props.forcedSourceFilter?.trim();
- if (!forcedSource) return;
- if (sourceFilter() !== forcedSource) {
- setSourceFilter(forcedSource);
- }
- });
-
createEffect(() => {
if (!props.forcedView) return;
if (view() !== props.forcedView) {
diff --git a/frontend-modern/src/components/Storage/useStoragePageFilters.ts b/frontend-modern/src/components/Storage/useStoragePageFilters.ts
index 8f8aa79090..81602bfd1d 100644
--- a/frontend-modern/src/components/Storage/useStoragePageFilters.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageFilters.ts
@@ -22,6 +22,7 @@ type UseStoragePageFiltersOptions = {
search: string;
};
navigate: (path: string, options: { replace: true }) => void;
+ lockedSourceFilter?: () => string | undefined;
};
export const useStoragePageFilters = (options: UseStoragePageFiltersOptions) => {
@@ -38,7 +39,40 @@ export const useStoragePageFilters = (options: UseStoragePageFiltersOptions) =>
);
const [groupBy, setGroupBy] = createSignal<StorageGroupKey>(DEFAULT_STORAGE_GROUP_KEY);
- const isActiveStorageRoute = () => true;
+ // Storage can remain mounted as a warmed Proxmox tab. Route effects must
+ // stay dormant while another tab is visible or the hidden surface will
+ // parse and rewrite unrelated query state on every platform navigation.
+ const isActiveStorageRoute = () => options.location.pathname.endsWith('/storage');
+
+ const routeFields = buildStorageRouteFields({
+ view,
+ setView,
+ sourceFilter,
+ setSourceFilter,
+ healthFilter,
+ setHealthFilter,
+ diskRoleFilter,
+ setDiskRoleFilter,
+ diskGroupFilter,
+ setDiskGroupFilter,
+ selectedNodeId,
+ setSelectedNodeId,
+ groupBy,
+ setGroupBy,
+ sortKey,
+ setSortKey,
+ sortDirection,
+ setSortDirection,
+ search,
+ setSearch,
+ });
+ if (options.lockedSourceFilter?.()?.trim() && routeFields.source) {
+ routeFields.source = {
+ ...routeFields.source,
+ read: () => options.lockedSourceFilter?.()?.trim() || DEFAULT_STORAGE_SOURCE_FILTER,
+ write: () => null,
+ };
+ }
useStorageRouteState({
location: options.location,
@@ -50,28 +84,7 @@ export const useStoragePageFilters = (options: UseStoragePageFiltersOptions) =>
isReadEnabled: isActiveStorageRoute,
isWriteEnabled: isActiveStorageRoute,
useCurrentPathForNavigation: true,
- fields: buildStorageRouteFields({
- view,
- setView,
- sourceFilter,
- setSourceFilter,
- healthFilter,
- setHealthFilter,
- diskRoleFilter,
- setDiskRoleFilter,
- diskGroupFilter,
- setDiskGroupFilter,
- selectedNodeId,
- setSelectedNodeId,
- groupBy,
- setGroupBy,
- sortKey,
- setSortKey,
- sortDirection,
- setSortDirection,
- search,
- setSearch,
- }),
+ fields: routeFields,
});
return {
diff --git a/frontend-modern/src/components/Storage/useStoragePageModel.ts b/frontend-modern/src/components/Storage/useStoragePageModel.ts
index 58d8fc93da..7b62866551 100644
--- a/frontend-modern/src/components/Storage/useStoragePageModel.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageModel.ts
@@ -93,6 +93,7 @@ export const useStoragePageModel = (options: UseStoragePageModelOptions = {}) =>
} = useStoragePageFilters({
location,
navigate,
+ lockedSourceFilter: options.forcedSourceFilter,
});
const storageSummaryCharts = useStorageSummaryCharts({
timeRange: summaryTimeRange,
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index fbb2f62797..2ec948670a 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -1042,7 +1042,7 @@ describe('Workloads performance contract', () => {
await waitFor(() => {
expect(getGuestRowCount(container)).toBe(
- expectedByMode[mode] > 250 ? 140 : expectedByMode[mode],
+ expectedByMode[mode] > 140 ? 140 : expectedByMode[mode],
);
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts b/frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts
index 67184a585e..b993e5a306 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts
@@ -22,6 +22,7 @@ function createHook(
result = useGroupedTableWindowing({
totalRowCount: opts.totalRowCount,
windowSize: opts.windowSize,
+ enableThreshold: opts.enableThreshold,
enabled: opts.enabled,
revealIndex: opts.revealIndex,
rowIndexAtOffset: opts.rowIndexAtOffset,
@@ -49,8 +50,8 @@ describe('useGroupedTableWindowing', () => {
// isWindowed
// ──────────────────────────────────────────────────────────────
describe('isWindowed', () => {
- it('returns false when total rows are below default threshold (250)', () => {
- const hook = setup({ totalRowCount: () => 200 });
+ it('returns false when total rows are below the default mounted-row budget', () => {
+ const hook = setup({ totalRowCount: () => 140 });
expect(hook.isWindowed()).toBe(false);
});
@@ -60,7 +61,7 @@ describe('useGroupedTableWindowing', () => {
});
it('returns false when total rows equal threshold (not exceeded)', () => {
- const hook = setup({ totalRowCount: () => 250 });
+ const hook = setup({ totalRowCount: () => 140 });
expect(hook.isWindowed()).toBe(false);
});
@@ -78,6 +79,11 @@ describe('useGroupedTableWindowing', () => {
const hook = setup({ totalRowCount: () => 0, enabled: () => true });
expect(hook.isWindowed()).toBe(false);
});
+
+ it('respects a custom activation threshold', () => {
+ const hook = setup({ totalRowCount: () => 73, enableThreshold: 72 });
+ expect(hook.isWindowed()).toBe(true);
+ });
});
// ──────────────────────────────────────────────────────────────
@@ -142,8 +148,8 @@ describe('useGroupedTableWindowing', () => {
// ──────────────────────────────────────────────────────────────
describe('mountedCount', () => {
it('equals total when not windowed', () => {
- const hook = setup({ totalRowCount: () => 200 });
- expect(hook.mountedCount()).toBe(200);
+ const hook = setup({ totalRowCount: () => 100 });
+ expect(hook.mountedCount()).toBe(100);
});
it('equals window size when windowed and total > windowSize', () => {
diff --git a/frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts b/frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts
index 7f28d23ae1..dacb3c54f9 100644
--- a/frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts
+++ b/frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts
@@ -6,6 +6,8 @@ export interface UseGroupedTableWindowingOptions {
totalRowCount: () => number;
/** Maximum rows to mount */
windowSize?: number;
+ /** Row count above which the bounded window activates */
+ enableThreshold?: number;
/** Whether windowing is enabled */
enabled?: () => boolean;
/** Index to ensure is visible (selection/deep-link reveal) */
@@ -38,7 +40,7 @@ export interface UseGroupedTableWindowingResult {
const DEFAULT_WINDOW_SIZE = 140;
// Keep even medium estates virtualized. On mobile, mounting a few hundred
// metric-heavy rows is already enough to cause long layout and paint tasks.
-const DEFAULT_ENABLE_THRESHOLD = 250;
+const DEFAULT_ENABLE_THRESHOLD = DEFAULT_WINDOW_SIZE;
const DEFAULT_OVERSCAN_ROWS = 20;
const DEFAULT_EDGE_RUNWAY_ROWS = 24;
@@ -54,7 +56,8 @@ export const useGroupedTableWindowing = (
const isWindowed = createMemo(() => {
const total = options.totalRowCount();
- const enabled = options.enabled?.() ?? total > DEFAULT_ENABLE_THRESHOLD;
+ const threshold = Math.max(0, Math.floor(options.enableThreshold ?? DEFAULT_ENABLE_THRESHOLD));
+ const enabled = options.enabled?.() ?? total > threshold;
return enabled && total > 0;
});
diff --git a/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts b/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
index 06cc1d5266..a62fac5a86 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
@@ -15,6 +15,7 @@ export interface WorkloadRouteStateOptions {
allGuests: Accessor<WorkloadGuest[]>;
forcedPlatform?: string;
forcedViewMode?: ViewMode;
+ routeStateEnabled?: Accessor<boolean>;
showFilters: Accessor<boolean>;
setShowFilters: Setter<boolean>;
}
@@ -37,6 +38,7 @@ export function useWorkloadRouteState(options: WorkloadRouteStateOptions) {
onMount(() => {
if (typeof window === 'undefined') return;
+ if (options.routeStateEnabled && !options.routeStateEnabled()) return;
const params = new URLSearchParams(location.search);
let mutated = false;
@@ -97,7 +99,7 @@ export function useWorkloadRouteState(options: WorkloadRouteStateOptions) {
const { isWorkloadsRoute } = useWorkloadUrlSync({
containerRuntime,
containerRuntimeOptions: () => filterOptions.containerRuntimeOptions(),
- routeStateEnabled: () => true,
+ routeStateEnabled: options.routeStateEnabled ?? (() => true),
kubernetesNamespaceOptions: () => filterOptions.kubernetesNamespaceOptions(),
selectedCluster,
setSelectedCluster,
diff --git a/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts b/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
index 091e69bd0a..65e1f05faf 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
@@ -19,6 +19,7 @@ interface UseWorkloadsSelectionStateOptions {
clearAdditionalPageStateOnEscape?: () => void;
filteredGuests: Accessor<WorkloadGuest[]>;
summaryGroupScopes: Accessor<Map<string, SummarySeriesGroupScope>>;
+ routeStateEnabled?: Accessor<boolean>;
}
export function useWorkloadSelectionState(options: UseWorkloadsSelectionStateOptions) {
@@ -113,6 +114,7 @@ export function useWorkloadSelectionState(options: UseWorkloadsSelectionStateOpt
};
createEffect(() => {
+ if (options.routeStateEnabled && !options.routeStateEnabled()) return;
const selection = resolveWorkloadResourceSelection(location.search);
if (!selection) {
if (handledResourceId() !== null) {
diff --git a/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts b/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
index 44d65801b1..e8b9d31689 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
@@ -1,4 +1,4 @@
-import { createMemo, createSignal, onMount, type Accessor } from 'solid-js';
+import { createEffect, createMemo, createSignal, onMount, type Accessor } from 'solid-js';
import { useLocation, useNavigate } from '@solidjs/router';
import { useBreakpoint } from '@/hooks/useBreakpoint';
@@ -57,6 +57,7 @@ interface WorkloadsControlsStateOptions {
setShowFilters: (value: boolean | ((current: boolean) => boolean)) => void;
showFilters: Accessor<boolean>;
viewMode: Accessor<ViewMode>;
+ routeStateEnabled?: Accessor<boolean>;
}
const parseWorkloadsStatusMode = (raw: string | null | undefined): WorkloadsStatusMode =>
@@ -91,6 +92,12 @@ const readSavedWorkloadsStatusMode = (scope: string | undefined): WorkloadsStatu
export function useWorkloadsControlsState(options: WorkloadsControlsStateOptions) {
const location = useLocation();
const navigate = useNavigate();
+ const routeStateEnabled = options.routeStateEnabled ?? (() => true);
+ const [activeRouteSearch, setActiveRouteSearch] = createSignal(location.search);
+ createEffect(() => {
+ if (!routeStateEnabled()) return;
+ setActiveRouteSearch(location.search);
+ });
const breakpoint = useBreakpoint();
const workloadTableLayoutMode = createMemo(() => {
const measuredWidth = options.layoutWidth?.();
@@ -104,13 +111,18 @@ export function useWorkloadsControlsState(options: WorkloadsControlsStateOptions
const [isSearchLocked, setIsSearchLocked] = createSignal(false);
const updateSearchParam = (mutate: (params: URLSearchParams) => void): void => {
- const params = new URLSearchParams(location.search);
+ if (!routeStateEnabled()) return;
+ const params = new URLSearchParams(activeRouteSearch());
mutate(params);
const query = params.toString();
+ // Router propagation is asynchronous. Keep the local URL-backed controls
+ // responsive in the same event turn, then let the location effect confirm
+ // the canonical value after navigation completes.
+ setActiveRouteSearch(query ? `?${query}` : '');
navigate(`${location.pathname}${query ? `?${query}` : ''}`, { replace: true });
};
- const search: Accessor<string> = () => new URLSearchParams(location.search).get('q') ?? '';
+ const search: Accessor<string> = () => new URLSearchParams(activeRouteSearch()).get('q') ?? '';
const setSearch = (value: string): void => {
updateSearchParam((params) => {
if (value === '') {
@@ -122,7 +134,7 @@ export function useWorkloadsControlsState(options: WorkloadsControlsStateOptions
};
const statusMode: Accessor<WorkloadsStatusMode> = () =>
- parseWorkloadsStatusMode(new URLSearchParams(location.search).get('status'));
+ parseWorkloadsStatusMode(new URLSearchParams(activeRouteSearch()).get('status'));
const setStatusMode = (value: WorkloadsStatusMode): void => {
saveWorkloadsStatusMode(options.statusModeStorageScope, value);
updateSearchParam((params) => {
@@ -136,7 +148,8 @@ export function useWorkloadsControlsState(options: WorkloadsControlsStateOptions
onMount(() => {
if (typeof window === 'undefined') return;
- const params = new URLSearchParams(location.search);
+ if (!routeStateEnabled()) return;
+ const params = new URLSearchParams(activeRouteSearch());
if (params.has('status')) return;
const saved = readSavedWorkloadsStatusMode(options.statusModeStorageScope);
if (saved !== DEFAULT_WORKLOADS_STATUS_MODE) {
diff --git a/frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts b/frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts
index 44952c5161..87c5dbe897 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts
@@ -22,6 +22,8 @@ const DESKTOP_WORKLOAD_GROUP_HEADER_HEIGHT = 33;
const PHONE_WORKLOAD_ROW_HEIGHT = 37;
const PHONE_WORKLOAD_GROUP_HEADER_HEIGHT = 28;
const WORKLOADS_TABLE_DIVIDER_HEIGHT = 1;
+const DESKTOP_WORKLOAD_WINDOW_SIZE = 140;
+const PHONE_WORKLOAD_WINDOW_SIZE = 36;
interface WorkloadsWorkloadDerivedStateOptions {
activeAlerts: Accessor<Record<string, Alert>>;
@@ -170,6 +172,8 @@ export function useWorkloadsDerivedState(options: WorkloadsWorkloadDerivedStateO
const groupedWindowing = useGroupedTableWindowing({
totalRowCount: () => filteredGuests().length,
+ windowSize: phoneRowGeometry ? PHONE_WORKLOAD_WINDOW_SIZE : DESKTOP_WORKLOAD_WINDOW_SIZE,
+ enableThreshold: phoneRowGeometry ? PHONE_WORKLOAD_WINDOW_SIZE : DESKTOP_WORKLOAD_WINDOW_SIZE,
revealIndex: revealGuestIndex,
rowIndexAtOffset: guestIndexAtVirtualOffset,
});
diff --git a/frontend-modern/src/components/Workloads/useWorkloadsState.ts b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
index 084fb7c6be..d93d778d92 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadsState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
@@ -128,6 +128,8 @@ export interface WorkloadsSurfaceProps {
groupLabelBadges?: Record<string, WorkloadGroupLabelBadge>;
/** Lets an owning platform page share one viewer-safe source-health poll. */
inventorySourcesQuery?: WorkloadsInventorySourcesQuery;
+ /** Keeps a warmed, hidden platform tab from parsing or rewriting another tab's URL state. */
+ routeStateEnabled?: Accessor<boolean>;
}
export interface WorkloadsInventorySourcesQuery {
@@ -279,6 +281,7 @@ export function useWorkloadsState(props: WorkloadsSurfaceProps) {
forcedViewMode: props.forcedViewMode,
showFilters,
setShowFilters,
+ routeStateEnabled: props.routeStateEnabled,
});
const effectiveViewMode = createMemo<ViewMode>(() => props.forcedViewMode ?? viewMode());
const setEffectiveViewMode = (value: ViewMode): void => {
@@ -331,6 +334,7 @@ export function useWorkloadsState(props: WorkloadsSurfaceProps) {
setShowFilters,
showFilters,
viewMode: effectiveViewMode,
+ routeStateEnabled: props.routeStateEnabled,
});
const infrastructureNodes = createMemo<Node[]>(() => {
@@ -496,6 +500,7 @@ export function useWorkloadsState(props: WorkloadsSurfaceProps) {
},
filteredGuests,
summaryGroupScopes,
+ routeStateEnabled: props.routeStateEnabled,
});
const {
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 3d6fd8741a..7c3987ae0a 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -533,7 +533,9 @@ describe('shared primitive guardrails', () => {
expect(patrolIntelligenceHeaderSource).not.toContain(
'flex-1 py-1.5 px-2 text-xs font-semibold rounded-md transition-all duration-200',
);
- expect(proxmoxBackupsTableSource).toContain('FilterSegmentedControl');
+ // Backup workspaces are route tabs, so they use the canonical platform
+ // navigation primitive instead of recreating segmented-control chrome.
+ expect(proxmoxBackupsTableSource).toContain('PlatformSectionTabs');
expect(proxmoxBackupsTableSource).not.toContain('FilterButtonGroup');
expect(proxmoxBackupsTableSource).not.toContain('const viewButtonClass');
expect(proxmoxBackupsTableSource).not.toContain(
diff --git a/frontend-modern/src/features/actions/__tests__/actionsWatchOnlyEmptyState.test.ts b/frontend-modern/src/features/actions/__tests__/actionsWatchOnlyEmptyState.test.ts
index 08bccd3e11..a2423ac2ac 100644
--- a/frontend-modern/src/features/actions/__tests__/actionsWatchOnlyEmptyState.test.ts
+++ b/frontend-modern/src/features/actions/__tests__/actionsWatchOnlyEmptyState.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest';
+import actionsSource from '@/pages/Actions.tsx?raw';
import { getActionsWatchOnlyEmptyState } from '../actionPresentation';
const base = {
@@ -11,6 +12,11 @@ const base = {
};
describe('getActionsWatchOnlyEmptyState', () => {
+ it('keeps large action inventories on the shared bounded list renderer', () => {
+ expect(actionsSource).toContain('PlatformWindowedList');
+ expect(actionsSource).toContain('estimatedItemHeight={92}');
+ });
+
it('returns nothing when Patrol is not in Watch only', () => {
expect(getActionsWatchOnlyEmptyState({ ...base, patrolWatchOnly: false })).toBeUndefined();
expect(
diff --git a/frontend-modern/src/features/alerts/AlertHistoryMobileList.tsx b/frontend-modern/src/features/alerts/AlertHistoryMobileList.tsx
index fb73f25ab6..bc6bed8649 100644
--- a/frontend-modern/src/features/alerts/AlertHistoryMobileList.tsx
+++ b/frontend-modern/src/features/alerts/AlertHistoryMobileList.tsx
@@ -1,4 +1,4 @@
-import { For, Show } from 'solid-js';
+import { Show, createMemo } from 'solid-js';
import { IncidentTimelinePanel } from '@/components/Alerts/IncidentTimelinePanel';
import { getAlertHistoryResourceTypeBadgeClass } from '@/utils/alertHistoryPresentation';
@@ -9,6 +9,7 @@ import {
import { AlertHistoryItemActions } from './AlertHistoryItemActions';
import { AlertResourceIncidentsPanel } from './AlertResourceIncidentsPanel';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
import { getGroupSummaryLabel } from './AlertHistoryTableGroupRow';
import type { AlertHistoryState } from './useAlertHistoryState';
@@ -16,141 +17,145 @@ interface AlertHistoryMobileListProps {
state: AlertHistoryState;
}
+type AlertHistoryGroup = ReturnType<AlertHistoryState['groupedAlerts']>[number];
+type AlertHistoryAlert = AlertHistoryGroup['alerts'][number];
+type AlertHistoryMobileItem =
+ | { kind: 'group'; key: string; group: AlertHistoryGroup }
+ | { kind: 'alert'; key: string; alert: AlertHistoryAlert };
+
export function AlertHistoryMobileList(props: AlertHistoryMobileListProps) {
+ const mobileItems = createMemo<AlertHistoryMobileItem[]>(() => {
+ const items: AlertHistoryMobileItem[] = [];
+ for (const [groupIndex, group] of props.state.groupedAlerts().entries()) {
+ items.push({ kind: 'group', key: `group:${groupIndex}:${group.fullLabel}`, group });
+ for (const alert of group.alerts) {
+ items.push({ kind: 'alert', key: `alert:${alert.id}:${alert.startTime}`, alert });
+ }
+ }
+ return items;
+ });
+
return (
<div class="space-y-3 md:hidden" data-testid="alert-history-mobile-list">
- <For each={props.state.groupedAlerts()}>
- {(group) => (
- <section class="overflow-hidden rounded-lg border border-border bg-surface">
- <header class="flex items-start justify-between gap-3 border-b border-border bg-surface-alt px-3 py-2">
- <h3
- class="min-w-0 truncate text-xs font-semibold text-base-content"
- title={group.fullLabel}
- >
- {group.label}
- </h3>
- <span class="shrink-0 text-[10px] text-muted">{getGroupSummaryLabel(group)}</span>
- </header>
+ <PlatformWindowedList
+ items={mobileItems}
+ estimatedItemHeight={260}
+ enableThreshold={18}
+ windowSize={24}
+ >
+ {(item) => {
+ if (item.kind === 'group') {
+ return (
+ <header class="flex items-start justify-between gap-3 rounded-lg border border-border bg-surface-alt px-3 py-2">
+ <h3
+ class="min-w-0 truncate text-xs font-semibold text-base-content"
+ title={item.group.fullLabel}
+ >
+ {item.group.label}
+ </h3>
+ <span class="shrink-0 text-[10px] text-muted">
+ {getGroupSummaryLabel(item.group)}
+ </span>
+ </header>
+ );
+ }
- <div class="divide-y divide-border-subtle">
- <For each={group.alerts}>
- {(alert) => {
- const rowKey = () => props.state.getIncidentRowKey(alert);
- const status = () => getAlertHistoryStatusPresentation(alert.status);
+ const alert = item.alert;
+ const rowKey = () => props.state.getIncidentRowKey(alert);
+ const status = () => getAlertHistoryStatusPresentation(alert.status);
- return (
- <article class={`p-3 ${status().rowClassName}`}>
- <div class="flex items-start justify-between gap-3">
- <div class="min-w-0">
- <h4
- class="truncate text-sm font-semibold text-base-content"
- title={alert.resourceName}
- >
- {alert.resourceName}
- </h4>
- <span
- class={`${getAlertHistoryResourceTypeBadgeClass(alert.resourceType)} mt-1 inline-flex`}
- title={alert.resourceType}
- >
- {alert.title}
- </span>
- </div>
- <div class="flex shrink-0 flex-col items-end gap-1">
- <span class={getAlertIncidentLevelBadgeClass(alert.severity)}>
- {alert.severity}
- </span>
- <span class={status().className}>{status().label}</span>
- </div>
- </div>
+ return (
+ <article
+ class={`overflow-hidden rounded-lg border border-border bg-surface p-3 ${status().rowClassName}`}
+ >
+ <div class="flex items-start justify-between gap-3">
+ <div class="min-w-0">
+ <h4
+ class="truncate text-sm font-semibold text-base-content"
+ title={alert.resourceName}
+ >
+ {alert.resourceName}
+ </h4>
+ <span
+ class={`${getAlertHistoryResourceTypeBadgeClass(alert.resourceType)} mt-1 inline-flex`}
+ title={alert.resourceType}
+ >
+ {alert.title}
+ </span>
+ </div>
+ <div class="flex shrink-0 flex-col items-end gap-1">
+ <span class={getAlertIncidentLevelBadgeClass(alert.severity)}>
+ {alert.severity}
+ </span>
+ <span class={status().className}>{status().label}</span>
+ </div>
+ </div>
- <p class="mt-2 text-xs leading-relaxed text-base-content">
- {alert.description}
- </p>
+ <p class="mt-2 text-xs leading-relaxed text-base-content">{alert.description}</p>
- <dl class="mt-3 grid grid-cols-3 gap-2 text-[10px] text-muted">
- <div>
- <dt class="uppercase tracking-wide">Time</dt>
- <dd
- class="mt-0.5 font-mono text-base-content"
- title={props.state.formatAlertRowTimestamp(alert.startTime)}
- >
- {props.state.formatAlertRowTime(alert.startTime)}
- </dd>
- </div>
- <div>
- <dt class="uppercase tracking-wide">Duration</dt>
- <dd class="mt-0.5 text-base-content">{alert.duration}</dd>
- </div>
- <div class="min-w-0">
- <dt class="uppercase tracking-wide">Node</dt>
- <dd
- class="mt-0.5 truncate text-base-content"
- title={alert.nodeDisplayName || alert.node || ''}
- >
- {alert.nodeDisplayName || alert.node || '—'}
- </dd>
- </div>
- </dl>
+ <dl class="mt-3 grid grid-cols-3 gap-2 text-[10px] text-muted">
+ <div>
+ <dt class="uppercase tracking-wide">Time</dt>
+ <dd
+ class="mt-0.5 font-mono text-base-content"
+ title={props.state.formatAlertRowTimestamp(alert.startTime)}
+ >
+ {props.state.formatAlertRowTime(alert.startTime)}
+ </dd>
+ </div>
+ <div>
+ <dt class="uppercase tracking-wide">Duration</dt>
+ <dd class="mt-0.5 text-base-content">{alert.duration}</dd>
+ </div>
+ <div class="min-w-0">
+ <dt class="uppercase tracking-wide">Node</dt>
+ <dd
+ class="mt-0.5 truncate text-base-content"
+ title={alert.nodeDisplayName || alert.node || ''}
+ >
+ {alert.nodeDisplayName || alert.node || '—'}
+ </dd>
+ </div>
+ </dl>
- <AlertHistoryItemActions
- alert={alert}
- state={props.state}
- class="mt-3"
- touchSized
- />
+ <AlertHistoryItemActions alert={alert} state={props.state} class="mt-3" touchSized />
- <Show
- when={
- alert.source === 'alert' && props.state.expandedIncidents().has(rowKey())
- }
- >
- <div class="mt-3 border-t border-border pt-3">
- <IncidentTimelinePanel
- loading={props.state.incidentLoading()[rowKey()]}
- error={props.state.incidentErrors()[rowKey()]}
- timeline={props.state.incidentTimelines()[rowKey()]}
- filters={props.state.historyIncidentEventFilters}
- setFilters={props.state.setHistoryIncidentEventFilters}
- filterVariant="compact"
- eventCardVariant="surface"
- noteDraft={props.state.incidentNoteDrafts()[rowKey()] || ''}
- onNoteDraftChange={(value) =>
- props.state.setIncidentNoteDraft(rowKey(), value)
- }
- noteSaving={props.state.incidentNoteSaving().has(rowKey())}
- onSaveNote={() => {
- void props.state.saveIncidentNote(
- rowKey(),
- alert.id,
- alert.startTime,
- );
- }}
- onRetry={() => {
- void props.state.loadIncidentTimeline(
- rowKey(),
- alert.id,
- alert.startTime,
- );
- }}
- />
- </div>
- </Show>
+ <Show
+ when={alert.source === 'alert' && props.state.expandedIncidents().has(rowKey())}
+ >
+ <div class="mt-3 border-t border-border pt-3">
+ <IncidentTimelinePanel
+ loading={props.state.incidentLoading()[rowKey()]}
+ error={props.state.incidentErrors()[rowKey()]}
+ timeline={props.state.incidentTimelines()[rowKey()]}
+ filters={props.state.historyIncidentEventFilters}
+ setFilters={props.state.setHistoryIncidentEventFilters}
+ filterVariant="compact"
+ eventCardVariant="surface"
+ noteDraft={props.state.incidentNoteDrafts()[rowKey()] || ''}
+ onNoteDraftChange={(value) => props.state.setIncidentNoteDraft(rowKey(), value)}
+ noteSaving={props.state.incidentNoteSaving().has(rowKey())}
+ onSaveNote={() => {
+ void props.state.saveIncidentNote(rowKey(), alert.id, alert.startTime);
+ }}
+ onRetry={() => {
+ void props.state.loadIncidentTimeline(rowKey(), alert.id, alert.startTime);
+ }}
+ />
+ </div>
+ </Show>
- {/* Same reasoning as the desktop row: the panel belongs
+ {/* Same reasoning as the desktop row: the panel belongs
under the card that asked for it, not at page level. */}
- <Show when={props.state.resourceIncidentPanel()?.rowKey === rowKey()}>
- <div class="mt-3 border-t border-border pt-3">
- <AlertResourceIncidentsPanel state={props.state} />
- </div>
- </Show>
- </article>
- );
- }}
- </For>
- </div>
- </section>
- )}
- </For>
+ <Show when={props.state.resourceIncidentPanel()?.rowKey === rowKey()}>
+ <div class="mt-3 border-t border-border pt-3">
+ <AlertResourceIncidentsPanel state={props.state} />
+ </div>
+ </Show>
+ </article>
+ );
+ }}
+ </PlatformWindowedList>
</div>
);
}
diff --git a/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx b/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx
index 4de7d5a1cf..4760ce5ab9 100644
--- a/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx
+++ b/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx
@@ -1,8 +1,9 @@
-import { For, Show } from 'solid-js';
+import { Show, createMemo } from 'solid-js';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/shared/Table';
import { TableCard } from '@/components/shared/TableCard';
import { getPlatformTableHeadClassForKind } from '@/features/platformPage/sharedPlatformPage';
+import { PlatformWindowedRows } from '@/features/platformPage/PlatformWindowedRows';
import {
getAlertHistoryEmptyState,
getAlertHistoryLoadingState,
@@ -18,7 +19,24 @@ interface AlertHistoryTableSectionProps {
state: AlertHistoryState;
}
+type AlertHistoryGroup = ReturnType<AlertHistoryState['groupedAlerts']>[number];
+type AlertHistoryAlert = AlertHistoryGroup['alerts'][number];
+type AlertHistoryRenderItem =
+ | { kind: 'group'; key: string; group: AlertHistoryGroup }
+ | { kind: 'alert'; key: string; alert: AlertHistoryAlert };
+
export function AlertHistoryTableSection(props: AlertHistoryTableSectionProps) {
+ const renderItems = createMemo<AlertHistoryRenderItem[]>(() => {
+ const items: AlertHistoryRenderItem[] = [];
+ for (const [groupIndex, group] of props.state.groupedAlerts().entries()) {
+ items.push({ kind: 'group', key: `group:${groupIndex}:${group.fullLabel}`, group });
+ for (const alert of group.alerts) {
+ items.push({ kind: 'alert', key: `alert:${alert.id}:${alert.startTime}`, alert });
+ }
+ }
+ return items;
+ });
+
return (
<Show
when={props.state.loading()}
@@ -97,19 +115,15 @@ export function AlertHistoryTableSection(props: AlertHistoryTableSectionProps) {
</TableRow>
</TableHeader>
<TableBody>
- <For each={props.state.groupedAlerts()}>
- {(group) => (
- <>
- <AlertHistoryTableGroupRow group={group} />
-
- <For each={group.alerts}>
- {(alert) => (
- <AlertHistoryTableAlertRow alert={alert} state={props.state} />
- )}
- </For>
- </>
- )}
- </For>
+ <PlatformWindowedRows items={renderItems} estimatedRowHeight={40}>
+ {(item) =>
+ item.kind === 'group' ? (
+ <AlertHistoryTableGroupRow group={item.group} />
+ ) : (
+ <AlertHistoryTableAlertRow alert={item.alert} state={props.state} />
+ )
+ }
+ </PlatformWindowedRows>
</TableBody>
</Table>
</TableCard>
diff --git a/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx b/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
index 4cbad84dc1..f3e62f18cb 100644
--- a/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
+++ b/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
@@ -1,6 +1,7 @@
import { For, Show } from 'solid-js';
import { SectionHeader } from '@/components/shared/SectionHeader';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
import type { Alert } from '@/types/api';
import {
getAlertOverviewAcknowledgedToggleLabel,
@@ -118,7 +119,12 @@ export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlert
{getAlertListEmptyState(props.showAcknowledged)}
</div>
</Show>
- <For each={props.state.groupedAlerts()}>
+ <PlatformWindowedList
+ items={props.state.groupedAlerts}
+ estimatedItemHeight={180}
+ enableThreshold={24}
+ windowSize={32}
+ >
{(group) => (
<div>
<AlertOverviewAlertCard
@@ -168,7 +174,7 @@ export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlert
</Show>
</div>
)}
- </For>
+ </PlatformWindowedList>
</div>
</Show>
</div>
diff --git a/frontend-modern/src/features/docker/DockerAlertsTable.tsx b/frontend-modern/src/features/docker/DockerAlertsTable.tsx
index 2e36b9907e..8cf67dd717 100644
--- a/frontend-modern/src/features/docker/DockerAlertsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerAlertsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
+import { Show, type Component, type JSX } from 'solid-js';
import {
InlineDetailPanel,
compactDetailRows,
@@ -10,6 +10,7 @@ import { AlertSeverityBadge, AlertSeverityDot } from '@/components/shared/AlertS
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import {
+ PlatformWindowedRows,
PlatformTableEmptyState,
PlatformTableToolbar,
createPlatformTableFilterState,
@@ -198,7 +199,7 @@ export const DockerAlertsTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(incident) => {
const docker = () => incident.resource.docker;
const detailRowId = () => drawer.detailRowId(incident);
@@ -298,7 +299,7 @@ export const DockerAlertsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerConfigsTable.tsx b/frontend-modern/src/features/docker/DockerConfigsTable.tsx
index aaa831e441..84090b60ee 100644
--- a/frontend-modern/src/features/docker/DockerConfigsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerConfigsTable.tsx
@@ -1,8 +1,9 @@
-import { For, Show, createMemo, type Component } from 'solid-js';
+import { Show, createMemo, type Component } from 'solid-js';
import { TableCell, TableRow } from '@/components/shared/Table';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -161,7 +162,7 @@ export const DockerConfigsTable: Component<DockerNativeTableProps> = (props) =>
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const detailRowId = () => drawer.detailRowId(resource);
const isExpanded = () => drawer.isExpanded(resource);
@@ -238,7 +239,7 @@ export const DockerConfigsTable: Component<DockerNativeTableProps> = (props) =>
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerContainersTable.tsx b/frontend-modern/src/features/docker/DockerContainersTable.tsx
index d4af30d98c..edd0116bf4 100644
--- a/frontend-modern/src/features/docker/DockerContainersTable.tsx
+++ b/frontend-modern/src/features/docker/DockerContainersTable.tsx
@@ -42,6 +42,7 @@ import {
getPlatformTableFiniteMetric,
getPlatformTableCellClassForKind,
PlatformTableShell,
+ PlatformWindowedRows,
type PlatformTableSortValue,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
@@ -96,6 +97,10 @@ type DockerContainerHostGroup = {
rows: Resource[];
};
+type DockerContainerRenderItem =
+ | { kind: 'group'; key: string; group: DockerContainerHostGroup }
+ | { kind: 'resource'; key: string; resource: Resource };
+
const networkLabel = (network: DockerNetwork): string => {
const name = asTrimmedString(network.name);
const address = asTrimmedString(network.ipv4) || asTrimmedString(network.ipv6);
@@ -423,6 +428,16 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
.sort(([a], [b]) => a.localeCompare(b))
.map(([host, rows]) => ({ host, hostResource: hostResourceByName().get(host), rows }));
});
+ const groupedRenderItems = createMemo<DockerContainerRenderItem[]>(() => {
+ const items: DockerContainerRenderItem[] = [];
+ for (const group of groupedRows()) {
+ items.push({ kind: 'group', key: `group:${group.host}`, group });
+ for (const resource of group.rows) {
+ items.push({ kind: 'resource', key: `resource:${resource.id}`, resource });
+ }
+ }
+ return items;
+ });
// Runtime is host-level data repeated on every container row; it only
// informs when the fleet actually mixes runtimes (docker vs podman).
const showRuntimeColumn = createMemo(() => {
@@ -824,17 +839,18 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
<Show
when={groupingMode() === 'grouped'}
fallback={
- <For each={sortedRows()}>{(resource) => renderContainerRow(resource)}</For>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
+ {(resource) => renderContainerRow(resource)}
+ </PlatformWindowedRows>
}
>
- <For each={groupedRows()}>
- {(group) => (
- <>
- {renderHostGroupHeader(group)}
- <For each={group.rows}>{(resource) => renderContainerRow(resource)}</For>
- </>
- )}
- </For>
+ <PlatformWindowedRows items={groupedRenderItems} estimatedRowHeight={32}>
+ {(item) =>
+ item.kind === 'group'
+ ? renderHostGroupHeader(item.group)
+ : renderContainerRow(item.resource)
+ }
+ </PlatformWindowedRows>
</Show>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerHostsTable.tsx b/frontend-modern/src/features/docker/DockerHostsTable.tsx
index e2065cc857..2d97c213b5 100644
--- a/frontend-modern/src/features/docker/DockerHostsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerHostsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
import { StatusDot } from '@/components/shared/StatusDot';
@@ -16,6 +16,7 @@ import { asTrimmedString } from '@/utils/stringUtils';
import { normalizeDiskArray } from '@/utils/format';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformResponsiveTableLabel,
@@ -334,7 +335,7 @@ export const DockerHostsTable: Component<{
}
body={
<>
- <For each={sortedHosts()}>
+ <PlatformWindowedRows items={sortedHosts} estimatedRowHeight={32}>
{(host) => {
const docker = () => dockerHostMeta(host);
const name = () => asTrimmedString(host.name) || host.id;
@@ -522,7 +523,7 @@ export const DockerHostsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerImagesTable.tsx b/frontend-modern/src/features/docker/DockerImagesTable.tsx
index 78a9c335a3..c8a663580b 100644
--- a/frontend-modern/src/features/docker/DockerImagesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerImagesTable.tsx
@@ -1,6 +1,7 @@
-import { For, Show, createMemo, type Component } from 'solid-js';
+import { Show, createMemo, type Component } from 'solid-js';
import { TableCell, TableRow } from '@/components/shared/Table';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -183,7 +184,7 @@ export const DockerImagesTable: Component<
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const operational = () =>
getDockerImageOperationalPresentation(
@@ -254,7 +255,7 @@ export const DockerImagesTable: Component<
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerNetworksTable.tsx b/frontend-modern/src/features/docker/DockerNetworksTable.tsx
index 4af12600ce..772862aded 100644
--- a/frontend-modern/src/features/docker/DockerNetworksTable.tsx
+++ b/frontend-modern/src/features/docker/DockerNetworksTable.tsx
@@ -14,6 +14,7 @@ import {
getPlatformTableHeadClassForKind,
type PlatformTableContainerLayout,
PlatformTableShell,
+ PlatformWindowedRows,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
import { useObservedElementWidth } from '@/hooks/useObservedElementWidth';
@@ -513,7 +514,7 @@ export const DockerNetworksTable: Component<DockerNetworksTableProps> = (props)
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(resource) => {
const detailRowId = () => drawer.detailRowId(resource);
const isExpanded = () => drawer.isExpanded(resource);
@@ -606,7 +607,7 @@ export const DockerNetworksTable: Component<DockerNetworksTableProps> = (props)
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerSecretsTable.tsx b/frontend-modern/src/features/docker/DockerSecretsTable.tsx
index dca1712448..53b4e3476c 100644
--- a/frontend-modern/src/features/docker/DockerSecretsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerSecretsTable.tsx
@@ -1,8 +1,9 @@
-import { For, Show, createMemo, type Component } from 'solid-js';
+import { Show, createMemo, type Component } from 'solid-js';
import { TableCell, TableRow } from '@/components/shared/Table';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -171,7 +172,7 @@ export const DockerSecretsTable: Component<DockerNativeTableProps> = (props) =>
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const detailRowId = () => drawer.detailRowId(resource);
const isExpanded = () => drawer.isExpanded(resource);
@@ -254,7 +255,7 @@ export const DockerSecretsTable: Component<DockerNativeTableProps> = (props) =>
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerServicesTable.tsx b/frontend-modern/src/features/docker/DockerServicesTable.tsx
index 3d04272810..7381353101 100644
--- a/frontend-modern/src/features/docker/DockerServicesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerServicesTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableNumberValue,
@@ -283,7 +284,7 @@ export const DockerServicesTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(service) => {
const name = () => asTrimmedString(service.name) || service.id;
const stack = () => dockerServiceStack(service) || '—';
@@ -400,7 +401,7 @@ export const DockerServicesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerStorageUsageTable.tsx b/frontend-modern/src/features/docker/DockerStorageUsageTable.tsx
index 2a42ed40b0..31193cddd4 100644
--- a/frontend-modern/src/features/docker/DockerStorageUsageTable.tsx
+++ b/frontend-modern/src/features/docker/DockerStorageUsageTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
+import { Show, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
@@ -10,6 +10,7 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformTableEmptyState,
@@ -151,7 +152,7 @@ export const DockerStorageUsageTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(host) => {
const name = () => asTrimmedString(host.name) || host.id;
const indicator = () => getSimpleStatusIndicator(host.status);
@@ -248,7 +249,7 @@ export const DockerStorageUsageTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx b/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx
index 417fc020d8..af8c75e8ba 100644
--- a/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx
@@ -1,8 +1,9 @@
-import { For, Show, createMemo, type Component } from 'solid-js';
+import { Show, createMemo, type Component } from 'solid-js';
import { TableCell, TableRow } from '@/components/shared/Table';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -219,7 +220,7 @@ export const DockerSwarmNodesTable: Component<DockerNativeTableProps> = (props)
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const managerReachability = () =>
dockerTextValue(
@@ -325,7 +326,7 @@ export const DockerSwarmNodesTable: Component<DockerNativeTableProps> = (props)
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerTasksTable.tsx b/frontend-modern/src/features/docker/DockerTasksTable.tsx
index a13b6870d0..2df8695d91 100644
--- a/frontend-modern/src/features/docker/DockerTasksTable.tsx
+++ b/frontend-modern/src/features/docker/DockerTasksTable.tsx
@@ -1,8 +1,9 @@
-import { For, Show, createMemo, type Component } from 'solid-js';
+import { Show, createMemo, type Component } from 'solid-js';
import { TableCell, TableRow } from '@/components/shared/Table';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -194,7 +195,7 @@ export const DockerTasksTable: Component<DockerNativeTableProps> = (props) => {
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const detailRowId = () => drawer.detailRowId(resource);
const isExpanded = () => drawer.isExpanded(resource);
@@ -293,7 +294,7 @@ export const DockerTasksTable: Component<DockerNativeTableProps> = (props) => {
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/docker/DockerVolumesTable.tsx b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
index 2ef4a2ce18..28a2e56d4b 100644
--- a/frontend-modern/src/features/docker/DockerVolumesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
@@ -1,7 +1,8 @@
-import { For, Show, createMemo, type Component } from 'solid-js';
+import { Show, createMemo, type Component } from 'solid-js';
import { TableCell, TableRow } from '@/components/shared/Table';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -199,7 +200,7 @@ export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) =>
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const detailRowId = () => drawer.detailRowId(resource);
const isExpanded = () => drawer.isExpanded(resource);
@@ -280,7 +281,7 @@ export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) =>
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx
index abd4152a1f..f7a3a0824c 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
+import { Show, type Component, type JSX } from 'solid-js';
import {
InlineDetailPanel,
compactDetailRows,
@@ -10,6 +10,7 @@ import { AlertSeverityBadge, AlertSeverityDot } from '@/components/shared/AlertS
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import {
+ PlatformWindowedRows,
PlatformTableEmptyState,
PlatformTableToolbar,
createPlatformTableFilterState,
@@ -202,7 +203,7 @@ export const KubernetesAlertsTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(incident) => {
const k = () => incident.resource.kubernetes;
const detailRowId = () => drawer.detailRowId(incident);
@@ -308,7 +309,7 @@ export const KubernetesAlertsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
index 5c9611c827..1e51fd0891 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -232,7 +233,7 @@ export const KubernetesAutoscalingTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => getSimpleStatusIndicator(resource.status);
const name = () => autoscalerName(resource);
@@ -335,7 +336,7 @@ export const KubernetesAutoscalingTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx
index 06a20502a6..2517d7c8ab 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -10,6 +10,7 @@ import { asTrimmedString } from '@/utils/stringUtils';
import { useAlertsActivation } from '@/stores/alertsActivation';
import { unifiedPlatformOverrideIdCandidates } from '@/features/alerts/alertOverridesModel';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableCountRatioValue,
@@ -248,7 +249,7 @@ export const KubernetesClustersTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(cluster) => {
const name = () =>
asTrimmedString(cluster.kubernetes?.clusterName) ||
@@ -430,7 +431,7 @@ export const KubernetesClustersTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
index eecf1f8da2..05b1ad534b 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -316,7 +317,7 @@ export const KubernetesConfigTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => getSimpleStatusIndicator(resource.status);
const name = () => configName(resource);
@@ -409,7 +410,7 @@ export const KubernetesConfigTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
index d3ed73629c..0c6622253b 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getResourceTypeLabel } from '@/utils/resourceTypePresentation';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -353,7 +354,7 @@ export const KubernetesControllersTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => mapKubernetesControllerStatus(resource);
const name = () => controllerName(resource);
@@ -455,7 +456,7 @@ export const KubernetesControllersTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
index 4467e35f53..5180a71dd4 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableNumberValue,
@@ -243,7 +244,7 @@ export const KubernetesDeploymentsTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(deployment) => {
const name = () => asTrimmedString(deployment.name) || deployment.id;
const ns = () => formatPlatformTableTextValue(deployment.kubernetes?.namespace);
@@ -346,7 +347,7 @@ export const KubernetesDeploymentsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
index b1195756ca..bfcd01c1e2 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
@@ -1,8 +1,9 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformTableEmptyState,
@@ -155,7 +156,7 @@ export const KubernetesEventsTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(resource) => {
const indicator = () =>
mapKubernetesEventSeverity(resource.kubernetes?.eventType);
@@ -263,7 +264,7 @@ export const KubernetesEventsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx
index 7cae9da19c..cf71f01bfb 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -260,7 +261,7 @@ export const KubernetesNetworkingTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => getSimpleStatusIndicator(resource.status);
const name = () => resourceName(resource);
@@ -360,7 +361,7 @@ export const KubernetesNetworkingTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx
index af9eb1730c..33cd9f5352 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -11,6 +11,7 @@ import { useAlertsActivation } from '@/stores/alertsActivation';
import { unifiedPlatformOverrideIdCandidates } from '@/features/alerts/alertOverridesModel';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableMetricFallback,
@@ -280,7 +281,7 @@ export const KubernetesNodesTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(node) => {
const meta = () => node.kubernetes;
const name = () => asTrimmedString(node.name) || node.id;
@@ -444,7 +445,7 @@ export const KubernetesNodesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
index c624184e08..bc4488790c 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -286,7 +287,7 @@ export const KubernetesPodsTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => mapKubernetesPodStatus(resource);
const name = () => podName(resource);
@@ -396,7 +397,7 @@ export const KubernetesPodsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx
index 1396b2a17a..a508dda80e 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
+import { Show, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformTableEmptyState,
@@ -283,7 +284,7 @@ export const KubernetesPolicyTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => getSimpleStatusIndicator(resource.status);
const name = () => policyName(resource);
@@ -377,7 +378,7 @@ export const KubernetesPolicyTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx
index 7d699d5925..0dc6c9ab36 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx
@@ -1,10 +1,11 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -218,7 +219,7 @@ export const KubernetesServicesTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => getSimpleStatusIndicator(resource.status);
const name = () => serviceName(resource);
@@ -322,7 +323,7 @@ export const KubernetesServicesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx
index 8d4ae39278..3828bb4004 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -340,7 +341,7 @@ export const KubernetesStorageTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const indicator = () => getSimpleStatusIndicator(resource.status);
const name = () => storageName(resource);
@@ -440,7 +441,7 @@ export const KubernetesStorageTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/platformPage/PlatformWindowedList.tsx b/frontend-modern/src/features/platformPage/PlatformWindowedList.tsx
new file mode 100644
index 0000000000..9aa3897d25
--- /dev/null
+++ b/frontend-modern/src/features/platformPage/PlatformWindowedList.tsx
@@ -0,0 +1,41 @@
+import { For, Show, type Accessor, type JSX } from 'solid-js';
+
+import { usePlatformWindowedItems } from './usePlatformWindowedItems';
+
+export interface PlatformWindowedListProps<Item> {
+ items: Accessor<readonly Item[]>;
+ children: (item: Item, index: Accessor<number>) => JSX.Element;
+ estimatedItemHeight?: number;
+ enableThreshold?: number;
+ windowSize?: number;
+}
+
+/** Canonical bounded renderer for native-scrolling platform card/list surfaces. */
+export function PlatformWindowedList<Item>(props: PlatformWindowedListProps<Item>) {
+ const windowing = usePlatformWindowedItems({
+ items: props.items,
+ estimatedItemHeight: props.estimatedItemHeight,
+ enableThreshold: props.enableThreshold,
+ windowSize: props.windowSize,
+ });
+ const renderItems = (items: readonly Item[], globalOffset: number) => (
+ <For each={items}>{(item, index) => props.children(item, () => globalOffset + index())}</For>
+ );
+
+ return (
+ <Show when={windowing.isWindowed()} fallback={renderItems(props.items(), 0)}>
+ <div
+ ref={windowing.setAnchorRef}
+ aria-hidden="true"
+ data-platform-window-spacer="top"
+ style={{ height: `${windowing.topSpacerHeight()}px` }}
+ />
+ {renderItems(windowing.visibleItems(), windowing.startIndex())}
+ <div
+ aria-hidden="true"
+ data-platform-window-spacer="bottom"
+ style={{ height: `${windowing.bottomSpacerHeight()}px` }}
+ />
+ </Show>
+ );
+}
diff --git a/frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx b/frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx
new file mode 100644
index 0000000000..89731cccf3
--- /dev/null
+++ b/frontend-modern/src/features/platformPage/PlatformWindowedRows.tsx
@@ -0,0 +1,61 @@
+import { For, Show, type Accessor, type JSX } from 'solid-js';
+
+import { usePlatformWindowedItems } from './usePlatformWindowedItems';
+
+export interface PlatformWindowedRowsProps<Row> {
+ items: Accessor<readonly Row[]>;
+ children: (item: Row, index: Accessor<number>) => JSX.Element;
+ colSpan?: number;
+ estimatedRowHeight?: number;
+ enableThreshold?: number;
+ windowSize?: number;
+}
+
+/**
+ * Canonical bounded renderer for ordinary platform table rows.
+ *
+ * The full filtered/sorted result remains in memory, while only a directional
+ * runway is mounted. Spacer rows preserve native page scrolling and wheel/touch
+ * listeners move the runway before the compositor advances the viewport.
+ */
+export function PlatformWindowedRows<Row>(props: PlatformWindowedRowsProps<Row>) {
+ const windowing = usePlatformWindowedItems({
+ items: props.items,
+ estimatedItemHeight: props.estimatedRowHeight,
+ enableThreshold: props.enableThreshold,
+ windowSize: props.windowSize,
+ });
+
+ const renderRows = (items: readonly Row[], globalOffset: number) => (
+ <For each={items}>{(item, index) => props.children(item, () => globalOffset + index())}</For>
+ );
+
+ return (
+ <Show when={windowing.isWindowed()} fallback={renderRows(props.items(), 0)}>
+ <tr
+ ref={windowing.setAnchorRef}
+ aria-hidden="true"
+ data-platform-window-spacer="top"
+ style={{ height: `${windowing.topSpacerHeight()}px` }}
+ >
+ <td
+ colspan={props.colSpan ?? 100}
+ class="!p-0"
+ style={{ height: `${windowing.topSpacerHeight()}px` }}
+ />
+ </tr>
+ {renderRows(windowing.visibleItems(), windowing.startIndex())}
+ <tr
+ aria-hidden="true"
+ data-platform-window-spacer="bottom"
+ style={{ height: `${windowing.bottomSpacerHeight()}px` }}
+ >
+ <td
+ colspan={props.colSpan ?? 100}
+ class="!p-0"
+ style={{ height: `${windowing.bottomSpacerHeight()}px` }}
+ />
+ </tr>
+ </Show>
+ );
+}
diff --git a/frontend-modern/src/features/platformPage/__tests__/PlatformWindowedRows.test.tsx b/frontend-modern/src/features/platformPage/__tests__/PlatformWindowedRows.test.tsx
new file mode 100644
index 0000000000..ade170a95d
--- /dev/null
+++ b/frontend-modern/src/features/platformPage/__tests__/PlatformWindowedRows.test.tsx
@@ -0,0 +1,53 @@
+import { cleanup, render } from '@solidjs/testing-library';
+import { afterEach, describe, expect, it } from 'vitest';
+
+import { PlatformWindowedRows } from '../PlatformWindowedRows';
+import { PlatformWindowedList } from '../PlatformWindowedList';
+
+describe('PlatformWindowedRows', () => {
+ afterEach(cleanup);
+
+ it('mounts small tables in full without virtual spacer rows', () => {
+ const items = () => Array.from({ length: 20 }, (_, index) => index);
+ const { container } = render(() => (
+ <table>
+ <tbody>
+ <PlatformWindowedRows items={items}>
+ {(item) => <tr data-row-id={item} />}
+ </PlatformWindowedRows>
+ </tbody>
+ </table>
+ ));
+
+ expect(container.querySelectorAll('[data-row-id]')).toHaveLength(20);
+ expect(container.querySelectorAll('[data-platform-window-spacer]')).toHaveLength(0);
+ });
+
+ it('keeps estate-sized tables within the shared mounted-row budget', () => {
+ const items = () => Array.from({ length: 1_000 }, (_, index) => index);
+ const { container } = render(() => (
+ <table>
+ <tbody>
+ <PlatformWindowedRows items={items}>
+ {(item) => <tr data-row-id={item} />}
+ </PlatformWindowedRows>
+ </tbody>
+ </table>
+ ));
+
+ expect(container.querySelectorAll('[data-row-id]')).toHaveLength(140);
+ expect(container.querySelectorAll('[data-platform-window-spacer]')).toHaveLength(2);
+ });
+
+ it('keeps estate-sized card lists within their configured mounted-item budget', () => {
+ const items = () => Array.from({ length: 1_000 }, (_, index) => index);
+ const { container } = render(() => (
+ <PlatformWindowedList items={items} enableThreshold={24} windowSize={32}>
+ {(item) => <article data-card-id={item} />}
+ </PlatformWindowedList>
+ ));
+
+ expect(container.querySelectorAll('[data-card-id]')).toHaveLength(32);
+ expect(container.querySelectorAll('[data-platform-window-spacer]')).toHaveLength(2);
+ });
+});
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 1e9503e867..800ecce773 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -49,6 +49,8 @@ import {
} from './platformEstateOverviewModel';
export type { PlatformTableFilterOption };
+export { PlatformWindowedRows } from './PlatformWindowedRows';
+export { PlatformWindowedList } from './PlatformWindowedList';
// Decorates every status option with the row count the table would show if
// that option were selected. Callers pass the same predicate the table's
diff --git a/frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts b/frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts
new file mode 100644
index 0000000000..bbab1f7064
--- /dev/null
+++ b/frontend-modern/src/features/platformPage/usePlatformWindowedItems.ts
@@ -0,0 +1,169 @@
+import { createEffect, createMemo, createSignal, onCleanup, type Accessor } from 'solid-js';
+
+import { useTableWindowing } from '@/components/Infrastructure/useTableWindowing';
+
+const DEFAULT_ESTIMATED_ITEM_HEIGHT = 40;
+const DESKTOP_WINDOW_SIZE = 140;
+const PHONE_WINDOW_SIZE = 36;
+const SCROLLABLE_OVERFLOW_PATTERN = /(?:auto|scroll|overlay)/;
+const WHEEL_LINE_HEIGHT_PX = 16;
+
+const findScrollContainer = (element: HTMLElement): HTMLElement | null => {
+ let parent = element.parentElement;
+ while (parent && parent !== document.body && parent !== document.documentElement) {
+ const styles = getComputedStyle(parent);
+ const hasVerticalScrollRange = parent.scrollHeight - parent.clientHeight > 1;
+ if (
+ SCROLLABLE_OVERFLOW_PATTERN.test(styles.overflowY) &&
+ (styles.overflowY === 'scroll' || hasVerticalScrollRange)
+ ) {
+ return parent;
+ }
+ parent = parent.parentElement;
+ }
+ return null;
+};
+
+const wheelDeltaInPixels = (event: WheelEvent, viewportHeight: number): number => {
+ if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) return event.deltaY * WHEEL_LINE_HEIGHT_PX;
+ if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) return event.deltaY * viewportHeight;
+ return event.deltaY;
+};
+
+export interface PlatformWindowedItemsOptions<Item> {
+ items: Accessor<readonly Item[]>;
+ estimatedItemHeight?: number;
+ enableThreshold?: number;
+ windowSize?: number;
+}
+
+/**
+ * Shared native-scroll window controller for platform tables and card lists.
+ *
+ * The wheel/touch listeners project the next scroll position before the browser
+ * paints it, keeping a directional runway mounted during rapid input.
+ */
+export function usePlatformWindowedItems<Item>(options: PlatformWindowedItemsOptions<Item>) {
+ const defaultWindowSize =
+ typeof window !== 'undefined' && window.innerWidth < 640
+ ? PHONE_WINDOW_SIZE
+ : DESKTOP_WINDOW_SIZE;
+ const resolvedWindowSize = options.windowSize ?? defaultWindowSize;
+ const [anchorRef, setAnchorRef] = createSignal<HTMLElement | null>(null);
+ const [estimatedItemHeight, setEstimatedItemHeight] = createSignal(
+ Math.max(1, options.estimatedItemHeight ?? DEFAULT_ESTIMATED_ITEM_HEIGHT),
+ );
+ const windowing = useTableWindowing({
+ totalCount: () => options.items().length,
+ windowSize: resolvedWindowSize,
+ enableThreshold: options.enableThreshold ?? resolvedWindowSize,
+ });
+
+ const visibleItems = createMemo<readonly Item[]>(() => {
+ const items = options.items();
+ if (!windowing.isWindowed()) return items;
+ return items.slice(windowing.startIndex(), windowing.endIndex());
+ });
+ const topSpacerHeight = createMemo(() =>
+ windowing.isWindowed() ? windowing.startIndex() * estimatedItemHeight() : 0,
+ );
+ const bottomSpacerHeight = createMemo(() =>
+ windowing.isWindowed()
+ ? Math.max(0, options.items().length - windowing.endIndex()) * estimatedItemHeight()
+ : 0,
+ );
+
+ const syncWindowToViewport = (projectedScrollDelta = 0, measureItems = false) => {
+ if (typeof window === 'undefined' || !windowing.isWindowed()) return;
+ const anchor = anchorRef();
+ if (!anchor) return;
+
+ if (measureItems) {
+ const measuredHeight = anchor.nextElementSibling?.getBoundingClientRect().height;
+ if (measuredHeight && measuredHeight > 0) setEstimatedItemHeight(measuredHeight);
+ }
+
+ const segmentRect = anchor.getBoundingClientRect();
+ const scrollContainer = findScrollContainer(anchor);
+ if (scrollContainer) {
+ const containerRect = scrollContainer.getBoundingClientRect();
+ windowing.onScroll(
+ Math.max(0, containerRect.top - segmentRect.top + projectedScrollDelta),
+ scrollContainer.clientHeight || window.innerHeight,
+ estimatedItemHeight(),
+ );
+ return;
+ }
+ windowing.onScroll(
+ Math.max(0, -segmentRect.top + projectedScrollDelta),
+ window.innerHeight,
+ estimatedItemHeight(),
+ );
+ };
+
+ createEffect(() => {
+ if (typeof window === 'undefined') return;
+ options.items().length;
+ const anchor = anchorRef();
+ if (!anchor || !windowing.isWindowed()) return;
+
+ let lastTouchY: number | null = null;
+ const scrollContainer = findScrollContainer(anchor);
+ const scrollTarget: HTMLElement | Window = scrollContainer ?? window;
+ const viewportHeight = () =>
+ scrollContainer?.clientHeight || window.innerHeight || estimatedItemHeight();
+ const handleScroll = () => syncWindowToViewport();
+ const handleWheel = (event: Event) => {
+ const wheelEvent = event as WheelEvent;
+ if (wheelEvent.deltaY === 0) return;
+ syncWindowToViewport(wheelDeltaInPixels(wheelEvent, viewportHeight()));
+ };
+ const handleTouchStart = (event: Event) => {
+ lastTouchY = (event as TouchEvent).touches.item(0)?.clientY ?? null;
+ };
+ const handleTouchMove = (event: Event) => {
+ const nextTouchY = (event as TouchEvent).touches.item(0)?.clientY ?? null;
+ if (nextTouchY == null || lastTouchY == null) {
+ lastTouchY = nextTouchY;
+ return;
+ }
+ const deltaY = lastTouchY - nextTouchY;
+ lastTouchY = nextTouchY;
+ if (deltaY !== 0) syncWindowToViewport(deltaY);
+ };
+ const handleTouchEnd = () => {
+ lastTouchY = null;
+ };
+ const handleResize = () => syncWindowToViewport(0, true);
+
+ handleResize();
+ scrollTarget.addEventListener('scroll', handleScroll, { passive: true });
+ // Let the keyed runway move before the compositor advances native scroll.
+ // The handlers never cancel input; non-passive ordering only prevents a
+ // fast wheel or fling from exposing an as-yet-unmounted region.
+ scrollTarget.addEventListener('wheel', handleWheel, { passive: false });
+ scrollTarget.addEventListener('touchstart', handleTouchStart, { passive: true });
+ scrollTarget.addEventListener('touchmove', handleTouchMove, { passive: false });
+ scrollTarget.addEventListener('touchend', handleTouchEnd, { passive: true });
+ scrollTarget.addEventListener('touchcancel', handleTouchEnd, { passive: true });
+ window.addEventListener('resize', handleResize);
+ onCleanup(() => {
+ scrollTarget.removeEventListener('scroll', handleScroll);
+ scrollTarget.removeEventListener('wheel', handleWheel);
+ scrollTarget.removeEventListener('touchstart', handleTouchStart);
+ scrollTarget.removeEventListener('touchmove', handleTouchMove);
+ scrollTarget.removeEventListener('touchend', handleTouchEnd);
+ scrollTarget.removeEventListener('touchcancel', handleTouchEnd);
+ window.removeEventListener('resize', handleResize);
+ });
+ });
+
+ return {
+ isWindowed: windowing.isWindowed,
+ startIndex: windowing.startIndex,
+ visibleItems,
+ topSpacerHeight,
+ bottomSpacerHeight,
+ setAnchorRef,
+ };
+}
diff --git a/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx
index 290c7da535..a1e3205277 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx
@@ -14,6 +14,7 @@ import {
PlatformTableNumberValue,
PlatformTablePercentValue,
PlatformTableShell,
+ PlatformWindowedRows,
} from '@/features/platformPage/sharedPlatformPage';
import { PlatformResourceDetailToggleButton } from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { PBSBackup } from '@/types/api';
@@ -251,7 +252,7 @@ export function ProxmoxBackupServersTable(props: {
}
body={
<>
- <For each={rows()}>
+ <PlatformWindowedRows items={rows} estimatedRowHeight={32}>
{(row) => {
const pct = () => (row.datastore ? usagePercent(row.datastore) : undefined);
const isExpanded = () => expandedKey() === row.key;
@@ -451,7 +452,7 @@ export function ProxmoxBackupServersTable(props: {
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx
index 197ce6235c..59b64d15d3 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx
@@ -24,6 +24,7 @@ import {
type PlatformTableFilterOption,
PlatformTableEmptyState,
PlatformTableShell,
+ PlatformWindowedRows,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
import { PlatformResourceDetailToggleButton } from '@/features/platformPage/PlatformResourceDetailTableRow';
@@ -402,7 +403,7 @@ export const ProxmoxCephTable: Component<{
}
body={
<>
- <For each={filtered()}>
+ <PlatformWindowedRows items={filtered} estimatedRowHeight={32}>
{(cluster) => {
const ind = indicatorFor(classify(cluster));
const name = asTrimmedString(cluster.name) || cluster.id;
@@ -535,7 +536,7 @@ export const ProxmoxCephTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxMailGatewayTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxMailGatewayTable.tsx
index aedeef3149..0866fef381 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxMailGatewayTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxMailGatewayTable.tsx
@@ -19,6 +19,7 @@ import {
type PlatformResourceStatusFilter,
PlatformTableEmptyState,
PlatformTableShell,
+ PlatformWindowedRows,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
import { useObservedElementWidth } from '@/hooks/useObservedElementWidth';
@@ -229,7 +230,7 @@ export const ProxmoxMailGatewayTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(instance) => {
const pmg = () => instance.pmg;
const name = () => asTrimmedString(instance.name) || instance.id;
@@ -363,7 +364,7 @@ export const ProxmoxMailGatewayTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
index ed91d572d8..8d596e4ce4 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
@@ -36,6 +36,7 @@ import {
PlatformTableMetricFallback,
PlatformTablePreviewToggle,
PlatformTableShell,
+ PlatformWindowedRows,
createPlatformTablePreview,
createPlatformTableSortState,
formatPlatformTableIntegerValue,
@@ -354,7 +355,7 @@ export const ProxmoxNodesTable: Component<{
</For>
}
body={
- <For each={nodePreview.visibleRows()}>
+ <PlatformWindowedRows items={nodePreview.visibleRows} estimatedRowHeight={40}>
{(node) => {
const name = () => asTrimmedString(node.name) || node.id;
const nativeNodeName = () => asTrimmedString(node.proxmox?.nodeName) ?? '';
@@ -752,7 +753,7 @@ export const ProxmoxNodesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
}
/>
</Show>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
index bfed82a1b0..6cc50705f5 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
@@ -1,5 +1,14 @@
import { useLocation } from '@solidjs/router';
-import { Show, createMemo, createResource, type Accessor } from 'solid-js';
+import {
+ Show,
+ createEffect,
+ createMemo,
+ createResource,
+ createSignal,
+ onCleanup,
+ onMount,
+ type Accessor,
+} from 'solid-js';
import StorageSurface from '@/components/Storage/Storage';
import { WorkloadsFilter } from '@/components/Workloads/WorkloadsFilter';
import { WorkloadsSurface } from '@/components/Workloads/WorkloadsSurface';
@@ -52,24 +61,28 @@ import { updateStore } from '@/stores/updates';
import {
PROXMOX_TAB_SPECS,
buildProxmoxPageModel,
- buildVisibleProxmoxTabSpecs,
+ buildVisibleProxmoxTabSpecsFromCounts,
type ProxmoxPageModel,
type ProxmoxPageTabId,
} from './proxmoxPageModel';
-// `datastore`, `dataset`, and ZFS-style `pool` are not first-class
-// resource type tokens at the API boundary — they all collapse to
-// `storage` (with `storage.topology` differentiating dataset vs pool) or
-// `ceph` (for Ceph pools). Including them in the type filter triggers a
-// 400 from `/api/resources` which surfaces as "Could not load Proxmox
-// resources" in the UI. The page model still filters those topologies
-// client-side from the canonical `storage` rows.
-const PROXMOX_RESOURCE_QUERY =
- 'type=agent,vm,system-container,oci-container,storage,physical_disk,ceph,pbs,pmg';
+// Each workflow hydrates only the resource families it consumes. The first
+// REST page also carries global type aggregations, so evidence-gated tabs do
+// not require the old 1,000+ row workspace request.
+const PROXMOX_RESOURCE_QUERY_BY_TAB: Record<ProxmoxPageTabId, string> = {
+ overview: 'type=agent,vm,system-container,oci-container',
+ storage: 'type=agent,pbs,storage,physical_disk',
+ replication: 'type=agent',
+ backups: 'type=agent,vm,system-container,pbs',
+ ceph: 'type=ceph',
+ mail: 'type=pmg',
+};
const PROXMOX_PLATFORM_FILTER = 'proxmox-all';
const PROXMOX_WORKLOAD_STATUS_STORAGE_SCOPE = 'proxmox';
const PROXMOX_WORKLOAD_EXCLUDED_TYPES = ['app-container'] as const;
+const PHONE_MOUNTED_TAB_LIMIT = 2;
+const PHONE_BACKGROUND_HYDRATION_INTERVAL_MS = 750;
const VALID_TABS = new Set<ProxmoxPageTabId>(PROXMOX_TAB_SPECS.map((tab) => tab.id));
const PROXMOX_WORKLOAD_STATUS_OPTIONS: readonly WorkloadsStatusOption[] = [
{ value: 'all', label: 'All' },
@@ -84,14 +97,13 @@ const EMPTY_PROXMOX_PAGE_MODEL = buildProxmoxPageModel([]);
export function ProxmoxPageSurface() {
const location = useLocation();
- const { resources, loading, error, refetch } = useUnifiedResources({
- query: PROXMOX_RESOURCE_QUERY,
- cacheKey: 'proxmox-workspace',
- initialHydration: 'prefer-ws-then-rest',
+ const phoneViewport = typeof window !== 'undefined' && window.innerWidth < 640;
+ const requestedTab = createMemo<ProxmoxPageTabId>(() => {
+ const segment = location.pathname.split('/').filter(Boolean)[1] as ProxmoxPageTabId | undefined;
+ return segment && VALID_TABS.has(segment) ? segment : 'overview';
});
- const model = createMemo(() =>
- buildProxmoxPageModel(Array.isArray(resources()) ? resources() : []),
- );
+ const [resourceAggregations, setResourceAggregations] =
+ createSignal<ReturnType<ReturnType<typeof useUnifiedResources>['aggregations']>>(null);
// Replication jobs come straight from /api/replication/jobs (they bypass
// the unified-resource pipeline), so the surface owns the fetch: the job
// count gates the Replication tab and the same data feeds the table.
@@ -101,14 +113,174 @@ export function ProxmoxPageSurface() {
const replicationJobCount = createMemo(() =>
replicationJobs.error ? 0 : (replicationJobs() ?? []).length,
);
- const visibleTabs = createMemo(() => buildVisibleProxmoxTabSpecs(model(), replicationJobCount()));
+ const visibleTabs = createMemo(() => {
+ const aggregations = resourceAggregations();
+ if (aggregations) {
+ return buildVisibleProxmoxTabSpecsFromCounts(aggregations.byType, replicationJobCount());
+ }
+ return PROXMOX_TAB_SPECS;
+ });
const visibleTabIds = createMemo(
() => new Set<ProxmoxPageTabId>(visibleTabs().map((tab) => tab.id)),
);
const activeTab = createMemo<ProxmoxPageTabId>(() => {
- const segment = location.pathname.split('/').filter(Boolean)[1] as ProxmoxPageTabId | undefined;
- if (!segment || !VALID_TABS.has(segment)) return 'overview';
- return visibleTabIds().has(segment) ? segment : 'overview';
+ const requested = requestedTab();
+ return visibleTabIds().has(requested) ? requested : 'overview';
+ });
+ const [backgroundHydrationTabs, setBackgroundHydrationTabs] = createSignal<Set<ProxmoxPageTabId>>(
+ new Set(),
+ );
+ onMount(() => {
+ const hydrationQueue: ProxmoxPageTabId[] = [
+ 'storage',
+ 'backups',
+ 'replication',
+ 'ceph',
+ 'mail',
+ 'overview',
+ ];
+ const idleHandles: number[] = [];
+ const timeoutHandles: number[] = [];
+
+ const hydrateNext = (index: number) => {
+ if (index >= hydrationQueue.length) return;
+ const hydrate = () => {
+ setBackgroundHydrationTabs((current) => {
+ const next = new Set(current);
+ next.add(hydrationQueue[index]);
+ return next;
+ });
+ if (phoneViewport) {
+ timeoutHandles.push(
+ window.setTimeout(() => hydrateNext(index + 1), PHONE_BACKGROUND_HYDRATION_INTERVAL_MS),
+ );
+ } else {
+ hydrateNext(index + 1);
+ }
+ };
+
+ if (typeof window.requestIdleCallback === 'function') {
+ idleHandles.push(window.requestIdleCallback(hydrate, { timeout: 1_000 }));
+ } else {
+ timeoutHandles.push(window.setTimeout(hydrate, 250));
+ }
+ };
+
+ hydrateNext(0);
+ onCleanup(() => {
+ idleHandles.forEach((handle) => window.cancelIdleCallback(handle));
+ timeoutHandles.forEach((handle) => window.clearTimeout(handle));
+ });
+ });
+ const shouldHydrateTab = (tab: ProxmoxPageTabId) =>
+ activeTab() === tab || backgroundHydrationTabs().has(tab);
+ const overviewResources = useUnifiedResources({
+ query: PROXMOX_RESOURCE_QUERY_BY_TAB.overview,
+ cacheKey: 'proxmox-overview',
+ enabled: () => shouldHydrateTab('overview'),
+ realtimeEnabled: () => activeTab() === 'overview',
+ });
+ const storageResources = useUnifiedResources({
+ query: PROXMOX_RESOURCE_QUERY_BY_TAB.storage,
+ cacheKey: 'proxmox-storage-shell',
+ enabled: () => shouldHydrateTab('storage'),
+ realtimeEnabled: () => activeTab() === 'storage',
+ });
+ const replicationResources = useUnifiedResources({
+ query: PROXMOX_RESOURCE_QUERY_BY_TAB.replication,
+ cacheKey: 'proxmox-replication-shell',
+ enabled: () => shouldHydrateTab('replication'),
+ realtimeEnabled: () => activeTab() === 'replication',
+ });
+ const backupResources = useUnifiedResources({
+ query: PROXMOX_RESOURCE_QUERY_BY_TAB.backups,
+ cacheKey: 'proxmox-backups-shell',
+ enabled: () => shouldHydrateTab('backups'),
+ realtimeEnabled: () => activeTab() === 'backups',
+ });
+ const cephResources = useUnifiedResources({
+ query: PROXMOX_RESOURCE_QUERY_BY_TAB.ceph,
+ cacheKey: 'proxmox-ceph',
+ enabled: () => shouldHydrateTab('ceph'),
+ realtimeEnabled: () => activeTab() === 'ceph',
+ });
+ const mailResources = useUnifiedResources({
+ query: PROXMOX_RESOURCE_QUERY_BY_TAB.mail,
+ cacheKey: 'proxmox-mail',
+ enabled: () => shouldHydrateTab('mail'),
+ realtimeEnabled: () => activeTab() === 'mail',
+ });
+ const [mountedTabs, setMountedTabs] = createSignal<Set<ProxmoxPageTabId>>(
+ new Set([requestedTab()]),
+ );
+ const mountTab = (tab: ProxmoxPageTabId) =>
+ setMountedTabs((current) => {
+ const mountedOrder = [...current];
+ if (mountedOrder[mountedOrder.length - 1] === tab) return current;
+ const next = new Set(current);
+ // Refresh insertion order so the least-recently-used tab is evicted.
+ next.delete(tab);
+ next.add(tab);
+ if (phoneViewport) {
+ while (next.size > PHONE_MOUNTED_TAB_LIMIT) {
+ const oldestTab = next.values().next().value as ProxmoxPageTabId | undefined;
+ if (!oldestTab) break;
+ next.delete(oldestTab);
+ }
+ }
+ return next;
+ });
+ createEffect(() => {
+ mountTab(activeTab());
+ });
+ let storagePrewarmScheduled = false;
+ createEffect(() => {
+ if (
+ storagePrewarmScheduled ||
+ activeTab() !== 'overview' ||
+ !backgroundHydrationTabs().has('storage') ||
+ storageResources.resources().length === 0
+ ) {
+ return;
+ }
+ storagePrewarmScheduled = true;
+ if (typeof window.requestIdleCallback === 'function') {
+ const idleHandle = window.requestIdleCallback(() => mountTab('storage'), { timeout: 2_000 });
+ onCleanup(() => window.cancelIdleCallback(idleHandle));
+ return;
+ }
+ const timeoutHandle = window.setTimeout(() => mountTab('storage'), 250);
+ onCleanup(() => window.clearTimeout(timeoutHandle));
+ });
+ const resourceState = createMemo(() => {
+ switch (activeTab()) {
+ case 'storage':
+ return storageResources;
+ case 'replication':
+ return replicationResources;
+ case 'backups':
+ return backupResources;
+ case 'ceph':
+ return cephResources;
+ case 'mail':
+ return mailResources;
+ default:
+ return overviewResources;
+ }
+ });
+ const loading = () => resourceState().loading();
+ const error = () => resourceState().error();
+ const refetch = () => resourceState().refetch();
+ createEffect(() => {
+ const next = resourceState().aggregations?.();
+ if (next) setResourceAggregations(next);
+ });
+ const buildModel = (snapshot: Resource[] | undefined) =>
+ buildProxmoxPageModel(Array.isArray(snapshot) ? snapshot : []);
+ const overviewModel = createMemo(() => buildModel(overviewResources.resources()));
+ const model = createMemo(() => {
+ if (activeTab() === 'overview') return overviewModel();
+ return buildModel(resourceState().resources());
});
const agentUpdateTargetVersion = createMemo(
() => updateStore.versionInfo()?.agentUpdateTargetVersion,
@@ -211,10 +383,15 @@ export function ProxmoxPageSurface() {
nodes={outdatedSensorSetupNodes()}
actionHref={buildInfrastructureWorkspacePath()}
/>
- <Show when={activeTab() === 'overview'}>
- <div class="space-y-4">
+ <Show when={mountedTabs().has('overview')}>
+ <div
+ class="space-y-4"
+ classList={{ hidden: activeTab() !== 'overview' }}
+ aria-hidden={activeTab() !== 'overview' ? 'true' : undefined}
+ >
<ProxmoxOverview
- model={model}
+ model={overviewModel}
+ active={() => activeTab() === 'overview'}
metricDisplayMode={metricDisplayMode}
setMetricDisplayMode={setMetricDisplayMode}
metricHistoryRange={metricHistoryRange}
@@ -222,22 +399,29 @@ export function ProxmoxPageSurface() {
memoryDisplayBasis={memoryDisplayBasis}
setMemoryDisplayBasis={setMemoryDisplayBasis}
resourceSnapshot={() =>
- loading() && model().resources.length === 0 ? undefined : model().resources
+ overviewResources.loading() && overviewModel().resources.length === 0
+ ? undefined
+ : overviewModel().resources
}
- resourceSnapshotRefetch={() => refetch()}
+ resourceSnapshotRefetch={() => overviewResources.refetch()}
inventoryCountsVisible={inventoryCountsVisible}
setInventoryCountsVisible={setInventoryCountsVisible}
/>
</div>
</Show>
- <Show when={activeTab() === 'storage'}>
- <StorageSurface
- forcedSourceFilter={PROXMOX_PLATFORM_FILTER}
- suppressNodeFilter
- filterAriaLabel="Proxmox storage filters"
- filterSearchPlaceholder="Search Proxmox storage by pool, datastore, node, or device"
- filterSearchEmptyMessage="Recent Proxmox storage searches appear here."
- />
+ <Show when={mountedTabs().has('storage')}>
+ <div
+ classList={{ hidden: activeTab() !== 'storage' }}
+ aria-hidden={activeTab() !== 'storage' ? 'true' : undefined}
+ >
+ <StorageSurface
+ forcedSourceFilter={PROXMOX_PLATFORM_FILTER}
+ suppressNodeFilter
+ filterAriaLabel="Proxmox storage filters"
+ filterSearchPlaceholder="Search Proxmox storage by pool, datastore, node, or device"
+ filterSearchEmptyMessage="Recent Proxmox storage searches appear here."
+ />
+ </div>
</Show>
<Show when={activeTab() === 'replication'}>
<ProxmoxReplicationTable
@@ -280,6 +464,7 @@ export function ProxmoxPageSurface() {
interface ProxmoxOverviewProps {
model: Accessor<ProxmoxPageModel>;
+ active: Accessor<boolean>;
metricDisplayMode: Accessor<WorkloadsMetricDisplayMode>;
setMetricDisplayMode: (value: WorkloadsMetricDisplayMode) => void;
metricHistoryRange: Accessor<WorkloadTableMetricHistoryRange>;
@@ -318,6 +503,7 @@ function ProxmoxOverview(props: ProxmoxOverviewProps) {
metricHistoryRange: props.metricHistoryRange,
onMetricHistoryRangeChange: props.setMetricHistoryRange,
memoryDisplayBasis: props.memoryDisplayBasis,
+ routeStateEnabled: props.active,
});
const showSharedFilterToolbar = createMemo(
() =>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx
index 93f8ecf6b5..7c7b416f65 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx
@@ -21,6 +21,7 @@ import {
PlatformTableEmptyState,
PlatformTableLoadingState,
PlatformTableShell,
+ PlatformWindowedRows,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
import { useObservedElementWidth } from '@/hooks/useObservedElementWidth';
@@ -486,7 +487,7 @@ export const ProxmoxReplicationTable: Component<{
}
body={
<>
- <For each={filtered()}>
+ <PlatformWindowedRows items={filtered} estimatedRowHeight={32}>
{(job, index) => {
const classification = classifyJob(job);
const ind = indicatorFor(classification);
@@ -684,7 +685,7 @@ export const ProxmoxReplicationTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
index 8900ee621f..e751604a23 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
@@ -517,9 +517,12 @@ describe('ProxmoxBackupsTable', () => {
});
it('keeps the overview node and guest regions on one canonical resource snapshot', () => {
- expect(proxmoxPageSurfaceSource).toContain('const { resources, loading, error, refetch }');
+ expect(proxmoxPageSurfaceSource).toContain('const overviewResources = useUnifiedResources({');
+ expect(proxmoxPageSurfaceSource).toContain("cacheKey: 'proxmox-overview'");
expect(proxmoxPageSurfaceSource).toContain('resourceSnapshot={() =>');
- expect(proxmoxPageSurfaceSource).toContain('resourceSnapshotRefetch={() => refetch()}');
+ expect(proxmoxPageSurfaceSource).toContain(
+ 'resourceSnapshotRefetch={() => overviewResources.refetch()}',
+ );
expect(proxmoxPageSurfaceSource).toContain('useWorkloadsState({');
expect(proxmoxPageSurfaceSource).toContain('resourceSnapshot: props.resourceSnapshot');
expect(proxmoxPageSurfaceSource).not.toContain(
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
index 9accf0c99c..cc3d6f1581 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
@@ -351,6 +351,46 @@ describe('ProxmoxPageSurface contract', () => {
expect(proxmoxBackupsTableSource).not.toContain('SavedViews');
});
+ it('hydrates route-scoped resource families instead of one broad estate request', () => {
+ setResources([
+ makeResource({
+ id: 'agent:pve-1',
+ type: 'agent',
+ proxmox: { nodeName: 'pve-1', clusterName: 'homelab' },
+ }),
+ ]);
+
+ renderSurface();
+
+ const options = mockUseUnifiedResources.mock.calls.map(
+ ([value]) =>
+ value as {
+ query: string;
+ cacheKey: string;
+ enabled: () => boolean;
+ },
+ );
+ expect(options.map((value) => value.cacheKey)).toEqual([
+ 'proxmox-overview',
+ 'proxmox-storage-shell',
+ 'proxmox-replication-shell',
+ 'proxmox-backups-shell',
+ 'proxmox-ceph',
+ 'proxmox-mail',
+ ]);
+ expect(options.map((value) => value.query)).toEqual([
+ 'type=agent,vm,system-container,oci-container',
+ 'type=agent,pbs,storage,physical_disk',
+ 'type=agent',
+ 'type=agent,vm,system-container,pbs',
+ 'type=ceph',
+ 'type=pmg',
+ ]);
+ expect(options[0].enabled()).toBe(true);
+ expect(options.slice(1).every((value) => value.enabled() === false)).toBe(true);
+ expect(proxmoxPageSurfaceSource).toContain('requestIdleCallback');
+ });
+
it('places workload controls beside the workload table they affect', () => {
const nodesTableIndex = proxmoxPageSurfaceSource.indexOf('<ProxmoxNodesTable');
const workloadFilterIndex = proxmoxPageSurfaceSource.indexOf('<WorkloadsFilter');
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
index a252a13440..9ce1aab887 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
@@ -297,15 +297,39 @@ function isCoverageWorkload(workload: WorkloadReference): boolean {
return workload.type === 'host' && Boolean(workload.vmid.trim());
}
-function resolveWorkload(
+interface WorkloadCandidateIndex {
+ byTypeAndVmid: ReadonlyMap<string, readonly WorkloadCandidate[]>;
+ byVmid: ReadonlyMap<string, readonly WorkloadCandidate[]>;
+}
+
+const workloadTypeVmidKey = (type: WorkloadReference['type'], vmid: string): string =>
+ `${type}:${vmid}`;
+
+function buildWorkloadCandidateIndex(
candidates: readonly WorkloadCandidate[],
+): WorkloadCandidateIndex {
+ const byTypeAndVmid = new Map<string, WorkloadCandidate[]>();
+ const byVmid = new Map<string, WorkloadCandidate[]>();
+ for (const candidate of candidates) {
+ const typedKey = workloadTypeVmidKey(candidate.type, candidate.vmid);
+ const typed = byTypeAndVmid.get(typedKey);
+ if (typed) typed.push(candidate);
+ else byTypeAndVmid.set(typedKey, [candidate]);
+
+ const matchingVmid = byVmid.get(candidate.vmid);
+ if (matchingVmid) matchingVmid.push(candidate);
+ else byVmid.set(candidate.vmid, [candidate]);
+ }
+ return { byTypeAndVmid, byVmid };
+}
+
+function resolveWorkload(
+ candidates: WorkloadCandidateIndex,
type: WorkloadReference['type'],
vmid: string,
hints: readonly (string | undefined)[],
): WorkloadReference {
- const typed = candidates.filter(
- (candidate) => candidate.type === type && candidate.vmid === vmid,
- );
+ const typed = candidates.byTypeAndVmid.get(workloadTypeVmidKey(type, vmid)) ?? [];
const normalizedHints = hints.map(normalizeKey).filter(Boolean);
if (typed.length > 0 && normalizedHints.length > 0) {
const exact = typed.find((candidate) =>
@@ -350,8 +374,8 @@ function matchWorkloadByHints<T extends WorkloadReference>(
}
function resolveTaskWorkload(
- candidates: readonly WorkloadCandidate[],
- rows: ReadonlyMap<string, WorkloadRowDraft>,
+ candidates: WorkloadCandidateIndex,
+ workloadsByVmid: ReadonlyMap<string, readonly WorkloadReference[]>,
task: BackupTask,
): WorkloadReference | undefined {
const vmid = String(task.vmid);
@@ -361,18 +385,10 @@ function resolveTaskWorkload(
const hints = [task.instance, task.node];
if (explicitType !== 'unknown') return resolveWorkload(candidates, explicitType, vmid, hints);
- const candidate = matchWorkloadByHints(
- candidates.filter((item) => item.vmid === vmid),
- hints,
- );
+ const candidate = matchWorkloadByHints(candidates.byVmid.get(vmid) ?? [], hints);
if (candidate) return candidate;
- return matchWorkloadByHints(
- Array.from(rows.values())
- .map((row) => row.workload)
- .filter((workload) => workload.vmid === vmid && workload.type !== 'unknown'),
- hints,
- );
+ return matchWorkloadByHints(workloadsByVmid.get(vmid) ?? [], hints);
}
function newest<T>(items: readonly T[], getMs: (item: T) => number | undefined): T | undefined {
@@ -439,7 +455,9 @@ export function buildProxmoxBackupRecoveryModel(
const candidates = input.workloads
.map(buildCandidateFromResource)
.filter((candidate): candidate is WorkloadCandidate => candidate !== null);
+ const candidateIndex = buildWorkloadCandidateIndex(candidates);
const rows = new Map<string, WorkloadRowDraft>();
+ const workloadsByVmid = new Map<string, WorkloadReference[]>();
const ensureRow = (workload: WorkloadReference) => {
const existing = rows.get(workload.key);
@@ -453,6 +471,9 @@ export function buildProxmoxBackupRecoveryModel(
snapshotCount: 0,
};
rows.set(workload.key, row);
+ const matchingVmid = workloadsByVmid.get(workload.vmid);
+ if (matchingVmid) matchingVmid.push(workload);
+ else workloadsByVmid.set(workload.vmid, [workload]);
return row;
};
@@ -474,7 +495,7 @@ export function buildProxmoxBackupRecoveryModel(
for (const backup of input.pbsBackups) {
const type = backupTypeLabel(backup.backupType);
- const workload = resolveWorkload(candidates, type, backup.vmid, [
+ const workload = resolveWorkload(candidateIndex, type, backup.vmid, [
backup.namespace,
backup.datastore,
]);
@@ -500,7 +521,7 @@ export function buildProxmoxBackupRecoveryModel(
for (const archive of input.archives) {
const type = backupTypeLabel(archive.type);
- const workload = resolveWorkload(candidates, type, String(archive.vmid), [
+ const workload = resolveWorkload(candidateIndex, type, String(archive.vmid), [
archive.instance,
archive.node,
]);
@@ -525,7 +546,7 @@ export function buildProxmoxBackupRecoveryModel(
for (const snapshot of input.snapshots) {
const type = backupTypeLabel(snapshot.type);
- const workload = resolveWorkload(candidates, type, String(snapshot.vmid), [
+ const workload = resolveWorkload(candidateIndex, type, String(snapshot.vmid), [
snapshot.instance,
snapshot.node,
]);
@@ -547,7 +568,7 @@ export function buildProxmoxBackupRecoveryModel(
}
for (const task of input.tasks) {
- const workload = resolveTaskWorkload(candidates, rows, task);
+ const workload = resolveTaskWorkload(candidateIndex, workloadsByVmid, task);
if (!workload) continue;
const row = ensureRow(workload);
const candidateTask: CoverageTask = {
diff --git a/frontend-modern/src/features/proxmox/proxmoxPageModel.ts b/frontend-modern/src/features/proxmox/proxmoxPageModel.ts
index 14c37122ca..bfb961bee2 100644
--- a/frontend-modern/src/features/proxmox/proxmoxPageModel.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxPageModel.ts
@@ -13,6 +13,8 @@ export type ProxmoxTabSpec = {
path: string;
};
+export type ProxmoxResourceTypeCounts = Partial<Record<ResourceType, number>>;
+
export type ProxmoxClusterGroup = {
id: string;
label: string;
@@ -199,6 +201,35 @@ export function isProxmoxChildOfNode(child: Resource, node: Resource): boolean {
);
}
+const buildProxmoxNodeResolver = (nodes: readonly Resource[]) => {
+ const nodesById = new Map(nodes.map((node) => [node.id, node] as const));
+ const nodesByName = new Map<string, Resource[]>();
+ for (const node of nodes) {
+ const name = getResourceNodeName(node);
+ const matching = nodesByName.get(name);
+ if (matching) matching.push(node);
+ else nodesByName.set(name, [node]);
+ }
+
+ return (child: Resource): Resource | undefined => {
+ if (child.parentId) {
+ const explicitParent = nodesById.get(child.parentId);
+ if (explicitParent) return explicitParent;
+ }
+ const candidates = nodesByName.get(getResourceNodeName(child)) ?? [];
+ if (candidates.length === 0) return undefined;
+ const childScopes = getProxmoxProviderScopes(child);
+ return candidates.find((node) => {
+ const nodeScopes = new Set(getProxmoxProviderScopes(node));
+ return (
+ childScopes.length === 0 ||
+ nodeScopes.size === 0 ||
+ childScopes.some((scope) => nodeScopes.has(scope))
+ );
+ });
+ };
+};
+
export function getResourceVmid(resource: Resource): string {
const vmid = resource.proxmox?.vmid;
if (typeof vmid === 'number' && Number.isFinite(vmid)) {
@@ -243,13 +274,18 @@ export const filterProxmoxNodes = (
const split = splitSearchExclusions(search);
if (!split.needle && split.excludes.length === 0) return nodes;
- return nodes.filter((node) => {
- const values = getProxmoxSearchValues(node);
- for (const guest of guests) {
- if (isProxmoxChildOfNode(guest, node)) values.push(...getProxmoxSearchValues(guest));
- }
+ const resolveNode = buildProxmoxNodeResolver(nodes);
+ const searchValuesByNodeId = new Map(
+ nodes.map((node) => [node.id, getProxmoxSearchValues(node)] as const),
+ );
+ for (const guest of guests) {
+ const owningNode = resolveNode(guest);
+ if (!owningNode) continue;
+ searchValuesByNodeId.get(owningNode.id)?.push(...getProxmoxSearchValues(guest));
+ }
- const haystack = values
+ return nodes.filter((node) => {
+ const haystack = (searchValuesByNodeId.get(node.id) ?? [])
.filter(
(value): value is string | number => typeof value === 'string' || typeof value === 'number',
)
@@ -331,6 +367,7 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {
isRecord(getPlatformData(resource).ceph),
);
const physicalDisks = proxmoxResources.filter((resource) => resource.type === 'physical_disk');
+ const resolveOwningNode = buildProxmoxNodeResolver(pveNodes);
const groupsById = new Map<string, ProxmoxClusterGroup>();
const ensureGroup = (label: string, providerScope: string): ProxmoxClusterGroup => {
@@ -356,7 +393,7 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {
});
guests.forEach((resource) => {
- const owningNode = pveNodes.find((node) => isProxmoxChildOfNode(resource, node));
+ const owningNode = resolveOwningNode(resource);
ensureGroup(
owningNode ? getResourceClusterLabel(owningNode) : getResourceClusterLabel(resource),
owningNode ? getProxmoxProviderScope(owningNode) : getProxmoxProviderScope(resource),
@@ -364,7 +401,7 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {
});
storage.forEach((resource) => {
- const owningNode = pveNodes.find((node) => isProxmoxChildOfNode(resource, node));
+ const owningNode = resolveOwningNode(resource);
ensureGroup(
owningNode ? getResourceClusterLabel(owningNode) : getResourceClusterLabel(resource),
owningNode ? getProxmoxProviderScope(owningNode) : getProxmoxProviderScope(resource),
@@ -444,3 +481,17 @@ export function buildVisibleProxmoxTabSpecs(
return PROXMOX_TAB_SPECS.filter((tab) => visible.has(tab.id));
}
+
+export function buildVisibleProxmoxTabSpecsFromCounts(
+ counts: ProxmoxResourceTypeCounts,
+ replicationJobCount: number,
+): ProxmoxTabSpec[] {
+ const visible = new Set<ProxmoxPageTabId>(['overview']);
+ const count = (type: ResourceType): number => Math.max(0, counts[type] ?? 0);
+ if (count('storage') + count('physical_disk') > 0) visible.add('storage');
+ if (replicationJobCount > 0) visible.add('replication');
+ if (count('pbs') + count('vm') + count('system-container') > 0) visible.add('backups');
+ if (count('ceph') > 0) visible.add('ceph');
+ if (count('pmg') > 0) visible.add('mail');
+ return PROXMOX_TAB_SPECS.filter((tab) => visible.has(tab.id));
+}
diff --git a/frontend-modern/src/features/proxmox/useProxmoxBackupTableWindowing.ts b/frontend-modern/src/features/proxmox/useProxmoxBackupTableWindowing.ts
index 9cb76f6209..a8795f8258 100644
--- a/frontend-modern/src/features/proxmox/useProxmoxBackupTableWindowing.ts
+++ b/frontend-modern/src/features/proxmox/useProxmoxBackupTableWindowing.ts
@@ -1,58 +1,20 @@
-import { createEffect, createMemo, createSignal, onCleanup, type Accessor } from 'solid-js';
+import type { Accessor } from 'solid-js';
-import { useTableWindowing } from '@/components/Infrastructure/useTableWindowing';
+import { usePlatformWindowedItems } from '@/features/platformPage/usePlatformWindowedItems';
const BACKUP_TABLE_ESTIMATED_ROW_HEIGHT = 32;
export function useProxmoxBackupTableWindowing<T>(items: Accessor<readonly T[]>) {
- const [rootRef, setRootRef] = createSignal<HTMLElement | null>(null);
- const windowing = useTableWindowing({ totalCount: () => items().length });
-
- const visibleItems = createMemo<readonly T[]>(() => {
- if (!windowing.isWindowed()) return items();
- return items().slice(windowing.startIndex(), windowing.endIndex());
- });
- const topSpacerHeight = createMemo(() =>
- windowing.isWindowed() ? windowing.startIndex() * BACKUP_TABLE_ESTIMATED_ROW_HEIGHT : 0,
- );
- const bottomSpacerHeight = createMemo(() =>
- windowing.isWindowed()
- ? Math.max(0, items().length - windowing.endIndex()) * BACKUP_TABLE_ESTIMATED_ROW_HEIGHT
- : 0,
- );
-
- const syncWindowToViewport = () => {
- if (!windowing.isWindowed() || typeof window === 'undefined') return;
- const root = rootRef();
- if (!root) return;
- const rect = root.getBoundingClientRect();
- windowing.onScroll(
- Math.max(0, -rect.top),
- window.innerHeight,
- BACKUP_TABLE_ESTIMATED_ROW_HEIGHT,
- );
- };
-
- createEffect(() => {
- if (typeof window === 'undefined') return;
- items().length;
- if (!windowing.isWindowed() || !rootRef()) return;
-
- const handleViewportChange = () => syncWindowToViewport();
- handleViewportChange();
- window.addEventListener('scroll', handleViewportChange, { passive: true });
- window.addEventListener('resize', handleViewportChange);
- onCleanup(() => {
- window.removeEventListener('scroll', handleViewportChange);
- window.removeEventListener('resize', handleViewportChange);
- });
+ const windowing = usePlatformWindowedItems({
+ items,
+ estimatedItemHeight: BACKUP_TABLE_ESTIMATED_ROW_HEIGHT,
});
return {
isWindowed: windowing.isWindowed,
- visibleItems,
- topSpacerHeight,
- bottomSpacerHeight,
- setRootRef,
+ visibleItems: windowing.visibleItems,
+ topSpacerHeight: windowing.topSpacerHeight,
+ bottomSpacerHeight: windowing.bottomSpacerHeight,
+ setRootRef: windowing.setAnchorRef,
};
}
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index 59b06626b9..947b579ef0 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -38,6 +38,7 @@ import {
getPlatformResourceDetailRowClass,
} from '@/features/platformPage/PlatformResourceDetailTableRow';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformTableEmptyState,
PlatformTableMetricFallback,
@@ -1467,7 +1468,7 @@ export const AgentsMachinesTable: Component<{
}
body={
<>
- <For each={sortedMachines()}>
+ <PlatformWindowedRows items={sortedMachines} estimatedRowHeight={32}>
{(machine) => {
const name = () => asTrimmedString(machine.name) || machine.id;
const hostname = () =>
@@ -1872,7 +1873,7 @@ export const AgentsMachinesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx b/frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx
index d516a0c45e..60e182eab9 100644
--- a/frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx
+++ b/frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx
@@ -1,5 +1,5 @@
import { A } from '@solidjs/router';
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import PlusIcon from 'lucide-solid/icons/plus';
import SettingsIcon from 'lucide-solid/icons/settings';
import { MetadataBadge } from '@/components/shared/MetadataBadge';
@@ -18,6 +18,7 @@ import {
getPlatformTableHeadClassForKind,
type PlatformResourceStatusFilter,
PlatformTableShell,
+ PlatformWindowedRows,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
import {
@@ -192,131 +193,128 @@ export const AvailabilityChecksTable: Component<{
</>
}
body={
- <>
- <For each={orderedChecks()}>
- {(check) => {
- const availability = () => availabilityFor(check);
- const probe = () => getAvailabilityProbePresentation(check);
- const indicator = () => getStandaloneResourceStatusIndicator(check);
- const method = () =>
- probe()?.methodLabel ?? availability()?.protocol ?? 'Probe';
- const result = () => probe()?.resultLabel ?? indicator().label;
- const target = () => formatTarget(check);
- const probeSource = () =>
- getProbeSourceChipLabel(
- props.probeAgentOptions ?? [],
- availability()?.probeAgentId,
- );
- const detailRowId = () => drawer.detailRowId(check);
- const isExpanded = () => drawer.isExpanded(check);
+ <PlatformWindowedRows items={orderedChecks} estimatedRowHeight={32}>
+ {(check) => {
+ const availability = () => availabilityFor(check);
+ const probe = () => getAvailabilityProbePresentation(check);
+ const indicator = () => getStandaloneResourceStatusIndicator(check);
+ const method = () => probe()?.methodLabel ?? availability()?.protocol ?? 'Probe';
+ const result = () => probe()?.resultLabel ?? indicator().label;
+ const target = () => formatTarget(check);
+ const probeSource = () =>
+ getProbeSourceChipLabel(
+ props.probeAgentOptions ?? [],
+ availability()?.probeAgentId,
+ );
+ const detailRowId = () => drawer.detailRowId(check);
+ const isExpanded = () => drawer.isExpanded(check);
- return (
- <>
- <TableRow
- data-availability-check-row={check.id}
- class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
- aria-controls={isExpanded() ? detailRowId() : undefined}
- aria-expanded={isExpanded() ? 'true' : 'false'}
- onClick={() => drawer.toggle(check)}
- onKeyDown={drawer.handleActivationKey(check)}
- tabIndex={0}
- >
- <TableCell class={getPlatformTableCellClassForKind('name')}>
- <div class="flex min-w-0 items-center gap-2">
- <PlatformResourceDetailToggleButton
- expanded={isExpanded()}
- resourceLabel={check.name}
- controlsId={detailRowId()}
- onToggle={() => drawer.toggle(check)}
- />
- <StatusDot
- size="sm"
- variant={indicator().variant}
- title={indicator().label}
- ariaHidden
- />
- <span
- class="truncate font-semibold text-base-content"
- title={check.name}
- >
- {check.name}
- </span>
- </div>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- {method()}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- <span class="block truncate" title={target()}>
- {target()}
- </span>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
- >
- <span class={probe()?.toneClassName ?? ''} title={probe()?.detailLabel}>
- {result()}
- </span>
- <Show when={probeSource()}>
- {(sourceLabel) => (
- <MetadataBadge
- tone="muted"
- size="xs"
- appearance="outline"
- class="mt-0.5 flex"
- data-availability-probe-source={availability()?.probeAgentId}
- >
- {sourceLabel()}
- </MetadataBadge>
- )}
- </Show>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
- >
- <PlatformTableRelativeTimeValue
- value={availability()?.lastChecked}
- emptyText="Not checked"
- />
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
- >
- <PlatformTableRelativeTimeValue
- value={availability()?.lastSuccess}
- emptyText="Never"
+ return (
+ <>
+ <TableRow
+ data-availability-check-row={check.id}
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
+ onClick={() => drawer.toggle(check)}
+ onKeyDown={drawer.handleActivationKey(check)}
+ tabIndex={0}
+ >
+ <TableCell class={getPlatformTableCellClassForKind('name')}>
+ <div class="flex min-w-0 items-center gap-2">
+ <PlatformResourceDetailToggleButton
+ expanded={isExpanded()}
+ resourceLabel={check.name}
+ controlsId={detailRowId()}
+ onToggle={() => drawer.toggle(check)}
/>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
- >
- {formatFailures(availability())}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
- >
- <PlatformTableDurationValue
- seconds={availability()?.pollIntervalSeconds}
+ <StatusDot
+ size="sm"
+ variant={indicator().variant}
+ title={indicator().label}
+ ariaHidden
/>
- </TableCell>
- </TableRow>
- <PlatformResourceDetailTableRow
- resource={check}
- open={isExpanded()}
- detailRowId={detailRowId()}
- colSpan={8}
- resolveResourceLabel={resolveResourceLabel}
- onClose={() => drawer.close(check)}
- />
- </>
- );
- }}
- </For>
- </>
+ <span
+ class="truncate font-semibold text-base-content"
+ title={check.name}
+ >
+ {check.name}
+ </span>
+ </div>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ {method()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <span class="block truncate" title={target()}>
+ {target()}
+ </span>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
+ >
+ <span class={probe()?.toneClassName ?? ''} title={probe()?.detailLabel}>
+ {result()}
+ </span>
+ <Show when={probeSource()}>
+ {(sourceLabel) => (
+ <MetadataBadge
+ tone="muted"
+ size="xs"
+ appearance="outline"
+ class="mt-0.5 flex"
+ data-availability-probe-source={availability()?.probeAgentId}
+ >
+ {sourceLabel()}
+ </MetadataBadge>
+ )}
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
+ >
+ <PlatformTableRelativeTimeValue
+ value={availability()?.lastChecked}
+ emptyText="Not checked"
+ />
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
+ >
+ <PlatformTableRelativeTimeValue
+ value={availability()?.lastSuccess}
+ emptyText="Never"
+ />
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
+ >
+ {formatFailures(availability())}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
+ >
+ <PlatformTableDurationValue
+ seconds={availability()?.pollIntervalSeconds}
+ />
+ </TableCell>
+ </TableRow>
+ <PlatformResourceDetailTableRow
+ resource={check}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={8}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(check)}
+ />
+ </>
+ );
+ }}
+ </PlatformWindowedRows>
}
/>
</Show>
diff --git a/frontend-modern/src/features/truenas/TrueNASAlertsTable.tsx b/frontend-modern/src/features/truenas/TrueNASAlertsTable.tsx
index f47bc317d8..fb71dbc550 100644
--- a/frontend-modern/src/features/truenas/TrueNASAlertsTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASAlertsTable.tsx
@@ -1,8 +1,9 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
+import { Show, type Component, type JSX } from 'solid-js';
import { AlertSeverityBadge, AlertSeverityDot } from '@/components/shared/AlertSeverityBadge';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import {
+ PlatformWindowedRows,
PlatformTableEmptyState,
PlatformTableToolbar,
PlatformResponsiveTableLabel,
@@ -202,7 +203,7 @@ export const TrueNASAlertsTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(incident) => {
const detailRowId = () => drawer.detailRowId(incident);
const isExpanded = () => drawer.isExpanded(incident);
@@ -300,7 +301,7 @@ export const TrueNASAlertsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
index 4c8a7cb81a..862b1228f2 100644
--- a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -10,6 +10,7 @@ import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import { useAlertsActivation } from '@/stores/alertsActivation';
import { unifiedPlatformOverrideIdCandidates } from '@/features/alerts/alertOverridesModel';
import {
+ PlatformWindowedRows,
PlatformSortableTableHead,
PlatformResponsiveTableLabel,
PlatformTableMetricFallback,
@@ -312,7 +313,7 @@ export const TrueNASAppsTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const app = () => appMeta(resource);
const name = () =>
@@ -455,7 +456,7 @@ export const TrueNASAppsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx b/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
index 71246ce710..24ca5f83e4 100644
--- a/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -238,7 +239,7 @@ export const TrueNASNetworkSharesTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const share = () => shareMeta(resource);
const name = () => shareName(resource, share());
@@ -337,7 +338,7 @@ export const TrueNASNetworkSharesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx
index 193d78bdab..46bab371e8 100644
--- a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
@@ -10,6 +10,7 @@ import {
import { asTrimmedString } from '@/utils/stringUtils';
import type { StatusIndicatorVariant } from '@/utils/status';
import {
+ PlatformWindowedRows,
PlatformErrorState,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
@@ -496,7 +497,7 @@ export const TrueNASProtectionTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(point) => {
const outcome = () => normalizeRecoveryOutcome(point.outcome);
const artifact = () => artifactLabel(point);
@@ -595,7 +596,7 @@ export const TrueNASProtectionTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx b/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
index 60dfe928f5..f3dc92f44f 100644
--- a/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PlatformSortableTableHead,
PlatformTableEmptyState,
PlatformTableToolbar,
@@ -296,7 +297,7 @@ export const TrueNASServicesTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(row) => {
const status = () => mapTrueNASServiceStatus(row);
const pids = createMemo(() => formatPIDs(row.service.pids));
@@ -371,7 +372,7 @@ export const TrueNASServicesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx b/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx
index 01cfa749c4..0c5ebaed5a 100644
--- a/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { TableCell, TableRow } from '@/components/shared/Table';
@@ -7,6 +7,7 @@ import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
+ PlatformWindowedRows,
PlatformSortableTableHead,
PlatformResponsiveTableLabel,
PlatformTableEmptyState,
@@ -395,7 +396,7 @@ export const TrueNASStorageTopologyTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(row) => {
const resource = () => row.resource;
const detailRowId = () => drawer.detailRowId(resource());
@@ -470,7 +471,7 @@ export const TrueNASStorageTopologyTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx b/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx
index 0859cf6612..15da9aa576 100644
--- a/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -11,6 +11,7 @@ import { unifiedPlatformOverrideIdCandidates } from '@/features/alerts/alertOver
import { asTrimmedString } from '@/utils/stringUtils';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableMetricFallback,
@@ -289,7 +290,7 @@ export const TrueNASSystemsTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(system) => {
const name = () => asTrimmedString(system.name) || system.id;
const version = () => asTrimmedString(system.agent?.osVersion) || '—';
@@ -485,7 +486,7 @@ export const TrueNASSystemsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx b/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
index 4a3b809df3..b241d7ec3e 100644
--- a/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
@@ -1,9 +1,10 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PlatformResponsiveTableLabel,
PlatformSortableTableHead,
PlatformTableEmptyState,
@@ -268,7 +269,7 @@ export const TrueNASVirtualMachinesTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(resource) => {
const vm = () => vmMeta(resource);
const name = () =>
@@ -370,7 +371,7 @@ export const TrueNASVirtualMachinesTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/vmware/VsphereActivityTable.tsx b/frontend-modern/src/features/vmware/VsphereActivityTable.tsx
index 8d59aa01f2..cd370f4d96 100644
--- a/frontend-modern/src/features/vmware/VsphereActivityTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereActivityTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import {
InlineDetailPanel,
compactDetailRows,
@@ -12,6 +12,7 @@ import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { filterChipStatusDot } from '@/components/shared/FilterBar';
import {
+ PlatformWindowedRows,
PlatformSortableTableHead,
PlatformTableDateTimeValue,
PlatformTableEmptyState,
@@ -367,7 +368,7 @@ export const VsphereActivityTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(activity) => {
const meta = () => activity.resource.vmware;
const detailRowId = () => drawer.detailRowId(activity);
@@ -476,7 +477,7 @@ export const VsphereActivityTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx b/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx
index c108ab353a..46a48007e7 100644
--- a/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import {
InlineDetailPanel,
compactDetailRows,
@@ -10,6 +10,7 @@ import { AlertSeverityBadge, AlertSeverityDot } from '@/components/shared/AlertS
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import {
+ PlatformWindowedRows,
PlatformTableEmptyState,
PlatformResponsiveTableLabel,
PlatformTableToolbar,
@@ -207,7 +208,7 @@ export const VsphereAlertsTable: Component<{
}
body={
<>
- <For each={tableState.filtered()}>
+ <PlatformWindowedRows items={tableState.filtered} estimatedRowHeight={32}>
{(incident) => {
const meta = () => incident.resource.vmware;
const detailRowId = () => drawer.detailRowId(incident);
@@ -309,7 +310,7 @@ export const VsphereAlertsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
index e13a75e4fc..012f3eed1a 100644
--- a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
import { TableCell, TableRow } from '@/components/shared/Table';
@@ -6,6 +6,7 @@ import { filterChipStatusDot } from '@/components/shared/FilterBar';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PlatformSortableTableHead,
PlatformResponsiveTableLabel,
PlatformTableEmptyState,
@@ -257,7 +258,7 @@ export const VsphereDatastoresTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(datastore) => {
const hosts = createMemo(() => hostSummary(datastore));
const consumers = createMemo(() => consumerSummary(datastore));
@@ -354,7 +355,7 @@ export const VsphereDatastoresTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
index 380ab58788..e753da5593 100644
--- a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -17,6 +17,7 @@ import {
} from './vmwarePageModel';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
+ PlatformWindowedRows,
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformSortableTableHead,
PlatformTableMetricFallback,
@@ -303,7 +304,7 @@ export const VsphereHostsTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(host) => {
const meta = () => host.vmware;
const name = () => asTrimmedString(host.name) || host.id;
@@ -483,7 +484,7 @@ export const VsphereHostsTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx b/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx
index 94d88709b0..3b48e76ab8 100644
--- a/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx
@@ -1,10 +1,11 @@
-import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
+import { Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import { filterChipStatusDot } from '@/components/shared/FilterBar';
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PlatformWindowedRows,
PlatformSortableTableHead,
PlatformResponsiveTableLabel,
PlatformTableEmptyState,
@@ -225,7 +226,7 @@ export const VsphereNetworksTable: Component<{
}
body={
<>
- <For each={sortedRows()}>
+ <PlatformWindowedRows items={sortedRows} estimatedRowHeight={32}>
{(network) => {
const hosts = createMemo(() => hostSummary(network));
const vms = createMemo(() => vmSummary(network));
@@ -316,7 +317,7 @@ export const VsphereNetworksTable: Component<{
</>
);
}}
- </For>
+ </PlatformWindowedRows>
</>
}
/>
diff --git a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
index 02057544e9..f759120cd1 100644
--- a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
+++ b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
@@ -878,6 +878,34 @@ describe('useUnifiedResources', () => {
dispose();
});
+ it('keeps a prefetched route inert until realtime updates are enabled', async () => {
+ const [realtimeEnabled, setRealtimeEnabled] = createSignal(false);
+ let dispose = () => {};
+ let result: ReturnType<UseUnifiedResourcesModule['useUnifiedResources']> | undefined;
+ createRoot((d) => {
+ dispose = d;
+ result = useUnifiedResources({ realtimeEnabled });
+ });
+
+ await waitForResourceCount(() => result!.resources().length);
+ expect(result!.resources()[0]?.cpu?.current).toBe(15);
+
+ batch(() => {
+ setWsState(
+ 'resources',
+ reconcile([createWsResource({ cpu: { current: 77 } })], { key: 'id' }),
+ );
+ setWsState('lastUpdate', 1738843204000);
+ });
+ await flushAsync();
+ expect(result!.resources()[0]?.cpu?.current).toBe(15);
+
+ setRealtimeEnabled(true);
+ await waitForValue(() => result!.resources()[0]?.cpu?.current, 77);
+
+ dispose();
+ });
+
it('falls back to REST when websocket initial hydration does not arrive in time', async () => {
setWsConnected(false);
setWsInitialDataReceived(false);
@@ -1466,6 +1494,42 @@ describe('useUnifiedResources', () => {
dispose();
});
+ it('normalizes global resource counts for evidence-gated platform tabs', async () => {
+ apiFetchMock.mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ data: [v2Resource],
+ aggregations: {
+ total: 42,
+ byType: {
+ agent: 5,
+ vm: 20,
+ 'system-container': 17,
+ },
+ },
+ }),
+ });
+
+ let dispose = () => {};
+ let result: ReturnType<UseUnifiedResourcesModule['useUnifiedResources']> | undefined;
+ createRoot((d) => {
+ dispose = d;
+ result = useUnifiedResources();
+ });
+
+ await waitForValue(() => result!.aggregations()?.total, 42);
+ expect(result!.aggregations()).toEqual({
+ total: 42,
+ byType: {
+ agent: 5,
+ vm: 20,
+ 'system-container': 17,
+ },
+ });
+
+ dispose();
+ });
+
it('normalizes legacy k8s discovery targets to pod for frontend consumers', async () => {
apiFetchMock.mockResolvedValue({
ok: true,
diff --git a/frontend-modern/src/hooks/useUnifiedResources.ts b/frontend-modern/src/hooks/useUnifiedResources.ts
index 4518a08e75..49c412fc21 100644
--- a/frontend-modern/src/hooks/useUnifiedResources.ts
+++ b/frontend-modern/src/hooks/useUnifiedResources.ts
@@ -1,5 +1,5 @@
import { batch, createEffect, createSignal, onCleanup, type Accessor } from 'solid-js';
-import { createStore, reconcile } from 'solid-js/store';
+import { createStore, reconcile, unwrap } from 'solid-js/store';
import { canonicalizeMetricsHistoryTargetType } from '@/api/charts';
import { readAPIErrorMessage } from '@/api/responseUtils';
import { apiFetch, getOrgID } from '@/utils/apiClient';
@@ -36,7 +36,11 @@ import { canonicalDiscoveryResourceType } from '@/utils/discoveryTarget';
import { canonicalizeFrontendResourceType } from '@/utils/resourceTypeCompat';
import { getPreferredNormalizedPlatformId } from '@/utils/resourceIdentity';
import { getExplicitResourceClusterName } from '@/utils/agentResources';
-import { mergeCanonicalResourceSnapshot } from '@/utils/resourceStateAdapters';
+import {
+ mergeCanonicalResource,
+ mergeCanonicalResourceDeltaSnapshot,
+ mergeCanonicalResourceSnapshot,
+} from '@/utils/resourceStateAdapters';
import { RESOURCE_METADATA_CHANGED_EVENT } from '@/utils/resourceMetadataEvents';
import {
normalizeSourcePlatformScopes,
@@ -509,10 +513,17 @@ type APIListResponse = {
totalPages?: number;
};
aggregations?: {
+ total?: number;
+ byType?: Partial<Record<string, number>>;
policyPosture?: APIResourcePolicyPostureSummary;
};
};
+export type UnifiedResourceAggregations = {
+ total: number;
+ byType: Partial<Record<ResourceType, number>>;
+};
+
type APIResourcePolicyPostureSummary = {
totalResources?: number;
sensitivityCounts?: Partial<Record<string, number>>;
@@ -523,15 +534,18 @@ type APIResourcePolicyPostureSummary = {
type UnifiedResourcesSnapshot = {
resources: Resource[];
policyPosture: ResourcePolicyPostureSummary | null;
+ aggregations: UnifiedResourceAggregations | null;
};
type UnifiedResourcesCacheEntry = {
resources: Resource[];
policyPosture: ResourcePolicyPostureSummary | null;
+ aggregations: UnifiedResourceAggregations | null;
hasSnapshot: boolean;
cachedAt: number;
lastFetchAt: number;
sharedFetch: Promise<Resource[]> | null;
+ realtimeVersion: number;
};
const unifiedResourcesCaches = new Map<string, UnifiedResourcesCacheEntry>();
@@ -959,18 +973,40 @@ const normalizeResourcePolicyPosture = (
};
};
+const normalizeUnifiedResourceAggregations = (
+ value: APIListResponse['aggregations'],
+): UnifiedResourceAggregations | null => {
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return null;
+ const byType: Partial<Record<ResourceType, number>> = {};
+ for (const [rawType, rawCount] of Object.entries(value.byType ?? {})) {
+ const count = normalizeNonNegativeCount(rawCount);
+ if (count === undefined) continue;
+ byType[resolveType(rawType)] = count;
+ }
+ return {
+ total: normalizeNonNegativeCount(value.total) ?? 0,
+ byType,
+ };
+};
+
const resolveResourcesPayload = (
payload: unknown,
): {
data: APIResource[];
totalPages: number;
policyPosture: ResourcePolicyPostureSummary | null;
+ aggregations: UnifiedResourceAggregations | null;
} => {
if (Array.isArray(payload)) {
- return { data: payload as APIResource[], totalPages: 1, policyPosture: null };
+ return {
+ data: payload as APIResource[],
+ totalPages: 1,
+ policyPosture: null,
+ aggregations: null,
+ };
}
if (!payload || typeof payload !== 'object') {
- return { data: [], totalPages: 1, policyPosture: null };
+ return { data: [], totalPages: 1, policyPosture: null, aggregations: null };
}
const record = payload as APIListResponse;
const data = Array.isArray(record.data)
@@ -985,6 +1021,7 @@ const resolveResourcesPayload = (
data,
totalPages,
policyPosture: normalizeResourcePolicyPosture(record.aggregations?.policyPosture),
+ aggregations: normalizeUnifiedResourceAggregations(record.aggregations),
};
};
@@ -1007,10 +1044,12 @@ const getUnifiedResourcesCacheEntry = (cacheKey: string): UnifiedResourcesCacheE
const created: UnifiedResourcesCacheEntry = {
resources: [],
policyPosture: null,
+ aggregations: null,
hasSnapshot: false,
cachedAt: 0,
lastFetchAt: 0,
sharedFetch: null,
+ realtimeVersion: 0,
};
unifiedResourcesCaches.set(cacheKey, created);
return created;
@@ -1024,13 +1063,32 @@ const setUnifiedResourcesCache = (
resources: Resource[],
at = Date.now(),
policyPosture: ResourcePolicyPostureSummary | null = entry.policyPosture,
+ aggregations: UnifiedResourceAggregations | null = entry.aggregations,
) => {
entry.resources = resources;
entry.policyPosture = policyPosture;
+ entry.aggregations = aggregations;
entry.hasSnapshot = true;
entry.cachedAt = at;
};
+const enrichCanonicalAllResourcesCache = (
+ entry: UnifiedResourcesCacheEntry,
+ resources: Resource[],
+) => {
+ if (!entry.hasSnapshot || resources.length === 0) return;
+
+ const incomingById = new Map(resources.map((resource) => [resource.id, resource] as const));
+ const enriched = entry.resources.map((existing) => {
+ const incoming = incomingById.get(existing.id);
+ if (!incoming) return existing;
+ incomingById.delete(existing.id);
+ return mergeCanonicalResource(incoming, existing);
+ });
+ enriched.push(...incomingById.values());
+ setUnifiedResourcesCache(entry, enriched);
+};
+
const parseUnifiedResourcesTypeFilter = (query: string): Set<ResourceType> | null => {
const normalizedQuery = normalizeUnifiedResourcesQuery(query);
if (normalizedQuery === '') {
@@ -1098,6 +1156,7 @@ const seedUnifiedResourcesCacheFromAllResources = (
typeFilter.has(resolveType(resource.type)),
);
entry.policyPosture = allResourcesEntry.policyPosture;
+ entry.aggregations = allResourcesEntry.aggregations;
entry.hasSnapshot = true;
entry.cachedAt = allResourcesEntry.cachedAt;
entry.lastFetchAt = allResourcesEntry.lastFetchAt;
@@ -1150,14 +1209,17 @@ async function fetchUnifiedResources(query: string): Promise<UnifiedResourcesSna
const allRawResources: APIResource[] = [];
let policyPosture: ResourcePolicyPostureSummary | null = null;
+ let aggregations: UnifiedResourceAggregations | null = null;
for (const resolved of pages) {
allRawResources.push(...resolved.data);
policyPosture = policyPosture ?? resolved.policyPosture;
+ aggregations = aggregations ?? resolved.aggregations;
}
return {
resources: dedupeResources(allRawResources).map((resource) => toResource(resource)),
policyPosture,
+ aggregations,
};
}
@@ -1177,7 +1239,13 @@ const fetchUnifiedResourcesShared = async (
const request = (async () => {
const fetched = await fetchUnifiedResources(query);
const now = Date.now();
- setUnifiedResourcesCache(entry, fetched.resources, now, fetched.policyPosture);
+ setUnifiedResourcesCache(
+ entry,
+ fetched.resources,
+ now,
+ fetched.policyPosture,
+ fetched.aggregations,
+ );
entry.lastFetchAt = now;
return fetched.resources;
})();
@@ -1219,6 +1287,8 @@ type UseUnifiedResourcesOptions = {
cacheKey?: string;
initialHydration?: UnifiedResourcesInitialHydration;
enabled?: Accessor<boolean>;
+ /** Keep cached/background data inert while another retained route is visible. */
+ realtimeEnabled?: Accessor<boolean>;
};
export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
@@ -1226,6 +1296,7 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
const cacheKey = (options?.cacheKey || query || 'all').trim();
const initialHydration = options?.initialHydration ?? 'immediate';
const enabled = options?.enabled ?? (() => true);
+ const realtimeEnabled = options?.realtimeEnabled ?? enabled;
const typeFilter = parseUnifiedResourcesTypeFilter(query);
const supportsCanonicalWsHydration = query === '' || typeFilter !== null;
const prefersWsInitialHydration =
@@ -1243,12 +1314,16 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
);
const initialResources = cacheEntry.resources;
const initialPolicyPosture = cacheEntry.policyPosture;
+ const initialAggregations = cacheEntry.aggregations;
const hasCachedResources = cacheEntry.hasSnapshot;
const [resources, setResources] = createStore<Resource[]>(initialResources);
const [policyPosture, setPolicyPosture] = createSignal<ResourcePolicyPostureSummary | null>(
initialPolicyPosture,
);
+ const [aggregations, setAggregations] = createSignal<UnifiedResourceAggregations | null>(
+ initialAggregations,
+ );
const [loading, setLoading] = createSignal(!hasCachedResources);
const [error, setError] = createSignal<unknown>(undefined);
const wsStore = getGlobalWebSocketStore();
@@ -1271,6 +1346,7 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
}
setResources(reconcile(next, { key: 'id' }));
setPolicyPosture(targetEntry.policyPosture);
+ setAggregations(targetEntry.aggregations);
};
const runRefetch = async (options?: {
@@ -1315,6 +1391,13 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
if (!isCurrentRequest()) {
return resources as unknown as Resource[];
}
+ const allResourcesEntry = getUnifiedResourcesCacheEntry(
+ buildScopedUnifiedResourcesCacheKey(ALL_RESOURCES_CACHE_KEY, orgScope()),
+ );
+ if (allResourcesEntry !== entryForRequest) {
+ enrichCanonicalAllResourcesCache(allResourcesEntry, fetched);
+ entryForRequest.realtimeVersion = allResourcesEntry.realtimeVersion;
+ }
batch(() => {
applyResources(fetched, entryForRequest);
setError(undefined);
@@ -1481,7 +1564,7 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
createEffect(() => {
const currentOrgScope = orgScope();
- if (!enabled()) {
+ if (!enabled() || !realtimeEnabled()) {
return;
}
if (!supportsCanonicalWsHydration) {
@@ -1503,7 +1586,13 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
blockedWsHydrationToken = null;
}
- const wsResources = Array.isArray(wsStore.state.resources) ? wsStore.state.resources : [];
+ const wsResources = Array.isArray(wsStore.state.resources)
+ ? (unwrap(wsStore.state.resources) as Resource[])
+ : [];
+ const resourceChange = wsStore.resourceChange?.() ?? {
+ version: Number(lastUpdateToken) || 0,
+ changedIds: null,
+ };
// For normal page loads, keep the first paint on the canonical REST contract.
// Only explicit websocket-first consumers are allowed to render directly
// from the thinner realtime transport before a canonical snapshot exists.
@@ -1515,10 +1604,23 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
const allResourcesEntry = getUnifiedResourcesCacheEntry(
buildScopedUnifiedResourcesCacheKey(ALL_RESOURCES_CACHE_KEY, currentOrgScope),
);
- const mergedWsResources = mergeCanonicalResourceSnapshot(
- wsResources,
- allResourcesEntry.resources,
- );
+ const canApplyIncrementally =
+ resourceChange.changedIds !== null &&
+ allResourcesEntry.realtimeVersion > 0 &&
+ resourceChange.version === allResourcesEntry.realtimeVersion + 1;
+ const realtimeSnapshotAlreadyApplied =
+ resourceChange.version > 0 &&
+ allResourcesEntry.hasSnapshot &&
+ allResourcesEntry.realtimeVersion === resourceChange.version;
+ const mergedWsResources = realtimeSnapshotAlreadyApplied
+ ? allResourcesEntry.resources
+ : canApplyIncrementally
+ ? mergeCanonicalResourceDeltaSnapshot(
+ wsResources,
+ allResourcesEntry.resources,
+ resourceChange.changedIds!,
+ )
+ : mergeCanonicalResourceSnapshot(wsResources, allResourcesEntry.resources);
const projectedResources = filterCanonicalUnifiedResources(
mergedWsResources,
query,
@@ -1528,20 +1630,40 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
clearInitialHydrationTimeout();
setUnifiedResourcesCache(allResourcesEntry, mergedWsResources, now);
allResourcesEntry.lastFetchAt = now;
+ allResourcesEntry.realtimeVersion = resourceChange.version;
if (projectedResources === null) {
return;
}
- const mergedProjectedResources = mergeCanonicalResourceSnapshot(
- projectedResources,
- cacheEntry.resources,
- );
- setUnifiedResourcesCache(cacheEntry, mergedProjectedResources, now);
+ // A route can finish its richer REST hydration before the first websocket
+ // snapshot exists. Preserve that one-time enrichment, then promote it into
+ // the shared canonical cache so later incremental updates and retained tabs
+ // can project directly without repeating an estate-wide merge.
+ const resolvedProjectedResources =
+ cacheEntry !== allResourcesEntry && cacheEntry.hasSnapshot && cacheEntry.realtimeVersion === 0
+ ? mergeCanonicalResourceSnapshot(projectedResources, cacheEntry.resources)
+ : projectedResources;
+ if (resolvedProjectedResources !== projectedResources) {
+ const enrichedById = new Map(
+ resolvedProjectedResources.map((resource) => [resource.id, resource] as const),
+ );
+ setUnifiedResourcesCache(
+ allResourcesEntry,
+ allResourcesEntry.resources.map((resource) => enrichedById.get(resource.id) ?? resource),
+ now,
+ );
+ allResourcesEntry.lastFetchAt = now;
+ allResourcesEntry.realtimeVersion = resourceChange.version;
+ }
+
+ setUnifiedResourcesCache(cacheEntry, resolvedProjectedResources, now);
cacheEntry.lastFetchAt = now;
+ cacheEntry.realtimeVersion = resourceChange.version;
batch(() => {
- setResources(reconcile(mergedProjectedResources, { key: 'id' }));
+ setResources(reconcile(resolvedProjectedResources, { key: 'id' }));
setPolicyPosture(cacheEntry.policyPosture);
+ setAggregations(cacheEntry.aggregations);
setError(undefined);
setLoading(false);
});
@@ -1554,7 +1676,7 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
createEffect(() => {
orgScope();
- if (!enabled()) {
+ if (!enabled() || !realtimeEnabled()) {
wsInitialized = false;
lastWsUpdateToken = '';
clearInitialHydrationTimeout();
@@ -1616,10 +1738,12 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
const scopedResources = cacheEntry.resources;
const scopedPolicyPosture = cacheEntry.policyPosture;
+ const scopedAggregations = cacheEntry.aggregations;
batch(() => {
setError(undefined);
setResources(reconcile(scopedResources, { key: 'id' }));
setPolicyPosture(scopedPolicyPosture);
+ setAggregations(scopedAggregations);
setLoading(enabled() && !cacheEntry.hasSnapshot);
});
@@ -1665,6 +1789,7 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
return {
resources: () => resources,
policyPosture,
+ aggregations,
refetch,
mutate,
loading,
diff --git a/frontend-modern/src/pages/Actions.tsx b/frontend-modern/src/pages/Actions.tsx
index 79053028ef..f87cb248c2 100644
--- a/frontend-modern/src/pages/Actions.tsx
+++ b/frontend-modern/src/pages/Actions.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
+import { Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import { useLocation, useSearchParams } from '@solidjs/router';
import ChevronRightIcon from 'lucide-solid/icons/chevron-right';
import EyeIcon from 'lucide-solid/icons/eye';
@@ -20,6 +20,7 @@ import { MetadataBadge } from '@/components/shared/MetadataBadge';
import { PageHeader } from '@/components/shared/PageHeader';
import { Subtabs } from '@/components/shared/Subtabs';
import { ActionReviewDialog } from '@/features/actions/ActionReviewDialog';
+import { PlatformWindowedList } from '@/features/platformPage/PlatformWindowedList';
import { ACTION_REVIEW_QUERY_PARAM, parseActionReviewId } from '@/features/actions/actionRouting';
import {
formatActionName,
@@ -247,11 +248,17 @@ export function Actions() {
</Show>
<Show when={actions().length > 0}>
<Card padding="none" class="overflow-hidden" data-testid="actions-queue">
- <ul
+ <div
+ role="list"
class="divide-y divide-border-subtle"
aria-label={view() === 'pending' ? 'Open actions' : 'Action history'}
>
- <For each={displayedActions()}>
+ <PlatformWindowedList
+ items={displayedActions}
+ estimatedItemHeight={92}
+ enableThreshold={36}
+ windowSize={48}
+ >
{(action) => {
const state = () => getActionInboxStatePresentation(action.state);
const resource = () =>
@@ -259,7 +266,7 @@ export function Actions() {
const title = () => formatActionName(action.request.capabilityName);
const originLabel = () => getActionOriginLabel(action.origin);
return (
- <li>
+ <div role="listitem">
<button
type="button"
aria-label={`Review ${title()} on ${action.request.resourceId}, ${state().label}`}
@@ -310,11 +317,11 @@ export function Actions() {
</span>
</div>
</button>
- </li>
+ </div>
);
}}
- </For>
- </ul>
+ </PlatformWindowedList>
+ </div>
</Card>
</Show>
<ActionReviewDialog
diff --git a/frontend-modern/src/stores/__tests__/websocket-unified.test.ts b/frontend-modern/src/stores/__tests__/websocket-unified.test.ts
index a46913d98c..85b37cb682 100644
--- a/frontend-modern/src/stores/__tests__/websocket-unified.test.ts
+++ b/frontend-modern/src/stores/__tests__/websocket-unified.test.ts
@@ -155,6 +155,8 @@ describe('websocket store unified resource contract', () => {
},
});
+ expect(store.resourceChange().changedIds).toBeNull();
+
expect(store.state.resources).toHaveLength(2);
expect((store.state as unknown as Record<string, unknown>).nodes).toBeUndefined();
} finally {
@@ -360,6 +362,7 @@ describe('websocket store unified resource contract', () => {
// the delta path has to agree with the full-snapshot path here.
expect(agent?.status).toBe('online');
expect(store.state.lastUpdate).toBe(200);
+ expect(store.resourceChange().changedIds).toEqual(new Set(['agent-1', 'vm-2', 'vm-1']));
} finally {
dispose();
}
diff --git a/frontend-modern/src/stores/websocket-global.ts b/frontend-modern/src/stores/websocket-global.ts
index 7aff0b478e..149353924f 100644
--- a/frontend-modern/src/stores/websocket-global.ts
+++ b/frontend-modern/src/stores/websocket-global.ts
@@ -22,6 +22,10 @@ const createNoopWebSocketStore = (): ReturnType<typeof createWebSocketStore> =>
const [reconnecting] = createSignal(false);
const [initialDataReceived] = createSignal(true);
const [updateProgress] = createSignal<unknown>(null);
+ const [resourceChange] = createSignal<{
+ version: number;
+ changedIds: ReadonlySet<string> | null;
+ }>({ version: 0, changedIds: null });
const [state] = createStore<State>({
connectedInfrastructure: [],
metrics: [],
@@ -58,6 +62,7 @@ const createNoopWebSocketStore = (): ReturnType<typeof createWebSocketStore> =>
reconnecting,
initialDataReceived,
updateProgress,
+ resourceChange,
shutdown: () => {},
reconnect: () => {},
switchUrl: () => {},
diff --git a/frontend-modern/src/stores/websocket.ts b/frontend-modern/src/stores/websocket.ts
index a8c461efb1..753965de6f 100644
--- a/frontend-modern/src/stores/websocket.ts
+++ b/frontend-modern/src/stores/websocket.ts
@@ -247,6 +247,11 @@ export function createWebSocketStore(url: string) {
const [activeAlerts, setActiveAlerts] = createStore<Record<string, Alert>>({});
const [recentlyResolved, setRecentlyResolved] = createStore<Record<string, ResolvedAlert>>({});
const [updateProgress, setUpdateProgress] = createSignal<unknown>(null);
+ let resourceChangeVersion = 0;
+ const [resourceChange, setResourceChange] = createSignal<{
+ version: number;
+ changedIds: ReadonlySet<string> | null;
+ }>({ version: 0, changedIds: null });
// Track alerts with pending acknowledgment changes to prevent race conditions
const pendingAckChanges = new Map<string, { ack: boolean; previousAckTime?: string }>();
@@ -451,6 +456,10 @@ export function createWebSocketStore(url: string) {
changedCount: changedResourceIds?.size ?? nextResources.length,
});
setState('resources', reconcile(nextResources, { key: 'id' }));
+ setResourceChange({
+ version: ++resourceChangeVersion,
+ changedIds: changedResourceIds ? new Set(changedResourceIds) : null,
+ });
syncContainerCommands(nextResources, changedResourceIds);
};
@@ -1157,6 +1166,7 @@ export function createWebSocketStore(url: string) {
reconnecting,
initialDataReceived,
updateProgress,
+ resourceChange,
shutdown,
reconnect: () => {
if (isDisposed) return;
@@ -1182,6 +1192,7 @@ export function createWebSocketStore(url: string) {
setReconnecting(false);
setInitialDataReceived(false);
setUpdateProgress(null);
+ setResourceChange({ version: ++resourceChangeVersion, changedIds: null });
setState(reconcile(createInitialState()));
setActiveAlerts(reconcile({}));
setRecentlyResolved(reconcile({}));