Skip to content

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

TypeScript

chore(frontend): merge current dev table baseline

Josuéd7030aad54cd
diff --cc control-api/package-lock.json
index 5d430cb4d,be373522a..62ec1ae47
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@@ -1,12 -1,12 +1,12 @@@
{
"name": "clerum-control-api",
- "version": "0.1.524",
- "version": "0.1.522",
++ "version": "0.1.525",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.524",
- "version": "0.1.522",
++ "version": "0.1.525",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --cc control-api/package.json
index fa90332bd,f1c4b8132..0d1304ce4
--- a/control-api/package.json
+++ b/control-api/package.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "clerum-control-api",
- "version": "0.1.524",
- "version": "0.1.522",
++ "version": "0.1.525",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --cc control-ui/components/CodexSubscriptionHub/index.tsx
index 3991b284e,e089eb941..8bbbd1484
--- a/control-ui/components/CodexSubscriptionHub/index.tsx
+++ b/control-ui/components/CodexSubscriptionHub/index.tsx
@@@ -1,7 -1,7 +1,8 @@@
'use client'
- import React, { useCallback, useEffect, useMemo, useState } from 'react'
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { DataTable, TableHeaderCell, useTableSort } from '@clerum/frontend-table-system'
+ import { copyTextToClipboard } from '@lib/clipboard'
import {
type CodexSubscriptionConnectionView,
createCodexSubscriptionConnection,
diff --cc control-ui/components/LlmDiscoveryPanel/index.tsx
index b0303a156,56f781647..2016c677b
--- a/control-ui/components/LlmDiscoveryPanel/index.tsx
+++ b/control-ui/components/LlmDiscoveryPanel/index.tsx
@@@ -233,44 -344,47 +233,46 @@@ export function LlmDiscoveryPanel(
showToast(message, { tone: 'error' })
}
- const reviewColumns: TableHeaderColumn[] = [
- {
- key: 'select',
- width: '2.75rem',
- label: (
- <input
- type="checkbox"
- checked={allSelected}
- ref={element => {
- if (element) element.indeterminate = selectedCount > 0 && !allSelected
- }}
- onChange={toggleAll}
- disabled={reviewQueue.length === 0 || bulkEnabling}
- aria-label={allSelected ? 'Deselect all review models' : 'Select all review models'}
- />
- ),
- },
- { key: 'provider', label: 'Provider', minWidth: '9rem' },
- { key: 'model', label: 'Model', minWidth: '12rem' },
- { key: 'vendor', label: 'Vendor', width: '10rem' },
- {
- key: 'contextWindow',
- label: 'Context window',
- align: 'right',
- width: '9rem',
- },
- { key: 'actions', width: '7rem', align: 'right', ariaLabel: 'Actions' },
- ].map(column =>
- const renderSortHeader = (key: ReviewSortKey, label: string) => (
- <TableSortHeader
- activeKey={sortKey}
- defaultDirections={REVIEW_SORT_DEFAULT_DIR}
- direction={sortDir}
- label={label}
- onSort={nextKey =>
- toggleSort(nextKey, sortKey, REVIEW_SORT_DEFAULT_DIR, setSortKey, setSortDir)
- }
- sortKey={key}
- />
++ const reviewColumns: TableHeaderColumn[] = (
++ [
++ {
++ key: 'select',
++ width: '2.75rem',
++ label: (
++ <input
++ type="checkbox"
++ checked={allSelected}
++ ref={element => {
++ if (element) element.indeterminate = selectedCount > 0 && !allSelected
++ }}
++ onChange={toggleAll}
++ disabled={reviewQueue.length === 0 || bulkEnabling}
++ aria-label={allSelected ? 'Deselect all review models' : 'Select all review models'}
++ />
++ ),
++ },
++ { key: 'provider', label: 'Provider', minWidth: '9rem' },
++ { key: 'model', label: 'Model', minWidth: '12rem' },
++ { key: 'vendor', label: 'Vendor', width: '10rem' },
++ {
++ key: 'contextWindow',
++ label: 'Context window',
++ align: 'right',
++ width: '9rem',
++ },
++ { key: 'actions', width: '7rem', align: 'right', ariaLabel: 'Actions' },
++ ] satisfies TableHeaderColumn[]
++ ).map(column =>
+ column.key === 'select' || column.key === 'actions'
+ ? column
+ : {
+ ...column,
+ activeDirection: reviewSort.key === column.key ? reviewSort.direction : null,
+ defaultDirection: column.key === 'contextWindow' ? 'desc' : 'asc',
+ onSort: () => reviewSort.sortBy(column.key as ReviewSortKey),
+ }
)
- const reviewColumns: TableHeaderColumn[] = [
- {
- key: 'select',
- width: '2.75rem',
- label: (
- <input
- type="checkbox"
- checked={allSelected}
- ref={element => {
- if (element) element.indeterminate = selectedCount > 0 && !allSelected
- }}
- onChange={toggleAll}
- disabled={reviewQueue.length === 0 || bulkEnabling}
- aria-label={allSelected ? 'Deselect all review models' : 'Select all review models'}
- />
- ),
- },
- { key: 'model', label: renderSortHeader('model', 'Model'), minWidth: '12rem' },
- { key: 'vendor', label: renderSortHeader('vendor', 'Vendor'), width: '10rem' },
- {
- key: 'contextWindow',
- label: renderSortHeader('contextWindow', 'Context window'),
- align: 'right',
- width: '9rem',
- },
- { key: 'actions', width: '7rem', align: 'right', ariaLabel: 'Actions' },
- ]
-
return (
<>
{error ? (
diff --cc control-ui/components/LlmModelTable.tsx
index 7bd40f0b2,9e5b21f52..4920c9b0e
--- a/control-ui/components/LlmModelTable.tsx
+++ b/control-ui/components/LlmModelTable.tsx
@@@ -193,29 -228,52 +193,31 @@@ export function LlmModelTable(
function handleProviderFilterChange(nextProvider: string) {
setProviderFilter(nextProvider)
- if (nextProvider === ALL_PROVIDERS) return
- setExpandedProviders(current => new Set(current).add(nextProvider))
- }
-
- function toggleProvider(provider: string) {
- setExpandedProviders(current => {
- const next = new Set(current)
- if (next.has(provider)) next.delete(provider)
- else next.add(provider)
- return next
- })
}
- const modelColumns: TableHeaderColumn[] = [
- { key: 'provider', label: 'Provider', minWidth: '9rem' },
- { key: 'model', label: 'Model', minWidth: '15rem' },
- { key: 'credential', label: 'Credential', width: '11rem' },
- { key: 'vendor', label: 'Vendor', width: '10rem' },
- { key: 'displayName', label: 'Display name', minWidth: '10rem' },
- { key: 'contextWindow', label: 'Context window', align: 'right', width: '9rem' },
- { key: 'enabled', label: 'Enabled', width: '6rem' },
- { key: 'source', label: 'Source', width: '7rem' },
- { key: 'actions', width: '5rem', align: 'right', ariaLabel: 'Actions' },
- ].map(column =>
- const renderSortHeader = (key: ModelSortKey, label: string) => (
- <TableSortHeader
- activeKey={sortKey}
- defaultDirections={MODEL_SORT_DEFAULT_DIR}
- direction={sortDir}
- label={label}
- onSort={nextKey =>
- toggleSort(nextKey, sortKey, MODEL_SORT_DEFAULT_DIR, setSortKey, setSortDir)
- }
- sortKey={key}
- />
++ const modelColumns: TableHeaderColumn[] = (
++ [
++ { key: 'provider', label: 'Provider', minWidth: '9rem' },
++ { key: 'model', label: 'Model', minWidth: '15rem' },
++ { key: 'credential', label: 'Credential', width: '11rem' },
++ { key: 'vendor', label: 'Vendor', width: '10rem' },
++ { key: 'displayName', label: 'Display name', minWidth: '10rem' },
++ { key: 'contextWindow', label: 'Context window', align: 'right', width: '9rem' },
++ { key: 'enabled', label: 'Enabled', width: '6rem' },
++ { key: 'source', label: 'Source', width: '7rem' },
++ { key: 'actions', width: '5rem', align: 'right', ariaLabel: 'Actions' },
++ ] satisfies TableHeaderColumn[]
++ ).map(column =>
+ column.key === 'actions'
+ ? column
+ : {
+ ...column,
+ activeDirection: modelSort.key === column.key ? modelSort.direction : null,
+ defaultDirection: column.key === 'contextWindow' ? 'desc' : 'asc',
+ onSort: () => modelSort.sortBy(column.key as ModelSortKey),
+ }
)
- const modelColumns: TableHeaderColumn[] = [
- { key: 'model', label: renderSortHeader('model', 'Model'), minWidth: '15rem' },
- { key: 'credential', label: 'Credential', width: '11rem' },
- { key: 'vendor', label: renderSortHeader('vendor', 'Vendor'), width: '10rem' },
- {
- key: 'displayName',
- label: renderSortHeader('displayName', 'Display name'),
- minWidth: '10rem',
- },
- {
- key: 'contextWindow',
- label: renderSortHeader('contextWindow', 'Context window'),
- align: 'right',
- width: '9rem',
- },
- { key: 'enabled', label: 'Enabled', width: '6rem' },
- { key: 'source', label: 'Source', width: '7rem' },
- { key: 'actions', width: '5rem', align: 'right', ariaLabel: 'Actions' },
- ]
-
return (
<div className="cu-card cu-card--viewport-fill cu-section-card">
<TablePanelHeader
diff --cc control-ui/components/ProfileAdminHome.tsx
index 4e37988ca,7896d6255..6b1b25089
--- a/control-ui/components/ProfileAdminHome.tsx
+++ b/control-ui/components/ProfileAdminHome.tsx
@@@ -210,37 -216,6 +210,41 @@@ export function ProfileAdminHome({ acti
? `Members (${visibleUsers.length}${pendingInvitations.length ? `, ${pendingInvitations.length} pending` : ''})`
: 'Members'
const teamsTabLabel = activeTab === 'teams' ? `Teams (${teams.length})` : 'Teams'
- const teamColumns: TableHeaderColumn[] = [
- { key: 'name', label: 'Team name' },
- { key: 'members', label: 'Members', width: '5rem', align: 'right' },
- { key: 'agents', label: 'Agents', width: '5rem', align: 'right' },
- { key: 'contexts', label: 'Contexts', width: '5rem', align: 'right' },
- { key: 'actions', width: '4.5rem', align: 'right', ariaLabel: 'Actions' },
- ].map(column =>
++ const teamColumns: TableHeaderColumn[] = (
++ [
++ { key: 'name', label: 'Team name' },
++ { key: 'members', label: 'Members', width: '5rem', align: 'right' },
++ { key: 'agents', label: 'Agents', width: '5rem', align: 'right' },
++ { key: 'contexts', label: 'Contexts', width: '5rem', align: 'right' },
++ { key: 'actions', width: '4.5rem', align: 'right', ariaLabel: 'Actions' },
++ ] satisfies TableHeaderColumn[]
++ ).map(column =>
+ column.key === 'actions'
+ ? column
+ : {
+ ...column,
+ activeDirection: teamSort.key === column.key ? teamSort.direction : null,
+ defaultDirection: column.key === 'name' ? 'asc' : 'desc',
+ onSort: () => teamSort.sortBy(column.key as TeamSortKey),
+ }
+ )
- const memberColumns: TableHeaderColumn[] = [
- { key: 'name', label: 'Name' },
- { key: 'email', label: 'Email' },
- { key: 'teams', label: 'Teams', width: '7rem', align: 'right' },
- { key: 'actions', width: '4.5rem', align: 'right', ariaLabel: 'Actions' },
- ].map(column =>
++ const memberColumns: TableHeaderColumn[] = (
++ [
++ { key: 'name', label: 'Name' },
++ { key: 'email', label: 'Email' },
++ { key: 'teams', label: 'Teams', width: '7rem', align: 'right' },
++ { key: 'actions', width: '4.5rem', align: 'right', ariaLabel: 'Actions' },
++ ] satisfies TableHeaderColumn[]
++ ).map(column =>
+ column.key === 'actions'
+ ? column
+ : {
+ ...column,
+ activeDirection: memberSort.key === column.key ? memberSort.direction : null,
+ defaultDirection: column.key === 'teams' ? 'desc' : 'asc',
+ onSort: () => memberSort.sortBy(column.key as MemberSortKey),
+ }
+ )
const adminsTabLabel =
activeTab === 'admins'
? `Admins (${adminCounts.admins}${
diff --cc control-ui/components/RegistryCatalog.tsx
index 5982680ef,17a6c0432..5a705bb87
--- a/control-ui/components/RegistryCatalog.tsx
+++ b/control-ui/components/RegistryCatalog.tsx
@@@ -75,22 -73,11 +75,22 @@@ export default function RegistryCatalog
const connectionState = capability?.connectionState ?? null
// Curators administer the shared catalog, so they keep inline edit/remove;
// everyone else manages their own entries from the ownership area (§5.4).
- const columns = REGISTRY_COLUMNS.map(column => {
- const columns = (
- isCurator ? REGISTRY_COLUMNS : REGISTRY_COLUMNS.filter(c => c.key !== 'actions')
- ).map(column => {
- if (column.key === 'name' || column.key === 'version') {
- return { ...column, label: renderSortHeader(column.key, column.label as string) }
++ const columns: TableHeaderColumn[] = REGISTRY_COLUMNS.map(column => {
+ if (
+ column.key === 'name' ||
+ column.key === 'description' ||
+ column.key === 'type' ||
+ column.key === 'tags' ||
+ column.key === 'trust' ||
+ column.key === 'quality' ||
+ column.key === 'version'
+ ) {
+ return {
+ ...column,
+ activeDirection: sortKey === column.key ? sortDirection : null,
+ defaultDirection: column.key === 'version' ? 'desc' : 'asc',
+ onSort: () => toggleSort(column.key as CatalogSortKey),
+ }
}
return column
})
diff --cc control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
index 0dbcd2ad8,b54b60610..b3ad1b8f7
--- a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
+++ b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
@@@ -122,15 -349,46 +352,44 @@@ describe('CodexSubscriptionHub', () =>
)
expect(screen.queryByRole('columnheader', { name: 'Agents' })).not.toBeInTheDocument()
expect(screen.queryByLabelText('Add agents to this subscription')).not.toBeInTheDocument()
- expect(
- screen.getByRole('button', { name: 'Update ChatGPT subscription Team A' })
- ).toBeInTheDocument()
- expect(
- screen.getByRole('button', { name: 'Delete ChatGPT subscription Team A' })
- ).toBeInTheDocument()
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for ChatGPT subscription Team A' }))
+ expect(screen.getByRole('menuitem', { name: 'Edit' })).toBeInTheDocument()
+ expect(screen.getByRole('menuitem', { name: 'Delete' })).toBeInTheDocument()
})
- it('opens the grant modal for Sign in, Sync, and model toggles without binding hosts', async () => {
+ it('renders the ChatGPT verification link from the pencil Sign in path', async () => {
+ vi.mocked(startCodexDeviceConnect).mockResolvedValue({
+ userCode: 'WXYZ-9876',
+ verificationUri: 'https://auth.openai.com/codex/device',
+ intervalSeconds: 0.001,
+ state: 'state-pencil',
+ intent: 'reconnect',
+ })
+ render(
+ <ToastProvider>
+ <CodexSubscriptionHub />
+ </ToastProvider>
+ )
+ fireEvent.click(
- await screen.findByRole('button', { name: 'Update ChatGPT subscription Team A' })
++ await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
+ )
++ fireEvent.click(screen.getByRole('menuitem', { name: 'Edit' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Sign in with ChatGPT' }))
+ const link = await screen.findByTestId('codex-device-verification-link')
+ expect(link).toHaveAttribute('href', 'https://auth.openai.com/codex/device')
+ expect(link.getAttribute('rel') ?? '').toContain('noopener')
+ expect(link.getAttribute('rel') ?? '').toContain('noreferrer')
+ expect(screen.getByTestId('codex-device-code').closest('[role="status"]')).toHaveTextContent(
+ 'WXYZ-9876'
+ )
+ expect(screen.getByRole('button', { name: 'Update subscription' })).toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Saving…' })).not.toBeInTheDocument()
+ })
+
+ it('opens the grant modal for Sign in and default model without a Sync catalog control', async () => {
vi.mocked(startCodexDeviceConnect).mockResolvedValue({
userCode: 'ABCD-1234',
- verificationUri: 'https://chatgpt.com/device',
+ verificationUri: 'https://auth.openai.com/codex/device',
intervalSeconds: 1,
state: 'state-1',
intent: 'connect',
@@@ -155,20 -402,13 +403,14 @@@
</ToastProvider>
)
fireEvent.click(
- await screen.findByRole('button', { name: 'Update ChatGPT subscription Team A' })
+ await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Edit' }))
expect(await screen.findByRole('button', { name: 'Sign in with ChatGPT' })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'Sync catalog' })).toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Sync catalog' })).not.toBeInTheDocument()
+ expect(screen.queryByRole('group', { name: 'Enabled models' })).not.toBeInTheDocument()
expect(listCodexConnectionModels).toHaveBeenCalledWith('codex-aaa')
- fireEvent.click(screen.getByRole('button', { name: 'Sync catalog' }))
- await waitFor(() => {
- expect(syncCodexSubscriptionCatalog).toHaveBeenCalledWith('codex-aaa')
- })
- fireEvent.click(screen.getByLabelText('gpt-5.3-codex'))
- await waitFor(() => {
- expect(patchCodexCatalogModel).toHaveBeenCalledWith('codex-aaa', 'gpt-5.3-codex', true)
- })
+ expect(syncCodexSubscriptionCatalog).not.toHaveBeenCalled()
fireEvent.click(screen.getByRole('button', { name: 'Update subscription' }))
await waitFor(() => {
expect(patchCodexSubscriptionConnection).toHaveBeenCalledWith('codex-aaa', {
diff --cc control-ui/package-lock.json
index 6104d68a7,ecb75d0c5..e542bdb86
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@@ -1,15 -1,14 +1,15 @@@
{
"name": "clerum-control-ui",
- "version": "0.1.493",
- "version": "0.1.478",
++ "version": "0.1.494",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.493",
- "version": "0.1.478",
++ "version": "0.1.494",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
+ "@clerum/frontend-table-system": "file:../packages/frontend-table-system",
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
"@uiw/react-md-editor": "^4.1.0",
diff --cc control-ui/package.json
index 87bb82ece,79200bdfe..421b2ebcc
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "clerum-control-ui",
- "version": "0.1.493",
- "version": "0.1.479",
++ "version": "0.1.494",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",