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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Keep Alert History rows on one line on desktop
rcourtman9ae30ff138ad
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.mdindex d12ecd58c6..8b1187b81a 100644--- a/docs/release-control/v6/internal/subsystems/alerts.md+++ b/docs/release-control/v6/internal/subsystems/alerts.md@@ -1756,7 +1756,12 @@ and never falls under 18% of the card; `App.architecture.test.ts` holds thoseminimums and the 50rem, 64rem and 80rem switch points. From an 800px card thethree actions share one line; below it they stack, which makes those rowstaller, and rows there still differ by how many action buttons they stack.-Below an 80rem card, Resource and Message cells wrap inside a `line-clamp-2`+Table rows show Timeline and Resource as 24px icon buttons beside the+Investigate icon (accessible names and titles say what each opens; cards keep+the worded buttons), so the three actions need 100px instead of 177px, and+Status uses a compact 11px badge that needs 108px for "moved to agent"+instead of 119px. Resource and Message take that width.+Below a 50rem card, Resource and Message cells wrap inside a `line-clamp-2`wrapper (`data-alert-history-cell`) instead of ending in an ellipsis after oneline, so more of what happened reads without hover. A message or name longerthan its two lines still ends in an ellipsis with the full text on its title;@@ -1767,9 +1772,11 @@ never changes its row's height: the shared windowing hook sizes its spacersfrom a single measured row. Scrolling a 600-row history in 60px wheel steps(414 tracked comparisons) moved a tracked row by exactly the scroll distancewith uniform 49px rows, while the same history with the minimum removed (rows-of 39px and 49px) showed 46 steps where the row jumped by up to 20px. From an-80rem card both cells return to a one-line clamp, the single 39px row that-card already had (`@min-[80rem]:line-clamp-1`, minimum height released).+of 39px and 49px) showed 46 steps where the row jumped by up to 20px. From a+50rem card (a desktop window of about 1250px beside the sidebar) both cells+return to a one-line clamp (`@min-[50rem]:line-clamp-1`, minimum height+released) and rows are 33px like the other tables; the earlier 80rem switch+left 1280-1440px windows with 49px two-line rows.Measured on the mock estate in a real browser (the estate regenerates onevery run, so the row count differs: 88 before, 90 after), messages that endedin an ellipsis fell from 82 of 88 rows to 24 of 90 at a 1024px window with thediff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex d919c03dc7..d88b3b3569 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -1024,9 +1024,9 @@ alert threshold toggles and inputs. Settings > Infrastructure body cells usethe platform tables' 4px vertical padding (39px rows before), and its systemline keeps the name, collection badge and member toggle on one line,truncating the name, where a wrapped badge had made a 63px row. Long text-ends in an ellipsis with its full value in the title. Alert History keeps-its two-line Message below an 80rem card: at a 1280px window its message-track is about 180px, and one line read "Docker service..." for most rows.+ends in an ellipsis with its full value in the title. Alert History rows+are one line from a 50rem card once its icon row actions and compact Status+give Message and Resource the width; below 50rem Message keeps two lines.### Visible phone row disclosure keeps rows single-line@@ -6718,14 +6718,17 @@ removed, so the visible widths sum to 100% and the table width is the sum ofall nine; `App.architecture.test.ts` checks both at every density, the pixelminimums the content-bound tracks need at the narrowest card their densityserves, that each density block sits inside its 50rem, 64rem or 80rem-container query, and that Message keeps at least 18% of the card. Below an-80rem card the Alert History table's Resource and Message cells wrap in a+container query, and that Message keeps at least 18% of the card. Below a+50rem card the Alert History table's Resource and Message cells wrap in a`line-clamp-2` wrapper that sets `whitespace-normal` itself (the global`.table-fixed td` rule forces nowrap), so more of a row reads without hover ona row that has no disclosure to recover the rest; Message keeps a two-lineminimum height so its length never changes a row's height, which the shared-windowing hook's single measured row assumes, and from an 80rem card both-cells return to a one-line clamp (`@min-[80rem]:line-clamp-1`).+windowing hook's single measured row assumes, and from a 50rem card both+cells return to a one-line clamp (`@min-[50rem]:line-clamp-1`): icon-only+Timeline/Resource row actions (100px instead of 177px) and a compact Status+badge (108px instead of 119px) give Resource and Message the width that one+line needs.Alert History investigation detail is also responsive by interaction model,not only by CSS. Desktop may keep Timeline and Resource incident detail inlinewith its table row, while the virtualized phone card list must open the shareddiff --git a/frontend-modern/browser-verification/ab662b248c7211fe.json b/frontend-modern/browser-verification/ab662b248c7211fe.jsonnew file mode 100644index 0000000000..7262739bb1--- /dev/null+++ b/frontend-modern/browser-verification/ab662b248c7211fe.json@@ -0,0 +1,54 @@+{+ "version": 1,+ "base_sha": "0a844bdd340fc4f3df38d30548073fc2b4c06830",+ "verified_at": "2026-10-25T21:56:05Z",+ "result": "passed",+ "changed_paths": [+ "frontend-modern/src/features/alerts/AlertHistoryItemActions.tsx",+ "frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx",+ "frontend-modern/src/index.css",+ "frontend-modern/src/utils/alertIncidentPresentation.ts"+ ],+ "content_sha256": {+ "frontend-modern/src/features/alerts/AlertHistoryItemActions.tsx": "260a03b94b8c6002d2ed7a37ec39fd1aa122d68d1ced2bc2a2d0110599f72a16",+ "frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx": "1f3eaa52a4f432f4b48d9585d409865fd56e5039e9a7ae79f536733ebf0851cf",+ "frontend-modern/src/index.css": "03c3054d36a58b6793e1fb821067f462f8a9abe79bedd9a974ac76a0bf9c0ff2",+ "frontend-modern/src/utils/alertIncidentPresentation.ts": "1414e1437863b96071d5fd23b32ffe4eb656e883ac98a4db4ae1e5be29ec033b"+ },+ "routes": [+ "/alerts/history"+ ],+ "viewports": [+ {+ "width": 1920,+ "height": 900+ },+ {+ "width": 1440,+ "height": 900+ },+ {+ "width": 1366,+ "height": 900+ },+ {+ "width": 1280,+ "height": 900+ },+ {+ "width": 390,+ "height": 844+ }+ ],+ "states": [+ "Embedded production build in mock mode on pulse-dev, headless Chromium, dark theme, All time range (about 130 rows); runtime files sha256-identical to the measured build. Cut = a Message or Resource cell whose text runs past its visible lines.",+ "Before (origin/main, two-line below 80rem): rows 49px at 1280/1366/1440px and 39px at 1920px; Message cut 30/13/6/13 and Resource cut 44/35/33/35 of ~132 rows at 1280/1366/1440/1920px. One line with the old columns (Actions 177px, Status 119px): Message cut 96/42/28 and Resource cut 99/97/90 at 1280/1366/1440px.",+ "After: every row 33px at 1280, 1366, 1440 and 1920px. Message track 232/299/356/516px (was 180/250/310/457), Resource 134/146/157/201px (was 98/107/115/172), Actions 100px, Status 108px. Message cut 62/35/32/4 and Resource cut 76/62/50/31. Screenshots: at 1280px messages keep the object name (\"Docker service 'ops-jenkins' ...\") and resource names are whole except long disk/branch names; at 1440px most messages read whole.",+ "Phone 390px: the card list is unchanged, no table, worded Timeline and Resource actions (46 buttons, none icon-only)."+ ],+ "interactions": [+ "Inspected 1280 and 1440px screenshots of the history table; Timeline, Resource and Investigate are 24px icon buttons with titles and accessible names naming the alert/resource; the acknowledged/moved-to-agent status badges fit the 108px track.",+ "Full frontend suite under Node 24 on this branch: 1276 of 1277 files passed; the one failure was a 5s timeout in the unrelated docs mirror test under load average 10-14, which passes alone (3/3)."+ ],+ "proof_scope": "Alert History desktop row layout, row action presentation and status badge size; alert data, actions behaviour, phone cards and windowing are unchanged."+}diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.tsindex a1e8176d97..23e9e556aa 100644--- a/frontend-modern/src/__tests__/App.architecture.test.ts+++ b/frontend-modern/src/__tests__/App.architecture.test.ts@@ -1175,9 +1175,10 @@ describe('Alert History column widths', () => {// Each density is sized for the narrowest card it serves, from the natural// widths measured in a real browser (padding included): "08:27 AM" in a 14px- // monospace, the Severity/Duration/Resource headers, a 119px "acknowledged"- // badge, and the three row actions on one line (177px). Below 800px the- // actions stack, so the base density only needs the widest single button.+ // monospace, the Severity/Duration/Resource headers, the compact 11px+ // "moved to agent" status badge (108px), and the three 24px icon row actions+ // on one line (100px; worded buttons needed 177px). The base density only+ // needs the actions' width at its percentage.// Message, the column that says what happened, may never fall under 18% of// the card. Type and Node, which appear from 1024px, get a floor too: the// longest type label, "Container Health", needs 119px with its padding.@@ -1186,8 +1187,8 @@ describe('Alert History column widths', () => {resource: 93,severity: 86,duration: 91,- status: 119,- actions: 177,+ status: 108,+ actions: 100,} as const;const pixelNeeds: Array<{name: string;@@ -1197,7 +1198,7 @@ describe('Alert History column widths', () => {{name: 'base',cardWidth: 600,- needs: { timestamp: 84, resource: 93, severity: 86, status: 119, actions: 80 },+ needs: { timestamp: 84, resource: 93, severity: 86, status: 108, actions: 100 },},{ name: '50rem', cardWidth: 800, needs: wideNeeds },{ name: '64rem', cardWidth: 1024, needs: { ...wideNeeds, type: 120, node: 68 } },diff --git a/frontend-modern/src/features/alerts/AlertHistoryItemActions.tsx b/frontend-modern/src/features/alerts/AlertHistoryItemActions.tsxindex 8a111ed24d..f49744f639 100644--- a/frontend-modern/src/features/alerts/AlertHistoryItemActions.tsx+++ b/frontend-modern/src/features/alerts/AlertHistoryItemActions.tsx@@ -1,4 +1,6 @@import { Show } from 'solid-js';+import BoxIcon from 'lucide-solid/icons/box';+import HistoryIcon from 'lucide-solid/icons/history';import { InvestigateAlertButton } from '@/components/Alerts/InvestigateAlertButton';import {@@ -11,11 +13,21 @@ import type { AlertHistoryState } from './useAlertHistoryState';type AlertHistoryAlert = ReturnType<AlertHistoryState['groupedAlerts']>[number]['alerts'][number];+// Table rows show Timeline and Resource as 24px icon buttons beside the+// Investigate icon, so the three actions take about 100px instead of 177px+// and Message and Resource get that width on one line. Their accessible+// names and titles still say what each opens; cards keep the worded buttons.+const ALERT_HISTORY_ICON_ACTION_CLASS =+ 'inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-surface text-muted transition-colors hover:bg-surface-hover hover:text-base-content focus:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500';+const ALERT_HISTORY_TEXT_ACTION_CLASS =+ 'rounded-md border border-border px-2 py-1 text-[10px] text-muted hover:bg-surface-hover';+interface AlertHistoryItemActionsProps {alert: AlertHistoryAlert;state: AlertHistoryState;class?: string;touchSized?: boolean;+ iconOnly?: boolean;onTimelineClick?: () => void;onResourceClick?: () => void;timelineOpen?: boolean;@@ -34,16 +46,21 @@ export function AlertHistoryItemActions(props: AlertHistoryItemActionsProps) {});return (- <div class={`flex flex-wrap items-center gap-1.5 ${props.class ?? ''}`.trim()}>+ <div+ class={`flex ${props.iconOnly ? 'flex-nowrap' : 'flex-wrap'} items-center gap-1.5 ${props.class ?? ''}`.trim()}+ ><Show when={props.alert.source === 'alert'}><buttontype="button"- class={`rounded-md border border-border px-2 py-1 text-[10px] text-muted hover:bg-surface-hover ${- props.touchSized ? 'min-h-11' : ''- }`}+ class={+ props.iconOnly+ ? `${ALERT_HISTORY_ICON_ACTION_CLASS} ${timelineOpen() ? 'bg-surface-hover text-base-content' : ''}`+ : `${ALERT_HISTORY_TEXT_ACTION_CLASS} ${props.touchSized ? 'min-h-11' : ''}`+ }data-alert-history-action="timeline"aria-label={timelineLabel()}aria-expanded={timelineOpen()}+ title={props.iconOnly ? (timelineOpen() ? 'Hide timeline' : 'Timeline') : undefined}onClick={() => {if (props.onTimelineClick) {props.onTimelineClick();@@ -56,15 +73,19 @@ export function AlertHistoryItemActions(props: AlertHistoryItemActionsProps) {);}}>- {timelineOpen() ? 'Hide' : 'Timeline'}+ <Show when={props.iconOnly} fallback={timelineOpen() ? 'Hide' : 'Timeline'}>+ <HistoryIcon class="h-3.5 w-3.5" aria-hidden="true" />+ </Show></button></Show><Show when={props.alert.source === 'alert' && props.alert.resourceId}><buttontype="button"- class={`rounded-md border border-border px-2 py-1 text-[10px] text-muted hover:bg-surface-hover ${- props.touchSized ? 'min-h-11' : ''- }`}+ class={+ props.iconOnly+ ? ALERT_HISTORY_ICON_ACTION_CLASS+ : `${ALERT_HISTORY_TEXT_ACTION_CLASS} ${props.touchSized ? 'min-h-11' : ''}`+ }data-alert-history-action="resource"aria-label={getAlertHistoryResourceActionLabel(props.alert.resourceName)}title={getAlertResourceIncidentViewTitle()}@@ -80,7 +101,9 @@ export function AlertHistoryItemActions(props: AlertHistoryItemActionsProps) {);}}>- Resource+ <Show when={props.iconOnly} fallback="Resource">+ <BoxIcon class="h-3.5 w-3.5" aria-hidden="true" />+ </Show></button></Show><Showdiff --git a/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx b/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsxindex fe39485a39..2596c70512 100644--- a/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx+++ b/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx@@ -17,18 +17,18 @@ import type { AlertHistoryState } from './useAlertHistoryState';type AlertHistoryAlert = ReturnType<AlertHistoryState['groupedAlerts']>[number]['alerts'][number];-// Below an 80rem card the cells that say which resource and what happened wrap-// instead of ending in an ellipsis after one line. Message then holds two lines,-// so its length never changes the row's height: the windowing hook sizes its-// spacers from one measured row, and rows of mixed heights make a long history-// jump as it scrolls. From an 80rem card the message track is wide enough for-// one line, so both cells return to a one-line clamp, the single-line row the-// other platform tables keep. Text past its lines ends in an ellipsis and keeps-// its title.+// Below a 50rem card (a 1024px window) the message track is about 110px, too+// narrow to tell alerts apart on one line, so the cells that say which+// resource and what happened wrap and Message holds two lines on every row:+// the windowing hook sizes its spacers from one measured row, and rows of+// mixed heights make a long history jump as it scrolls. From a 50rem card the+// icon row actions and compact status leave Message and Resource enough room+// for one line, the single-line row the other platform tables keep. Text past+// its line ends in an ellipsis and keeps its title.const ALERT_HISTORY_MESSAGE_TEXT_CLASS =- 'line-clamp-2 min-h-[2lh] @min-[80rem]:line-clamp-1 @min-[80rem]:min-h-0 whitespace-normal wrap-break-word text-base-content';+ 'line-clamp-2 min-h-[2lh] @min-[50rem]:line-clamp-1 @min-[50rem]:min-h-0 whitespace-normal wrap-break-word text-base-content';const ALERT_HISTORY_RESOURCE_TEXT_CLASS =- 'line-clamp-2 @min-[80rem]:line-clamp-1 whitespace-normal wrap-break-word text-base-content';+ 'line-clamp-2 @min-[50rem]:line-clamp-1 whitespace-normal wrap-break-word text-base-content';interface AlertHistoryTableAlertRowProps {alert: AlertHistoryAlert;@@ -37,7 +37,8 @@ interface AlertHistoryTableAlertRowProps {export function AlertHistoryTableAlertRow(props: AlertHistoryTableAlertRowProps) {const rowKey = () => props.state.getIncidentRowKey(props.alert);- const historyStatusPresentation = () => getAlertHistoryStatusPresentation(props.alert.status);+ const historyStatusPresentation = () =>+ getAlertHistoryStatusPresentation(props.alert.status, { compact: true });// An open threshold alert's live reading turns stale when evaluations stop,// so it rechecks on the shared clock; the last breach moves to the hover.const now = useRelativeTimeNow();@@ -117,7 +118,12 @@ export function AlertHistoryTableAlertRow(props: AlertHistoryTableAlertRowProps)</TableCell><TableCell class={getPlatformTableCellClassForKind('badge')}>- <AlertHistoryItemActions alert={props.alert} state={props.state} class="justify-center" />+ <AlertHistoryItemActions+ alert={props.alert}+ state={props.state}+ class="justify-center"+ iconOnly+ /></TableCell></TableRow>diff --git a/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsx b/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsxindex 9b2b3512b0..14433f0bf1 100644--- a/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsx+++ b/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsx@@ -141,9 +141,11 @@ describe('AlertHistoryTableAlertRow', () => {expect(message.dataset.alertHistoryCell).toBe('message');expect(message.className).toContain('line-clamp-2');expect(message.className).toContain('min-h-[2lh]');- // From an 80rem card both cells return to one line at the old row height.- expect(message.className).toContain('@min-[80rem]:line-clamp-1');- expect(message.className).toContain('@min-[80rem]:min-h-0');+ // From a 50rem card (a desktop window of about 1250px) both cells return to+ // one line: icon row actions and a compact status give them the width.+ expect(message.className).toContain('@min-[50rem]:line-clamp-1');+ expect(message.className).toContain('@min-[50rem]:min-h-0');+ expect(message.className).not.toContain('80rem');expect(message.className).toContain('whitespace-normal');expect(message.className).toContain('wrap-break-word');expect(message.className).not.toContain('truncate');@@ -153,11 +155,34 @@ describe('AlertHistoryTableAlertRow', () => {const resource = screen.getByText('standalone2-iso-library');expect(resource.dataset.alertHistoryCell).toBe('resource');expect(resource.className).toContain('line-clamp-2');- expect(resource.className).toContain('@min-[80rem]:line-clamp-1');+ expect(resource.className).toContain('@min-[50rem]:line-clamp-1');expect(resource.className).toContain('whitespace-normal');expect(resource.className).toContain('wrap-break-word');expect(resource.className).not.toContain('truncate');expect(resource).toHaveAttribute('title', 'standalone2-iso-library');expect(resource.closest('td')?.className).not.toMatch(/max-w-\[/);});++ // Worded Timeline and Resource buttons took 177px with Investigate; as 24px+ // icons beside it the actions need about 100px, which Message and Resource+ // take so a row reads on one line. Names and titles still say what each opens.+ it('shows the row actions as named icon buttons on one line', () => {+ const { container } = renderRow(historyItem({}));+ const timeline = container.querySelector('[data-alert-history-action="timeline"]');+ const resource = container.querySelector('[data-alert-history-action="resource"]');+ expect(timeline).toHaveClass('h-6', 'w-6');+ expect(resource).toHaveClass('h-6', 'w-6');+ expect(timeline).toHaveTextContent('');+ expect(timeline?.querySelector('svg')).toBeInTheDocument();+ expect(resource?.querySelector('svg')).toBeInTheDocument();+ expect(timeline).toHaveAttribute('title', 'Timeline');+ expect(timeline?.getAttribute('aria-label')).toMatch(/timeline/i);+ expect(resource?.getAttribute('aria-label')).toMatch(/minipc/);+ expect(timeline?.parentElement).toHaveClass('flex-nowrap');+ });++ it('uses the compact status badge in the table row', () => {+ renderRow(historyItem({ status: 'acknowledged' }));+ expect(screen.getByText('acknowledged')).toHaveClass('text-[11px]', 'px-1.5');+ });});diff --git a/frontend-modern/src/index.css b/frontend-modern/src/index.cssindex 8daf0b3805..4ece442743 100644--- a/frontend-modern/src/index.css+++ b/frontend-modern/src/index.css@@ -492,11 +492,11 @@--alert-history-resource-width: 15.6%;--alert-history-type-width: 0%;--alert-history-severity-width: 14.4%;- --alert-history-message-width: 22.7%;+ --alert-history-message-width: 21.3%;--alert-history-duration-width: 0%;- --alert-history-status-width: 19.9%;+ --alert-history-status-width: 18%;--alert-history-node-width: 0%;- --alert-history-actions-width: 13.4%;+ --alert-history-actions-width: 16.7%;width: 100%;}@@ -596,14 +596,14 @@.table-scroll-shell table.alert-history-responsive-table {--alert-history-timestamp-width: 84px;- --alert-history-resource-width: 11.7%;+ --alert-history-resource-width: 16%;--alert-history-type-width: 0px;--alert-history-severity-width: 86px;--alert-history-message-width: auto;--alert-history-duration-width: 91px;- --alert-history-status-width: 119px;+ --alert-history-status-width: 108px;--alert-history-node-width: 0px;- --alert-history-actions-width: 177px;+ --alert-history-actions-width: 100px;width: 100%;}@@ -640,14 +640,14 @@.table-scroll-shell table.alert-history-responsive-table {--alert-history-timestamp-width: 84px;- --alert-history-resource-width: 9.1%;+ --alert-history-resource-width: 13%;--alert-history-type-width: 120px;--alert-history-severity-width: 86px;--alert-history-message-width: auto;--alert-history-duration-width: 91px;- --alert-history-status-width: 119px;+ --alert-history-status-width: 108px;--alert-history-node-width: 6.7%;- --alert-history-actions-width: 177px;+ --alert-history-actions-width: 100px;width: 100%;}}@@ -655,14 +655,14 @@@container (min-width: 80rem) {.table-scroll-shell table.alert-history-responsive-table {--alert-history-timestamp-width: 84px;- --alert-history-resource-width: 12%;+ --alert-history-resource-width: 14%;--alert-history-type-width: 128px;--alert-history-severity-width: 86px;--alert-history-message-width: auto;--alert-history-duration-width: 91px;- --alert-history-status-width: 119px;+ --alert-history-status-width: 108px;--alert-history-node-width: 8.5%;- --alert-history-actions-width: 177px;+ --alert-history-actions-width: 100px;width: 100%;}diff --git a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.tsindex 95f73767f0..1ece757029 100644--- a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts+++ b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts@@ -532,10 +532,10 @@ describe('tab path helpers', () => {// Message holds two lines on every row so the windowing hook's single// measured row height stays true as a long history scrolls.expect(alertHistoryTableAlertRowSource).toMatch(- /ALERT_HISTORY_MESSAGE_TEXT_CLASS =\s*'line-clamp-2 min-h-\[2lh\] @min-\[80rem\]:line-clamp-1 @min-\[80rem\]:min-h-0 whitespace-normal wrap-break-word /,+ /ALERT_HISTORY_MESSAGE_TEXT_CLASS =\s*'line-clamp-2 min-h-\[2lh\] @min-\[50rem\]:line-clamp-1 @min-\[50rem\]:min-h-0 whitespace-normal wrap-break-word /,);expect(alertHistoryTableAlertRowSource).toMatch(- /ALERT_HISTORY_RESOURCE_TEXT_CLASS =\s*'line-clamp-2 @min-\[80rem\]:line-clamp-1 whitespace-normal wrap-break-word /,+ /ALERT_HISTORY_RESOURCE_TEXT_CLASS =\s*'line-clamp-2 @min-\[50rem\]:line-clamp-1 whitespace-normal wrap-break-word /,);expect(alertHistoryTableAlertRowSource).not.toMatch(/max-w-\[\d+px\]/);expect(alertHistoryTableAlertRowSource).not.toMatch(diff --git a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.tsindex c248033bb8..47d0f00847 100644--- a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts@@ -116,6 +116,21 @@ describe('alertIncidentPresentation', () => {});});+ // The history table row uses an 11px badge so the Status track needs 108px+ // for "moved to agent" instead of 119px; the cards keep the 12px badge.+ it('gives a table row the compact status badge without changing the card badge', () => {+ expect(getAlertHistoryStatusPresentation('acknowledged', { compact: true })).toEqual({+ label: 'acknowledged',+ className:+ 'text-[11px] px-1.5 py-0.5 rounded-sm bg-yellow-100 dark:bg-yellow-900/25 text-yellow-700 dark:text-yellow-300',+ rowClassName: '',+ });+ expect(+ getAlertHistoryStatusPresentation(ALERT_HISTORY_MOVED_STATUS, { compact: true }).className,+ ).toContain('text-[11px] px-1.5');+ expect(getAlertHistoryStatusPresentation('resolved').className).toContain('text-xs px-2');+ });+it('says a handed-over alert did not recover, and leaves recoveries alone', () => {expect(getAlertResolutionDetail(undefined)).toBeUndefined();expect(diff --git a/frontend-modern/src/utils/alertIncidentPresentation.ts b/frontend-modern/src/utils/alertIncidentPresentation.tsindex 270144f1c7..e400c6fdf8 100644--- a/frontend-modern/src/utils/alertIncidentPresentation.ts+++ b/frontend-modern/src/utils/alertIncidentPresentation.ts@@ -95,16 +95,19 @@ export function getAlertResolutionDetail(resolution?: AlertResolution | null): sreturn resolution.summary?.trim() || undefined;}+// A table row passes `compact` for an 11px badge with tighter padding, so the+// Status track needs about 108px for "moved to agent" instead of 119px.export function getAlertHistoryStatusPresentation(status?: string | null,+ options: { compact?: boolean } = {},): AlertHistoryStatusPresentation {const normalized = (status ?? '').trim().toLowerCase();+ const badge = options.compact ? 'text-[11px] px-1.5' : 'text-xs px-2';if (normalized === 'active') {return {label: 'active',- className:- 'text-xs px-2 py-0.5 rounded-sm bg-red-100 dark:bg-red-900/25 text-red-700 dark:text-red-300 font-medium',+ className: `${badge} py-0.5 rounded-sm bg-red-100 dark:bg-red-900/25 text-red-700 dark:text-red-300 font-medium`,rowClassName: 'bg-red-50 dark:bg-red-900/25',};}@@ -112,8 +115,7 @@ export function getAlertHistoryStatusPresentation(if (normalized === 'acknowledged') {return {label: 'acknowledged',- className:- 'text-xs px-2 py-0.5 rounded-sm bg-yellow-100 dark:bg-yellow-900/25 text-yellow-700 dark:text-yellow-300',+ className: `${badge} py-0.5 rounded-sm bg-yellow-100 dark:bg-yellow-900/25 text-yellow-700 dark:text-yellow-300`,rowClassName: '',};}@@ -123,15 +125,14 @@ export function getAlertHistoryStatusPresentation(if (normalized === ALERT_HISTORY_MOVED_STATUS) {return {label: 'moved to agent',- className:- 'text-xs px-2 py-0.5 rounded-sm bg-blue-100 dark:bg-blue-900/25 text-blue-700 dark:text-blue-300',+ className: `${badge} py-0.5 rounded-sm bg-blue-100 dark:bg-blue-900/25 text-blue-700 dark:text-blue-300`,rowClassName: '',};}return {label: normalized || 'resolved',- className: 'text-xs px-2 py-0.5 rounded-sm bg-surface-hover text-base-content',+ className: `${badge} py-0.5 rounded-sm bg-surface-hover text-base-content`,rowClassName: '',};}