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 workload table header alignment

rcourtman3b866458f665
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 719895cf39..60b5794486 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -932,6 +932,11 @@ change may globally weaken the Task 03 lifecycle-state idempotency invariant.
the column label must remain present through an `sr-only` label so the
header row exposes names such as Uptime, Image, Context, and Node instead
of collapsing to only the visible text columns.
+ Info/ID headers and cells must center as compact identifiers beside the
+ workload Type column, while compound Net I/O and Disk I/O headers center
+ over their paired directional values. Header alignment exceptions belong
+ in `WorkloadTableHeader.tsx`; page CSS and duplicated platform table
+ schemas must not reposition them.
Sort-direction presentation must remain a constant-time shared helper call:
inactive headers render no repeated marker, while the active header consumes
`frontend-modern/src/components/shared/tableSortPresentation.ts`. It must not
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 21e16ff2e3..f94a69763b 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,42 +1,41 @@
{
"version": 1,
- "base_sha": "52a3373ae6cafaffcd97bb466c42216b896fe5ce",
- "verified_at": "2026-08-26T05:42:38Z",
+ "base_sha": "af370a8dda01852586e6462b3208a7d822ee1261",
+ "verified_at": "2026-08-26T09:08:45Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx",
- "frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts",
- "frontend-modern/src/routing/resourceLinks.ts"
+ "frontend-modern/src/components/Workloads/GuestRow.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx"
],
"content_sha256": {
- "frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx": "8f4b168bc6748f9318d04d67f3b2a614bdeb0e5c6d884d5aec309e1b7d202886",
- "frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts": "5fb8dd36ee2144095e3ad979109dc750649c5818f36e9587caafaef1313be4ec",
- "frontend-modern/src/routing/resourceLinks.ts": "cdd803824f883dab64654fcceb92da963bd18013eae3d1cf768880a3f77bb96b"
+ "frontend-modern/src/components/Workloads/GuestRow.tsx": "c1886d219bb44a9560a93e3227e022e370d0df7e3e396fa6e69ac4d982f275e2",
+ "frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx": "9ed1b7fe10646efa7ec366a2ceca0c69fe30e77aff9334d2440ca6ede3f65fb8"
},
"routes": [
- "/proxmox/backups/date",
- "/proxmox/backups/coverage"
+ "/proxmox/overview"
],
"viewports": [
{
- "width": 1280,
- "height": 800
+ "width": 1920,
+ "height": 1200
},
{
- "width": 390,
- "height": 844
+ "width": 768,
+ "height": 1000
}
],
"states": [
- "unfiltered 3018-point By date inventory with multiple PBS servers and datastores",
- "By date narrowed to backup-vault / offsite-vault with unrelated primary-vault and PVE evidence absent",
- "Coverage narrowed to backup-vault / primary-vault with 381 of 932 targets and location-scoped expanded restore evidence",
- "mobile Coverage filter rail with the active backup-location chip, clear control, and filtered target count"
+ "loaded grouped guest table with running and stopped VM and LXC rows",
+ "wide table with shared Info/ID, Net I/O, and Disk I/O columns visible",
+ "narrow table with the responsive Info/ID column visible and I/O columns omitted",
+ "active descending Net I/O sort indicator"
],
"interactions": [
- "opened the Backup location filter and selected backup-vault / offsite-vault on the current development build",
- "confirmed the URL-owned location query appeared and the By date table retained offsite-vault evidence while removing primary-vault evidence",
- "switched to Coverage and confirmed the location query persisted, the target count narrowed, and an expanded row showed only primary-vault restore evidence",
- "repeated the filtered Coverage state at 390x844, expanded the mobile filter rail, checked placement and clipping, and removed the location chip"
+ "reloaded the Proxmox overview after the final source change",
+ "confirmed Type and the shared Info/ID header and cells use balanced centered alignment at desktop and narrow widths",
+ "confirmed Net I/O and Disk I/O headers stay centered over their paired directional readings",
+ "sorted by ID and Net I/O and confirmed the sort indicator preserves the corrected alignment",
+ "confirmed table and scroll-shell width parity at 1920px and 768px without unintended horizontal overflow",
+ "confirmed no browser console warnings or errors and restored the viewport override"
]
}
diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
index 3cbe39a080..529dc9d65c 100644
--- a/frontend-modern/src/components/Workloads/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -322,8 +322,8 @@ export function GuestRow(props: GuestRowProps) {
{/* Info - merged identifier (VMID / image / namespace) for mixed-type views */}
<Show when={isColVisible('info')}>
- <td class="px-0.5 py-0.5 align-middle sm:px-2">
- <div class="flex justify-center text-xs text-muted whitespace-nowrap">
+ <td class="px-0.5 py-0.5 align-middle text-center sm:px-2" data-workload-col="info">
+ <div class="text-xs text-muted whitespace-nowrap">
<Show
when={infoValue()}
fallback={
@@ -344,8 +344,8 @@ export function GuestRow(props: GuestRowProps) {
{/* VMID */}
<Show when={isColVisible('vmid')}>
- <td class="px-1.5 sm:px-2 py-0.5 align-middle">
- <div class="flex justify-center text-xs text-muted whitespace-nowrap">
+ <td class="px-1.5 sm:px-2 py-0.5 align-middle text-center" data-workload-col="vmid">
+ <div class="text-xs text-muted tabular-nums whitespace-nowrap">
<Show
when={displayId()}
fallback={
diff --git a/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
index 2c752775ae..31e390f34c 100644
--- a/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
@@ -6,6 +6,7 @@ import {
getPlatformColumnAlign,
type PlatformTableColumnKind,
} from '@/features/platformPage/columnAlignment';
+import type { PlatformTableCellAlign } from '@/features/platformPage/sharedPlatformPage';
import { getGuestColumnStyle } from './guestRowModel';
import type { WorkloadsMemoryDisplayBasis } from './workloadsFilterModel';
@@ -44,12 +45,24 @@ export const getWorkloadColumnHeaderLabel = (
// 'name' is forced to left because the first column is always the
// primary identifier regardless of how the column model labels it.
// Unknown / unset kinds fall back to text → left.
+const CENTERED_WORKLOAD_COLUMN_IDS = new Set(['info', 'vmid', 'netIo', 'diskIo']);
+
+export const getWorkloadColumnHeaderAlign = (
+ columnId: string,
+ kind: PlatformTableColumnKind | undefined,
+ isFirst: boolean,
+): PlatformTableCellAlign => {
+ const effectiveKind: PlatformTableColumnKind = isFirst ? 'name' : (kind ?? 'text');
+ if (CENTERED_WORKLOAD_COLUMN_IDS.has(columnId)) return 'center';
+ return getPlatformColumnAlign(effectiveKind);
+};
+
const resolveAlignClasses = (
+ columnId: string,
kind: PlatformTableColumnKind | undefined,
isFirst: boolean,
): { textAlign: string; flexJustify: string } => {
- const effectiveKind: PlatformTableColumnKind = isFirst ? 'name' : (kind ?? 'text');
- const align = getPlatformColumnAlign(effectiveKind);
+ const align = getWorkloadColumnHeaderAlign(columnId, kind, isFirst);
if (align === 'right') {
return { textAlign: 'text-right', flexJustify: 'justify-end' };
}
@@ -66,7 +79,7 @@ export function WorkloadTableHeader(props: WorkloadTableHeaderProps) {
<For each={props.workloadTableVisibleColumns()}>
{(col) => {
const isFirst = () => col.id === props.visibleColumns()[0]?.id;
- const alignClasses = () => resolveAlignClasses(col.kind, isFirst());
+ const alignClasses = () => resolveAlignClasses(col.id, col.kind, isFirst());
const sortKeyForCol = col.sortKey as WorkloadSortKey | undefined;
const isSortable = !!sortKeyForCol;
const isSorted = () => sortKeyForCol && props.sortKey() === sortKeyForCol;
diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
index 309fa95738..0a11815d96 100644
--- a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
@@ -471,12 +471,22 @@ describe('GuestRow', () => {
});
describe('displayId logic', () => {
+ it('centers the shared info identifier beside the workload type', () => {
+ const { container } = renderGuestRow({
+ guest: makeGuest({ vmid: 123, displayId: undefined }),
+ visibleColumnIds: ['name', 'info'],
+ });
+
+ expect(container.querySelector('[data-workload-col="info"]')).toHaveClass('text-center');
+ });
+
it('shows vmid when displayId is not set', () => {
- renderGuestRow({
+ const { container } = renderGuestRow({
guest: makeGuest({ vmid: 123, displayId: undefined }),
visibleColumnIds: ['name', 'vmid'],
});
expect(screen.getByText('123')).toBeTruthy();
+ expect(container.querySelector('[data-workload-col="vmid"]')).toHaveClass('text-center');
});
it('shows displayId when set', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadTableHeader.test.ts b/frontend-modern/src/components/Workloads/__tests__/WorkloadTableHeader.test.ts
index 51f5f06631..84af00882d 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadTableHeader.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadTableHeader.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import { getWorkloadColumnHeaderLabel } from '../WorkloadTableHeader';
+import { getWorkloadColumnHeaderAlign, getWorkloadColumnHeaderLabel } from '../WorkloadTableHeader';
describe('getWorkloadColumnHeaderLabel', () => {
it('keeps the default memory label for guest-relative values', () => {
@@ -22,3 +22,23 @@ describe('getWorkloadColumnHeaderLabel', () => {
expect(getWorkloadColumnHeaderLabel('uptime', 'Uptime', 'guest', true)).toBe('Age');
});
});
+
+describe('getWorkloadColumnHeaderAlign', () => {
+ it('centers paired I/O headers over their two directional values', () => {
+ expect(getWorkloadColumnHeaderAlign('netIo', 'numeric-value', false)).toBe('center');
+ expect(getWorkloadColumnHeaderAlign('diskIo', 'numeric-value', false)).toBe('center');
+ });
+
+ it('centers identifiers beside the workload type column', () => {
+ expect(getWorkloadColumnHeaderAlign('info', 'numeric-value', false)).toBe('center');
+ expect(getWorkloadColumnHeaderAlign('vmid', 'numeric-value', false)).toBe('center');
+ });
+
+ it('keeps scalar quantities right aligned', () => {
+ expect(getWorkloadColumnHeaderAlign('uptime', 'numeric-value', false)).toBe('right');
+ });
+
+ it('keeps the primary identity header left aligned', () => {
+ expect(getWorkloadColumnHeaderAlign('name', 'numeric-value', true)).toBe('left');
+ });
+});