From 33febcaf1ba1409ab375b105154a11bd64dc30cb Mon Sep 17 00:00:00 2001 From: Juan Denis Date: Tue, 3 Nov 2026 13:01:55 -0500 Subject: [PATCH] fix(ui): stack DataTable rows into cards on phones for Servers, Fleet proxy, Incidents, Jobs --- frontend/src/components/ds/DataTable.jsx | 11 +++- frontend/src/pages/FleetProxy.jsx | 1 + frontend/src/pages/Incidents.jsx | 1 + frontend/src/pages/Jobs.jsx | 2 + frontend/src/pages/Servers.jsx | 1 + .../src/styles/components/_design-system.scss | 54 +++++++++++++++++++ 6 files changed, 68 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ds/DataTable.jsx b/frontend/src/components/ds/DataTable.jsx index 6410c284..4acdf844 100644 --- a/frontend/src/components/ds/DataTable.jsx +++ b/frontend/src/components/ds/DataTable.jsx @@ -105,6 +105,9 @@ export function DataTable({ className, rowClassName, tableClassName, + // Below 640px each row becomes a card: first column is the title, the rest + // are label/value pairs (CSS-only, see .sk-dtable-wrap--stack). + stackOnMobile = false, }) { const { t } = useTranslation(); const internal = useTableSort({ @@ -365,10 +368,14 @@ export function DataTable({ /> )} - {visibleColumns.map((column) => ( + {visibleColumns.map((column, columnIndex) => ( {column.render ? column.render(row) @@ -380,7 +387,7 @@ export function DataTable({ }; return ( -
+
diff --git a/frontend/src/pages/FleetProxy.jsx b/frontend/src/pages/FleetProxy.jsx index b925db48..e686c448 100644 --- a/frontend/src/pages/FleetProxy.jsx +++ b/frontend/src/pages/FleetProxy.jsx @@ -400,6 +400,7 @@ const FleetProxy = () => {
) : ( ) : scheduledView ? ( ) : ( { /> ) : ( svg:only-child) { + position: absolute; + inset-block-start: $space-3; + inset-inline-end: $space-4; + } + } +} + // A table that is one section of a titled card/panel runs flush inside it: // two frames a pixel apart is the seam this rule removes. A page-specific // panel that frames its own header + table opts in with --flush.