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.

Make large-estate navigation and updates incremental

rcourtmane9fdd1857053
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 39b37fae18..bf17248af5 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -3434,7 +3434,10 @@ query...`, and `Reading storage...` before streamed tool arguments are
`AppLayout`'s tab lists shares the nav identity-stability contract owned
by `frontend-primitives` (`stableNavTabs.ts`): a websocket state frame
with structurally unchanged tab content must not recreate the Patrol
- button DOM or its attention-count badge element.
+ button DOM or its attention-count badge element. Patrol and the peer
+ utility destinations commit navigation without awaiting best-effort module
+ warming, so lazy-route work cannot make the shared AI-aware shell drop or
+ defer a tap.
The primary-nav demotion of Infrastructure / Workloads / Storage /
Recovery does not change Patrol or Assistant addressability: both
surfaces remain reachable through the utility tab strip in
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index c0901bae37..be814186cc 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -635,6 +635,10 @@ utility tab arrays are identity-stabilized through the shared
`frontend-primitives`): navigation destinations, including the Actions utility
tab and its pending-approval badge, must not have their DOM recreated by a
websocket state frame whose tab content is structurally unchanged.
+Primary and utility navigation must commit the route synchronously with the
+tap. Route-module warming remains best-effort background work and must never be
+awaited before `navigate`, so a cold or invalidated lazy chunk cannot make the
+responsive shell appear to ignore an operator.
1. Add or change limits through `pkg/licensing/`
2. Add or change hosted entitlement issuance through `internal/cloudcp/entitlements/service.go`
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index d7cb761343..84cb9303e4 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -2551,9 +2551,11 @@ default` instead of fusing provider and badge text such as
primitive spinner contract.
The authenticated app shell's boot-time route preloads must be owned by
`frontend-modern/src/routing/routePreload.ts` so top-level cold-tab
- readiness cannot drift from the route-module preloader. Workloads,
- Recovery, Patrol, Alerts, Storage, and Settings are part of that shared
- preload contract.
+ readiness cannot drift from the route-module preloader. The delayed
+ boot-time set is bounded to the lightweight global Actions review
+ destination. Alerts, platform, Patrol, and Settings modules load from
+ current route or interaction intent instead of compiling an unseen
+ workspace behind the active phone route.
Route-module preloads and chart-cache fetches are separate shell
responsibilities: the shared route preload inventory must stay module-only,
while chart payload warming must route through the route or interaction that
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 b5ad96a510..2098c524ff 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -975,7 +975,11 @@ dashboard-specific overview, trend, or summary transport.
preload call in `frontend-modern/src/App.tsx`. `frontend-modern/src/useAppRuntimeState.ts`
must not keep page-local dynamic imports or a second route-preload cache,
because the runtime bootstrap already owns state, chart cache warming, org
- hydration, and health probing.
+ hydration, and health probing. The delayed preload set is limited to the
+ lightweight global Actions review route. Alerts and platform routes load
+ from operator intent because their larger module graphs should not compile
+ behind the current destination; Patrol, Settings, and alternate platform
+ modules remain lazy for the same phone-startup reason.
The same protected hot path now also owns proof harness steadiness.
Store-backed chart SLO and benchmark helpers in `pkg/metrics/store_slo_test.go`,
`internal/api/slo_bench_test.go`, and `internal/monitoring/monitor_metrics_slo_test.go`
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 9cee12a832..0e62060679 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -532,10 +532,13 @@ 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
+Mail from route-scoped resource families. Only the visible tab consumes
+realtime reconciliation. Desktop background hydration may prefetch the other
+route families, while phone background hydration is bounded to Storage because
+the phone shell retains at most the two most-recent tab trees. Storage reuses
+the shell's bounded agent/PBS/storage/physical-disk/Ceph source instead of
+opening a duplicate page query or an all-estate subscription, and 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
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index ef3dbd1055..a7bfa77c58 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -1163,7 +1163,11 @@ AI-only summary payloads, or page-local heuristics.
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:
+ canonical result. A sequential revision with unchanged route membership
+ patches only the changed row indices plus the bounded agent coalescing set;
+ initial hydration, missed revisions, additions, removals, or reorderings
+ fall back to keyed full reconciliation. 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
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 2f2167d968..f2083d1e9c 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,20 +1,31 @@
{
"version": 1,
- "base_sha": "dec1c94c27d65b6110f5bef08d2b54313a1a7e3a",
- "verified_at": "2026-08-24T09:23:55Z",
+ "base_sha": "30c07922b499611b33ef46d6c1eafa37b1b16890",
+ "verified_at": "2026-08-24T09:30:12Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts",
- "frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts",
- "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts"
+ "frontend-modern/src/AppLayout.tsx",
+ "frontend-modern/src/components/Storage/Storage.tsx",
+ "frontend-modern/src/components/Storage/useStoragePageModel.ts",
+ "frontend-modern/src/components/Storage/useStoragePageResources.ts",
+ "frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx",
+ "frontend-modern/src/hooks/useUnifiedResources.ts",
+ "frontend-modern/src/routing/routePreload.ts"
],
"content_sha256": {
- "frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts": "79f29210f6edcb74dc7bcc4bd66fd43e2268467bc4f0cca318a5824a9f966c5e",
- "frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts": "301ea460d570d7e1ba1d87ab78c41000f78f55b2913cf454036415026bcf4599",
- "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts": "2bd50562e5b58f8a197c6b4cfb3c50a2cb7c61a187cb26203419e7ac668e5f8f"
+ "frontend-modern/src/AppLayout.tsx": "ca3dd5972bbb5e0690aeeb19b36773ad26fa427e142838905f5750955d9e0861",
+ "frontend-modern/src/components/Storage/Storage.tsx": "dd8c9e4e1490c516f5d7d3c58ad4f59f87552323800f32ad828ea28cdad8ea88",
+ "frontend-modern/src/components/Storage/useStoragePageModel.ts": "83c905bc17e0ddef56e73cbb0aa61cb930d7dae6c53bf3732f099673253d743a",
+ "frontend-modern/src/components/Storage/useStoragePageResources.ts": "c61b1d17d52fd54d20e6faec2ad7f7d7178c41cb2d73a0907acb4dbce516b46c",
+ "frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx": "07b9669969c45e21fb5253b7b807ba0b8dfd53f25fcef28467e72e308a2ece20",
+ "frontend-modern/src/hooks/useUnifiedResources.ts": "0bfdd2f8210d71da9aec15d78e2bde550eb82832fd42edeeefd5d98a19dd103e",
+ "frontend-modern/src/routing/routePreload.ts": "ee79d423db0afcf8d76d1d39da59a13cb2c98e908e516a016cbb425982b25873"
},
"routes": [
- "/proxmox"
+ "/proxmox/overview",
+ "/proxmox/storage",
+ "/alerts/overview",
+ "/actions"
],
"viewports": [
{
@@ -28,14 +39,14 @@
],
"states": [
"managed hot-dev mock estate with 50 nodes and 929 guests",
- "first visible guest expanded with its variable-height inline detail mounted",
- "expanded detail crossed out of the virtual window while the guest selection and full table height were retained",
- "mock mode disabled and the managed runtime restored to real-nodes mode after verification"
+ "phone cold load with the Proxmox Overview active and Storage prewarmed from its bounded route source",
+ "retained Proxmox Storage tree reusing the shell resource source with realtime active only while visible",
+ "global Alerts and Actions transitions from the phone bottom navigation"
],
"interactions": [
- "expanded artifact-cache-310 from the guest-table chevron at both responsive breakpoints",
- "repeated native scrolling crossed the expanded-detail handoff without a backward jump: phone advanced 611 to 4251 and desktop advanced 1021 to 5921",
- "confirmed the mounted guest budgets stayed at 36 rows on phone and 140 rows on desktop through the handoff",
+ "measured Proxmox Storage route work at 274 ms on the 390x844 viewport and 406 ms on the 1440x900 viewport",
+ "measured the warmed Actions transition at 146 ms of browser main-thread work on the phone viewport",
+ "verified a cache-disabled phone reload requested the active Storage family and the lightweight Actions preload with zero Alerts, Settings, or Patrol page-module requests",
"confirmed zero browser console errors on phone and desktop"
]
}
diff --git a/frontend-modern/src/AppLayout.tsx b/frontend-modern/src/AppLayout.tsx
index 226c76f38c..13cb76b546 100644
--- a/frontend-modern/src/AppLayout.tsx
+++ b/frontend-modern/src/AppLayout.tsx
@@ -644,35 +644,6 @@ export function AppLayout(props: AppLayoutProps) {
const utilityTabs = createStableTabList(utilityTabsSource, utilityNavTabEquals);
- const handlePrimaryClick = (tab: PrimaryTab) => {
- const targetRoute = resolvePrimaryNavigationRoute(tab, primaryRouteMemory);
- void (async () => {
- try {
- await preloadRouteModule(targetRoute);
- } catch (error) {
- logger.warn('Failed to preload navigation target', {
- route: targetRoute,
- error: error instanceof Error ? error.message : String(error),
- });
- }
- navigate(targetRoute);
- })();
- };
-
- const handleUtilityClick = (tab: UtilityTab) => {
- void (async () => {
- try {
- await preloadRouteModule(tab.route);
- } catch (error) {
- logger.warn('Failed to preload navigation target', {
- route: tab.route,
- error: error instanceof Error ? error.message : String(error),
- });
- }
- navigate(tab.route);
- })();
- };
-
const warmNavigationTarget = (route: string) => {
void preloadRouteModule(route).catch((error) => {
logger.warn('Failed to warm navigation target', {
@@ -682,6 +653,17 @@ export function AppLayout(props: AppLayoutProps) {
});
};
+ const handlePrimaryClick = (tab: PrimaryTab) => {
+ const targetRoute = resolvePrimaryNavigationRoute(tab, primaryRouteMemory);
+ warmNavigationTarget(targetRoute);
+ navigate(targetRoute);
+ };
+
+ const handleUtilityClick = (tab: UtilityTab) => {
+ warmNavigationTarget(tab.route);
+ navigate(tab.route);
+ };
+
const getPrimaryTargetRoute = (tab: PrimaryTab) => {
return resolvePrimaryNavigationRoute(tab, primaryRouteMemory);
};
diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.ts
index 29c8917fec..8707781ef5 100644
--- a/frontend-modern/src/__tests__/App.architecture.test.ts
+++ b/frontend-modern/src/__tests__/App.architecture.test.ts
@@ -268,8 +268,11 @@ describe('App architecture', () => {
"import { APP_SHELL_ROUTE_PRELOAD_PATHS, preloadRouteModule } from '@/routing/routePreload';",
);
expect(routePreloadSource).toContain('export const APP_SHELL_ROUTE_PRELOAD_PATHS = [');
- expect(routePreloadSource).toContain('ROOT_PROXMOX_PATH,');
- expect(routePreloadSource).toContain('PATROL_PATH,');
+ expect(routePreloadSource).toContain(
+ 'export const APP_SHELL_ROUTE_PRELOAD_PATHS = [ACTIONS_PATH] as const;',
+ );
+ expect(routePreloadSource).not.toContain('ROOT_PROXMOX_PATH');
+ expect(routePreloadSource).not.toContain('ROOT_STANDALONE_PATH');
// These aggregate pages never shipped as stable top-level routes, so they
// must not remain wired as hidden compatibility or shell workspace surfaces.
expect(routePreloadSource).not.toContain('ROOT_INFRASTRUCTURE_PATH');
@@ -660,8 +663,12 @@ describe('App architecture', () => {
expect(appLayoutSource).not.toContain('presentationPolicyHidesCommercialSurfaces');
expect(appLayoutSource).not.toContain('presentationPolicyHidesOrganizationSurfaces');
expect(appLayoutSource).not.toContain('presentationPolicyIsDemoMode');
- expect(appLayoutSource).toContain('await preloadRouteModule(targetRoute);');
- expect(appLayoutSource).toContain('await preloadRouteModule(tab.route);');
+ expect(appLayoutSource).toContain(
+ 'warmNavigationTarget(targetRoute);\n navigate(targetRoute);',
+ );
+ expect(appLayoutSource).toContain('warmNavigationTarget(tab.route);\n navigate(tab.route);');
+ expect(appLayoutSource).not.toContain('await preloadRouteModule(targetRoute);');
+ expect(appLayoutSource).not.toContain('await preloadRouteModule(tab.route);');
expect(appLayoutSource).toContain('onMouseEnter={() => warmNavigationTarget(');
expect(appLayoutSource).toContain('aiChatStore.enabled === true &&');
expect(appLayoutSource).toContain('!dialogStackHasBlockingDialog()');
diff --git a/frontend-modern/src/__tests__/AppLayout.test.tsx b/frontend-modern/src/__tests__/AppLayout.test.tsx
index a1d0d62a12..d72eb9d1f7 100644
--- a/frontend-modern/src/__tests__/AppLayout.test.tsx
+++ b/frontend-modern/src/__tests__/AppLayout.test.tsx
@@ -31,6 +31,7 @@ const patrolAttentionMockState = vi.hoisted(() => ({
const actionInboxMockState = vi.hoisted(() => ({
pendingActionCount: 0,
}));
+const preloadRouteModuleMock = vi.hoisted(() => vi.fn(() => Promise.resolve()));
vi.mock('@/stores/patrolAttention', () => ({
patrolAttentionStore: {
@@ -49,7 +50,7 @@ vi.mock('@/stores/actionInbox', () => ({
}));
vi.mock('@/routing/routePreload', () => ({
- preloadRouteModule: vi.fn(() => Promise.resolve()),
+ preloadRouteModule: preloadRouteModuleMock,
}));
const makeResource = (overrides: Partial<Resource>): Resource =>
@@ -141,6 +142,8 @@ describe('AppLayout navigation icons', () => {
resetPrimaryNavigationRouteMemory();
patrolAttentionMockState.activeCount = 0;
actionInboxMockState.pendingActionCount = 0;
+ preloadRouteModuleMock.mockReset();
+ preloadRouteModuleMock.mockResolvedValue(undefined);
clearRuntimeBranding();
aiChatStore.close();
aiChatStore.setEnabled(true);
@@ -258,6 +261,17 @@ describe('AppLayout navigation icons', () => {
expect(document.title).toContain('Actions');
});
+ it('commits utility navigation without waiting for a cold route preload', async () => {
+ setViewportWidth(390);
+ preloadRouteModuleMock.mockReturnValueOnce(new Promise<void>(() => undefined));
+ renderLayout([], '/alerts');
+
+ const mobileNav = screen.getByRole('navigation', { name: 'Mobile navigation' });
+ fireEvent.click(within(mobileNav).getByRole('button', { name: 'Actions' }));
+
+ await waitFor(() => expect(window.location.pathname).toBe('/actions'));
+ });
+
it('shows platform and runtime lens tabs with supported infrastructure evidence', () => {
renderLayout([
makeResource({ id: 'agent-1', type: 'agent', platformType: 'agent' }),
diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsx
index a009bfac75..542f6f6dde 100644
--- a/frontend-modern/src/components/Storage/Storage.tsx
+++ b/frontend-modern/src/components/Storage/Storage.tsx
@@ -3,6 +3,7 @@ import StorageContentCard from '@/components/Storage/StorageContentCard';
import StoragePageControls from '@/components/Storage/StoragePageControls';
import { DEFAULT_STORAGE_SELECTED_NODE_ID } from './storagePageState';
import { useStoragePageModel } from './useStoragePageModel';
+import type { StoragePageResourceSource } from './useStoragePageResources';
type StorageProps = {
forcedView?: 'pools' | 'disks';
@@ -17,6 +18,7 @@ type StorageProps = {
filterAriaLabel?: string;
filterSearchPlaceholder?: string;
filterSearchEmptyMessage?: string;
+ resourceSource?: StoragePageResourceSource;
};
const Storage: Component<StorageProps> = (props) => {
@@ -77,6 +79,7 @@ const Storage: Component<StorageProps> = (props) => {
setSummaryTableRootRef,
} = useStoragePageModel({
forcedSourceFilter: () => props.forcedSourceFilter,
+ resourceSource: props.resourceSource,
});
createEffect(() => {
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index 556b448706..96a2506ebc 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -328,7 +328,8 @@ vi.mock('@/hooks/useUnifiedResources', () => ({
mutate: vi.fn(),
}),
useUnifiedResources: (options?: { cacheKey?: string }) => ({
- resources: () => (options?.cacheKey === 'storage-page' ? hookResources : nodeResources),
+ resources: () =>
+ options?.cacheKey === 'storage-page' ? [...nodeResources, ...hookResources] : nodeResources,
loading: () => (options?.cacheKey === 'storage-page' ? hookLoading : false),
error: () => (options?.cacheKey === 'storage-page' ? hookError : undefined),
refetch: vi.fn(),
diff --git a/frontend-modern/src/components/Storage/useStoragePageModel.ts b/frontend-modern/src/components/Storage/useStoragePageModel.ts
index 7b62866551..90ed4045f4 100644
--- a/frontend-modern/src/components/Storage/useStoragePageModel.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageModel.ts
@@ -22,7 +22,7 @@ import { useStorageExpansionState } from './useStorageExpansionState';
import { useStorageFilterState } from './useStorageFilterState';
import { useStoragePageData } from './useStoragePageData';
import { useStoragePageFilters } from './useStoragePageFilters';
-import { useStoragePageResources } from './useStoragePageResources';
+import { useStoragePageResources, type StoragePageResourceSource } from './useStoragePageResources';
import { useStoragePageStatus } from './useStoragePageStatus';
import { useStorageResourceHighlight } from './useStorageResourceHighlight';
import { useStorageSummaryCharts } from './useStorageSummaryCharts';
@@ -37,6 +37,7 @@ import { buildStorageSummaryGroupScopeMap } from './storageSummaryGroups';
type UseStoragePageModelOptions = {
forcedSourceFilter?: () => string | undefined;
+ resourceSource?: StoragePageResourceSource;
};
export const useStoragePageModel = (options: UseStoragePageModelOptions = {}) => {
@@ -67,7 +68,7 @@ export const useStoragePageModel = (options: UseStoragePageModelOptions = {}) =>
physicalDisks,
cephResources,
alertsEnabled,
- } = useStoragePageResources();
+ } = useStoragePageResources({ resourceSource: options.resourceSource });
const {
search,
diff --git a/frontend-modern/src/components/Storage/useStoragePageResources.ts b/frontend-modern/src/components/Storage/useStoragePageResources.ts
index 93c57f4e3e..721516b6a2 100644
--- a/frontend-modern/src/components/Storage/useStoragePageResources.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageResources.ts
@@ -1,27 +1,47 @@
-import { createMemo } from 'solid-js';
+import { createMemo, type Accessor } from 'solid-js';
import { useWebSocket } from '@/contexts/appRuntime';
-import { useResources } from '@/hooks/useResources';
import { useUnifiedResources } from '@/hooks/useUnifiedResources';
import { useAlertsActivation } from '@/stores/alertsActivation';
+import type { Resource, ResourceType } from '@/types/resource';
-const STORAGE_PAGE_RESOURCES_QUERY = 'type=storage';
+const STORAGE_PAGE_RESOURCES_QUERY = 'type=agent,pbs,storage,physical_disk,ceph';
-export const useStoragePageResources = () => {
+export type StoragePageResourceSource = {
+ resources: Accessor<Resource[]>;
+ loading: Accessor<boolean>;
+ error: Accessor<unknown>;
+ refetch: () => Promise<Resource[]>;
+ mutate: (value: Resource[] | ((previous: Resource[]) => Resource[])) => Resource[];
+};
+
+type UseStoragePageResourcesOptions = {
+ resourceSource?: StoragePageResourceSource;
+};
+
+export const useStoragePageResources = (options: UseStoragePageResourcesOptions = {}) => {
const { state, activeAlerts, connected, initialDataReceived, reconnecting, reconnect } =
useWebSocket();
- const { byType } = useResources();
- // The storage adapter consumes canonical storage resources only. Recovery
- // needs workload inventory too, but sharing its broad query here made this
- // tab hydrate every guest in a large estate before doing useful work.
- const storageResources = useUnifiedResources({
- query: STORAGE_PAGE_RESOURCES_QUERY,
- cacheKey: 'storage-page',
- });
+ // Platform shells can inject their already-prefetched route source. The
+ // standalone page owns the same bounded resource family itself. Keeping one
+ // source avoids an all-estate subscription and a duplicate Storage query.
+ const resourceSource =
+ options.resourceSource ??
+ useUnifiedResources({
+ query: STORAGE_PAGE_RESOURCES_QUERY,
+ cacheKey: 'storage-page',
+ });
const alertsActivation = useAlertsActivation();
+ const byType = (type: ResourceType): Resource[] =>
+ resourceSource.resources().filter((resource) => resource.type === type);
const nodes = createMemo(() => byType('agent'));
const physicalDisks = createMemo(() => byType('physical_disk'));
const cephResources = createMemo(() => byType('ceph'));
+ const storageResourceRows = createMemo(() => byType('storage'));
+ const storageResources: StoragePageResourceSource = {
+ ...resourceSource,
+ resources: storageResourceRows,
+ };
const alertsEnabled = alertsActivation.detectionEnabled;
return {
diff --git a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
index 6cc50705f5..5abbe88b4c 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
@@ -71,7 +71,7 @@ import {
// 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',
+ storage: 'type=agent,pbs,storage,physical_disk,ceph',
replication: 'type=agent',
backups: 'type=agent,vm,system-container,pbs',
ceph: 'type=ceph',
@@ -131,14 +131,13 @@ export function ProxmoxPageSurface() {
new Set(),
);
onMount(() => {
- const hydrationQueue: ProxmoxPageTabId[] = [
- 'storage',
- 'backups',
- 'replication',
- 'ceph',
- 'mail',
- 'overview',
- ];
+ // A phone retains only two tab trees, so downloading every route in the
+ // background spends memory and main-thread time on views that will be
+ // evicted before they are likely to be used. Storage is the common
+ // Overview transition and the only worthwhile phone prewarm.
+ const hydrationQueue: ProxmoxPageTabId[] = phoneViewport
+ ? ['storage']
+ : ['storage', 'backups', 'replication', 'ceph', 'mail', 'overview'];
const idleHandles: number[] = [];
const timeoutHandles: number[] = [];
@@ -416,6 +415,7 @@ export function ProxmoxPageSurface() {
>
<StorageSurface
forcedSourceFilter={PROXMOX_PLATFORM_FILTER}
+ resourceSource={storageResources}
suppressNodeFilter
filterAriaLabel="Proxmox storage filters"
filterSearchPlaceholder="Search Proxmox storage by pool, datastore, node, or device"
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 cc3d6f1581..3f5f36137a 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
@@ -380,7 +380,7 @@ describe('ProxmoxPageSurface contract', () => {
]);
expect(options.map((value) => value.query)).toEqual([
'type=agent,vm,system-container,oci-container',
- 'type=agent,pbs,storage,physical_disk',
+ 'type=agent,pbs,storage,physical_disk,ceph',
'type=agent',
'type=agent,vm,system-container,pbs',
'type=ceph',
@@ -389,6 +389,8 @@ describe('ProxmoxPageSurface contract', () => {
expect(options[0].enabled()).toBe(true);
expect(options.slice(1).every((value) => value.enabled() === false)).toBe(true);
expect(proxmoxPageSurfaceSource).toContain('requestIdleCallback');
+ expect(proxmoxPageSurfaceSource).toContain("phoneViewport\n ? ['storage']");
+ expect(proxmoxPageSurfaceSource).toContain('resourceSource={storageResources}');
});
it('places workload controls beside the workload table they affect', () => {
diff --git a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
index f759120cd1..6a93177308 100644
--- a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
+++ b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
@@ -141,9 +141,14 @@ describe('useUnifiedResources', () => {
let setWsState: SetStoreFunction<TestWsState>;
let setWsConnected: (value: boolean) => boolean;
let setWsInitialDataReceived: (value: boolean) => boolean;
+ let setWsResourceChange: (value: {
+ version: number;
+ changedIds: ReadonlySet<string> | null;
+ }) => unknown;
let useUnifiedResources: UseUnifiedResourcesModule['useUnifiedResources'];
let useStorageRecoveryResources: UseUnifiedResourcesModule['useStorageRecoveryResources'];
let resetUnifiedResourcesCacheForTests: UseUnifiedResourcesModule['__resetUnifiedResourcesCacheForTests'];
+ let resolveIncrementalResourcePatchIndices: UseUnifiedResourcesModule['resolveIncrementalResourcePatchIndices'];
let eventBus: (typeof import('@/stores/events'))['eventBus'];
beforeEach(async () => {
@@ -157,8 +162,13 @@ describe('useUnifiedResources', () => {
const [connected, _setConnected] = createSignal(true);
const [initialDataReceived, _setInitialDataReceived] = createSignal(true);
+ const [resourceChange, _setResourceChange] = createSignal<{
+ version: number;
+ changedIds: ReadonlySet<string> | null;
+ }>({ version: 0, changedIds: null });
setWsConnected = _setConnected;
setWsInitialDataReceived = _setInitialDataReceived;
+ setWsResourceChange = _setResourceChange;
const [state, _setWsState] = createStore<TestWsState>({
connectedInfrastructure: [],
metrics: [],
@@ -188,7 +198,7 @@ describe('useUnifiedResources', () => {
});
setWsState = _setWsState;
- const wsStore = { connected, initialDataReceived, state };
+ const wsStore = { connected, initialDataReceived, state, resourceChange };
vi.doMock('@/utils/apiClient', () => ({
apiFetch: apiFetchMock,
@@ -202,6 +212,7 @@ describe('useUnifiedResources', () => {
useUnifiedResources,
useStorageRecoveryResources,
__resetUnifiedResourcesCacheForTests: resetUnifiedResourcesCacheForTests,
+ resolveIncrementalResourcePatchIndices,
} = await import('@/hooks/useUnifiedResources'));
({ eventBus } = await import('@/stores/events'));
resetUnifiedResourcesCacheForTests();
@@ -213,6 +224,85 @@ describe('useUnifiedResources', () => {
vi.resetModules();
});
+ it('bounds realtime store reconciliation to changed rows in a large estate', () => {
+ const current = Array.from({ length: 1_508 }, (_, index): Resource => ({
+ ...createWsResource(),
+ id: `resource-${index}`,
+ name: `resource-${index}`,
+ displayName: `resource-${index}`,
+ type: index < 50 ? 'agent' : 'vm',
+ }));
+ const next = current.map((resource, index) =>
+ index === 900 ? { ...resource, cpu: { current: 73 } } : resource,
+ );
+
+ expect(
+ resolveIncrementalResourcePatchIndices(current, next, new Set(['resource-900']), false),
+ ).toEqual([900]);
+
+ const hostRefresh = resolveIncrementalResourcePatchIndices(
+ current,
+ next,
+ new Set(['resource-900']),
+ true,
+ );
+ expect(hostRefresh).toHaveLength(51);
+ expect(hostRefresh?.slice(0, 50)).toEqual(Array.from({ length: 50 }, (_, index) => index));
+ expect(hostRefresh?.at(-1)).toBe(900);
+ });
+
+ it('falls back to a full keyed reconcile when realtime membership or order changes', () => {
+ const first = createWsResource({ id: 'first' });
+ const second = createWsResource({ id: 'second' });
+
+ expect(
+ resolveIncrementalResourcePatchIndices(
+ [first, second],
+ [second, first],
+ new Set(['first', 'second']),
+ false,
+ ),
+ ).toBeNull();
+ expect(
+ resolveIncrementalResourcePatchIndices([first], [first, second], new Set(['second']), false),
+ ).toBeNull();
+ });
+
+ it('applies sequential changed-ID revisions through the incremental route store path', async () => {
+ const vm = createWsResource({
+ id: 'vm-1',
+ name: 'vm-1',
+ displayName: 'vm-1',
+ type: 'vm',
+ });
+ setWsState('resources', [vm]);
+ setWsResourceChange({ version: 1, changedIds: null });
+
+ let dispose = () => {};
+ let result: ReturnType<UseUnifiedResourcesModule['useUnifiedResources']> | undefined;
+ createRoot((d) => {
+ dispose = d;
+ result = useUnifiedResources({
+ query: '',
+ cacheKey: 'all-resources',
+ initialHydration: 'prefer-ws',
+ });
+ });
+
+ await waitForResourceCount(() => result!.resources().length);
+ expect(result!.resources()[0]?.cpu?.current).toBe(15);
+
+ batch(() => {
+ setWsState('resources', 0, 'cpu', 'current', 88);
+ setWsResourceChange({ version: 2, changedIds: new Set(['vm-1']) });
+ setWsState('lastUpdate', 1738843201000);
+ });
+
+ await waitForValue(() => result!.resources()[0]?.cpu?.current, 88);
+ expect(apiFetchMock).not.toHaveBeenCalled();
+ dispose();
+ });
+
it('uses canonical websocket resource updates without a REST refetch for supported queries', async () => {
let dispose = () => {};
let result: ReturnType<UseUnifiedResourcesModule['useUnifiedResources']> | undefined;
diff --git a/frontend-modern/src/hooks/useUnifiedResources.ts b/frontend-modern/src/hooks/useUnifiedResources.ts
index 49c412fc21..59fbbfd5d8 100644
--- a/frontend-modern/src/hooks/useUnifiedResources.ts
+++ b/frontend-modern/src/hooks/useUnifiedResources.ts
@@ -1130,6 +1130,38 @@ const filterCanonicalUnifiedResources = (
return resources.filter((resource) => typeFilter.has(resolveType(resource.type)));
};
+/**
+ * Resolve the small set of store rows that need reconciliation for one
+ * canonical realtime revision. A structural mismatch returns `null` so the
+ * caller can fall back to a full keyed reconcile for additions, removals, type
+ * membership changes, or order changes.
+ *
+ * Agent rows are a bounded exception: when an agent changed, canonical host
+ * coalescing can update another agent row as well, so refresh the complete
+ * agent subset while leaving every non-host row outside the delta untouched.
+ */
+export const resolveIncrementalResourcePatchIndices = (
+ current: readonly Resource[],
+ next: readonly Resource[],
+ changedIds: ReadonlySet<string>,
+ refreshAgentRows: boolean,
+): number[] | null => {
+ if (current.length !== next.length) return null;
+
+ const patchIndices: number[] = [];
+ for (let index = 0; index < next.length; index += 1) {
+ const currentResource = current[index];
+ const nextResource = next[index];
+ if (!currentResource || !nextResource || currentResource.id !== nextResource.id) {
+ return null;
+ }
+ if (changedIds.has(nextResource.id) || (refreshAgentRows && nextResource.type === 'agent')) {
+ patchIndices.push(index);
+ }
+ }
+ return patchIndices;
+};
+
const seedUnifiedResourcesCacheFromAllResources = (
entry: UnifiedResourcesCacheEntry,
cacheKey: string,
@@ -1657,11 +1689,37 @@ export function useUnifiedResources(options?: UseUnifiedResourcesOptions) {
allResourcesEntry.realtimeVersion = resourceChange.version;
}
+ const canPatchProjectionIncrementally =
+ resourceChange.changedIds !== null &&
+ cacheEntry.hasSnapshot &&
+ cacheEntry.realtimeVersion > 0 &&
+ resourceChange.version === cacheEntry.realtimeVersion + 1 &&
+ resolvedProjectedResources === projectedResources;
+ const changedResourceTouchesAgent =
+ canPatchProjectionIncrementally &&
+ wsResources.some(
+ (resource) => resource.type === 'agent' && resourceChange.changedIds!.has(resource.id),
+ );
+ const incrementalPatchIndices = canPatchProjectionIncrementally
+ ? resolveIncrementalResourcePatchIndices(
+ resources as unknown as Resource[],
+ resolvedProjectedResources,
+ resourceChange.changedIds!,
+ changedResourceTouchesAgent,
+ )
+ : null;
+
setUnifiedResourcesCache(cacheEntry, resolvedProjectedResources, now);
cacheEntry.lastFetchAt = now;
cacheEntry.realtimeVersion = resourceChange.version;
batch(() => {
- setResources(reconcile(resolvedProjectedResources, { key: 'id' }));
+ if (incrementalPatchIndices === null) {
+ setResources(reconcile(resolvedProjectedResources, { key: 'id' }));
+ } else {
+ incrementalPatchIndices.forEach((index) => {
+ setResources(index, reconcile(resolvedProjectedResources[index], { key: 'id' }));
+ });
+ }
setPolicyPosture(cacheEntry.policyPosture);
setAggregations(cacheEntry.aggregations);
setError(undefined);
diff --git a/frontend-modern/src/routing/__tests__/routePreload.test.ts b/frontend-modern/src/routing/__tests__/routePreload.test.ts
index e647c857cb..31d7ad8c3b 100644
--- a/frontend-modern/src/routing/__tests__/routePreload.test.ts
+++ b/frontend-modern/src/routing/__tests__/routePreload.test.ts
@@ -1,21 +1,10 @@
import { describe, expect, it } from 'vitest';
import { APP_SHELL_ROUTE_PRELOAD_PATHS } from '../routePreload';
-import { ACTIONS_PATH, PATROL_PATH, buildProxmoxPath, buildStandalonePath } from '../resourceLinks';
+import { ACTIONS_PATH } from '../resourceLinks';
describe('route preloading', () => {
- it('keeps Proxmox in the authenticated app-shell preload set', () => {
- expect(APP_SHELL_ROUTE_PRELOAD_PATHS).toContain(buildProxmoxPath());
- });
-
- it('keeps the eager authenticated-shell preload set bounded', () => {
- expect([...APP_SHELL_ROUTE_PRELOAD_PATHS]).toEqual([
- buildProxmoxPath(),
- buildStandalonePath(),
- PATROL_PATH,
- ACTIONS_PATH,
- '/alerts',
- '/settings',
- ]);
+ it('preloads only the lightweight global Actions review route', () => {
+ expect([...APP_SHELL_ROUTE_PRELOAD_PATHS]).toEqual([ACTIONS_PATH]);
});
});
diff --git a/frontend-modern/src/routing/routePreload.ts b/frontend-modern/src/routing/routePreload.ts
index 350ecc1b6b..7c5a37b1c1 100644
--- a/frontend-modern/src/routing/routePreload.ts
+++ b/frontend-modern/src/routing/routePreload.ts
@@ -1,7 +1,5 @@
import {
- buildProxmoxPath,
ACTIONS_PATH,
- buildStandalonePath,
DOCKER_PATH,
KUBERNETES_PATH,
PATROL_PATH,
@@ -17,20 +15,11 @@ type RoutePreloader = {
preload: () => Promise<void>;
};
-const ROOT_PROXMOX_PATH = buildProxmoxPath();
-const ROOT_STANDALONE_PATH = buildStandalonePath();
const ALERTS_PATH = '/alerts';
const SETTINGS_PATH = '/settings';
const routePreloadCache = new Map<string, Promise<void>>();
-export const APP_SHELL_ROUTE_PRELOAD_PATHS = [
- ROOT_PROXMOX_PATH,
- ROOT_STANDALONE_PATH,
- PATROL_PATH,
- ACTIONS_PATH,
- ALERTS_PATH,
- SETTINGS_PATH,
-] as const;
+export const APP_SHELL_ROUTE_PRELOAD_PATHS = [ACTIONS_PATH] as const;
function normalizeRoute(route: string): string {
const [pathname] = route.split(/[?#]/, 1);
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 217143e12d..be64f887f5 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -1457,11 +1457,12 @@ describe('frontend resource type boundaries', () => {
expect(storagePageDataSource).toContain('useStorageModel');
expect(storagePageResourcesSource).toContain('export const useStoragePageResources');
expect(storagePageResourcesSource).toContain('useWebSocket');
- expect(storagePageResourcesSource).toContain('useResources');
expect(storagePageResourcesSource).toContain('useUnifiedResources');
expect(storagePageResourcesSource).toContain(
- "const STORAGE_PAGE_RESOURCES_QUERY = 'type=storage'",
+ "const STORAGE_PAGE_RESOURCES_QUERY = 'type=agent,pbs,storage,physical_disk,ceph'",
);
+ expect(storagePageResourcesSource).not.toContain("from '@/hooks/useResources'");
+ expect(storagePageResourcesSource).toContain('options.resourceSource ??');
expect(storagePageResourcesSource).toContain('useAlertsActivation');
expect(storagePageModelSource).toContain('export const useStoragePageModel');
expect(storagePageModelSource).toContain('useStoragePageResources');