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(ui): keep active subtabs visible

rcourtman75e4105d8385
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 015b390f14..dc7b60e7b0 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,42 +1,45 @@
{
"version": 1,
- "base_sha": "662bb4f1946606e51122bfe06fd2d82aa33c6a15",
- "verified_at": "2026-08-05T23:44:24Z",
+ "base_sha": "dd49fbd93e2eb573beb08aa442e42b73b0ac04b6",
+ "verified_at": "2026-08-05T23:54:57Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/stores/websocket.ts",
- "frontend-modern/src/types/api.ts"
+ "frontend-modern/src/components/shared/Subtabs.tsx"
],
"content_sha256": {
- "frontend-modern/src/stores/websocket.ts": "056eb325939f188c6095273441fd3b48c0f02cdfb4dd0a5b044c43b73868301a",
- "frontend-modern/src/types/api.ts": "895ab5aa5ee5e1162008be6c8da83377169941d25b1655d73a1042d91076697b"
+ "frontend-modern/src/components/shared/Subtabs.tsx": "3570327799b306ee929d3777cf85f85db2d37b062cbb732c0d1c49e5e12f4388"
},
"routes": [
- "/proxmox/overview",
- "/truenas/overview"
+ "/alerts/thresholds/proxmox",
+ "/alerts/thresholds/docker",
+ "/alerts/thresholds/kubernetes",
+ "/alerts/thresholds/truenas",
+ "/alerts/thresholds/vmware",
+ "/alerts/thresholds/systems",
+ "/actions"
],
"viewports": [
{
"width": 1280,
- "height": 720
+ "height": 820
},
{
- "width": 390,
- "height": 844
+ "width": 320,
+ "height": 820
}
],
"states": [
- "full initial WebSocket state hydration",
- "live resource merge-patch refresh after the initial baseline",
- "full WebSocket resync after a page reload",
- "Proxmox node disk-array rendering after a delta refresh",
- "TrueNAS system and health-alert rendering after desktop and narrow delta refreshes"
+ "direct deep links to every threshold platform",
+ "selected threshold platform at the start, middle, and end of an overflowing tab strip",
+ "desktop threshold tables with adaptive metric columns",
+ "mobile threshold resource cards after the table-to-card breakpoint",
+ "shared Subtabs rendering on the Actions Open and History views"
],
"interactions": [
- "signed in to the current local build and waited for the initial Proxmox resource workspace to hydrate",
- "waited through a live refresh and confirmed changing metrics rendered without disconnecting or logging browser errors",
- "opened the TrueNAS workspace and confirmed its system and alert projections remained intact after delta application",
- "reloaded the TrueNAS route and confirmed the complete resync restored a connected, populated workspace",
- "repeated TrueNAS initial hydration and live refresh at 390 by 844 and visually inspected the responsive result"
+ "opened every threshold platform directly at 320 by 820 and measured the selected tab against the visible tablist bounds",
+ "confirmed Kubernetes, TrueNAS, vSphere, and Machines now scroll into view with zero document overflow",
+ "confirmed Proxmox and Docker remain at their natural leading positions without unnecessary scrolling",
+ "visually inspected the fixed Machines threshold strip and its responsive resource content",
+ "rechecked the Actions shared subtab consumer at desktop and mobile widths"
]
}
diff --git a/frontend-modern/src/components/shared/Subtabs.tsx b/frontend-modern/src/components/shared/Subtabs.tsx
index 55878c5d92..1e4c7eb3be 100644
--- a/frontend-modern/src/components/shared/Subtabs.tsx
+++ b/frontend-modern/src/components/shared/Subtabs.tsx
@@ -1,4 +1,4 @@
-import { Component, For, JSX, splitProps } from 'solid-js';
+import { Component, createEffect, For, JSX, splitProps } from 'solid-js';
export interface SubtabOption {
value: string;
@@ -30,6 +30,7 @@ export const subtabButtonClass =
export const subtabButtonActiveClass = 'border-blue-600 text-base-content';
export const subtabButtonInactiveClass = 'border-transparent text-muted hover:text-base-content';
export const Subtabs: Component<SubtabsProps> = (props) => {
+ let tablistRef: HTMLDivElement | undefined;
const [local, divProps] = splitProps(props, [
'value',
'onChange',
@@ -41,8 +42,20 @@ export const Subtabs: Component<SubtabsProps> = (props) => {
'trailing',
]);
+ createEffect(() => {
+ // Keep the selected tab discoverable when a narrow, horizontally scrolling
+ // tablist is opened through a deep link or changed programmatically.
+ void local.value;
+ queueMicrotask(() => {
+ tablistRef
+ ?.querySelector<HTMLElement>('[role="tab"][aria-selected="true"]')
+ ?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
+ });
+ });
+
const tablist = () => (
<div
+ ref={tablistRef}
role="tablist"
aria-label={local.ariaLabel}
class={`${subtabsListClass} ${local.listClass ?? ''}`.trim()}
diff --git a/frontend-modern/src/components/shared/__tests__/Subtabs.test.tsx b/frontend-modern/src/components/shared/__tests__/Subtabs.test.tsx
index 267389c3b6..1fb87eb24d 100644
--- a/frontend-modern/src/components/shared/__tests__/Subtabs.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/Subtabs.test.tsx
@@ -1,4 +1,5 @@
-import { render, screen, within } from '@solidjs/testing-library';
+import { fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
+import { createSignal } from 'solid-js';
import { describe, expect, it, vi } from 'vitest';
import { Subtabs } from '@/components/shared/Subtabs';
@@ -28,4 +29,49 @@ describe('Subtabs', () => {
expect(historyTab).toHaveClass('shrink-0');
expect(historyTab).toHaveClass('whitespace-nowrap');
});
+
+ it('scrolls a newly selected tab into view', async () => {
+ const previousScrollIntoView = Element.prototype.scrollIntoView;
+ const scrollIntoView = vi.fn();
+ Object.defineProperty(Element.prototype, 'scrollIntoView', {
+ configurable: true,
+ value: scrollIntoView,
+ });
+
+ try {
+ const [value, setValue] = createSignal('overview');
+ render(() => (
+ <Subtabs
+ value={value()}
+ onChange={setValue}
+ ariaLabel="Threshold platform"
+ tabs={[
+ { value: 'overview', label: 'Overview' },
+ { value: 'kubernetes', label: 'Kubernetes' },
+ { value: 'systems', label: 'Machines' },
+ ]}
+ />
+ ));
+
+ scrollIntoView.mockClear();
+ fireEvent.click(screen.getByRole('tab', { name: 'Machines' }));
+
+ await waitFor(() => {
+ expect(screen.getByRole('tab', { name: 'Machines' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ expect(scrollIntoView).toHaveBeenCalledWith({ block: 'nearest', inline: 'nearest' });
+ });
+ } finally {
+ if (previousScrollIntoView) {
+ Object.defineProperty(Element.prototype, 'scrollIntoView', {
+ configurable: true,
+ value: previousScrollIntoView,
+ });
+ } else {
+ Reflect.deleteProperty(Element.prototype, 'scrollIntoView');
+ }
+ }
+ });
});