Skip to content

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

TypeScript

fix(control-ui): balance grouped LLM table columns

Josuéa8d70734db0f
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 6ef6c1aa1..86e6399b1 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -11248,7 +11248,12 @@ td.cu-registry-description {
gap: var(--cu-space-2);
}
-.cu-llm-model-table {
+.cu-llm-model-table,
+.cu-llm-review-table {
+ min-width: 48rem;
+}
+
+.cu-llm-model-table__children {
min-width: 68rem;
}
@@ -11267,7 +11272,7 @@ td.cu-registry-description {
margin-bottom: 0;
}
-.cu-llm-review-table {
+.cu-llm-review-table__children {
min-width: 48rem;
}
@@ -11406,6 +11411,7 @@ td.cu-registry-description {
.cu-llm-model-group__count {
display: inline-flex;
+ margin-left: calc((var(--cu-space-2) + 1px) * -1);
padding: calc(var(--cu-space-1) / 2) var(--cu-space-2);
border: 1px solid var(--cu-border-subtle);
border-radius: var(--cu-radius-sm);
diff --git a/control-ui/components/LlmDiscoveryPanel/index.tsx b/control-ui/components/LlmDiscoveryPanel/index.tsx
index 0d4a9941c..8ca2e9271 100644
--- a/control-ui/components/LlmDiscoveryPanel/index.tsx
+++ b/control-ui/components/LlmDiscoveryPanel/index.tsx
@@ -300,7 +300,7 @@ export function LlmDiscoveryPanel({
)
const providerColumns: TableHeaderColumn[] = [
- { key: 'provider', label: 'Provider', colSpan: 2 },
+ { key: 'provider', label: 'Provider' },
{ key: 'models', label: 'Models' },
{ key: 'details', label: 'Details' },
{ key: 'actions', label: 'Actions', align: 'right' },
@@ -389,14 +389,17 @@ export function LlmDiscoveryPanel({
) : null}
<TableViewport className="cu-table-wrap cu-table-wrap--sticky-header">
- <DataTable className="eft-table cu-table cu-table--header-band cu-llm-review-table">
+ <DataTable
+ className="eft-table cu-table cu-table--header-band cu-llm-review-table"
+ variant="grouped"
+ >
<thead>
<TableHeaderRow columns={providerColumns} />
</thead>
{isInitialLoad ? (
<tbody>
<TableStateRow
- colSpan={reviewColumns.length}
+ colSpan={providerColumns.length}
kind="loading"
message="Loading discovery review…"
/>
@@ -404,7 +407,7 @@ export function LlmDiscoveryPanel({
) : reviewQueue.length === 0 ? (
<tbody>
<TableStateRow
- colSpan={reviewColumns.length}
+ colSpan={providerColumns.length}
message="No models awaiting review. Sync the catalog to pull newly released models."
/>
</tbody>
@@ -417,8 +420,9 @@ export function LlmDiscoveryPanel({
<GroupedTableBody
childBodyClassName="cu-llm-model-group__children"
childHeader={<TableHeaderRow columns={reviewColumns} />}
+ childTableClassName="cu-llm-review-table__children"
className="cu-llm-model-group"
- colSpan={reviewColumns.length}
+ colSpan={providerColumns.length}
disclosureClassName="cu-llm-model-group__toggle"
disclosureLabel={isExpanded =>
`${isExpanded ? 'Collapse' : 'Expand'} ${providerLabel} review models`
@@ -426,11 +430,11 @@ export function LlmDiscoveryPanel({
expanded={expanded}
groupId={provider}
key={provider}
+ nestedChildTable
onExpandedChange={nextExpanded => setProviderExpanded(provider, nextExpanded)}
summaryCells={[
{
key: 'provider',
- colSpan: 2,
content: (
<>
<LlmProviderIcon provider={provider} label={providerLabel} />
diff --git a/control-ui/components/LlmModelTable.tsx b/control-ui/components/LlmModelTable.tsx
index 5a2743ae2..abc2daafa 100644
--- a/control-ui/components/LlmModelTable.tsx
+++ b/control-ui/components/LlmModelTable.tsx
@@ -263,8 +263,8 @@ export function LlmModelTable({
const providerColumns: TableHeaderColumn[] = [
{ key: 'provider', label: 'Provider' },
{ key: 'models', label: 'Models' },
- { key: 'availability', label: 'Availability', colSpan: 4 },
- { key: 'actions', label: 'Actions', align: 'right', colSpan: 2 },
+ { key: 'availability', label: 'Availability' },
+ { key: 'actions', label: 'Actions', align: 'right' },
]
return (
@@ -348,14 +348,17 @@ export function LlmModelTable({
/>
{navigation}
<TableViewport className="cu-table-wrap cu-table-wrap--sticky-header">
- <DataTable className="eft-table cu-table cu-table--header-band cu-llm-model-table">
+ <DataTable
+ className="eft-table cu-table cu-table--header-band cu-llm-model-table"
+ variant="grouped"
+ >
<thead>
<TableHeaderRow columns={providerColumns} />
</thead>
{isInitialLoad ? (
<tbody>
<TableStateRow
- colSpan={modelColumns.length}
+ colSpan={providerColumns.length}
kind="loading"
message="Loading models…"
/>
@@ -363,7 +366,7 @@ export function LlmModelTable({
) : filteredItems.length === 0 ? (
<tbody>
<TableStateRow
- colSpan={modelColumns.length}
+ colSpan={providerColumns.length}
message={
hasActiveFilter
? 'No models match this filter.'
@@ -387,8 +390,9 @@ export function LlmModelTable({
<GroupedTableBody
childBodyClassName="cu-llm-model-group__children"
childHeader={<TableHeaderRow columns={modelColumns} />}
+ childTableClassName="cu-llm-model-table__children"
className="cu-llm-model-group"
- colSpan={modelColumns.length}
+ colSpan={providerColumns.length}
disclosureClassName="cu-llm-model-group__toggle"
disclosureLabel={isExpanded =>
`${isExpanded ? 'Collapse' : 'Expand'} ${providerLabel} models`
@@ -396,6 +400,7 @@ export function LlmModelTable({
expanded={expanded}
groupId={provider}
key={provider}
+ nestedChildTable
onExpandedChange={nextExpanded => setProviderExpanded(provider, nextExpanded)}
summaryCells={[
{
@@ -417,7 +422,6 @@ export function LlmModelTable({
},
{
key: 'availability',
- colSpan: 4,
content: (
<span className="cu-llm-model-group__summary">
{enabledCount} enabled
@@ -428,7 +432,6 @@ export function LlmModelTable({
},
{
key: 'actions',
- colSpan: 2,
className: 'cu-llm-model-group__action-cell',
content: (
<span className="cu-llm-model-group__action" aria-hidden="true">
diff --git a/control-ui/components/__tests__/FrontendComponents.test.tsx b/control-ui/components/__tests__/FrontendComponents.test.tsx
index a49b6e7d7..f9d0bf9ee 100644
--- a/control-ui/components/__tests__/FrontendComponents.test.tsx
+++ b/control-ui/components/__tests__/FrontendComponents.test.tsx
@@ -178,6 +178,59 @@ describe('shared frontend components', () => {
}
)
+ it('keeps grouped summary and nested child column schemas independent', () => {
+ render(
+ <DataTable variant="grouped">
+ <thead>
+ <tr>
+ {['Provider', 'Models', 'Details', 'Actions'].map(label => (
+ <TableHeaderCell key={label} label={label} />
+ ))}
+ </tr>
+ </thead>
+ <GroupedTableBody
+ childHeader={
+ <tr>
+ {['Select', 'Model', 'Vendor', 'Context', 'Enabled', 'Actions'].map(label => (
+ <TableHeaderCell key={label} label={label} />
+ ))}
+ </tr>
+ }
+ childTableClassName="test-child-table"
+ colSpan={4}
+ disclosureLabel={() => 'Collapse provider records'}
+ expanded
+ groupId="provider"
+ nestedChildTable
+ onExpandedChange={() => undefined}
+ summaryCells={['Provider', 'Models', 'Details', 'Actions'].map(label => ({
+ key: label,
+ content: `${label} summary`,
+ }))}
+ >
+ <tr>
+ <td>Select value</td>
+ <td>Model value</td>
+ <td>Vendor value</td>
+ <td>Context value</td>
+ <td>Enabled value</td>
+ <td>Action value</td>
+ </tr>
+ </GroupedTableBody>
+ </DataTable>
+ )
+
+ const outerTable = document.querySelector<HTMLTableElement>('.eft-table--grouped')
+ const childTable = document.querySelector<HTMLTableElement>('.test-child-table')
+ expect(outerTable).not.toBeNull()
+ expect(outerTable?.querySelectorAll(':scope > thead > tr > th')).toHaveLength(4)
+ expect(childTable).not.toBeNull()
+ expect(childTable).not.toBe(outerTable)
+ expect(childTable?.querySelectorAll(':scope > thead > tr > th')).toHaveLength(6)
+ expect(childTable?.querySelectorAll(':scope > tbody > tr > td')).toHaveLength(6)
+ expect(childTable?.closest('.eft-table-group__child-cell')).toHaveAttribute('colspan', '4')
+ })
+
it('rejects grouped summary-cell spans that cannot match the table columns', () => {
const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined)
const preventReportedError = (event: ErrorEvent) => event.preventDefault()
@@ -369,6 +422,12 @@ describe('shared frontend components', () => {
const tableHeaderPaintRule = cssRule(frontendStyles, '.eft-table thead th::before')
const disabledActionTriggerRule = cssRule(frontendStyles, '.eft-row-actions__trigger:disabled')
const descriptionCellRule = cssRule(controlStyles, 'td.cu-registry-description')
+ const groupedTableRule = cssRule(frontendStyles, '.eft-table--grouped')
+ const groupedActionsRule = cssRule(
+ frontendStyles,
+ '.eft-table--grouped > thead > tr > th:last-child'
+ )
+ const groupedCountRule = cssRule(controlStyles, '.cu-llm-model-group__count')
expect(frontendStyles).not.toContain(':has(')
expect(tableHeaderRule).toContain('background-clip: border-box;')
@@ -381,6 +440,10 @@ describe('shared frontend components', () => {
expect(descriptionCellRule).toContain('overflow: visible;')
expect(descriptionCellRule).toContain('-webkit-line-clamp: unset;')
expect(descriptionCellRule).toContain('line-clamp: unset;')
+ expect(groupedTableRule).toContain('table-layout: fixed;')
+ expect(groupedActionsRule).toContain('text-align: right;')
+ expect(groupedActionsRule).toContain('width: var(--eft-table-group-actions-width, 8rem);')
+ expect(groupedCountRule).toContain('margin-left: calc((var(--cu-space-2) + 1px) * -1);')
const seamShadow = '0 -0.375rem 0 var(--eft-surface-muted), inset 0 -1px 0 var(--eft-border)'
const { unmount } = render(
diff --git a/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx b/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx
index 1ce760677..4cadd9dac 100644
--- a/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx
+++ b/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx
@@ -101,8 +101,11 @@ describe('LlmDiscoveryPanel merged lifecycle workflow', () => {
const summaryRow = screen
.getByRole('button', { name: 'Expand OpenAI review models' })
.closest('tr')
- expect(Array.from(summaryRow?.cells ?? []).map(cell => cell.colSpan)).toEqual([2, 1, 1, 1])
+ expect(Array.from(summaryRow?.cells ?? []).map(cell => cell.colSpan)).toEqual([1, 1, 1, 1])
fireEvent.click(screen.getByRole('button', { name: 'Expand OpenAI review models' }))
+ const childTable = screen.getByText('gpt-5').closest('table')
+ expect(childTable).toHaveClass('cu-llm-review-table__children')
+ expect(childTable?.querySelectorAll(':scope > thead > tr > th')).toHaveLength(5)
expect(screen.getByText('gpt-5')).toBeInTheDocument()
expect(screen.queryByText('claude-retired')).toBeNull()
diff --git a/control-ui/components/__tests__/LlmModelTable.test.tsx b/control-ui/components/__tests__/LlmModelTable.test.tsx
index 55f6aff42..77be48567 100644
--- a/control-ui/components/__tests__/LlmModelTable.test.tsx
+++ b/control-ui/components/__tests__/LlmModelTable.test.tsx
@@ -372,13 +372,16 @@ describe('LlmModelTable provider groups', () => {
'false'
)
const summaryRow = screen.getByRole('button', { name: 'Expand Anthropic models' }).closest('tr')
- expect(Array.from(summaryRow?.cells ?? []).map(cell => cell.colSpan)).toEqual([1, 1, 4, 2])
+ expect(Array.from(summaryRow?.cells ?? []).map(cell => cell.colSpan)).toEqual([1, 1, 1, 1])
expect(screen.queryByText('claude-sonnet-4-6')).toBeNull()
expect(screen.queryByText('gpt-5')).toBeNull()
expandAnthropicModels()
expect(screen.getByRole('columnheader', { name: 'Credential' })).toBeInTheDocument()
+ const childTable = screen.getByText('claude-sonnet-4-6').closest('table')
+ expect(childTable).toHaveClass('cu-llm-model-table__children')
+ expect(childTable?.querySelectorAll(':scope > thead > tr > th')).toHaveLength(8)
expect(screen.getByText('claude-sonnet-4-6')).toBeInTheDocument()
expect(screen.queryByText('gpt-5')).toBeNull()
expect(screen.getByRole('button', { name: 'Collapse Anthropic models' })).toHaveAttribute(
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 1f3a0a35e..aa2b00df1 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.583",
+ "version": "0.1.584",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.583",
+ "version": "0.1.584",
"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 1131e44d9..88a4656f9 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.583",
+ "version": "0.1.584",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/docs/agents/control-ui-rules.md b/docs/agents/control-ui-rules.md
index 65e41486a..0c5fdfe93 100644
--- a/docs/agents/control-ui-rules.md
+++ b/docs/agents/control-ui-rules.md
@@ -90,10 +90,11 @@ leaning on either behaviour.
ordinary table row-expansion presentations. Both datasets repeat provider
identity across many models, so they render one provider/provider-family
summary row with expandable model child rows through the shared
- domain-neutral grouped table primitive. Their summary cells mirror the
- visible header spans so native table layout owns alignment. This exception
- does not apply to any other table without a separately recorded owner
- decision.
+ domain-neutral grouped table primitive. Each summary uses four balanced
+ Provider, Models, Availability/Details, and Actions cells. The expanded model
+ header and rows use a nested child table because their schemas differ from
+ the provider summary. This exception does not apply to any other table
+ without a separately recorded owner decision.
## Routing
diff --git a/docs/agents/frontend-style-rules.md b/docs/agents/frontend-style-rules.md
index 9fd0b65c6..6065edf0e 100644
--- a/docs/agents/frontend-style-rules.md
+++ b/docs/agents/frontend-style-rules.md
@@ -151,7 +151,12 @@ application guidance that must be combined with this shared document.
`GroupedTableBody.summaryCells` and mirror the visible header `colSpan`
values. Native table cells own alignment for every valid column count; do
not reproduce header lanes with app-specific flex/grid widths or positional
- selectors.
+ selectors. When expanded rows expose a different column schema, use the
+ grouped `DataTable` variant and `GroupedTableBody.nestedChildTable`; do not
+ force summary and child schemas into one physical column grid. The grouped
+ parent shares available width across its non-action columns and reserves a
+ fixed, right-aligned final Actions lane. Domain-specific child widths belong
+ to the nested table through `childTableClassName`.
- Keep standard rows compact and consistent. Use `TableViewport` for horizontal
overflow and for long-list body scrolling so the page title, toolbar, tabs,
and semantic sticky table header remain visible. Embedded/diagnostic views
diff --git a/packages/frontend-components/README.md b/packages/frontend-components/README.md
index efdbd7f89..57e327a97 100644
--- a/packages/frontend-components/README.md
+++ b/packages/frontend-components/README.md
@@ -23,3 +23,10 @@ cell and its optional `colSpan` must mirror the corresponding header span. The
component validates that the summary spans cover the complete grouped row, so
new grouped layouts do not need app-specific grid or positional CSS. The
single `summary` prop remains available for intentionally full-width summaries.
+
+When expanded child rows use a different column schema, set `nestedChildTable`
+and use the `grouped` `DataTable` variant on the parent. The parent summary
+columns then share their available width independently, with a fixed final
+Actions lane, while the child header and rows remain a separate semantic table.
+Use `childTableClassName` to set domain-specific minimum widths on that child
+table without changing the provider-summary columns.
diff --git a/packages/frontend-components/src/table/grouped.tsx b/packages/frontend-components/src/table/grouped.tsx
index 357268653..1a266f014 100644
--- a/packages/frontend-components/src/table/grouped.tsx
+++ b/packages/frontend-components/src/table/grouped.tsx
@@ -2,12 +2,14 @@
import { Fragment, useId } from 'react'
import type { ReactNode } from 'react'
+import { DataTable } from './primitives'
import type { GroupedTableBodyProps } from './types'
import { classNames } from './utils'
export function GroupedTableBody({
childBodyClassName,
childHeader,
+ childTableClassName,
children,
className,
colSpan,
@@ -15,6 +17,7 @@ export function GroupedTableBody({
disclosureLabel,
expanded,
groupId,
+ nestedChildTable = false,
onExpandedChange,
summary,
summaryCells,
@@ -81,10 +84,22 @@ export function GroupedTableBody({
</tbody>
<tbody
aria-labelledby={disclosureId}
- className={classNames('eft-table-group__children', childBodyClassName)}
+ className={classNames('eft-table-group__children', !nestedChildTable && childBodyClassName)}
id={childRowsId}
>
- {expanded ? (
+ {expanded && nestedChildTable ? (
+ <tr className="eft-table-group__child-row">
+ <td className="eft-table-group__child-cell" colSpan={colSpan}>
+ <DataTable
+ aria-labelledby={disclosureId}
+ className={classNames('eft-table-group__child-table', childTableClassName)}
+ >
+ {childHeader ? <thead>{childHeader}</thead> : null}
+ <tbody className={childBodyClassName}>{children}</tbody>
+ </DataTable>
+ </td>
+ </tr>
+ ) : expanded ? (
<>
{childHeader}
{children}
diff --git a/packages/frontend-components/src/table/types.ts b/packages/frontend-components/src/table/types.ts
index eabe65759..657631c00 100644
--- a/packages/frontend-components/src/table/types.ts
+++ b/packages/frontend-components/src/table/types.ts
@@ -2,7 +2,7 @@ import type { ReactNode, ThHTMLAttributes } from 'react'
export type SortDirection = 'asc' | 'desc'
export type SortValue = string | number | boolean | Date | null | undefined
-export type TableVariant = 'standard' | 'selection' | 'hierarchy' | 'embedded'
+export type TableVariant = 'standard' | 'selection' | 'hierarchy' | 'embedded' | 'grouped'
export type CellKind = 'text' | 'numeric' | 'fixed' | 'selection' | 'actions'
export type DataViewHeaderProps = {
@@ -33,6 +33,7 @@ export type TableStateRowProps = {
type GroupedTableBodyBaseProps = {
childBodyClassName?: string
childHeader?: ReactNode
+ childTableClassName?: string
children: ReactNode
className?: string
colSpan: number
@@ -40,6 +41,7 @@ type GroupedTableBodyBaseProps = {
disclosureLabel: (expanded: boolean) => string
expanded: boolean
groupId: string
+ nestedChildTable?: boolean
onExpandedChange: (expanded: boolean) => void
}
diff --git a/packages/frontend-components/styles.css b/packages/frontend-components/styles.css
index e9ab5adad..359f5866e 100644
--- a/packages/frontend-components/styles.css
+++ b/packages/frontend-components/styles.css
@@ -118,6 +118,13 @@
.eft-table--wide {
min-width: 42rem;
}
+.eft-table--grouped {
+ table-layout: fixed;
+}
+.eft-table--grouped > thead > tr > th:last-child {
+ text-align: right;
+ width: var(--eft-table-group-actions-width, 8rem);
+}
.eft-table thead th {
background: var(--eft-surface-muted);
background-clip: border-box;
@@ -198,6 +205,22 @@
flex: 1;
align-items: center;
}
+.eft-table-group__child-row > .eft-table-group__child-cell {
+ background: transparent;
+ padding: 0;
+}
+.eft-table-group__child-row:hover > .eft-table-group__child-cell {
+ background: transparent;
+}
+.eft-table-group__child-table {
+ table-layout: auto;
+}
+.eft-table-group__child-table > tbody > tr > td {
+ border-bottom: 1px solid color-mix(in srgb, var(--eft-border) 75%, transparent);
+}
+.eft-table-group__child-table > tbody > tr:last-child > td {
+ border-bottom: 0;
+}
.eft-table tr[data-selected='true'] > td {
background: color-mix(in srgb, var(--eft-accent) 12%, var(--eft-surface));
}