Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): drop the empty trailing column from the Logs table

Yudhi Armyndharis96fb03103fd9
diff --git a/dashboard/src/pages/Logs.css b/dashboard/src/pages/Logs.css
index b5f1647e4..67fe9dc79 100644
--- a/dashboard/src/pages/Logs.css
+++ b/dashboard/src/pages/Logs.css
@@ -85,7 +85,7 @@
/* Unified row styling - same class for header and data */
.logs-page .logs-table .table-row {
display: grid;
- grid-template-columns: 180px 200px 150px 150px 150px 1fr 120px;
+ grid-template-columns: 180px 200px 150px 150px 150px 1fr;
gap: 1rem;
padding: 1rem 1.5rem;
align-items: center;
@@ -136,14 +136,6 @@
white-space: nowrap;
}
-.logs-page .details {
- font-size: 0.875rem;
- color: var(--text-secondary);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
.logs-page .severity-badge {
display: inline-block;
padding: 0.25rem 0.625rem;
diff --git a/dashboard/src/pages/Logs.test.ts b/dashboard/src/pages/Logs.test.ts
index 2eef915e2..eeec8aa2c 100644
--- a/dashboard/src/pages/Logs.test.ts
+++ b/dashboard/src/pages/Logs.test.ts
@@ -7,6 +7,8 @@
import '../test-helpers/register-hooks.ts';
import { test, before, afterEach } from 'node:test';
import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
import { createElement } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { AuditLog } from '../services/api';
@@ -256,3 +258,14 @@ test('a row written while the export walks the pages is not exported twice', asy
restore();
}
});
+
+test('the table grid declares one column track per rendered cell', async () => {
+ const container = renderLogs();
+ await rtl.screen.findByText('infra.restart');
+ const css = readFileSync(fileURLToPath(new URL('./Logs.css', import.meta.url)), 'utf8');
+ const template = css.match(/\.logs-table \.table-row \{[^}]*grid-template-columns: ([^;]+);/)?.[1];
+ assert.ok(template, 'the row grid template was not found');
+ for (const row of container.querySelectorAll('.logs-table .table-row')) {
+ assert.equal(template.split(/\s+/).length, row.children.length, template);
+ }
+});