Skip to content

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

TypeScript

refactor(control-ui): standardize workflow run record lists

Josué5fddb28ce23b
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 05b69549d..79df71a8f 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -9138,6 +9138,19 @@ td.cu-registry-description {
gap: var(--cu-space-2);
}
+.cu-diagnostic-record-list {
+ background: var(--cu-bg-elevated);
+}
+
+.cu-diagnostic-record-list__row {
+ min-width: 0;
+ font-size: 0.82rem;
+}
+
+.cu-diagnostic-record-list__row--workload {
+ font-size: 0.85rem;
+}
+
.cu-recipe-inline-error {
color: var(--cu-danger);
font-size: 0.75rem;
diff --git a/control-ui/components/RecipeStatusContent/index.tsx b/control-ui/components/RecipeStatusContent/index.tsx
index cd7f74821..2f20553c0 100644
--- a/control-ui/components/RecipeStatusContent/index.tsx
+++ b/control-ui/components/RecipeStatusContent/index.tsx
@@ -1,6 +1,7 @@
'use client'
import React, { useEffect, useRef, useState } from 'react'
+import { RecordList, RecordListRow, RowActionMenu } from '@clerum/frontend-components'
import { useConfirmDialog } from '@components/ConfirmDialog'
import { useToast } from '@components/Toast'
import { WorkflowAccessPanel } from '@components/WorkflowAccessPanel'
@@ -559,21 +560,13 @@ function ArtifactsPanel({
</button>
</div>
)}
- <div style={{ display: 'grid', gap: 6 }}>
+ <RecordList className="cu-diagnostic-record-list" aria-label="Output artifacts">
{visibleArtifacts.map(a => (
- <div
+ <RecordListRow
key={a.name}
+ className="cu-diagnostic-record-list__row"
data-testid="artifact-row"
data-artifact-name={a.name}
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 10,
- padding: '8px 12px',
- background: 'var(--cu-bg-elevated)',
- border: '1px solid var(--cu-border-subtle)',
- borderRadius: 6,
- }}
>
<span
data-testid="artifact-format"
@@ -606,50 +599,31 @@ function ArtifactsPanel({
<span style={{ color: 'var(--cu-text-muted)', fontSize: '0.75rem' }}>
{formatBytes(a.sizeBytes)}
</span>
- <button
- onClick={() => handleDownload(a)}
- disabled={downloading === a.name || !runId}
- title={runId ? `Download ${a.name}` : 'Open a specific run to download artifacts'}
- data-testid="artifact-download"
- style={{
- padding: '3px 10px',
- borderRadius: 4,
- border: '1px solid var(--cu-border)',
- background:
- downloading === a.name || !runId
- ? 'var(--cu-border-subtle)'
- : 'var(--cu-bg-elevated)',
- color:
- downloading === a.name || !runId ? 'var(--cu-text-muted)' : 'var(--cu-text-soft)',
- cursor: downloading === a.name ? 'wait' : runId ? 'pointer' : 'not-allowed',
- fontSize: '0.75rem',
- fontWeight: 600,
- }}
- >
- {downloading === a.name ? '...' : 'Download'}
- </button>
- {runId && (
- <button
- onClick={() => void handleDeleteFile(a)}
- disabled={deleting === a.name}
- title={`Delete ${a.name}`}
- style={{
- padding: '3px 7px',
- borderRadius: 4,
- border: '1px solid #5a2020',
- background: deleting === a.name ? '#1a0a0a' : '#0d0505',
- color: deleting === a.name ? '#6b4040' : '#ff8ea7',
- cursor: deleting === a.name ? 'wait' : 'pointer',
- fontSize: '0.72rem',
- fontWeight: 700,
- }}
- >
- {deleting === a.name ? '...' : '✕'}
- </button>
- )}
- </div>
+ <RowActionMenu
+ actions={[
+ {
+ key: 'download',
+ label: downloading === a.name ? 'Downloading…' : 'Download',
+ disabled: downloading === a.name || !runId,
+ onSelect: () => void handleDownload(a),
+ },
+ ...(runId
+ ? [
+ {
+ key: 'delete',
+ label: deleting === a.name ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: deleting === a.name,
+ onSelect: () => void handleDeleteFile(a),
+ },
+ ]
+ : []),
+ ]}
+ ariaLabel={`Actions for artifact ${a.name}`}
+ />
+ </RecordListRow>
))}
- </div>
+ </RecordList>
{downloadError && (
<p style={{ margin: '6px 0 0', color: '#ff8ea7', fontSize: '0.78rem' }}>{downloadError}</p>
)}
@@ -1493,19 +1467,11 @@ export function RecipeStatusContent({ name, namespace, runId }: RecipeStatusCont
>
Workloads ({workloads.length})
</div>
- <div style={{ display: 'grid', gap: 4 }}>
+ <RecordList className="cu-diagnostic-record-list" aria-label="Execution workloads">
{workloads.map(w => (
- <div
+ <RecordListRow
key={w.id}
- style={{
- display: 'flex',
- gap: 10,
- alignItems: 'center',
- padding: '6px 10px',
- background: 'var(--cu-bg-elevated)',
- borderRadius: 6,
- fontSize: '0.85rem',
- }}
+ className="cu-diagnostic-record-list__row cu-diagnostic-record-list__row--workload"
>
<span style={{ color: 'var(--cu-text)', fontWeight: 600, flexGrow: 1 }}>
{w.id}
@@ -1521,9 +1487,9 @@ export function RecipeStatusContent({ name, namespace, runId }: RecipeStatusCont
{w.replicas !== undefined && (
<span style={{ color: 'var(--cu-text-muted)' }}>×{w.replicas}</span>
)}
- </div>
+ </RecordListRow>
))}
- </div>
+ </RecordList>
</div>
)}
diff --git a/control-ui/components/__tests__/RecipeStatusContent.test.tsx b/control-ui/components/__tests__/RecipeStatusContent.test.tsx
index c9724d399..579dab3b8 100644
--- a/control-ui/components/__tests__/RecipeStatusContent.test.tsx
+++ b/control-ui/components/__tests__/RecipeStatusContent.test.tsx
@@ -7,6 +7,7 @@ import {
render as rtlRender,
screen,
waitFor,
+ within,
} from '@testing-library/react'
import {
deleteWorkflowRunArtifact,
@@ -117,6 +118,12 @@ describe('RecipeStatusContent — workload recipe', () => {
expect(screen.getByText('Ready')).toBeInTheDocument()
expect(screen.getByText('Not Ready')).toBeInTheDocument()
expect(screen.getByText('×2')).toBeInTheDocument()
+ const list = screen.getByRole('list', { name: 'Execution workloads' })
+ expect(
+ within(list)
+ .getAllByRole('listitem')
+ .map(row => row.textContent)
+ ).toEqual(['my-mcp-serverReady×2', 'redisNot Ready'])
})
it('shows message section with copy button', async () => {
@@ -671,7 +678,10 @@ describe('RecipeStatusContent — runId child resolution', () => {
render(<RecipeStatusContent {...DEFAULT_PROPS} runId="ABCD1234-aaaa-bbbb-cccc-dddddddddddd" />)
await screen.findByText('custom-sdk-result.json')
- fireEvent.click(screen.getByTestId('artifact-download'))
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Actions for artifact custom-sdk-result.json' })
+ )
+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Download' }))
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith('http://localhost/run-download', {
@@ -686,7 +696,7 @@ describe('RecipeStatusContent — runId child resolution', () => {
)
expect(downloadName).toBe('ABCD1234-custom-sdk-result.json')
expect(screen.getByText('Clear All')).toBeInTheDocument()
- expect(screen.getByTitle('Delete custom-sdk-result.json')).toBeInTheDocument()
+ expect(screen.getByRole('list', { name: 'Output artifacts' })).toBeInTheDocument()
expect(click).toHaveBeenCalled()
})
@@ -713,7 +723,10 @@ describe('RecipeStatusContent — runId child resolution', () => {
render(<RecipeStatusContent {...DEFAULT_PROPS} runId="ABCD1234-aaaa-bbbb-cccc-dddddddddddd" />)
await screen.findByText('custom-sdk-result.json')
- fireEvent.click(screen.getByTitle('Delete custom-sdk-result.json'))
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Actions for artifact custom-sdk-result.json' })
+ )
+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Delete' }))
expect(mockDeleteWorkflowRunArtifact).not.toHaveBeenCalled()
expect(await screen.findByRole('alertdialog', { name: 'Delete Artifact' })).toBeInTheDocument()
fireEvent.click(screen.getByRole('button', { name: 'Delete' }))
diff --git a/control-ui/e2e/gke-workflow-mythos.spec.ts b/control-ui/e2e/gke-workflow-mythos.spec.ts
index ca00100f2..e09c3551d 100644
--- a/control-ui/e2e/gke-workflow-mythos.spec.ts
+++ b/control-ui/e2e/gke-workflow-mythos.spec.ts
@@ -124,9 +124,10 @@ async function verifyAndDownloadArtifact(
// Filename label — same scoping rationale.
await expect(row.locator('[data-testid="artifact-name"]')).toHaveText(filename)
- // Trigger download via the row-local Download button.
+ // Trigger download through the row-local canonical action menu.
const downloadPromise = page.waitForEvent('download', { timeout: 30_000 })
- await row.locator('[data-testid="artifact-download"]').click()
+ await row.getByRole('button', { name: `Actions for artifact ${filename}` }).click()
+ await page.getByRole('menuitem', { name: 'Download' }).click()
const download = await downloadPromise
expect(download.suggestedFilename()).toBe(filename)
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 691ca0c05..7f7a85fba 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.549",
+ "version": "0.1.550",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.549",
+ "version": "0.1.550",
"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 381fe25ec..d2902e0c8 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.549",
+ "version": "0.1.550",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",