Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): make action header sizing explicit

Josuéd4491937d17e
diff --git a/control-ui/components/TableHeaderRow/index.tsx b/control-ui/components/TableHeaderRow/index.tsx
index ee8983a90..f508400f9 100644
--- a/control-ui/components/TableHeaderRow/index.tsx
+++ b/control-ui/components/TableHeaderRow/index.tsx
@@ -12,7 +12,7 @@ export function TableHeaderRow({ columns }: { columns: TableHeaderColumn[] }) {
aria-label={column.ariaLabel}
title={column.title}
label={column.label}
- kind={column.kind ?? (column.key === 'actions' ? 'actions' : undefined)}
+ kind={column.kind}
activeDirection={column.activeDirection}
defaultDirection={column.defaultDirection}
onSort={column.onSort}
diff --git a/control-ui/components/__tests__/TableHeaderRow.test.tsx b/control-ui/components/__tests__/TableHeaderRow.test.tsx
new file mode 100644
index 000000000..687004e3d
--- /dev/null
+++ b/control-ui/components/__tests__/TableHeaderRow.test.tsx
@@ -0,0 +1,46 @@
+import { afterEach, describe, expect, it } from 'vitest'
+import { cleanup, render, screen } from '@testing-library/react'
+import { TableHeaderRow } from '../TableHeaderRow'
+
+afterEach(cleanup)
+
+describe('TableHeaderRow', () => {
+ it('does not compact a wide action column unless the column opts in', () => {
+ render(
+ <table>
+ <thead>
+ <TableHeaderRow
+ columns={[
+ { key: 'name', label: 'Name' },
+ { key: 'actions', label: 'Actions', width: '7rem', align: 'right' },
+ ]}
+ />
+ </thead>
+ </table>
+ )
+
+ const actions = screen.getByRole('columnheader', { name: 'Actions' })
+ expect(actions).toHaveClass('eft-table__header--text')
+ expect(actions).not.toHaveClass('eft-table__header--actions')
+ expect(actions).toHaveStyle({ width: '7rem' })
+ })
+
+ it('uses compact action styling when a table declares an action-menu column', () => {
+ render(
+ <table>
+ <thead>
+ <TableHeaderRow
+ columns={[
+ { key: 'name', label: 'Name' },
+ { key: 'menu', label: 'Actions', kind: 'actions', width: '3.5rem' },
+ ]}
+ />
+ </thead>
+ </table>
+ )
+
+ expect(screen.getByRole('columnheader', { name: 'Actions' })).toHaveClass(
+ 'eft-table__header--actions'
+ )
+ })
+})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 5937d9c39..113c65c13 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.534",
+ "version": "0.1.535",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.534",
+ "version": "0.1.535",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index d03406898..8d9fd8b8e 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.534",
+ "version": "0.1.535",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",