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.

Eliminate large-estate scroll blanks

rcourtman679497119925
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 3084198373..84594a909e 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -833,12 +833,15 @@ change may globally weaken the Task 03 lifecycle-state idempotency invariant.
Virtualization must remain visually invisible under rapid wheel and
trackpad input. The windowing owner keeps a hysteretic directional runway
instead of shifting the slice for every visible-row change, and viewport
- sync may prewarm that runway from one passive wheel listener before the
- corresponding scroll event. Group and guest iteration must remain keyed so
- overlapping rows survive window shifts rather than rebinding every mounted
- row. This anticipation must preserve the existing bounded mounted-row
- budget; rendering the whole estate or adding per-row observers, timers, or
- scroll listeners is forbidden.
+ sync must prewarm that runway before the compositor advances the viewport.
+ The single viewport owner may use non-passive wheel and vertical touch-move
+ listeners for that sequencing, provided they do not cancel native input or
+ add per-frame reactive work when the mounted runway already covers the next
+ viewport. Group and guest iteration must remain keyed so overlapping rows
+ survive window shifts rather than rebinding every mounted row. This
+ anticipation must preserve the existing bounded mounted-row budget;
+ rendering the whole estate or adding per-row observers, timers, or scroll
+ listeners is forbidden.
That same viewport-sync owner may expose one passive app-shell scroll
position signal and a smooth back-to-top action for the Workloads surface.
The control must remain absent near the top, sit above the mobile navigation
@@ -1811,6 +1814,11 @@ which owns the Workloads table body measurement and the scroll/resize listener
lifecycle. Future viewport sync changes must extend through that hook rather
than rebuilding browser-event wiring or table-body geometry reads inside
`frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`.
+Its wheel and vertical touch-move prewarm listeners are deliberately
+non-passive so the browser compositor cannot advance beyond the mounted runway
+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
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index ddb4b93cb4..49e433881a 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,17 +1,13 @@
{
"version": 1,
- "base_sha": "6ee36bc1ea456938a22f5a4bae4d3332ca98d9ed",
- "verified_at": "2026-08-23T18:54:26Z",
+ "base_sha": "10116cc17efb0004e3820f1a250335899d3b9bf0",
+ "verified_at": "2026-08-23T19:17:24Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/shared/useAnimatedNumberState.ts",
- "frontend-modern/src/stores/websocket.ts",
- "frontend-modern/src/utils/resourceStateAdapters.ts"
+ "frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts"
],
"content_sha256": {
- "frontend-modern/src/components/shared/useAnimatedNumberState.ts": "eff0a4e3e886c41515e1ebfb563004bad0218dda1e1465d45ab6d0025ab10363",
- "frontend-modern/src/stores/websocket.ts": "f2d071acd989ba5fa3c2877be66ae54231adfe34e311e19151b3ddeb1de4e923",
- "frontend-modern/src/utils/resourceStateAdapters.ts": "3999af02f025c93d3ffd8fc2d28d801d264b35e7091f0262d869ce8e60569433"
+ "frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts": "f21b70f169cc595b31337584e3df20022342e39d50bdfc9eac96a04770bcf7ba"
},
"routes": [
"/proxmox/overview"
@@ -19,7 +15,7 @@
"viewports": [
{
"width": 1280,
- "height": 720
+ "height": 800
},
{
"width": 390,
@@ -27,16 +23,16 @@
}
],
"states": [
- "Fresh desktop navigation hydrated the connected 50-node and 929-guest mock estate with both Nodes and Guests tables visible",
- "A fast desktop table scroll to scrollTop 20000 retained populated guest rows with no blank virtualized section",
- "At 390x844 the node summary, Nodes table, and Guests table remained visible, and a fast table scroll to scrollTop 12000 retained populated rows",
- "The Back to top control appeared after deep scrolling and returned the desktop table to scrollTop 0",
- "A clean phone-width reload remained stable during sustained realtime updates with no console errors"
+ "The connected public mock estate rendered 50 nodes and 929 guests with the grouped workload window active",
+ "Across 24 consecutive 600-pixel desktop wheel steps from scrollTop 10000 to 24400, every sample retained at least 26 visible guest rows",
+ "Across 24 consecutive 600-pixel wheel steps at 390x844 from scrollTop 10000 to 24400, every sample retained at least 22 visible guest rows",
+ "Desktop and narrow verification both retained the 140-row mounted guest budget throughout rapid scrolling",
+ "The verified route reported no browser error-level runtime logs during responsive and sustained-scroll checks"
],
"interactions": [
- "Loaded /proxmox/overview in fresh desktop and phone-width tabs and waited for the full large-estate snapshot",
- "Performed fast wheel-equivalent guest-table scrolling at desktop and phone widths and inspected the rendered row window",
- "Activated Back to top after a deep desktop scroll and confirmed the scroll settled at the table origin",
- "Reloaded the phone-width route after the animation bound changed and sampled sustained renderer metrics and console output"
+ "Reloaded /proxmox/overview and confirmed the complete large-estate mock snapshot and bounded workload window",
+ "Applied repeated physical wheel input through the workload viewport and sampled visible and mounted rows immediately after every desktop step",
+ "Repeated the same sustained wheel-input sequence at a 390x844 phone viewport and visually inspected the populated table",
+ "Inspected browser runtime logs after both responsive scroll sequences"
]
}
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 0ddb39e9dd..fbb2f62797 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
@@ -925,7 +925,12 @@ describe('Workloads performance contract', () => {
expect(workloadsWorkloadViewportSyncSource).toContain(
'SCROLL_TO_TOP_VISIBILITY_THRESHOLD_PX',
);
- expect(workloadsWorkloadViewportSyncSource).toContain("addEventListener('wheel'");
+ expect(workloadsWorkloadViewportSyncSource).toContain(
+ "addEventListener('wheel', handleViewportWheel, { passive: false })",
+ );
+ expect(workloadsWorkloadViewportSyncSource).toContain(
+ "addEventListener('touchmove', handleViewportTouchMove, { passive: false })",
+ );
expect(workloadsWorkloadViewportSyncSource).toContain('wheelDeltaInPixels');
expect(workloadsWorkloadViewportSyncSource).toContain(
"scrollContainer.scrollTo({ top: 0, behavior: 'smooth' })",
diff --git a/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
index 997ab78c4b..2167d6a41e 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
@@ -67,8 +67,14 @@ describe('useWorkloadViewportSync', () => {
passive: true,
});
expect(addEventListenerSpy).toHaveBeenCalledWith('wheel', expect.any(Function), {
+ passive: false,
+ });
+ expect(addEventListenerSpy).toHaveBeenCalledWith('touchstart', expect.any(Function), {
passive: true,
});
+ expect(addEventListenerSpy).toHaveBeenCalledWith('touchmove', expect.any(Function), {
+ passive: false,
+ });
expect(addEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
window.dispatchEvent(new Event('scroll'));
@@ -80,6 +86,8 @@ describe('useWorkloadViewportSync', () => {
expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
expect(removeEventListenerSpy).toHaveBeenCalledWith('wheel', expect.any(Function));
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('touchstart', expect.any(Function));
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('touchmove', expect.any(Function));
expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
});
@@ -174,10 +182,26 @@ describe('useWorkloadViewportSync', () => {
horizontalTableWrapper.dispatchEvent(new Event('scroll'));
expect(onScroll).toHaveBeenCalledTimes(2);
- appScrollContainer.dispatchEvent(new WheelEvent('wheel', { deltaY: 120 }));
- await waitFor(() => {
- expect(onScroll).toHaveBeenLastCalledWith(680, 400, 32);
+ const wheelEvent = new WheelEvent('wheel', {
+ cancelable: true,
+ deltaY: 120,
+ });
+ appScrollContainer.dispatchEvent(wheelEvent);
+ expect(onScroll).toHaveBeenLastCalledWith(680, 400, 32);
+ expect(wheelEvent.defaultPrevented).toBe(false);
+
+ const touchStart = new Event('touchstart');
+ Object.defineProperty(touchStart, 'touches', {
+ value: { item: () => ({ clientX: 200, clientY: 240 }) },
+ });
+ appScrollContainer.dispatchEvent(touchStart);
+ const touchMove = new Event('touchmove');
+ Object.defineProperty(touchMove, 'touches', {
+ value: { item: () => ({ clientX: 196, clientY: 120 }) },
});
+ appScrollContainer.dispatchEvent(touchMove);
+ expect(onScroll).toHaveBeenLastCalledWith(680, 400, 32);
+ expect(touchMove.defaultPrevented).toBe(false);
});
it('exposes one app-shell back-to-top action after sustained workload scrolling', async () => {
diff --git a/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts b/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
index 7808b39bba..bdec91d066 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
@@ -7,6 +7,11 @@ const MIN_VERTICAL_SCROLL_RANGE_PX = 1;
const SCROLL_TO_TOP_VISIBILITY_THRESHOLD_PX = 640;
const WHEEL_LINE_HEIGHT_PX = 16;
+interface TouchPosition {
+ x: number;
+ y: number;
+}
+
const wheelDeltaInPixels = (event: WheelEvent, viewportHeight: 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;
@@ -91,6 +96,7 @@ export function useWorkloadViewportSync(options: WorkloadsWorkloadViewportSyncOp
const handleViewportScroll = () => {
syncGuestWindowToViewport();
};
+ let lastTouchPosition: TouchPosition | null = null;
const handleViewportWheel = (event: Event) => {
const wheelEvent = event as WheelEvent;
if (!options.groupedWindowing.isWindowed() || wheelEvent.deltaY === 0) return;
@@ -100,6 +106,31 @@ export function useWorkloadViewportSync(options: WorkloadsWorkloadViewportSyncOp
: window.innerHeight;
syncGuestWindowToViewport(false, wheelDeltaInPixels(wheelEvent, viewportHeight));
};
+ const handleViewportTouchStart = (event: Event) => {
+ const touch = (event as TouchEvent).touches.item(0);
+ lastTouchPosition = touch ? { x: touch.clientX, y: touch.clientY } : null;
+ };
+ const handleViewportTouchMove = (event: Event) => {
+ const touch = (event as TouchEvent).touches.item(0);
+ if (!touch) {
+ lastTouchPosition = null;
+ return;
+ }
+
+ const nextPosition = { x: touch.clientX, y: touch.clientY };
+ const previousPosition = lastTouchPosition;
+ lastTouchPosition = nextPosition;
+ if (!previousPosition || !options.groupedWindowing.isWindowed()) return;
+
+ const deltaX = previousPosition.x - nextPosition.x;
+ const deltaY = previousPosition.y - nextPosition.y;
+ if (deltaY === 0 || Math.abs(deltaY) <= Math.abs(deltaX)) return;
+ syncGuestWindowToViewport(false, deltaY);
+ };
+ const handleViewportTouchEnd = (event: Event) => {
+ const touch = (event as TouchEvent).touches.item(0);
+ lastTouchPosition = touch ? { x: touch.clientX, y: touch.clientY } : null;
+ };
const handleViewportResize = () => {
syncGuestWindowToViewport(true);
};
@@ -108,11 +139,22 @@ export function useWorkloadViewportSync(options: WorkloadsWorkloadViewportSyncOp
const scrollContainer = findScrollContainer(options.tableBodyRef()!);
const scrollTarget = scrollContainer ?? window;
scrollTarget.addEventListener('scroll', handleViewportScroll, { passive: true });
- scrollTarget.addEventListener('wheel', handleViewportWheel, { passive: true });
+ // These two pre-scroll listeners intentionally remain non-passive. That
+ // makes the browser wait for the bounded row window to move before its
+ // compositor advances the viewport; neither handler cancels native input.
+ scrollTarget.addEventListener('wheel', handleViewportWheel, { passive: false });
+ scrollTarget.addEventListener('touchstart', handleViewportTouchStart, { passive: true });
+ scrollTarget.addEventListener('touchmove', handleViewportTouchMove, { passive: false });
+ scrollTarget.addEventListener('touchend', handleViewportTouchEnd, { passive: true });
+ scrollTarget.addEventListener('touchcancel', handleViewportTouchEnd, { passive: true });
window.addEventListener('resize', handleViewportResize);
onCleanup(() => {
scrollTarget.removeEventListener('scroll', handleViewportScroll);
scrollTarget.removeEventListener('wheel', handleViewportWheel);
+ scrollTarget.removeEventListener('touchstart', handleViewportTouchStart);
+ scrollTarget.removeEventListener('touchmove', handleViewportTouchMove);
+ scrollTarget.removeEventListener('touchend', handleViewportTouchEnd);
+ scrollTarget.removeEventListener('touchcancel', handleViewportTouchEnd);
window.removeEventListener('resize', handleViewportResize);
});
});