Skip to content

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

TypeScript

feat(control-ui): kebab menus across tier 2 + missing-price row + host overview tab

palcf584a5a06f7
diff --git a/control-ui/app/constants/hostDetails.ts b/control-ui/app/constants/hostDetails.ts
index d0a18ab5f..13e7de0d4 100644
--- a/control-ui/app/constants/hostDetails.ts
+++ b/control-ui/app/constants/hostDetails.ts
@@ -1,5 +1,5 @@
export const HOST_DEFAULT_TAB = 'identity'
-export const HOST_TABS = ['identity', 'model', 'contexts', 'access', 'advanced'] as const
+export const HOST_TABS = ['details', 'identity', 'model', 'contexts', 'access', 'advanced'] as const
export type HostTab = (typeof HOST_TABS)[number]
diff --git a/control-ui/app/hosts/[name]/[tab]/page.tsx b/control-ui/app/hosts/[name]/[tab]/page.tsx
index 7d6bf7ea9..3f3a7b53b 100644
--- a/control-ui/app/hosts/[name]/[tab]/page.tsx
+++ b/control-ui/app/hosts/[name]/[tab]/page.tsx
@@ -7,7 +7,7 @@ interface HostTabPageProps {
export default async function HostTabPage({ params }: HostTabPageProps) {
const { tab } = await params
- const tabs = ['identity', 'model', 'contexts', 'access', 'advanced']
+ const tabs = ['overview', 'identity', 'model', 'contexts', 'access', 'advanced']
if (!tabs.includes(tab)) notFound()
return <HostDetailsPage />
diff --git a/control-ui/app/hosts/[name]/page.tsx b/control-ui/app/hosts/[name]/page.tsx
index 4bba0c29b..95af34683 100644
--- a/control-ui/app/hosts/[name]/page.tsx
+++ b/control-ui/app/hosts/[name]/page.tsx
@@ -10,6 +10,7 @@ import { CONTROL_ROUTES } from '@constants/routes'
import { HostAccessTab } from '../../../components/HostAccessTab'
import { HostAdvancedTab } from '../../../components/HostAdvancedTab'
import { HostIdentityTab } from '../../../components/HostIdentityTab'
+import { HostOverviewTab } from '../../../components/HostOverviewTab'
import { LlmProviderConfig } from '../../../components/LlmProviderConfig'
import { IconRobot } from '../../../components/Sidebar/icons'
import { IconCheck, IconMoreHorizontal, IconPencil } from '../../../components/icons'
@@ -36,6 +37,7 @@ import {
import type { HostTab } from './types'
const TAB_LABELS: Record<HostTab, string> = {
+ details: 'Overview',
model: 'Models & creds',
advanced: 'Advanced',
contexts: 'Context',
@@ -44,6 +46,7 @@ const TAB_LABELS: Record<HostTab, string> = {
}
const TAB_SLUGS: Record<HostTab, string> = {
+ details: 'overview',
model: 'model',
advanced: 'advanced',
contexts: 'contexts',
@@ -135,6 +138,13 @@ export default function HostDetailsPage() {
const [editingContext, setEditingContext] = useState(false)
const [contextRefDraft, setContextRefDraft] = useState('')
+ // Overview tab — read-only summary. Kept in sync with the host spec by loadData.
+ const [hostDisplayDraft, setHostDisplayDraft] = useState('')
+ const [contextMcpServers, setContextMcpServers] = useState<string[]>([])
+ const [accessSummary, setAccessSummary] = useState<{
+ memberCount: number
+ teamCount: number
+ }>({ memberCount: 0, teamCount: 0 })
const [providerDraft, setProviderDraft] = useState<LlmProvider>('openai')
// Model options are the operator allowlist (enabled only). The host's saved
// model is always kept selectable even if it fell out of the allowlist
@@ -238,7 +248,7 @@ export default function HostDetailsPage() {
setError('')
try {
const detail = await getHostDetailBundle(routeName)
- const { host, contexts: contextsList, secrets: secretsList } = detail
+ const { host, contexts: contextsList, secrets: secretsList, agentUsers, agentTeams } = detail
if (!mountedRef.current) return
const spec = host.spec || {}
// AP-6: remember the version of THIS read — the edit drafts below are
@@ -246,6 +256,28 @@ export default function HostDetailsPage() {
formResourceVersionRef.current = String(host.metadata?.resourceVersion || '')
if (resetDrafts === 'all' || resetDrafts === 'context') {
setContextRefDraft(String(spec.contextRef || ''))
+ // Overview summary — display name + the linked context's MCP servers.
+ // The display name falls back to the slug so the Overview card stays
+ // populated for legacy hosts that never set spec.host.
+ setHostDisplayDraft(String(spec.host || host.metadata?.name || routeName || ''))
+ const ref = String(spec.contextRef || '').trim()
+ const matched = (contextsList || []).find(
+ (item: { spec?: { contextId?: string }; metadata?: { name?: string } }) =>
+ String(item.spec?.contextId || item.metadata?.name || '').trim() === ref
+ )
+ const servers = Array.isArray(
+ (matched as { spec?: { mcpServers?: unknown[] } } | undefined)?.spec?.mcpServers
+ )
+ ? ((matched as { spec?: { mcpServers?: unknown[] } }).spec!.mcpServers as unknown[])
+ .map(String)
+ .map(v => v.trim())
+ .filter(Boolean)
+ : []
+ setContextMcpServers(servers)
+ setAccessSummary({
+ memberCount: Array.isArray(agentUsers) ? agentUsers.length : 0,
+ teamCount: Array.isArray(agentTeams) ? agentTeams.length : 0,
+ })
}
const nextProvider = normalizeProvider(
String((spec.model as { provider?: string } | undefined)?.provider || 'openai')
@@ -589,6 +621,27 @@ export default function HostDetailsPage() {
titleActions={<AgentActionsMenu busy={busy} onDelete={() => void handleDeleteAgent()} />}
>
<div className="cu-agent-detail-scroll">
+ {activeTab === 'details' && (
+ <HostOverviewTab
+ hostName={routeName}
+ displayName={hostDisplayDraft}
+ contextRef={contextRefDraft}
+ contextMcpServers={contextMcpServers}
+ provider={providerDraft}
+ modelName={modelNameDraft}
+ fallbackLines={(llmPolicyDraft?.fallbacks ?? []).map(entry => {
+ const label = getProviderLabel(entry.provider)
+ const slot = entry.credentialSlot ? ` · ${entry.credentialSlot}` : ''
+ return `${label} · ${entry.model || '—'}${slot}`
+ })}
+ allowedModelLines={allowedModelsDraft.map(entry => {
+ const label = getProviderLabel(entry.provider)
+ return `${label} · ${entry.model}`
+ })}
+ accessSummary={accessSummary}
+ />
+ )}
+
{activeTab === 'model' && (
<>
<div className={editingModel ? 'cu-agent-detail-toolbar' : 'cu-agent-detail-heading'}>
diff --git a/control-ui/components/CommunicationChannelsTable.tsx b/control-ui/components/CommunicationChannelsTable.tsx
index b596a6d51..dc78a2b56 100644
--- a/control-ui/components/CommunicationChannelsTable.tsx
+++ b/control-ui/components/CommunicationChannelsTable.tsx
@@ -1,6 +1,6 @@
'use client'
-import React, { useEffect, useMemo, useRef, useState } from 'react'
+import React, { useMemo, useState } from 'react'
import {
COMMUNICATION_CHANNEL_PROVIDERS,
type CommunicationChannelProvider,
@@ -9,6 +9,7 @@ import {
import type { CommunicationChannelItem } from '@lib/communicationChannels'
import { apiSend } from '../lib/api'
import { useConfirmDialog } from './ConfirmDialog'
+import { RowActionsMenu } from './RowActionsMenu'
import { SectionSearchInput } from './SectionSearchInput'
import { IconBroadcast } from './Sidebar/icons'
import { SkeletonTableRows } from './SkeletonTableRows'
@@ -16,7 +17,7 @@ import { TableHeaderRow } from './TableHeaderRow'
import type { TableHeaderColumn } from './TableHeaderRow/types'
import { TablePanelHeader } from './TablePanelHeader'
import { useToast } from './Toast'
-import { IconCopy, IconPencil, IconRefresh, IconX } from './icons'
+import { IconRefresh } from './icons'
function summary(item: CommunicationChannelItem): string {
const spec = item.spec || {}
@@ -256,34 +257,39 @@ export function CommunicationChannelsTable({
<td>
<span className="cu-table__cell-muted">{spec.hostRef || '-'}</span>
</td>
- <td>{providerTypes.map(communicationChannelProviderLabel).join(', ') || '-'}</td>
+ <td>
+ {providerTypes.map(communicationChannelProviderLabel).join(', ') || '-'}
+ </td>
<td>
<div className="cu-table-actions">
- <CopyChannelMenu
- item={item}
- onCopyChannel={onCopyChannel}
- disabled={!onCopyChannel}
+ <RowActionsMenu
+ ariaLabel={`Actions for channel ${name}`}
+ horizontalTrigger
+ actions={[
+ ...(onEditChannel
+ ? [
+ {
+ key: 'edit',
+ label: 'Edit',
+ onClick: () => onEditChannel(name),
+ },
+ ]
+ : []),
+ ...copyTargetsForChannel(item).map(provider => ({
+ key: `copy-${provider}`,
+ label: `Copy config into ${communicationChannelProviderLabel(provider)}`,
+ onClick: () => onCopyChannel?.(name, provider),
+ disabled: !onCopyChannel,
+ })),
+ {
+ key: 'delete',
+ label: deletingKey === key ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: deletingKey === key,
+ onClick: () => void deleteRow(item),
+ },
+ ]}
/>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => onEditChannel?.(name)}
- disabled={!onEditChannel}
- aria-label={`Edit channel ${name}`}
- >
- <IconPencil width={17} height={17} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void deleteRow(item)}
- disabled={deletingKey === key}
- aria-label={
- deletingKey === key ? 'Deleting…' : `Delete channel ${name}`
- }
- >
- <IconX width={17} height={17} />
- </button>
</div>
</td>
</tr>
@@ -299,74 +305,3 @@ export function CommunicationChannelsTable({
</>
)
}
-
-function CopyChannelMenu({
- disabled,
- item,
- onCopyChannel,
-}: {
- disabled?: boolean
- item: CommunicationChannelItem
- onCopyChannel?: (name: string, provider: CommunicationChannelProvider) => void
-}) {
- const [open, setOpen] = useState(false)
- const ref = useRef<HTMLDivElement>(null)
- const name = item.metadata?.name || ''
- const copyTargets = copyTargetsForChannel(item)
-
- useEffect(() => {
- if (!open) return
- function handleDocClick(event: MouseEvent) {
- if (!ref.current?.contains(event.target as Node)) setOpen(false)
- }
- function handleEsc(event: KeyboardEvent) {
- if (event.key === 'Escape') setOpen(false)
- }
- document.addEventListener('mousedown', handleDocClick)
- document.addEventListener('keydown', handleEsc)
- return () => {
- document.removeEventListener('mousedown', handleDocClick)
- document.removeEventListener('keydown', handleEsc)
- }
- }, [open])
-
- return (
- <div ref={ref} className="cu-kebab">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar cu-kebab__trigger"
- onClick={() => setOpen(value => !value)}
- disabled={disabled || !name}
- aria-label={`Copy channel ${name} config`}
- aria-haspopup="menu"
- aria-expanded={open}
- >
- <IconCopy width={17} height={17} />
- </button>
- {open ? (
- <div role="menu" className="cu-kebab__menu cu-kebab__menu--nowrap">
- {copyTargets.length === 0 ? (
- <button type="button" role="menuitem" className="cu-kebab__item" disabled>
- No provider targets
- </button>
- ) : (
- copyTargets.map(provider => (
- <button
- key={provider}
- type="button"
- role="menuitem"
- className="cu-kebab__item"
- onClick={() => {
- setOpen(false)
- onCopyChannel?.(name, provider)
- }}
- >
- Copy config into {communicationChannelProviderLabel(provider)}
- </button>
- ))
- )}
- </div>
- ) : null}
- </div>
- )
-}
diff --git a/control-ui/components/HostOverviewTab/index.tsx b/control-ui/components/HostOverviewTab/index.tsx
new file mode 100644
index 000000000..e2dd4f6f6
--- /dev/null
+++ b/control-ui/components/HostOverviewTab/index.tsx
@@ -0,0 +1,130 @@
+import React from 'react'
+import type { HostOverviewTabProps } from './types'
+
+function SummaryCard({ title, children }: { title: string; children: React.ReactNode }) {
+ return (
+ <section className="cu-card" aria-label={title}>
+ <div className="cu-card__body">
+ <h3 className="cu-section-title" style={{ marginBottom: 'var(--cu-space-2)' }}>
+ {title}
+ </h3>
+ {children}
+ </div>
+ </section>
+ )
+}
+
+export function HostOverviewTab({
+ hostName,
+ displayName,
+ contextRef,
+ contextMcpServers,
+ modelName,
+ fallbackLines,
+ allowedModelLines,
+ accessSummary,
+}: HostOverviewTabProps) {
+ const contextLabel = contextRef.trim() || '—'
+ const hasContext = Boolean(contextRef.trim())
+ const hasMcpServers = contextMcpServers.length > 0
+
+ return (
+ <div className="cu-form-stack cu-agent-form-stack">
+ <SummaryCard title="Name">
+ <div className="cu-field" style={{ marginBottom: 0 }}>
+ <div
+ style={{
+ fontSize: '1.25rem',
+ fontWeight: 600,
+ lineHeight: 1.3,
+ }}
+ >
+ {displayName.trim() || hostName}
+ </div>
+ <div className="cu-muted" style={{ fontSize: '0.8125rem', marginTop: '0.15rem' }}>
+ {hostName}
+ </div>
+ </div>
+ </SummaryCard>
+
+ <SummaryCard title="Access">
+ <div className="cu-field" style={{ marginBottom: 0 }}>
+ <div
+ style={{
+ display: 'flex',
+ gap: 'var(--cu-space-3)',
+ flexWrap: 'wrap',
+ }}
+ >
+ <span className="cu-chip">
+ {accessSummary.memberCount === 1
+ ? '1 member'
+ : `${accessSummary.memberCount} members`}
+ </span>
+ <span className="cu-chip">
+ {accessSummary.teamCount === 1 ? '1 team' : `${accessSummary.teamCount} teams`}
+ </span>
+ </div>
+ </div>
+ </SummaryCard>
+
+ <SummaryCard title="Models">
+ <div className="cu-field">
+ <label>Primary</label>
+ <div className="cu-field__readonly">{modelName.trim() || '—'}</div>
+ </div>
+ {fallbackLines.length > 0 ? (
+ <div className="cu-field">
+ <label>Fallbacks</label>
+ <ol className="cu-llm-policy__summary" style={{ margin: 0 }}>
+ {fallbackLines.map((line, index) => (
+ <li key={index} className="cu-field__readonly">
+ {line}
+ </li>
+ ))}
+ </ol>
+ </div>
+ ) : null}
+ {allowedModelLines.length > 0 ? (
+ <div className="cu-field">
+ <label>Per-host model allowlist</label>
+ <ul className="cu-llm-policy__summary" style={{ margin: 0 }}>
+ {allowedModelLines.map((line, index) => (
+ <li key={index} className="cu-field__readonly">
+ {line}
+ </li>
+ ))}
+ </ul>
+ </div>
+ ) : null}
+ </SummaryCard>
+
+ <SummaryCard title="Context">
+ <div className="cu-field" style={{ marginBottom: hasMcpServers ? undefined : 0 }}>
+ <div className="cu-field__readonly">{contextLabel}</div>
+ </div>
+ {hasContext ? (
+ <section className="cu-agent-context-mcp-summary" aria-label="Attached MCP servers">
+ <div className="cu-agent-context-mcp-summary__head">
+ <span>MCP servers</span>
+ <span>{contextMcpServers.length}</span>
+ </div>
+ {hasMcpServers ? (
+ <ul className="cu-agent-context-mcp-summary__list">
+ {contextMcpServers.map(server => (
+ <li key={server} title={server}>
+ {server}
+ </li>
+ ))}
+ </ul>
+ ) : (
+ <p className="cu-muted" style={{ margin: 0 }}>
+ No MCP servers attached.
+ </p>
+ )}
+ </section>
+ ) : null}
+ </SummaryCard>
+ </div>
+ )
+}
diff --git a/control-ui/components/HostOverviewTab/types.ts b/control-ui/components/HostOverviewTab/types.ts
new file mode 100644
index 000000000..474d748c2
--- /dev/null
+++ b/control-ui/components/HostOverviewTab/types.ts
@@ -0,0 +1,18 @@
+import type { LlmProvider } from '../../lib/llm'
+
+export type HostOverviewAccessSummary = {
+ memberCount: number
+ teamCount: number
+}
+
+export type HostOverviewTabProps = {
+ hostName: string
+ displayName: string
+ contextRef: string
+ contextMcpServers: string[]
+ provider: LlmProvider
+ modelName: string
+ fallbackLines: string[]
+ allowedModelLines: string[]
+ accessSummary: HostOverviewAccessSummary
+}
diff --git a/control-ui/components/LlmPriceTable.tsx b/control-ui/components/LlmPriceTable.tsx
index 82e2de48f..c2ff68838 100644
--- a/control-ui/components/LlmPriceTable.tsx
+++ b/control-ui/components/LlmPriceTable.tsx
@@ -6,13 +6,14 @@ import { getProviderDisplayLabel } from '@lib/llm'
import type { LlmPriceTableProps } from './LlmPriceTable.types'
import { LlmProviderIcon } from './LlmProviderIcon'
import { MissingPriceWarning } from './MissingPriceWarning'
+import { RowActionsMenu } from './RowActionsMenu'
import { SectionSearchInput } from './SectionSearchInput'
import { IconPrice } from './Sidebar/icons'
import { SkeletonTableRows } from './SkeletonTableRows'
import { TableHeaderRow } from './TableHeaderRow'
import type { TableHeaderColumn } from './TableHeaderRow/types'
import { TablePanelHeader } from './TablePanelHeader'
-import { IconPencil, IconRefresh, IconX } from './icons'
+import { IconRefresh } from './icons'
const PRICE_COLUMNS: TableHeaderColumn[] = [
{ key: 'provider', label: 'Provider', width: '10%' },
@@ -205,27 +206,24 @@ export function LlmPriceTable({
</span>
</td>
<td className="cu-px-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => onEdit(price.id)}
- aria-label={`Edit price ${price.provider}/${price.model}`}
- >
- <IconPencil width={16} height={16} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void onDelete(price)}
- disabled={deletingId === price.id}
- aria-label={
- deletingId === price.id
- ? 'Deleting price…'
- : `Delete price ${price.provider}/${price.model}`
- }
- >
- <IconX width={16} height={16} />
- </button>
+ <RowActionsMenu
+ ariaLabel={`Actions for price ${price.provider}/${price.model}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'edit',
+ label: 'Edit',
+ onClick: () => onEdit(price.id),
+ },
+ {
+ key: 'delete',
+ label: deletingId === price.id ? 'Deleting price…' : 'Delete',
+ danger: true,
+ disabled: deletingId === price.id,
+ onClick: () => void onDelete(price),
+ },
+ ]}
+ />
</td>
</tr>
)
@@ -267,15 +265,17 @@ export function LlmPriceTable({
<span className="cu-px-badge cu-px-badge--warn">Missing</span>
</td>
<td className="cu-px-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => onAddMissingPrice(item)}
- aria-label={`Add price for ${label}`}
- title={`Add price for ${label}`}
- >
- <IconPencil width={16} height={16} />
- </button>
+ <RowActionsMenu
+ ariaLabel={`Actions for price ${label}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'add',
+ label: 'Add price',
+ onClick: () => onAddMissingPrice(item),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/components/SecretsTable.tsx b/control-ui/components/SecretsTable.tsx
index 4a7f19b49..e22bab6a6 100644
--- a/control-ui/components/SecretsTable.tsx
+++ b/control-ui/components/SecretsTable.tsx
@@ -21,12 +21,13 @@ import { collectWorkflowRecipeSecretRefs } from '../lib/workflowRecipeSecretRefs
import { useConfirmDialog } from './ConfirmDialog'
import { LlmCredentialFields } from './LlmCredentialFields'
import { LlmProviderIcon } from './LlmProviderIcon'
+import { RowActionsMenu } from './RowActionsMenu'
import { SectionSearchInput } from './SectionSearchInput'
import { IconKey } from './Sidebar/icons'
import { TabBar } from './TabBar'
import { TablePanelHeader } from './TablePanelHeader'
import { useToast } from './Toast'
-import { IconPencil, IconRefresh, IconX } from './icons'
+import { IconRefresh, IconX } from './icons'
type SecretItem = {
name?: string
@@ -673,25 +674,24 @@ export function SecretsTable({
</td>
<td style={{ textAlign: 'right' }}>
<div style={{ display: 'inline-flex', gap: '0.35rem' }}>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => openUpdate(name)}
- aria-label={`Update LLM secret ${name}`}
- >
- <IconPencil width={16} height={16} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void deleteSecret(name)}
- disabled={deletingName === name}
- aria-label={
- deletingName === name ? 'Deleting…' : `Delete LLM secret ${name}`
- }
- >
- <IconX width={16} height={16} />
- </button>
+ <RowActionsMenu
+ ariaLabel={`Actions for LLM secret ${name}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'update',
+ label: 'Update',
+ onClick: () => openUpdate(name),
+ },
+ {
+ key: 'delete',
+ label: deletingName === name ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: deletingName === name,
+ onClick: () => void deleteSecret(name),
+ },
+ ]}
+ />
</div>
</td>
</tr>
@@ -920,27 +920,27 @@ export function SecretsTable({
</button>
) : (
<div style={{ display: 'inline-flex', gap: '0.35rem' }}>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => navigateToRecipeEdit(row.name, row.namespace)}
- aria-label={`Update recipe secret ${row.name}`}
- >
- <IconPencil width={16} height={16} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void deleteRecipeSecretRow(row.name, row.namespace)}
- disabled={recipeDeletingName === `${row.namespace}/${row.name}`}
- aria-label={
- recipeDeletingName === `${row.namespace}/${row.name}`
- ? 'Deleting…'
- : `Delete recipe secret ${row.name}`
- }
- >
- <IconX width={16} height={16} />
- </button>
+ <RowActionsMenu
+ ariaLabel={`Actions for recipe secret ${row.name}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'update',
+ label: 'Update',
+ onClick: () => navigateToRecipeEdit(row.name, row.namespace),
+ },
+ {
+ key: 'delete',
+ label:
+ recipeDeletingName === `${row.namespace}/${row.name}`
+ ? 'Deleting…'
+ : 'Delete',
+ danger: true,
+ disabled: recipeDeletingName === `${row.namespace}/${row.name}`,
+ onClick: () => void deleteRecipeSecretRow(row.name, row.namespace),
+ },
+ ]}
+ />
</div>
)}
</td>
diff --git a/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx b/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
index 3908903bf..f7553c0b4 100644
--- a/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
+++ b/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
@@ -75,7 +75,7 @@ describe('CommunicationChannelsTable', () => {
],
})
- fireEvent.click(screen.getByRole('button', { name: 'Copy channel telegram-channel config' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel telegram-channel' }))
expect(
screen.queryByRole('menuitem', { name: 'Copy config into Telegram' })
@@ -112,7 +112,7 @@ describe('CommunicationChannelsTable', () => {
],
})
- fireEvent.click(screen.getByRole('button', { name: 'Copy channel slack-channel config' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel slack-channel' }))
expect(
screen.queryByRole('menuitem', { name: 'Copy config into Slack' })
@@ -146,7 +146,7 @@ describe('CommunicationChannelsTable', () => {
],
})
- fireEvent.click(screen.getByRole('button', { name: 'Copy channel teams-channel config' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
expect(
screen.queryByRole('menuitem', { name: 'Copy config into Microsoft Teams' })
@@ -156,3 +156,123 @@ describe('CommunicationChannelsTable', () => {
expect(onCopyChannel).toHaveBeenCalledWith('teams-channel', 'slack')
})
})
+
+// ─────────────────────────────────────────────────────────────────────────────
+// Row actions kebab
+// ─────────────────────────────────────────────────────────────────────────────
+describe('CommunicationChannelsTable — row actions kebab', () => {
+ function teamsChannelItem(): CommunicationChannelItem {
+ return {
+ metadata: { name: 'teams-channel', namespace: 'channels' },
+ spec: { hostRef: 'agent-a', teamsSettings: { appId: 'app-123' } },
+ } as unknown as CommunicationChannelItem
+ }
+
+ it('opens the kebab with Edit + Delete and routes Edit through the matching handler', () => {
+ const onEditChannel = vi.fn()
+ render(
+ <ToastProvider>
+ <CommunicationChannelsTable
+ items={[teamsChannelItem()]}
+ onChanged={vi.fn().mockResolvedValue(undefined)}
+ onEditChannel={onEditChannel}
+ onRefresh={vi.fn()}
+ refreshing={false}
+ />
+ </ToastProvider>
+ )
+
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
+
+ const editItem = screen.getByRole('menuitem', { name: 'Edit' })
+ const deleteItem = screen.getByRole('menuitem', { name: 'Delete' })
+ expect(deleteItem).toHaveClass('cu-kebab__item--danger')
+
+ fireEvent.click(editItem)
+ expect(onEditChannel).toHaveBeenCalledWith('teams-channel')
+ })
+
+ it('opens the confirm dialog when Delete is clicked on the kebab', () => {
+ render(
+ <ToastProvider>
+ <CommunicationChannelsTable
+ items={[teamsChannelItem()]}
+ onChanged={vi.fn().mockResolvedValue(undefined)}
+ onEditChannel={vi.fn()}
+ onRefresh={vi.fn()}
+ refreshing={false}
+ />
+ </ToastProvider>
+ )
+
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Delete' }))
+
+ expect(screen.getByRole('alertdialog')).toHaveTextContent(/Delete communication channel/)
+ })
+
+ it('still renders the kebab without Edit when onEditChannel is omitted', () => {
+ render(
+ <ToastProvider>
+ <CommunicationChannelsTable
+ items={[teamsChannelItem()]}
+ onChanged={vi.fn().mockResolvedValue(undefined)}
+ onRefresh={vi.fn()}
+ refreshing={false}
+ />
+ </ToastProvider>
+ )
+
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
+
+ expect(screen.queryByRole('menuitem', { name: 'Edit' })).not.toBeInTheDocument()
+ expect(screen.getByRole('menuitem', { name: 'Delete' })).toBeInTheDocument()
+ })
+
+ it('exposes each copy target as its own menu item inside the row kebab', () => {
+ const onCopyChannel = vi.fn()
+ render(
+ <ToastProvider>
+ <CommunicationChannelsTable
+ items={[teamsChannelItem()]}
+ onChanged={vi.fn().mockResolvedValue(undefined)}
+ onCopyChannel={onCopyChannel}
+ onRefresh={vi.fn()}
+ refreshing={false}
+ />
+ </ToastProvider>
+ )
+
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
+
+ // teams-channel is configured for Teams, so copy targets are Slack + Telegram
+ expect(screen.getByRole('menuitem', { name: 'Copy config into Slack' })).toBeInTheDocument()
+ expect(screen.getByRole('menuitem', { name: 'Copy config into Telegram' })).toBeInTheDocument()
+ expect(
+ screen.queryByRole('menuitem', { name: 'Copy config into Microsoft Teams' })
+ ).not.toBeInTheDocument()
+
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Copy config into Slack' }))
+ expect(onCopyChannel).toHaveBeenCalledWith('teams-channel', 'slack')
+ })
+
+ it('disables copy-target items when onCopyChannel is not provided', () => {
+ render(
+ <ToastProvider>
+ <CommunicationChannelsTable
+ items={[teamsChannelItem()]}
+ onChanged={vi.fn().mockResolvedValue(undefined)}
+ onRefresh={vi.fn()}
+ refreshing={false}
+ />
+ </ToastProvider>
+ )
+
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
+
+ const slackCopy = screen.getByRole('menuitem', { name: 'Copy config into Slack' })
+ const telegramCopy = screen.getByRole('menuitem', { name: 'Copy config into Telegram' })
+ expect(slackCopy).toBeDisabled()
+ expect(telegramCopy).toBeDisabled()
+ })
+})
diff --git a/control-ui/components/__tests__/LlmPriceTable.test.tsx b/control-ui/components/__tests__/LlmPriceTable.test.tsx
index abd4ec6a2..0ffe6a9f4 100644
--- a/control-ui/components/__tests__/LlmPriceTable.test.tsx
+++ b/control-ui/components/__tests__/LlmPriceTable.test.tsx
@@ -59,10 +59,16 @@ describe('LlmPriceTable', () => {
const onDelete = vi.fn().mockResolvedValue(undefined)
renderTable({ onEdit, onDelete })
- fireEvent.click(screen.getByRole('button', { name: 'Edit price claude/claude-sonnet-4-6' }))
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Actions for price claude/claude-sonnet-4-6' })
+ )
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Edit' }))
expect(onEdit).toHaveBeenCalledWith('price-1')
- fireEvent.click(screen.getByRole('button', { name: 'Delete price claude/claude-sonnet-4-6' }))
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Actions for price claude/claude-sonnet-4-6' })
+ )
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Delete' }))
expect(onDelete).toHaveBeenCalledWith(prices[0])
})
@@ -88,7 +94,8 @@ describe('LlmPriceTable', () => {
'/cost-and-usage/llm-prices/new?provider=openai&model=gpt-5'
)
- fireEvent.click(screen.getByRole('button', { name: 'Add price for OpenAI/gpt-5' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for price OpenAI/gpt-5' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Add price' }))
expect(onAddMissingPrice).toHaveBeenCalledWith({ provider: 'openai', model: 'gpt-5' })
})
diff --git a/control-ui/components/__tests__/SecretsTable.test.tsx b/control-ui/components/__tests__/SecretsTable.test.tsx
index 00b7284a1..03affd027 100644
--- a/control-ui/components/__tests__/SecretsTable.test.tsx
+++ b/control-ui/components/__tests__/SecretsTable.test.tsx
@@ -91,7 +91,8 @@ describe('SecretsTable — LLM secret update payload', () => {
function openUpdateModal(keys: string[]) {
renderLlmTable(keys)
- fireEvent.click(screen.getByRole('button', { name: `Update LLM secret ${SECRET}` }))
+ fireEvent.click(screen.getByRole('button', { name: `Actions for LLM secret ${SECRET}` }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
}
it('shows the providers whose complete credentials are stored in each secret', () => {
@@ -255,11 +256,13 @@ describe('SecretsTable — LLM secret update payload', () => {
// Regression guard: a stale `removedKeys` would delete keys belonging to
// whichever secret is edited next.
renderLlmTable(['claude-api-key-fb1', 'openai-api-key'])
- fireEvent.click(screen.getByRole('button', { name: `Update LLM secret ${SECRET}` }))
+ fireEvent.click(screen.getByRole('button', { name: `Actions for LLM secret ${SECRET}` }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
removeExtraSlotIn('Anthropic')
fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
- fireEvent.click(screen.getByRole('button', { name: `Update LLM secret ${SECRET}` }))
+ fireEvent.click(screen.getByRole('button', { name: `Actions for LLM secret ${SECRET}` }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
fireEvent.change(screen.getByLabelText(/^OpenAI API key/i), { target: { value: 'sk-live' } })
save()
@@ -496,10 +499,11 @@ describe('SecretsTable — recipe pending refs', () => {
renderTable('recipe')
- const editButton = await screen.findByRole('button', {
- name: 'Update recipe secret ui-creds',
+ const trigger = await screen.findByRole('button', {
+ name: 'Actions for recipe secret ui-creds',
})
- fireEvent.click(editButton)
+ fireEvent.click(trigger)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
expect(mockPush).toHaveBeenCalledWith('/secrets/recipe/ui-creds/edit?namespace=sandbox-ui')
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 186b759a2..3ba55bed4 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.435",
+ "version": "0.1.436",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.435",
+ "version": "0.1.436",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-ui/package.json b/control-ui/package.json
index 414f82f1d..ff6ae447e 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.435",
+ "version": "0.1.436",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",