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.

Fix mobile platform tab scrolling

rcourtman51b7357285b0
diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.json
index f8f33403e9..f86e20d9ba 100644
--- a/docs/release-control/v6/internal/status.json
+++ b/docs/release-control/v6/internal/status.json
@@ -9761,21 +9761,7 @@
}
],
"candidate_lanes": [],
- "work_claims": [
- {
- "id": "root-lane-l1",
- "agent_id": "root",
- "summary": "Prepare and publish the next governed Pulse release candidate from current main.",
- "target_id": "v6-product-lane-expansion",
- "claimed_at": "2026-08-25T08:42:33Z",
- "heartbeat_at": "2026-08-25T08:42:33Z",
- "expires_at": "2026-08-25T10:42:33Z",
- "work_item": {
- "kind": "lane",
- "id": "L1"
- }
- }
- ],
+ "work_claims": [],
"open_decisions": [],
"source_of_truth_file": "docs/release-control/v6/internal/SOURCE_OF_TRUTH.md",
"resolved_decisions": [
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index eb4bc2a8e7..c20aac62cc 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,24 +1,21 @@
{
"version": 1,
- "base_sha": "831e55f011f3478767daa3d6578dab9f2bd96e45",
- "verified_at": "2026-08-25T09:34:54Z",
+ "base_sha": "7bac525af355bc5c8eb6ff2db8f9ce116697013f",
+ "verified_at": "2026-08-25T10:44:58Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/hooks/useUnifiedResources.ts",
- "frontend-modern/src/hooks/useWorkloads.ts",
- "frontend-modern/src/utils/resourceStateAdapters.ts"
+ "frontend-modern/src/components/shared/horizontalRailVisibilityModel.ts",
+ "frontend-modern/src/components/shared/useActiveHorizontalRailItemVisibility.ts",
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx"
],
"content_sha256": {
- "frontend-modern/src/hooks/useUnifiedResources.ts": "dd5880e08d41cd8d9595084a3bfedc292584e38e785ff144e4ead96c36a67a3b",
- "frontend-modern/src/hooks/useWorkloads.ts": "e14581a0af97e49da1322b253be6a3ffa433163d00bbc436c31614539e70094d",
- "frontend-modern/src/utils/resourceStateAdapters.ts": "2ec8e4754e323ae36f9c61148db4256732a2c7e8678746a7c0e9f60538539d1b"
+ "frontend-modern/src/components/shared/horizontalRailVisibilityModel.ts": "1fa3ad5d3cfffd0ccf78ced497d87564602cb124103175c17ba6c3e4b9531c4f",
+ "frontend-modern/src/components/shared/useActiveHorizontalRailItemVisibility.ts": "add047b223402743fbabf5d7c9b867f160174ab2e48baf53c0c60509caf01510",
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx": "3507374c3c9c236a95ee50793f2462b16d71680f13c1f4c864efc3ea88159659"
},
"routes": [
- "/login",
"/proxmox/overview",
- "/proxmox/storage",
- "/proxmox/backups/date",
- "/alerts"
+ "/proxmox/replication"
],
"viewports": [
{
@@ -31,17 +28,16 @@
}
],
"states": [
- "50-node/1512-resource mock estate with RandomMetrics websocket ticks every 2s riding through every dwell",
- "Proxmox overview fully hydrated at desktop (11.7k DOM nodes) after login, including return visit after sub-tab navigation",
- "Storage and Backups sub-tabs fully hydrated at desktop (11.4k / 15.4k DOM nodes)",
- "Alerts page dwelled 20s at 390px under 4x CPU throttle while websocket deltas applied (CDP profile captured)",
- "Proxmox overview dwelled 20s at 390px under 4x CPU throttle while websocket deltas applied (CDP profile captured)",
- "zero console errors across the desktop exercise run"
+ "Proxmox overview tab rail with all six destinations at desktop width",
+ "Proxmox overview tab rail initially clipped at phone width with the right affordance visible",
+ "phone tab rail manually scrolled to its 207px end position with the left affordance visible",
+ "manually scrolled phone rail after a same-width viewport-height resize",
+ "Replication selected from the manually explored rail with the active label clear of the left overlay"
],
"interactions": [
- "headless-Chromium (Playwright) login form fill and submit as admin",
- "SPA clicks across Proxmox sub-tab anchors Overview -> Storage -> Backups -> Overview at 1440x900",
- "mobile bottom-bar data-tab-id click into Alerts at 390x844 with 4x CPU throttle",
- "multi-tick idle dwells on Overview and Alerts confirming realtime delta merge, host coalescing, and workload row updates render live data"
+ "native horizontal wheel/swipe projection across the phone-width Proxmox section rail",
+ "phone viewport resize after manual rail exploration preserved scrollLeft at 207px",
+ "selected Replication from the revealed rail and confirmed route navigation plus active-tab visibility",
+ "repeated the final phone flow after the active-label clearance adjustment: swipe to 190px, resize without snap-back, then select Replication at a safe 55px viewport offset"
]
-}
\ No newline at end of file
+}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 6334d7ffb8..b4febbb676 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -7458,7 +7458,7 @@ describe('shared primitive guardrails', () => {
expect(sharedPlatformPageSource).toContain('href={tab.path}');
expect(sharedPlatformPageSource).toContain('border-b-2');
expect(sharedPlatformPageSource).toContain('overflow-x-auto pl-0');
- expect(sharedPlatformPageSource).toContain("canScrollRight() ? 'pr-10' : 'pr-0'");
+ expect(sharedPlatformPageSource).toContain("hasOverflow() ? 'pr-10' : 'pr-0'");
expect(sharedPlatformPageSource).not.toContain('overflow-x-auto px-10');
expect(sharedPlatformPageSource).toContain('export const getPlatformTableRowClass');
expect(sharedPlatformPageSource).toContain(
@@ -7473,10 +7473,13 @@ describe('shared primitive guardrails', () => {
'export function getHorizontalRailScrollLeft',
);
expect(activeHorizontalRailVisibilitySource).toContain(
- "window.addEventListener('resize', keepActiveItemVisible)",
+ "window.addEventListener('resize', keepActiveItemVisibleAfterResize)",
);
expect(activeHorizontalRailVisibilitySource).toContain(
- 'new ResizeObserver(keepActiveItemVisible)',
+ 'new ResizeObserver(keepActiveItemVisibleAfterResize)',
+ );
+ expect(activeHorizontalRailVisibilitySource).toContain(
+ "rail?.addEventListener('pointerdown', markManualScrollIntent",
);
expect(sharedPlatformPageSource).toContain(
"aria-current={props.active === tab.id ? 'page' : undefined}",
diff --git a/frontend-modern/src/components/shared/horizontalRailVisibilityModel.ts b/frontend-modern/src/components/shared/horizontalRailVisibilityModel.ts
index 2df3cfcec7..05ad0d15bc 100644
--- a/frontend-modern/src/components/shared/horizontalRailVisibilityModel.ts
+++ b/frontend-modern/src/components/shared/horizontalRailVisibilityModel.ts
@@ -1,4 +1,4 @@
-const HORIZONTAL_RAIL_EDGE_PADDING = 8;
+const DEFAULT_HORIZONTAL_RAIL_EDGE_PADDING = 8;
export interface HorizontalRailVisibilityMetrics {
scrollLeft: number;
@@ -6,20 +6,24 @@ export interface HorizontalRailVisibilityMetrics {
clientWidth: number;
itemOffsetLeft: number;
itemOffsetWidth: number;
+ edgePadding?: number;
}
export function getHorizontalRailScrollLeft(options: HorizontalRailVisibilityMetrics): number {
const maxScrollLeft = Math.max(0, options.scrollWidth - options.clientWidth);
+ const edgePadding = Number.isFinite(options.edgePadding)
+ ? Math.max(0, options.edgePadding ?? DEFAULT_HORIZONTAL_RAIL_EDGE_PADDING)
+ : DEFAULT_HORIZONTAL_RAIL_EDGE_PADDING;
const visibleStart = options.scrollLeft;
const visibleEnd = visibleStart + options.clientWidth;
const itemStart = options.itemOffsetLeft;
const itemEnd = itemStart + options.itemOffsetWidth;
- if (itemStart < visibleStart + HORIZONTAL_RAIL_EDGE_PADDING) {
- return Math.max(0, itemStart - HORIZONTAL_RAIL_EDGE_PADDING);
+ if (itemStart < visibleStart + edgePadding) {
+ return Math.max(0, itemStart - edgePadding);
}
- if (itemEnd > visibleEnd - HORIZONTAL_RAIL_EDGE_PADDING) {
- return Math.min(maxScrollLeft, itemEnd + HORIZONTAL_RAIL_EDGE_PADDING - options.clientWidth);
+ if (itemEnd > visibleEnd - edgePadding) {
+ return Math.min(maxScrollLeft, itemEnd + edgePadding - options.clientWidth);
}
return Math.min(maxScrollLeft, Math.max(0, options.scrollLeft));
}
diff --git a/frontend-modern/src/components/shared/useActiveHorizontalRailItemVisibility.ts b/frontend-modern/src/components/shared/useActiveHorizontalRailItemVisibility.ts
index 54bfa95806..164f4a8e83 100644
--- a/frontend-modern/src/components/shared/useActiveHorizontalRailItemVisibility.ts
+++ b/frontend-modern/src/components/shared/useActiveHorizontalRailItemVisibility.ts
@@ -5,11 +5,18 @@ interface ActiveHorizontalRailItemVisibilityOptions {
active: () => unknown;
rail: () => HTMLElement | undefined;
activeSelector?: string;
+ edgePadding?: number;
+}
+
+interface ActiveHorizontalRailItemVisibilityController {
+ markManualScrollIntent: () => void;
}
export function useActiveHorizontalRailItemVisibility(
options: ActiveHorizontalRailItemVisibilityOptions,
-): void {
+): ActiveHorizontalRailItemVisibilityController {
+ let preserveManualPosition = false;
+
const keepActiveItemVisible = () => {
const rail = options.rail();
const activeItem = rail?.querySelector<HTMLElement>(
@@ -23,11 +30,26 @@ export function useActiveHorizontalRailItemVisibility(
clientWidth: rail.clientWidth,
itemOffsetLeft: activeItem.offsetLeft,
itemOffsetWidth: activeItem.offsetWidth,
+ edgePadding: options.edgePadding,
});
};
+ const keepActiveItemVisibleAfterResize = () => {
+ if (preserveManualPosition) return;
+ keepActiveItemVisible();
+ };
+
+ const markManualScrollIntent = () => {
+ // Mobile browser chrome and responsive layout changes can emit resize
+ // events during a native horizontal swipe. Once the operator starts
+ // exploring the rail, keep their chosen position until the active item
+ // actually changes instead of pulling the rail back to the active tab.
+ preserveManualPosition = true;
+ };
+
createEffect(() => {
const active = options.active();
+ preserveManualPosition = false;
const timeoutId = window.setTimeout(() => {
if (options.active() !== active) return;
keepActiveItemVisible();
@@ -36,15 +58,25 @@ export function useActiveHorizontalRailItemVisibility(
});
onMount(() => {
- window.addEventListener('resize', keepActiveItemVisible);
const rail = options.rail();
+ window.addEventListener('resize', keepActiveItemVisibleAfterResize);
+ rail?.addEventListener('pointerdown', markManualScrollIntent, { passive: true });
+ rail?.addEventListener('touchstart', markManualScrollIntent, { passive: true });
+ rail?.addEventListener('wheel', markManualScrollIntent, { passive: true });
const resizeObserver =
- typeof ResizeObserver === 'function' ? new ResizeObserver(keepActiveItemVisible) : undefined;
+ typeof ResizeObserver === 'function'
+ ? new ResizeObserver(keepActiveItemVisibleAfterResize)
+ : undefined;
if (rail) resizeObserver?.observe(rail);
onCleanup(() => {
- window.removeEventListener('resize', keepActiveItemVisible);
+ window.removeEventListener('resize', keepActiveItemVisibleAfterResize);
+ rail?.removeEventListener('pointerdown', markManualScrollIntent);
+ rail?.removeEventListener('touchstart', markManualScrollIntent);
+ rail?.removeEventListener('wheel', markManualScrollIntent);
resizeObserver?.disconnect();
});
});
+
+ return { markManualScrollIntent };
}
diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.navigation.test.tsx b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.navigation.test.tsx
index 8ba484933c..3e3aba7a8c 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.navigation.test.tsx
+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.navigation.test.tsx
@@ -64,6 +64,19 @@ describe('PlatformSectionTabs', () => {
).toBe(300);
});
+ it('keeps active labels clear of overlaid mobile rail controls', () => {
+ expect(
+ getHorizontalRailScrollLeft({
+ scrollLeft: 207,
+ scrollWidth: 570,
+ clientWidth: 363,
+ itemOffsetLeft: 170,
+ itemOffsetWidth: 97,
+ edgePadding: 48,
+ }),
+ ).toBe(122);
+ });
+
it('hides overview-only section navigation', () => {
render(() => (
<Router>
@@ -107,6 +120,8 @@ describe('PlatformSectionTabs', () => {
const navigation = screen.getByRole('navigation', { name: 'TrueNAS sections' });
expect(navigation).toHaveClass('overflow-x-auto');
+ expect(navigation).toHaveClass('overscroll-x-contain');
+ expect(navigation).toHaveClass('touch-scroll');
expect(navigation).toHaveClass('scrollbar-hide');
expect(navigation).toHaveClass('pl-0');
expect(navigation).toHaveClass('pr-0');
@@ -173,6 +188,53 @@ describe('PlatformSectionTabs', () => {
await screen.findByRole('button', { name: 'Example sections: scroll left' }),
).toBeInTheDocument();
expect(navigation).toHaveClass('pl-0');
+ expect(navigation).toHaveClass('pr-10');
+ });
+
+ it('preserves a manually explored position when mobile viewport resizes fire mid-gesture', async () => {
+ render(() => (
+ <Router>
+ <Route
+ path="/"
+ component={() => (
+ <PlatformSectionTabs
+ tabs={
+ [
+ { id: 'overview', label: 'Overview', path: '/example/overview' },
+ { id: 'images', label: 'Images', path: '/example/images' },
+ { id: 'storage', label: 'Storage', path: '/example/storage' },
+ { id: 'networks', label: 'Networks', path: '/example/networks' },
+ ] as const
+ }
+ active="overview"
+ ariaLabel="Example sections"
+ />
+ )}
+ />
+ </Router>
+ ));
+
+ await new Promise((resolve) => window.setTimeout(resolve));
+
+ const navigation = screen.getByRole('navigation', { name: 'Example sections' });
+ const activeLink = within(navigation).getByRole('link', { name: 'Overview' });
+ Object.defineProperties(navigation, {
+ clientWidth: { configurable: true, value: 200 },
+ scrollWidth: { configurable: true, value: 500 },
+ scrollLeft: { configurable: true, writable: true, value: 0 },
+ });
+ Object.defineProperties(activeLink, {
+ offsetLeft: { configurable: true, value: 0 },
+ offsetWidth: { configurable: true, value: 100 },
+ });
+
+ navigation.dispatchEvent(new Event('pointerdown'));
+ navigation.scrollLeft = 120;
+ navigation.dispatchEvent(new Event('scroll'));
+ window.dispatchEvent(new Event('resize'));
+
+ await new Promise((resolve) => window.setTimeout(resolve));
+ expect(navigation.scrollLeft).toBe(120);
});
it('keeps the active destination visible when the tab rail narrows', async () => {
@@ -214,6 +276,6 @@ describe('PlatformSectionTabs', () => {
window.dispatchEvent(new Event('resize'));
- await waitFor(() => expect(navigation.scrollLeft).toBe(258));
+ await waitFor(() => expect(navigation.scrollLeft).toBe(298));
});
});
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 28fe7cda40..4d0bbc0ebf 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -95,6 +95,7 @@ export function PlatformSectionTabs<TabId extends string>(props: {
ariaLabel: string;
}) {
let tabListRef: HTMLElement | undefined;
+ const [hasOverflow, setHasOverflow] = createSignal(false);
const [canScrollLeft, setCanScrollLeft] = createSignal(false);
const [canScrollRight, setCanScrollRight] = createSignal(false);
@@ -102,13 +103,18 @@ export function PlatformSectionTabs<TabId extends string>(props: {
const rail = tabListRef;
if (!rail) return;
const maxScrollLeft = Math.max(0, rail.scrollWidth - rail.clientWidth);
+ setHasOverflow(maxScrollLeft > 1);
setCanScrollLeft(rail.scrollLeft > 1);
setCanScrollRight(rail.scrollLeft < maxScrollLeft - 1);
};
- useActiveHorizontalRailItemVisibility({
+ const activeItemVisibility = useActiveHorizontalRailItemVisibility({
active: () => props.active,
rail: () => tabListRef,
+ // The phone-only arrow overlays occupy 40px at either rail edge. Keep
+ // selected labels beyond those controls, with the normal 8px breathing
+ // room, whenever route navigation brings a tab into view.
+ edgePadding: 48,
});
createEffect(() => {
@@ -137,6 +143,7 @@ export function PlatformSectionTabs<TabId extends string>(props: {
const scrollSections = (direction: -1 | 1) => {
const rail = tabListRef;
if (!rail) return;
+ activeItemVisibility.markManualScrollIntent();
rail.scrollBy({
left: direction * Math.max(160, Math.round(rail.clientWidth * 0.7)),
behavior: 'smooth',
@@ -150,8 +157,8 @@ export function PlatformSectionTabs<TabId extends string>(props: {
ref={(element) => {
tabListRef = element;
}}
- class={`flex min-w-0 items-center gap-1 overflow-x-auto pl-0 scrollbar-hide sm:pr-0 ${
- canScrollRight() ? 'pr-10' : 'pr-0'
+ class={`touch-scroll flex min-w-0 items-center gap-1 overflow-x-auto pl-0 overscroll-x-contain scrollbar-hide sm:pr-0 ${
+ hasOverflow() ? 'pr-10' : 'pr-0'
}`}
aria-label={props.ariaLabel}
>