Skip to content

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

TypeScript

fix(frontend): stabilize shared table paint

Josué93f7f257f5e1
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 1ff1cf6bb..251f72db9 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -2620,6 +2620,14 @@ textarea.cu-input {
line-clamp: 2;
}
+td.cu-registry-description {
+ display: table-cell;
+ margin-top: 0;
+ overflow: visible;
+ -webkit-line-clamp: unset;
+ line-clamp: unset;
+}
+
.cu-registry-tags {
display: flex;
flex-wrap: wrap;
diff --git a/control-ui/components/__tests__/FrontendComponents.test.tsx b/control-ui/components/__tests__/FrontendComponents.test.tsx
index adacedeff..5e448bd81 100644
--- a/control-ui/components/__tests__/FrontendComponents.test.tsx
+++ b/control-ui/components/__tests__/FrontendComponents.test.tsx
@@ -1,5 +1,7 @@
import { describe, expect, it, vi } from 'vitest'
import { fireEvent, render, screen, within } from '@testing-library/react'
+import { readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
import {
DataTable,
RowActionMenu,
@@ -10,6 +12,13 @@ import {
stableSortRows,
} from '@clerum/frontend-components'
+function cssRule(css: string, selector: string) {
+ const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ const match = css.match(new RegExp(`${escaped}\\s*\\{([^}]*)\\}`, 'm'))
+ expect(match, `Expected CSS rule for ${selector}`).not.toBeNull()
+ return match?.[1] ?? ''
+}
+
describe('shared frontend components', () => {
it('exposes sortable header state and a keyboard sort control', () => {
const onSort = vi.fn()
@@ -112,6 +121,26 @@ describe('shared frontend components', () => {
expect(screen.getByRole('tooltip')).toHaveTextContent(longDescription)
})
+ it('keeps table paint contracts compatible with supported browsers', () => {
+ const frontendStyles = readFileSync(
+ resolve(process.cwd(), '../packages/frontend-components/styles.css'),
+ 'utf8'
+ )
+ const controlStyles = readFileSync(resolve(process.cwd(), 'app/globals.css'), 'utf8')
+ const tableHeaderRule = cssRule(frontendStyles, '.eft-table thead th')
+ const tableHeaderPaintRule = cssRule(frontendStyles, '.eft-table thead th::before')
+ const descriptionCellRule = cssRule(controlStyles, 'td.cu-registry-description')
+
+ expect(frontendStyles).not.toContain(':has(')
+ expect(tableHeaderRule).toContain('background-clip: border-box;')
+ expect(tableHeaderRule).toContain('top: -1px;')
+ expect(tableHeaderPaintRule).toContain('height: 2px;')
+ expect(descriptionCellRule).toContain('display: table-cell;')
+ expect(descriptionCellRule).toContain('overflow: visible;')
+ expect(descriptionCellRule).toContain('-webkit-line-clamp: unset;')
+ expect(descriptionCellRule).toContain('line-clamp: unset;')
+ })
+
it('opens one accessible action menu and executes its destructive action', () => {
const onDelete = vi.fn()
render(
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 4a0156754..2f588c107 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.538",
+ "version": "0.1.539",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.538",
+ "version": "0.1.539",
"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 8e200ceab..fb3cfdfe0 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.538",
+ "version": "0.1.539",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/packages/frontend-components/styles.css b/packages/frontend-components/styles.css
index f75fad978..d1a156a97 100644
--- a/packages/frontend-components/styles.css
+++ b/packages/frontend-components/styles.css
@@ -120,7 +120,7 @@
}
.eft-table thead th {
background: var(--eft-surface-muted);
- background-clip: padding-box;
+ background-clip: border-box;
border-bottom: 1px solid var(--eft-border);
color: var(--eft-muted);
font-size: var(--eft-table-header-font-size);
@@ -130,15 +130,15 @@
position: sticky;
text-align: left;
text-transform: uppercase;
- top: 0;
+ top: -1px;
white-space: nowrap;
z-index: 2;
}
.eft-table thead th::before {
background: var(--eft-surface-muted);
content: '';
- inset: -1px 0 auto;
- height: 1px;
+ inset: -2px 0 auto;
+ height: 2px;
position: absolute;
}
.eft-table tbody td {