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.

Fit storage table values on phones and move reasons to the drawer

rcourtman3049fae5c279
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index db181fda93..c60fbc8c65 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,56 +1,38 @@
{
"version": 1,
- "base_sha": "0e90236d3bb901dc84d4d07e70d4d2a09d5e6705",
- "verified_at": "2026-10-02T23:55:48Z",
+ "base_sha": "74fd189fd03098b7ed94d806b15f570722048670",
+ "verified_at": "2026-10-03T09:27:41Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/shared/Table.tsx"
+ "frontend-modern/src/components/Storage/DiskDetail.tsx",
+ "frontend-modern/src/components/Storage/DiskList.tsx",
+ "frontend-modern/src/components/Storage/EnhancedStorageBar.tsx",
+ "frontend-modern/src/components/Storage/StoragePoolRow.tsx",
+ "frontend-modern/src/components/Storage/StoragePoolsTable.tsx",
+ "frontend-modern/src/components/Storage/useDiskDetailModel.ts",
+ "frontend-modern/src/components/Storage/useEnhancedStorageBarModel.ts",
+ "frontend-modern/src/features/storageBackups/diskDetailPresentation.ts",
+ "frontend-modern/src/features/storageBackups/diskPresentation.ts",
+ "frontend-modern/src/features/storageBackups/rowPresentation.ts",
+ "frontend-modern/src/features/storageBackups/storageBarPresentation.ts",
+ "frontend-modern/src/features/storageBackups/storagePagePresentation.ts"
],
"content_sha256": {
- "frontend-modern/src/components/shared/Table.tsx": "8e5029d5ee9dddc86a4733fa1e7249793cdbedb135f3634e75112f8fb3b327c9"
+ "frontend-modern/src/components/Storage/DiskDetail.tsx": "04e5bacb4900cc77a94fdb804363048ed53f4b84dc1c0e9610878a106a1db1a6",
+ "frontend-modern/src/components/Storage/DiskList.tsx": "07aee61d9becb41c1cf97317bf57f5c5c70db4111eef0a15da2e31fea905d334",
+ "frontend-modern/src/components/Storage/EnhancedStorageBar.tsx": "ed72a33e754e96ebd03374c34f9732b02411cd9055667f4e0051d6f7e66ab653",
+ "frontend-modern/src/components/Storage/StoragePoolRow.tsx": "09417822bd543ddbc312d0c15a4ea74971066d6623d421d889858e56262b9d3d",
+ "frontend-modern/src/components/Storage/StoragePoolsTable.tsx": "7b61e9fac5e3a9fbae831a3cf907a71f1be7158f06bfe7a9fe7d16fce7a2c928",
+ "frontend-modern/src/components/Storage/useDiskDetailModel.ts": "ee5059bb3a7e0069561e4f103e2fd89101e096ad32b3b27c6f4777c26c1388f8",
+ "frontend-modern/src/components/Storage/useEnhancedStorageBarModel.ts": "d03daecfe22ede32e46edc74a20e4ac11d732d4f9ca202c0b6f36c22a590aa44",
+ "frontend-modern/src/features/storageBackups/diskDetailPresentation.ts": "4b348777cc39de3021e21c8f34e9e2029f2bc30e6768dfaa26c8ec6420d27d10",
+ "frontend-modern/src/features/storageBackups/diskPresentation.ts": "6ee8aaf027a9e91aa9c28a9d579449938c5139fe370ff59040ebfead9ecb53bc",
+ "frontend-modern/src/features/storageBackups/rowPresentation.ts": "cabd37e3f736467aecff68359fcb97be08bcabbe5c5ec6e0a0da2fe67d2e3261",
+ "frontend-modern/src/features/storageBackups/storageBarPresentation.ts": "562eac2212378e98823717f712c791133cebf1f44bd71c75c7db097b244f6cc0",
+ "frontend-modern/src/features/storageBackups/storagePagePresentation.ts": "2a93a0176b912283c77b384ee2c66c4bc62c21a04b645eb93917a41740ad2d6e"
},
"routes": [
- "/proxmox/overview",
- "/proxmox/storage",
- "/proxmox/replication",
- "/proxmox/ceph",
- "/proxmox/mail",
- "/docker/overview",
- "/docker/images",
- "/docker/storage",
- "/docker/networks",
- "/docker/swarm",
- "/kubernetes/overview",
- "/kubernetes/nodes",
- "/kubernetes/workloads",
- "/kubernetes/services",
- "/kubernetes/storage",
- "/kubernetes/configuration",
- "/kubernetes/events",
- "/truenas/overview",
- "/truenas/storage",
- "/truenas/services",
- "/truenas/apps",
- "/truenas/vms",
- "/truenas/shares",
- "/truenas/protection",
- "/vmware/overview",
- "/vmware/storage",
- "/vmware/networks",
- "/vmware/health",
- "/vmware/activity",
- "/standalone/machines",
- "/standalone/availability",
- "/alerts/overview",
- "/alerts/history",
- "/alerts/thresholds",
- "/actions",
- "/settings/infrastructure",
- "/settings/monitoring",
- "/settings/pulse-intelligence",
- "/settings/organization",
- "/settings/security-users",
- "/settings/security-webhooks"
+ "/proxmox/storage"
],
"viewports": [
{
@@ -63,38 +45,40 @@
},
{
"width": 900,
- "height": 900
+ "height": 844
},
{
"width": 700,
- "height": 900
+ "height": 844
},
{
- "width": 560,
- "height": 900
+ "width": 600,
+ "height": 844
+ },
+ {
+ "width": 420,
+ "height": 844
},
{
"width": 390,
- "height": 900
+ "height": 844
+ },
+ {
+ "width": 360,
+ "height": 844
}
],
"states": [
- "Mock stack on origin/main plus this change; Playwright sweep of every table on the routes above at all six viewports, before and after, recording computed th/td padding per cell and leaf elements with scrollWidth > clientWidth under hidden overflow (455 table states compared)",
- "Default TableCell/TableHead with no caller padding keep 8px/12px horizontal and 2px/6px vertical padding (Settings infrastructure source and agent tables unchanged at 12px/12px/6px/6px)",
- "Platform tables (Proxmox nodes, Docker hosts and containers, Kubernetes clusters/nodes/deployments/pods, TrueNAS systems, vSphere, Machines): cells 12px -> 8px horizontal at 700px and up and 8px -> 6px at 560/390px; header cells keep the stylesheet 6px horizontal and drop to 2px vertical, header rows 29px -> 21px; row height 32px unchanged; clipped-cell count improved in 89 table states, unchanged in 362; the 4 states counted worse are live mock-value drift (relative-time and usage labels) with identical or wider content boxes",
- "Physical Disks table (Proxmox > Storage > Physical Disks): cells 8px -> 4px horizontal at 390px and 12px -> 6px at 700px, matching the composed px-1 sm:px-1.5 lg:px-2; clipped cells at 390px 93 -> 18; detail row 12px -> 16px horizontal at 700px and 1440px",
- "Storage pools table unchanged at 6px/8px cell padding across 390, 560 and 700px",
- "Inline detail rows (Proxmox node, Kubernetes controller, TrueNAS system expansions): detail cell padding 12px/12px/2px/2px -> 0, detail panel inset now only its own px-2 sm:px-4; incident timeline panel in Alert History gets its p-3",
- "Alerts overview stats table: dot column right padding 12px -> 0 and value column 12px -> 6px at 700px and up as its classes name; Alert History header cells 12px -> 8px horizontal; AI cost table (Settings > Pulse Intelligence) Est. USD column 12px -> 4px as its px-1 names",
- "Workloads table header cells now 6px/8px to match their raw td data cells; Proxmox replication compact-mode !px-1 override still applies at 390px",
- "Reactive case: switching a cell class between px-1 and a non-padding class re-resolves the base padding (unit test)"
+ "Proxmox Storage tab pools table in narrow (360), compact (390/420), operational (600/700/900) and full (1280/1440) container layouts on main with the table padding fix (#2427), mock data with Online, Degraded and Unknown pools and Protected / Backup Repository badges",
+ "Pools table with the first pool row expanded (StoragePoolDetail drawer) at 390, 1280 and 1440",
+ "Physical Disks sub-tab in narrow (360/390), compact (420), basic (600/700), operational (900) and full (1280/1440) layouts with Healthy, Unknown and Needs Attention disks; phone cells measured at 8px horizontal padding with no layout override",
+ "Physical Disks table with the first (Needs Attention) disk row expanded so the DiskDetail drawer header shows the verdict and its reason at 390, 1280 and 1440",
+ "The mock backend did not emit its random ZFS-issue scenario (DEGRADED pool with resilver in progress) during this pass, so the derived Resilvering/Scrubbing badge word was not observed live; it is pinned by rowPresentation.test.ts"
],
"interactions": [
- "Load each route at 1440, 1280, 900, 700, 560 and 390px and run the padding and clip sweep over all tables",
- "Click Physical Disks on Proxmox > Storage at 390, 560, 700 and 1440px and expand the first disk row",
- "Expand the first node row on Proxmox > Overview, the first deployment row on Kubernetes > Workloads, the first host row on Docker > Overview and the first system row on TrueNAS > Overview at 390, 560, 700 and 1440px",
- "Expand the first alert row incident timeline on Alerts > History at 1440px",
- "Compare before and after JSON sweeps per route, tab, viewport and table; re-measure the four states counted worse three times each",
- "Revert and restore the change on the running dev server to A/B the Kubernetes clusters memory bar label at 560px"
+ "Switched between the Storage and Physical Disks view tabs and clicked pool and disk rows to open their inline detail drawers",
+ "Ran a Playwright scrollWidth-over-clientWidth sweep over every th/td leaf per viewport: 1440 reports nothing in either table, 1280 only one long disk model, 390 only long identity strings (two pool names, three disk models), 360 identity strings only, 600/700 the pre-existing operational host and Backup Repository clips, 900 nothing in the pools table",
+ "Measured per-column cell width, padding and text need at 390: pool name 126px for a 122px need, state 59 for 54, host 106 for 98, usage bar 39 for a 28px percentage",
+ "Confirmed the usage bar shows percentage-only below the 34rem container query and the full used/total label above it, and that the disk row health word is whole with its reason as the title"
]
}
diff --git a/frontend-modern/src/components/Storage/DiskDetail.tsx b/frontend-modern/src/components/Storage/DiskDetail.tsx
index 71c6cedb3a..3588836cc0 100644
--- a/frontend-modern/src/components/Storage/DiskDetail.tsx
+++ b/frontend-modern/src/components/Storage/DiskDetail.tsx
@@ -11,6 +11,10 @@ import {
resolveHistoryRangeWithinLimit,
} from '@/components/Storage/historyRangeAccess';
import {
+ DISK_DETAIL_HEADER_STACK_CLASS,
+ DISK_DETAIL_HEALTH_LABEL_CLASS,
+ DISK_DETAIL_HEALTH_ROW_CLASS,
+ DISK_DETAIL_HEALTH_SUMMARY_CLASS,
DISK_DETAIL_HISTORY_RANGE_OPTIONS,
DISK_DETAIL_LIVE_CHARTS,
getDiskAttributeValueTextClass,
@@ -55,6 +59,7 @@ export const DiskDetail: Component<DiskDetailProps> = (props) => {
historyResourceId,
attributeCards,
historyCharts,
+ healthPresentation,
metricResourceId,
collectionMessages,
liveIOAvailable,
@@ -91,19 +96,32 @@ export const DiskDetail: Component<DiskDetailProps> = (props) => {
return (
<div class={STORAGE_DISK_DETAIL_ROOT_CLASS}>
<div class={STORAGE_DISK_DETAIL_HEADER_CLASS}>
- <div class={STORAGE_DETAIL_META_ROW_CLASS}>
- <span class={STORAGE_DISK_DETAIL_MODEL_CLASS}>{diskData().model || 'Unknown Disk'}</span>
- <span class={STORAGE_DETAIL_MONO_CHIP_CLASS}>{diskData().devPath}</span>
- <span class={STORAGE_DISK_DETAIL_NODE_CLASS}>{diskData().node}</span>
- <span
- class={getPhysicalDiskSourceBadgePresentation(props.disk).className}
- title="Data source"
- >
- {getPhysicalDiskSourceBadgePresentation(props.disk).label}
- </span>
- <Show when={diskData().serial}>
- <span class={STORAGE_DISK_DETAIL_SERIAL_CLASS}>S/N: {diskData().serial}</span>
- </Show>
+ <div class={DISK_DETAIL_HEADER_STACK_CLASS}>
+ <div class={STORAGE_DETAIL_META_ROW_CLASS}>
+ <span class={STORAGE_DISK_DETAIL_MODEL_CLASS}>
+ {diskData().model || 'Unknown Disk'}
+ </span>
+ <span class={STORAGE_DETAIL_MONO_CHIP_CLASS}>{diskData().devPath}</span>
+ <span class={STORAGE_DISK_DETAIL_NODE_CLASS}>{diskData().node}</span>
+ <span
+ class={getPhysicalDiskSourceBadgePresentation(props.disk).className}
+ title="Data source"
+ >
+ {getPhysicalDiskSourceBadgePresentation(props.disk).label}
+ </span>
+ <Show when={diskData().serial}>
+ <span class={STORAGE_DISK_DETAIL_SERIAL_CLASS}>S/N: {diskData().serial}</span>
+ </Show>
+ </div>
+ {/* The verdict the row shows as a single word, with its reason in full. */}
+ <div class={DISK_DETAIL_HEALTH_ROW_CLASS} data-testid="disk-detail-health">
+ <span class={`${DISK_DETAIL_HEALTH_LABEL_CLASS} ${healthPresentation().tone}`}>
+ {healthPresentation().label}
+ </span>
+ <Show when={healthPresentation().summary}>
+ <span class={DISK_DETAIL_HEALTH_SUMMARY_CLASS}>{healthPresentation().summary}</span>
+ </Show>
+ </div>
</div>
</div>
diff --git a/frontend-modern/src/components/Storage/DiskList.tsx b/frontend-modern/src/components/Storage/DiskList.tsx
index 5715390316..a53c523a28 100644
--- a/frontend-modern/src/components/Storage/DiskList.tsx
+++ b/frontend-modern/src/components/Storage/DiskList.tsx
@@ -55,7 +55,6 @@ import {
PHYSICAL_DISK_HEADER_SIZE_CLASS,
PHYSICAL_DISK_HEADER_TEMP_CLASS,
PHYSICAL_DISK_HEALTH_LABEL_CLASS,
- PHYSICAL_DISK_HEALTH_SUMMARY_CLASS,
PHYSICAL_DISK_HEALTH_WRAP_CLASS,
PHYSICAL_DISK_DEVICE_TEXT_CLASS,
PHYSICAL_DISK_LIFE_CLASS,
@@ -72,8 +71,9 @@ import {
PHYSICAL_DISK_TABLE_ROW_HOVER_CLASS,
PHYSICAL_DISK_TABLE_ROW_SELECTED_CLASS,
PHYSICAL_DISK_TABLE_ROW_STYLE,
- getPhysicalDiskColumnWidthPercent,
+ getPhysicalDiskColumnWidthStyle,
getPhysicalDiskEmptyStatePresentation,
+ getPhysicalDiskHealthCompactLabel,
getPhysicalDiskHealthStatus,
getPhysicalDiskHealthSummary,
getPhysicalDiskHostLabel,
@@ -119,9 +119,8 @@ export const DiskList: Component<DiskListProps> = (props) => {
visibleClass: 'table-column' | 'table-cell',
) =>
`${baseClass} ${isPhysicalDiskColumnVisible(layoutMode(), columnId) ? visibleClass : 'hidden'}`.trim();
- const columnStyle = (columnId: PhysicalDiskTableColumnId) => ({
- width: `${getPhysicalDiskColumnWidthPercent(layoutMode(), columnId)}%`,
- });
+ const columnStyle = (columnId: PhysicalDiskTableColumnId) =>
+ getPhysicalDiskColumnWidthStyle(layoutMode(), columnId);
const { getDiskTemperatureThresholds } = useAlertsActivation();
const model = useDiskListModel({
disks: () => props.disks,
@@ -327,6 +326,11 @@ export const DiskList: Component<DiskListProps> = (props) => {
const status = createMemo(() => getPhysicalDiskHealthStatus(data()));
const hostLabel = createMemo(() => getPhysicalDiskHostLabel(data(), disk));
const healthSummary = createMemo(() => getPhysicalDiskHealthSummary(status()));
+ const healthCompactLabel = createMemo(() =>
+ getPhysicalDiskHealthCompactLabel(status().label),
+ );
+ const healthLabelClass = () =>
+ `${PHYSICAL_DISK_HEALTH_LABEL_CLASS} ${status().tone}`;
const isSelected = () => model.selectedDisk()?.id === disk.id;
const summarySeriesId = createMemo(() => resolvePhysicalDiskMetricResourceId(disk));
const isSummaryHighlighted = () =>
@@ -446,15 +450,30 @@ export const DiskList: Component<DiskListProps> = (props) => {
data-storage-column="health"
>
<div class={PHYSICAL_DISK_HEALTH_WRAP_CLASS}>
- <span class={`${PHYSICAL_DISK_HEALTH_LABEL_CLASS} ${status().tone}`}>
- {status().label}
- </span>
- <Show when={healthSummary()}>
+ {/* The row shows the verdict word only; the reason is the
+ cell's title here and is spelled out in the disk drawer.
+ The phone projection of the table container shows the
+ shorter word; the tone stays on each span so the rendered
+ label is the styled element in either projection. */}
+ <Show
+ when={healthCompactLabel() !== status().label}
+ fallback={
+ <span class={healthLabelClass()} title={healthSummary() || undefined}>
+ {status().label}
+ </span>
+ }
+ >
+ <span
+ class={`${healthLabelClass()} platform-table-label-compact`}
+ title={healthSummary() || undefined}
+ >
+ {healthCompactLabel()}
+ </span>
<span
- class={PHYSICAL_DISK_HEALTH_SUMMARY_CLASS}
- title={healthSummary()}
+ class={`${healthLabelClass()} platform-table-label-full`}
+ title={healthSummary() || undefined}
>
- {healthSummary()}
+ {status().label}
</span>
</Show>
</div>
diff --git a/frontend-modern/src/components/Storage/EnhancedStorageBar.tsx b/frontend-modern/src/components/Storage/EnhancedStorageBar.tsx
index 71ea29ccef..02a5af5eca 100644
--- a/frontend-modern/src/components/Storage/EnhancedStorageBar.tsx
+++ b/frontend-modern/src/components/Storage/EnhancedStorageBar.tsx
@@ -25,6 +25,7 @@ import {
getStorageBarTooltipTitle,
getStorageBarZfsHeadingLabel,
} from '@/features/storageBackups/storageBarPresentation';
+import { PlatformResponsiveTableLabel } from '@/features/platformPage/sharedPlatformPage';
import { useTooltip } from '@/hooks/useTooltip';
import { ProgressBar } from '@/components/shared/ProgressBar';
import { TooltipPortal } from '@/components/shared/TooltipPortal';
@@ -42,13 +43,14 @@ interface EnhancedStorageBarProps {
export function EnhancedStorageBar(props: EnhancedStorageBarProps) {
const tip = useTooltip();
const alertsActivation = useAlertsActivation();
- const { usagePercent, barColor, label, tooltipRows, zfsSummary } = useEnhancedStorageBarModel({
- used: () => props.used,
- total: () => props.total,
- free: () => props.free,
- zfsPool: () => props.zfsPool,
- thresholds: () => alertsActivation.getMetricThresholds('storage', 'disk'),
- });
+ const { usagePercent, barColor, label, compactLabel, tooltipRows, zfsSummary } =
+ useEnhancedStorageBarModel({
+ used: () => props.used,
+ total: () => props.total,
+ free: () => props.free,
+ zfsPool: () => props.zfsPool,
+ thresholds: () => alertsActivation.getMetricThresholds('storage', 'disk'),
+ });
return (
<div class={STORAGE_BAR_ROOT_CLASS}>
@@ -71,7 +73,12 @@ export function EnhancedStorageBar(props: EnhancedStorageBarProps) {
}
label={
<span class={STORAGE_BAR_LABEL_WRAP_CLASS}>
- <span class={STORAGE_BAR_LABEL_TEXT_CLASS}>{label()}</span>
+ <span class={STORAGE_BAR_LABEL_TEXT_CLASS}>
+ {/* The phone projection of the table container keeps the
+ percentage only; the used/total sublabel returns with the
+ wider container and always lives in the tooltip. */}
+ <PlatformResponsiveTableLabel compact={compactLabel()} full={label()} />
+ </span>
</span>
}
/>
diff --git a/frontend-modern/src/components/Storage/StoragePoolRow.tsx b/frontend-modern/src/components/Storage/StoragePoolRow.tsx
index 58e8e6d2a8..1d29643412 100644
--- a/frontend-modern/src/components/Storage/StoragePoolRow.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolRow.tsx
@@ -26,6 +26,7 @@ import {
import type { StorageCapacityDeltaPresentation } from '@/features/storageBackups/storageCapacityDeltaPresentation';
import type { Resource } from '@/types/resource';
import {
+ getStoragePoolCellPaddingClass,
isStoragePoolColumnVisible,
type StoragePoolTableColumnId,
type StoragePoolTableLayoutMode,
@@ -62,7 +63,11 @@ interface StoragePoolRowProps {
export const StoragePoolRow: Component<StoragePoolRowProps> = (props) => {
const columnClass = (baseClass: string, columnId: StoragePoolTableColumnId) =>
- `${baseClass} ${isStoragePoolColumnVisible(props.layoutMode, columnId) ? 'table-cell' : 'hidden'}`.trim();
+ `${baseClass} ${getStoragePoolCellPaddingClass(props.layoutMode)} ${
+ isStoragePoolColumnVisible(props.layoutMode, columnId) ? 'table-cell' : 'hidden'
+ }`
+ .replace(/\s+/g, ' ')
+ .trim();
const row = createMemo(() => buildStoragePoolRowModel(props.record, props.growthDelta ?? null));
const detailControlsId = createMemo(() =>
buildSummaryDisclosureControlsId(props.summarySeriesId),
diff --git a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
index c6217f0273..47dea2524a 100644
--- a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
@@ -9,7 +9,7 @@ import {
} from '@/components/shared/Table';
import { getPlatformTableHeadClassForKind } from '@/features/platformPage/sharedPlatformPage';
import {
- getStoragePoolColumnWidthPercent,
+ getStoragePoolColumnWidthStyle,
getStoragePoolTableColumns,
getStoragePoolTableLayoutModeForContainer,
getStorageEmptyStateMessage,
@@ -106,9 +106,7 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
{(column) => (
<col
class={columnClass(column.colClassName, column.id, 'table-column')}
- style={{
- width: `${getStoragePoolColumnWidthPercent(layoutMode(), column.id)}%`,
- }}
+ style={getStoragePoolColumnWidthStyle(layoutMode(), column.id)}
data-storage-column={column.id}
/>
)}
diff --git a/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx b/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
index 701ada6248..0a46eb23c6 100644
--- a/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
@@ -1,4 +1,4 @@
-import { fireEvent, render, screen } from '@solidjs/testing-library';
+import { fireEvent, render, screen, within } from '@solidjs/testing-library';
import { createSignal, type JSX } from 'solid-js';
import { describe, expect, it, vi } from 'vitest';
import { DiskDetail } from '@/components/Storage/DiskDetail';
@@ -135,6 +135,30 @@ describe('DiskDetail', () => {
expect(screen.getByText('Reallocated Sectors')).toBeInTheDocument();
});
+ it('shows the health verdict and its reason in the drawer header', () => {
+ const disk = buildDisk();
+ disk.physicalDisk!.health = 'FAILED';
+
+ render(() => <DiskDetail disk={disk} nodes={[]} />);
+
+ const health = screen.getByTestId('disk-detail-health');
+ expect(within(health).getByText('Replace Now')).toHaveClass('text-red-700');
+ expect(
+ within(health).getByText('Disk health has degraded to a critical state.'),
+ ).toBeInTheDocument();
+ });
+
+ it('keeps the drawer header to the verdict alone when the disk is healthy', () => {
+ const disk = buildDisk();
+ disk.physicalDisk!.health = 'PASSED';
+
+ render(() => <DiskDetail disk={disk} nodes={[]} />);
+
+ const health = screen.getByTestId('disk-detail-health');
+ expect(within(health).getByText('Healthy')).toBeInTheDocument();
+ expect(within(health).queryByText('No active disk-health issues.')).not.toBeInTheDocument();
+ });
+
it('shows an explicit overview fallback when no detail readings are available', () => {
const disk = buildDisk();
delete disk.physicalDisk!.smart;
diff --git a/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx b/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
index c8b0ad9432..ae75eb0693 100644
--- a/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
@@ -134,12 +134,18 @@ describe('DiskList', () => {
'archive',
'Cache Pool',
'Archive Pool',
- 'SMART failed.',
'4%',
'63°C',
]) {
expect(within(row as HTMLElement).getByText(text)).toBeInTheDocument();
}
+ // The reason is not a second truncating string in the 32px row: it rides
+ // on the verdict as its title and is spelled out in the disk drawer.
+ expect(within(row as HTMLElement).queryByText('SMART failed.')).not.toBeInTheDocument();
+ expect(within(row as HTMLElement).getByText('Replace Now')).toHaveAttribute(
+ 'title',
+ 'SMART failed.',
+ );
expect(within(row as HTMLElement).getByText('3.64 TB')).toBeInTheDocument();
expect(screen.queryByText('Healthy')).not.toBeInTheDocument();
expect(screen.queryByText('96%')).not.toBeInTheDocument();
@@ -275,7 +281,13 @@ describe('DiskList', () => {
expect(screen.getByText('Parity')).toBeInTheDocument();
expect(screen.getByText('Tower Array')).toBeInTheDocument();
expect(screen.getByText('Needs Attention')).toBeInTheDocument();
- expect(screen.getByText('Pending sectors detected.')).toBeInTheDocument();
+ // The reason stays one hover away on the verdict rather than as a second
+ // truncating string in the row; the drawer spells it out.
+ expect(screen.queryByText('Pending sectors detected.')).not.toBeInTheDocument();
+ expect(screen.getByText('Needs Attention')).toHaveAttribute(
+ 'title',
+ 'Pending sectors detected.',
+ );
});
it('renders SSD life and falls back to the Proxmox usage string for Belongs', () => {
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index e77acd0a3d..7c917328be 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -1154,10 +1154,11 @@ describe('Storage', () => {
render(() => <Storage />);
+ // zpool's upper-case state is presented titleized, like every other state.
await waitFor(() => {
- expect(screen.getAllByText('DEGRADED').length).toBeGreaterThan(0);
+ expect(screen.getAllByText('Degraded').length).toBeGreaterThan(0);
});
- expect(screen.getAllByText('DEGRADED')[0]).toHaveAttribute(
+ expect(screen.getAllByText('Degraded')[0]).toHaveAttribute(
'title',
'1 read, 2 checksum errors',
);
diff --git a/frontend-modern/src/components/Storage/__tests__/useEnhancedStorageBarModel.test.ts b/frontend-modern/src/components/Storage/__tests__/useEnhancedStorageBarModel.test.ts
index b3fc3721a0..18d67ca221 100644
--- a/frontend-modern/src/components/Storage/__tests__/useEnhancedStorageBarModel.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/useEnhancedStorageBarModel.test.ts
@@ -28,6 +28,7 @@ describe('useEnhancedStorageBarModel', () => {
expect(result.usagePercent()).toBe(40);
expect(result.label()).toBe('40% (400 B/1000 B)');
+ expect(result.compactLabel()).toBe('40%');
expect(result.tooltipRows()).toEqual([
{ label: 'Used', value: '400 B' },
{ label: 'Free', value: '600 B' },
diff --git a/frontend-modern/src/components/Storage/useDiskDetailModel.ts b/frontend-modern/src/components/Storage/useDiskDetailModel.ts
index 7ea36e2a61..2038b38433 100644
--- a/frontend-modern/src/components/Storage/useDiskDetailModel.ts
+++ b/frontend-modern/src/components/Storage/useDiskDetailModel.ts
@@ -7,6 +7,7 @@ import {
} from '@/features/storageBackups/diskPresentation';
import {
getDiskDetailAttributeCards,
+ getDiskDetailHealthPresentation,
getDiskDetailHistoryCharts,
} from '@/features/storageBackups/diskDetailPresentation';
import { useAlertsActivation } from '@/stores/alertsActivation';
@@ -29,6 +30,7 @@ export const useDiskDetailModel = (options: UseDiskDetailModelOptions) => {
getDiskDetailAttributeCards(diskData(), getDiskTemperatureThresholds(diskData().type)),
);
const historyCharts = createMemo(() => getDiskDetailHistoryCharts(diskData()));
+ const healthPresentation = createMemo(() => getDiskDetailHealthPresentation(diskData()));
const metricResourceId = createMemo(() => historyResourceId());
const collectionMessages = createMemo(() => getPhysicalDiskCollectionMessages(diskData()));
const liveIOAvailable = createMemo(() => {
@@ -43,6 +45,7 @@ export const useDiskDetailModel = (options: UseDiskDetailModelOptions) => {
historyResourceId,
attributeCards,
historyCharts,
+ healthPresentation,
metricResourceId,
collectionMessages,
liveIOAvailable,
diff --git a/frontend-modern/src/components/Storage/useEnhancedStorageBarModel.ts b/frontend-modern/src/components/Storage/useEnhancedStorageBarModel.ts
index ddb6f141e7..06cf0aa3d7 100644
--- a/frontend-modern/src/components/Storage/useEnhancedStorageBarModel.ts
+++ b/frontend-modern/src/components/Storage/useEnhancedStorageBarModel.ts
@@ -3,6 +3,7 @@ import type { ZFSPool } from '@/types/api';
import { getMetricColorClass } from '@/utils/metricThresholds';
import type { MetricDisplayThresholds } from '@/utils/metricThresholds';
import {
+ getStorageBarCompactLabel,
getStorageBarLabel,
getStorageBarTooltipRows,
getStorageBarUsagePercent,
@@ -23,6 +24,7 @@ export const useEnhancedStorageBarModel = (options: UseEnhancedStorageBarModelOp
getMetricColorClass(usagePercent(), 'disk', options.thresholds?.()),
);
const label = createMemo(() => getStorageBarLabel(options.used(), options.total()));
+ const compactLabel = createMemo(() => getStorageBarCompactLabel(options.used(), options.total()));
const tooltipRows = createMemo(() =>
getStorageBarTooltipRows(options.used(), options.free(), options.total()),
);
@@ -32,6 +34,7 @@ export const useEnhancedStorageBarModel = (options: UseEnhancedStorageBarModelOp
usagePercent,
barColor,
label,
+ compactLabel,
tooltipRows,
zfsSummary,
};
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
index 8edf3ca711..89a8caacb3 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
@@ -4,6 +4,7 @@ import {
DISK_DETAIL_LIVE_CHARTS,
getDiskAttributeValueTextClass,
getDiskDetailAttributeCards,
+ getDiskDetailHealthPresentation,
getDiskDetailHistoryCharts,
getDiskDetailHistoryFallbackMessage,
getDiskDetailLiveBadgeLabel,
@@ -34,6 +35,41 @@ describe('diskDetailPresentation', () => {
);
});
+ it('carries the row verdict and its reason into the drawer header', () => {
+ const disk = {
+ node: 'tower',
+ instance: 'cluster-main',
+ devPath: '/dev/sda',
+ model: 'Archive HDD',
+ serial: 'SERIAL-1',
+ wwn: '',
+ size: 1,
+ health: 'PASSED',
+ wearout: -1,
+ type: 'hdd',
+ temperature: 42,
+ rpm: 7200,
+ used: '',
+ riskReasons: [] as string[],
+ };
+ expect(getDiskDetailHealthPresentation(disk)).toEqual({
+ label: 'Healthy',
+ summary: '',
+ tone: 'text-emerald-700 dark:text-emerald-300',
+ });
+ expect(
+ getDiskDetailHealthPresentation({
+ ...disk,
+ health: 'FAILED',
+ riskReasons: ['SMART failed.'],
+ }),
+ ).toEqual({
+ label: 'Replace Now',
+ summary: 'SMART failed.',
+ tone: 'text-red-700 dark:text-red-300',
+ });
+ });
+
it('builds canonical SATA and NVMe attribute cards', () => {
expect(
getDiskDetailAttributeCards({
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
index 4d177523c1..ec35a8f9ac 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
@@ -19,9 +19,10 @@ import {
PHYSICAL_DISK_TABLE_CLASS,
PHYSICAL_DISK_TABLE_ROW_HOVER_CLASS,
getPhysicalDiskEmptyStatePresentation,
- getPhysicalDiskColumnWidthPercent,
+ getPhysicalDiskColumnWidthStyle,
getPhysicalDiskCollectionMessages,
getPhysicalDiskFieldStatusMessage,
+ getPhysicalDiskHealthCompactLabel,
getPhysicalDiskHealthStatus,
getPhysicalDiskHealthSummary,
getPhysicalDiskHostLabel,
@@ -158,14 +159,48 @@ describe('diskPresentation', () => {
),
),
).toBe(true);
- expect(getPhysicalDiskColumnWidthPercent('compact', 'disk')).toBe(33);
- expect(getPhysicalDiskColumnWidthPercent('compact', 'size')).toBe(14);
- expect(getPhysicalDiskColumnWidthPercent('operational', 'life')).toBe(9);
- expect(getPhysicalDiskColumnWidthPercent('compact', 'device')).toBe(0);
+ expect(getPhysicalDiskColumnWidthStyle('compact', 'disk')).toEqual({ width: '34%' });
+ expect(getPhysicalDiskColumnWidthStyle('compact', 'temp')).toEqual({ width: '12%' });
+ expect(getPhysicalDiskColumnWidthStyle('compact', 'size')).toEqual({ width: '15%' });
+ expect(getPhysicalDiskColumnWidthStyle('operational', 'life')).toEqual({ width: '9%' });
+ expect(getPhysicalDiskColumnWidthStyle('compact', 'device')).toEqual({ width: '0%' });
expect(isPhysicalDiskColumnVisible('narrow', 'life')).toBe(false);
expect(isPhysicalDiskColumnVisible('narrow', 'temp')).toBe(true);
- expect(getPhysicalDiskColumnWidthPercent('narrow', 'disk')).toBe(40);
- expect(getPhysicalDiskColumnWidthPercent('narrow', 'size')).toBe(15);
+ expect(getPhysicalDiskColumnWidthStyle('narrow', 'disk')).toEqual({ width: '41%' });
+ expect(getPhysicalDiskColumnWidthStyle('narrow', 'temp')).toEqual({ width: '12%' });
+ expect(getPhysicalDiskColumnWidthStyle('narrow', 'size')).toEqual({ width: '16%' });
+ });
+
+ it('keeps the desktop disk column widths on the canonical weighted helper', () => {
+ const columns = [
+ 'disk',
+ 'device',
+ 'host',
+ 'role',
+ 'parent',
+ 'health',
+ 'life',
+ 'temp',
+ 'size',
+ ] as const;
+ expect(columns.map((column) => getPhysicalDiskColumnWidthStyle('full', column).width)).toEqual([
+ '19%',
+ '9%',
+ '10%',
+ '8%',
+ '12%',
+ '17%',
+ '6%',
+ '7%',
+ '12%',
+ ]);
+ });
+
+ it('shortens only the health words that cannot fit a phone health column', () => {
+ expect(getPhysicalDiskHealthCompactLabel('Needs Attention')).toBe('Attention');
+ expect(getPhysicalDiskHealthCompactLabel('Replace Now')).toBe('Replace');
+ expect(getPhysicalDiskHealthCompactLabel('Healthy')).toBe('Healthy');
+ expect(getPhysicalDiskHealthCompactLabel('Unknown')).toBe('Unknown');
});
it('detects SMART warnings from counters', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov0712b.test.ts b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov0712b.test.ts
index 99ee1f17b7..a23aa645a0 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov0712b.test.ts
@@ -219,12 +219,12 @@ describe('getStoragePoolStateLabel branch coverage', () => {
expect(getStoragePoolStateLabel(record)).toBe('Online');
});
- it('returns the raw pool state when it is anything other than "ONLINE"', () => {
+ it('titleizes a non-ONLINE zfs pool state like every other state path', () => {
const record = {
...baseRecord(),
details: { zfsPool: { state: 'FAULTED', devices: [] } },
} as unknown as StorageRecord;
- expect(getStoragePoolStateLabel(record)).toBe('FAULTED');
+ expect(getStoragePoolStateLabel(record)).toBe('Faulted');
});
it('skips a zfs pool whose state is the empty string (pool?.state truthiness guard false)', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov2.test.ts b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov2.test.ts
index 0c2c8f0b59..27d8fff8e6 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.branchcov2.test.ts
@@ -239,7 +239,7 @@ describe('getStoragePoolStateLabel branch coverage', () => {
expect(getStoragePoolStateLabel(record)).toBe('Online');
});
- it('returns the raw pool state when it is anything other than "ONLINE"', () => {
+ it('titleizes a non-ONLINE zfs pool state like every other state path', () => {
const record = {
...baseRecord(),
details: {
@@ -249,7 +249,7 @@ describe('getStoragePoolStateLabel branch coverage', () => {
},
},
} as unknown as StorageRecord;
- expect(getStoragePoolStateLabel(record)).toBe('FAULTED');
+ expect(getStoragePoolStateLabel(record)).toBe('Faulted');
});
it('titleizes the derived status when arrayState and pool are both absent', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts
index 1afe8dff92..8787f8637d 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/rowPresentation.test.ts
@@ -101,6 +101,47 @@ describe('storage row presentation', () => {
expect(getCompactStoragePoolProtectionTitle(record)).not.toContain('without parity');
});
+ it('shows a zfs rebuild as its activity word and keeps the sentence as the title', () => {
+ const resilvering = {
+ ...baseRecord(),
+ rebuildInProgress: true,
+ protectionLabel: 'ZFS pool tank is resilvering',
+ details: {
+ zfsPool: { state: 'DEGRADED', scan: 'resilver in progress', devices: [] },
+ },
+ } as unknown as StorageRecord;
+ expect(getCompactStoragePoolProtectionLabel(resilvering)).toBe('Resilvering');
+ expect(getCompactStoragePoolProtectionTitle(resilvering)).toBe('ZFS pool tank is resilvering');
+
+ const scrubbing = {
+ ...baseRecord(),
+ rebuildInProgress: true,
+ protectionLabel: 'ZFS pool tank scrub is running (45.2%)',
+ protectionSummary: 'ZFS pool tank scrub is running (45.2%)',
+ details: {
+ zfsPool: {
+ state: 'ONLINE',
+ scan: '',
+ scanDetails: { function: 'SCRUB', state: 'SCANNING', percentage: 45.2 },
+ devices: [],
+ },
+ },
+ } as unknown as StorageRecord;
+ expect(getCompactStoragePoolProtectionLabel(scrubbing)).toBe('Scrubbing 45%');
+ expect(getCompactStoragePoolProtectionTitle(scrubbing)).toBe(
+ 'ZFS pool tank scrub is running (45.2%)',
+ );
+
+ // A rebuild without zfs scan data keeps the label its platform supplied.
+ const parity = {
+ ...baseRecord(),
+ rebuildInProgress: true,
+ protectionLabel: 'Parity sync 12%',
+ } as unknown as StorageRecord;
+ expect(getCompactStoragePoolProtectionLabel(parity)).toBe('Parity sync 12%');
+ expect(getCompactStoragePoolProtectionTitle(parity)).toBe('Parity sync 12%');
+ });
+
it('derives zfs issue fallback from pool state and errors', () => {
const record = {
...baseRecord(),
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageBarPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageBarPresentation.test.ts
index a2b1c04bed..86ec88080b 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageBarPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageBarPresentation.test.ts
@@ -13,6 +13,7 @@ import {
STORAGE_BAR_ZFS_SECTION_CLASS,
STORAGE_BAR_ZFS_STATE_LABEL_CLASS,
STORAGE_BAR_ZFS_STATE_ROW_CLASS,
+ getStorageBarCompactLabel,
getStorageBarLabel,
getStorageBarTooltipRowClass,
getStorageBarTooltipRows,
@@ -39,6 +40,7 @@ describe('storageBarPresentation', () => {
expect(STORAGE_BAR_ZFS_STATE_LABEL_CLASS).toBe('text-slate-400');
expect(getStorageBarUsagePercent(40, 100)).toBe(40);
expect(getStorageBarLabel(40, 100)).toBe('40% (40.0 B/100 B)');
+ expect(getStorageBarCompactLabel(40, 100)).toBe('40%');
expect(getStorageBarTooltipTitle()).toBe('Storage Details');
expect(getStorageBarTooltipRowClass()).toBe('flex justify-between gap-3 py-0.5 ');
expect(getStorageBarTooltipRowClass(true)).toBe(
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts
index a8971d42b9..b909d2e8f5 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest';
import {
- getStoragePoolColumnWidthPercent,
+ getStoragePoolCellPaddingClass,
+ getStoragePoolColumnWidthStyle,
getStoragePoolTableColumns,
getStoragePoolTableLayoutModeForContainer,
getStorageTableHeading,
@@ -46,22 +47,44 @@ describe('storagePagePresentation', () => {
expect(getStoragePoolTableLayoutModeForContainer(0)).toBe('compact');
expect(getStoragePoolTableLayoutModeForContainer(359)).toBe('narrow');
expect(getStoragePoolTableLayoutModeForContainer(360)).toBe('compact');
- expect(getStoragePoolTableLayoutModeForContainer(559)).toBe('compact');
- expect(getStoragePoolTableLayoutModeForContainer(560)).toBe('operational');
+ // The compact/operational boundary is the shared phone container query
+ // (34rem), so the usage bar label and the column set change together.
+ expect(getStoragePoolTableLayoutModeForContainer(543)).toBe('compact');
+ expect(getStoragePoolTableLayoutModeForContainer(544)).toBe('operational');
expect(getStoragePoolTableLayoutModeForContainer(1_039)).toBe('operational');
expect(getStoragePoolTableLayoutModeForContainer(1_040)).toBe('full');
expect(isStoragePoolColumnVisible('operational', 'host')).toBe(true);
expect(isStoragePoolColumnVisible('operational', 'growth')).toBe(false);
- expect(getStoragePoolColumnWidthPercent('operational', 'usage')).toBe(21);
+ expect(getStoragePoolColumnWidthStyle('operational', 'usage')).toEqual({ width: '25%' });
+ expect(getStoragePoolColumnWidthStyle('operational', 'name')).toEqual({ width: '27%' });
expect(isStoragePoolColumnVisible('compact', 'host')).toBe(true);
expect(isStoragePoolColumnVisible('compact', 'type')).toBe(false);
expect(isStoragePoolColumnVisible('compact', 'protection')).toBe(false);
- expect(getStoragePoolColumnWidthPercent('compact', 'name')).toBe(35);
- expect(getStoragePoolColumnWidthPercent('compact', 'usage')).toBe(25);
- expect(getStoragePoolColumnWidthPercent('compact', 'growth')).toBe(0);
+ expect(getStoragePoolColumnWidthStyle('compact', 'name')).toEqual({ width: '37%' });
+ expect(getStoragePoolColumnWidthStyle('compact', 'host')).toEqual({ width: '31.5%' });
+ expect(getStoragePoolColumnWidthStyle('compact', 'usage')).toEqual({ width: '13%' });
+ expect(getStoragePoolColumnWidthStyle('compact', 'growth')).toEqual({ width: '0%' });
expect(isStoragePoolColumnVisible('narrow', 'type')).toBe(false);
expect(isStoragePoolColumnVisible('narrow', 'protection')).toBe(false);
- expect(getStoragePoolColumnWidthPercent('narrow', 'name')).toBe(40);
- expect(getStoragePoolColumnWidthPercent('narrow', 'usage')).toBe(20);
+ expect(getStoragePoolColumnWidthStyle('narrow', 'name')).toEqual({ width: '35%' });
+ expect(getStoragePoolColumnWidthStyle('narrow', 'usage')).toEqual({ width: '13%' });
+ });
+
+ it('sheds the desktop cell gutter only on the phone pool layouts', () => {
+ expect(getStoragePoolCellPaddingClass('narrow')).toBe('!px-1');
+ expect(getStoragePoolCellPaddingClass('compact')).toBe('!px-1');
+ expect(getStoragePoolCellPaddingClass('operational')).toBe('');
+ expect(getStoragePoolCellPaddingClass('full')).toBe('');
+ });
+
+ it('keeps the desktop pool column widths on the canonical weighted helper', () => {
+ const fullWidths = ['name', 'state', 'type', 'host', 'protection', 'usage', 'growth'].map(
+ (column) =>
+ getStoragePoolColumnWidthStyle(
+ 'full',
+ column as 'name' | 'state' | 'type' | 'host' | 'protection' | 'usage' | 'growth',
+ ).width,
+ );
+ expect(fullWidths).toEqual(['20%', '14%', '10%', '12%', '13%', '20%', '11%']);
});
});
diff --git a/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts b/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
index 87af184ce3..018b37ca82 100644
--- a/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
@@ -1,4 +1,8 @@
-import type { PhysicalDiskPresentationData } from '@/features/storageBackups/diskPresentation';
+import {
+ getPhysicalDiskHealthStatus,
+ getPhysicalDiskHealthSummary,
+ type PhysicalDiskPresentationData,
+} from '@/features/storageBackups/diskPresentation';
import type { HistoryTimeRange } from '@/api/charts';
import { formatPowerOnHours } from '@/utils/format';
import { getMetricSeverity, type MetricDisplayThresholds } from '@/utils/metricThresholds';
@@ -78,6 +82,31 @@ export const getDiskDetailLiveBadgeLabel = (): string => 'Real-time';
export const getDiskDetailHistoryFallbackMessage = (): string =>
'Historical disk charts are unavailable until Pulse can resolve a stable identity for this disk.';
+export type DiskDetailHealthPresentation = {
+ label: string;
+ summary: string;
+ tone: string;
+};
+
+// The drawer header carries the disk's verdict and its reason. The table row
+// shows only the verdict word, so this is where the reason is read in full.
+export const DISK_DETAIL_HEADER_STACK_CLASS = 'min-w-0 space-y-1';
+export const DISK_DETAIL_HEALTH_ROW_CLASS =
+ 'flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[11px]';
+export const DISK_DETAIL_HEALTH_LABEL_CLASS = 'font-semibold';
+export const DISK_DETAIL_HEALTH_SUMMARY_CLASS = 'text-muted';
+
+export function getDiskDetailHealthPresentation(
+ disk: PhysicalDiskPresentationData,
+): DiskDetailHealthPresentation {
+ const status = getPhysicalDiskHealthStatus(disk);
+ return {
+ label: status.label,
+ summary: getPhysicalDiskHealthSummary(status),
+ tone: status.tone,
+ };
+}
+
export function getDiskDetailAttributeCards(
disk: PhysicalDiskPresentationData,
diskTempThresholds?: MetricDisplayThresholds | null,
diff --git a/frontend-modern/src/features/storageBackups/diskPresentation.ts b/frontend-modern/src/features/storageBackups/diskPresentation.ts
index 9cf9707e53..69715dbd38 100644
--- a/frontend-modern/src/features/storageBackups/diskPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskPresentation.ts
@@ -1,8 +1,10 @@
+import type { JSX } from 'solid-js';
import type {
PhysicalDiskCollectionStatus,
PhysicalDiskFieldStatus,
Resource,
} from '@/types/resource';
+import { getPlatformTableWeightedColumnWidthStyle } from '@/features/platformPage/sharedPlatformPage';
import {
getSourcePlatformLabel,
getSourcePlatformPresentation,
@@ -141,12 +143,16 @@ const PHYSICAL_DISK_VISIBLE_COLUMNS: Record<
full: ['disk', 'device', 'host', 'role', 'parent', 'health', 'life', 'temp', 'size'],
};
-const PHYSICAL_DISK_COLUMN_WIDTHS: Record<
+// Relative weights per layout, resolved through the canonical weighted-width
+// helper. The phone layouts are sized from the measured values they show:
+// a temperature ("100°C"), a capacity ("5.46 TB"), a compact health word and
+// a short node name must each fit whole, and the disk model takes the rest.
+const PHYSICAL_DISK_COLUMN_WEIGHTS: Record<
PhysicalDiskTableLayoutMode,
Partial<Record<PhysicalDiskTableColumnId, number>>
> = {
- narrow: { disk: 40, host: 15, health: 20, temp: 10, size: 15 },
- compact: { disk: 33, host: 15, health: 18, life: 10, temp: 10, size: 14 },
+ narrow: { disk: 41, host: 12, health: 19, temp: 12, size: 16 },
+ compact: { disk: 34, host: 11, health: 17, life: 11, temp: 12, size: 15 },
basic: { disk: 33, host: 17, health: 22, temp: 12, size: 16 },
operational: { disk: 25, host: 12, parent: 15, health: 17, life: 9, temp: 9, size: 13 },
expanded: { disk: 22, host: 10, role: 9, parent: 14, health: 15, life: 8, temp: 8, size: 14 },
@@ -168,10 +174,23 @@ export const isPhysicalDiskColumnVisible = (
columnId: PhysicalDiskTableColumnId,
): boolean => PHYSICAL_DISK_VISIBLE_COLUMNS[layout].includes(columnId);
-export const getPhysicalDiskColumnWidthPercent = (
+export const getPhysicalDiskColumnWidthStyle = (
layout: PhysicalDiskTableLayoutMode,
columnId: PhysicalDiskTableColumnId,
-): number => PHYSICAL_DISK_COLUMN_WIDTHS[layout][columnId] ?? 0;
+): JSX.CSSProperties =>
+ getPlatformTableWeightedColumnWidthStyle(
+ columnId,
+ PHYSICAL_DISK_COLUMN_WEIGHTS[layout],
+ PHYSICAL_DISK_VISIBLE_COLUMNS[layout],
+ );
+
+// Health words that do not fit a phone-width health column fall back to a
+// shorter form; the full label stays in the wider projections and the detail.
+export const getPhysicalDiskHealthCompactLabel = (label: string): string => {
+ if (label === 'Needs Attention') return 'Attention';
+ if (label === 'Replace Now') return 'Replace';
+ return label;
+};
export const PHYSICAL_DISK_COL_DISK_CLASS = '';
export const PHYSICAL_DISK_COL_DEVICE_CLASS = '';
@@ -221,8 +240,10 @@ export const PHYSICAL_DISK_MUTED_PLACEHOLDER_CLASS = 'text-[11px] text-muted';
export const PHYSICAL_DISK_LIFE_CLASS = 'text-[11px] font-medium';
export const PHYSICAL_DISK_HEALTH_WRAP_CLASS =
'flex min-w-0 items-center gap-1.5 whitespace-nowrap';
-export const PHYSICAL_DISK_HEALTH_LABEL_CLASS = 'min-w-0 truncate text-[11px] font-semibold';
-export const PHYSICAL_DISK_HEALTH_SUMMARY_CLASS = 'hidden xl:block truncate text-[11px] text-muted';
+// The health word is the row's verdict and always renders whole. Its reason
+// lives in the cell title and in the disk drawer, not in a truncating sibling
+// that would compete with it for the track.
+export const PHYSICAL_DISK_HEALTH_LABEL_CLASS = 'shrink-0 text-[11px] font-semibold';
export const PHYSICAL_DISK_TEMPERATURE_CLASS = 'text-[11px] font-medium';
export const PHYSICAL_DISK_SIZE_VALUE_CLASS = 'text-[11px] text-base-content';
diff --git a/frontend-modern/src/features/storageBackups/rowPresentation.ts b/frontend-modern/src/features/storageBackups/rowPresentation.ts
index 10e4c68f7a..f9bacbab41 100644
--- a/frontend-modern/src/features/storageBackups/rowPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/rowPresentation.ts
@@ -66,9 +66,32 @@ export function getStoragePoolStateTextClass(record: StorageRecord): string {
return 'text-base-content';
}
+// The rebuild summary the backend promotes into the protection label is a
+// sentence ("ZFS pool tank is resilvering (45.2%)"). The protection column is
+// a badge, so a ZFS scan reads as the activity word, derived from the pool's
+// own scan state (the same source the backend keys its risk reason on); the
+// sentence stays available as the cell title. Non-ZFS rebuilds keep the label
+// their platform supplies.
+export function getStoragePoolRebuildLabel(record: StorageRecord): string {
+ const pool = getStorageRecordZfsPool(record);
+ if (!pool) return '';
+ const scan = `${pool.scanDetails?.function || ''} ${pool.scan || ''}`.toLowerCase();
+ const percentage = pool.scanDetails?.percentage;
+ const progress =
+ typeof percentage === 'number' && Number.isFinite(percentage) && percentage > 0
+ ? ` ${Math.round(percentage)}%`
+ : '';
+ if (scan.includes('resilver')) return `Resilvering${progress}`;
+ if (scan.includes('scrub')) return `Scrubbing${progress}`;
+ return '';
+}
+
export function getCompactStoragePoolProtectionLabel(record: StorageRecord): string {
const label = (record.protectionLabel || '').trim();
- if (record.rebuildInProgress || record.protectionReduced) {
+ if (record.rebuildInProgress) {
+ return getStoragePoolRebuildLabel(record) || label || '—';
+ }
+ if (record.protectionReduced) {
return label || '—';
}
if (label && label.toLowerCase() !== 'healthy') {
@@ -87,7 +110,9 @@ export function getStoragePoolStateLabel(record: StorageRecord): string {
}
const pool = getStorageRecordZfsPool(record);
if (pool?.state) {
- return pool.state === 'ONLINE' ? 'Online' : pool.state;
+ // zpool reports upper-case states; present them like every other state
+ // path so a DEGRADED pool reads the same as a degraded array.
+ return titleize(pool.state);
}
const status = getStorageRecordStatus(record);
return status ? titleize(status) : '—';
@@ -122,7 +147,9 @@ export function getCompactStoragePoolProtectionTitle(record: StorageRecord): str
return issueSummary;
}
}
- return label;
+ // When the badge shows a derived word, the platform's full label is the title.
+ const fullLabel = (record.protectionLabel || '').trim();
+ return fullLabel && fullLabel.toLowerCase() !== label.toLowerCase() ? fullLabel : label;
}
export function getCompactStoragePoolImpactLabel(record: StorageRecord): string {
diff --git a/frontend-modern/src/features/storageBackups/storageBarPresentation.ts b/frontend-modern/src/features/storageBackups/storageBarPresentation.ts
index 02b7fda274..533641e90a 100644
--- a/frontend-modern/src/features/storageBackups/storageBarPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storageBarPresentation.ts
@@ -38,8 +38,13 @@ export const getStorageBarUsagePercent = (used: number, total: number): number =
return (used / total) * 100;
};
+// Phone-width tables only have room for the percentage inside the bar; the
+// used/total sublabel stays in the tooltip and in the wider projections.
+export const getStorageBarCompactLabel = (used: number, total: number): string =>
+ formatPercent(getStorageBarUsagePercent(used, total));
+
export const getStorageBarLabel = (used: number, total: number): string =>
- `${formatPercent(getStorageBarUsagePercent(used, total))} (${formatBytes(used)}/${formatBytes(total)})`;
+ `${getStorageBarCompactLabel(used, total)} (${formatBytes(used)}/${formatBytes(total)})`;
export const getStorageBarTooltipTitle = (): string => 'Storage Details';
diff --git a/frontend-modern/src/features/storageBackups/storagePagePresentation.ts b/frontend-modern/src/features/storageBackups/storagePagePresentation.ts
index 6d1d641452..26c156fd0e 100644
--- a/frontend-modern/src/features/storageBackups/storagePagePresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storagePagePresentation.ts
@@ -1,5 +1,7 @@
+import type { JSX } from 'solid-js';
import type { StorageSortKey } from './storageModelCore';
import type { PlatformTableColumnKind } from '@/features/platformPage/columnAlignment';
+import { getPlatformTableWeightedColumnWidthStyle } from '@/features/platformPage/sharedPlatformPage';
export type StorageViewOption = {
value: 'pools' | 'disks';
@@ -21,11 +23,14 @@ export type StoragePoolTableColumn = {
export type StoragePoolTableLayoutMode = 'narrow' | 'compact' | 'operational' | 'full';
+// The compact/operational boundary matches the shared phone projection of the
+// table container (`@container (max-width: 33.999rem)` = 544px), so the
+// columns and the in-cell labels always change projection together.
export const getStoragePoolTableLayoutModeForContainer = (
containerWidth: number,
): StoragePoolTableLayoutMode => {
if (containerWidth >= 1_040) return 'full';
- if (containerWidth >= 560) return 'operational';
+ if (containerWidth >= 544) return 'operational';
if (containerWidth > 0 && containerWidth < 360) return 'narrow';
return 'compact';
};
@@ -43,13 +48,20 @@ const STORAGE_POOL_VISIBLE_COLUMNS: Record<
full: ['name', 'state', 'type', 'host', 'protection', 'usage', 'growth'],
};
-const STORAGE_POOL_COLUMN_WIDTHS: Record<
+// Relative weights per layout, resolved through the canonical weighted-width
+// helper. On phones the usage bar carries only its percentage, so most of the
+// row goes to the two identity strings (pool name and host); a state word such
+// as "Degraded" must still fit whole. The shared 30% identity anchor is not
+// used here because a four-column row cannot keep the host readable with it.
+const STORAGE_POOL_COLUMN_WEIGHTS: Record<
StoragePoolTableLayoutMode,
Partial<Record<StoragePoolTableColumnId, number>>
> = {
- narrow: { name: 40, state: 20, host: 20, usage: 20 },
- compact: { name: 35, state: 20, host: 20, usage: 25 },
- operational: { name: 29, state: 20, host: 15, protection: 15, usage: 21 },
+ narrow: { name: 35, state: 21, host: 31, usage: 13 },
+ compact: { name: 37, state: 18.5, host: 31.5, usage: 13 },
+ // The full "59% (1.18 TB/2.00 TB)" bar label returns at 544px, so the usage
+ // track must hold ~120px of text from the first operational width.
+ operational: { name: 27, state: 18, host: 15, protection: 15, usage: 25 },
full: { name: 20, state: 14, type: 10, host: 12, protection: 13, usage: 20, growth: 11 },
};
@@ -58,10 +70,24 @@ export const isStoragePoolColumnVisible = (
columnId: StoragePoolTableColumnId,
): boolean => STORAGE_POOL_VISIBLE_COLUMNS[layout].includes(columnId);
-export const getStoragePoolColumnWidthPercent = (
+// On phones the pool row sheds the desktop cell gutter the same way its
+// headers (via the shared container query) and the physical-disk rows do:
+// four cells at 12px each were 48px of a 361px row, and the measured values
+// fit the tracks with only a pixel or two to spare.
+export const STORAGE_POOL_PHONE_CELL_PADDING_CLASS = '!px-1';
+
+export const getStoragePoolCellPaddingClass = (layout: StoragePoolTableLayoutMode): string =>
+ layout === 'narrow' || layout === 'compact' ? STORAGE_POOL_PHONE_CELL_PADDING_CLASS : '';
+
+export const getStoragePoolColumnWidthStyle = (
layout: StoragePoolTableLayoutMode,
columnId: StoragePoolTableColumnId,
-): number => STORAGE_POOL_COLUMN_WIDTHS[layout][columnId] ?? 0;
+): JSX.CSSProperties =>
+ getPlatformTableWeightedColumnWidthStyle(
+ columnId,
+ STORAGE_POOL_COLUMN_WEIGHTS[layout],
+ STORAGE_POOL_VISIBLE_COLUMNS[layout],
+ );
const STORAGE_POOL_TABLE_HEADER_CLASS =
'overflow-hidden text-ellipsis whitespace-nowrap text-[10px] sm:text-[11px] lg:text-xs uppercase tracking-wider';