Skip to content

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

TypeScript

feat(control-ui): standardize table interactions

Josué2706d4d5ba01
diff --git a/control-ui/app/contexts/[name]/page.tsx b/control-ui/app/contexts/[name]/page.tsx
index 1cbe6f3d9..e726574d2 100644
--- a/control-ui/app/contexts/[name]/page.tsx
+++ b/control-ui/app/contexts/[name]/page.tsx
@@ -7,6 +7,7 @@ import { DataTable } from '@clerum/frontend-table-system'
import { useConfirmDialog } from '@components/ConfirmDialog'
import { CreateFlowPanel } from '@components/CreateFlowPanel'
import { CreatePageHeader } from '@components/CreatePageHeader'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { SelectionDropdown } from '@components/SelectionDropdown'
import { TabBar } from '@components/TabBar'
import { TableHeaderRow } from '@components/TableHeaderRow'
@@ -919,19 +920,19 @@ export default function ContextDetailsPage() {
<tr key={server}>
<td>{server}</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() =>
- void saveMcpServers(mcpServersDraft.filter(s => s !== server))
- }
- disabled={busy}
- aria-label={`Remove connector ${server}`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for connector ${server}`}
+ actions={[
+ {
+ key: 'remove',
+ label: 'Remove connector',
+ danger: true,
+ disabled: busy,
+ onClick: () =>
+ void saveMcpServers(mcpServersDraft.filter(s => s !== server)),
+ },
+ ]}
+ />
</td>
</tr>
))}
@@ -973,23 +974,23 @@ export default function ContextDetailsPage() {
<code style={{ fontSize: '0.85rem' }}>{ref.mountPath}</code>
</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- disabled={busy}
- onClick={() =>
- void saveSharedFileSystems(
- sharedFileSystemsDraft.filter(
- r => !(r.name === ref.name && r.mountPath === ref.mountPath)
- )
- )
- }
- aria-label={`Detach shared filesystem ${ref.name}`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for shared filesystem ${ref.name}`}
+ actions={[
+ {
+ key: 'detach',
+ label: 'Detach shared filesystem',
+ danger: true,
+ disabled: busy,
+ onClick: () =>
+ void saveSharedFileSystems(
+ sharedFileSystemsDraft.filter(
+ r => !(r.name === ref.name && r.mountPath === ref.mountPath)
+ )
+ ),
+ },
+ ]}
+ />
</td>
</tr>
))}
@@ -1172,17 +1173,24 @@ export default function ContextDetailsPage() {
</button>
</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeTeamFromContext(team.id)}
- disabled={busy}
- aria-label={`Remove team ${team.name}`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for team ${team.name}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View team details',
+ onClick: () =>
+ router.push(CONTROL_ROUTES.usersAndTeams.team(team.id)),
+ },
+ {
+ key: 'remove',
+ label: 'Remove team',
+ danger: true,
+ disabled: busy,
+ onClick: () => void removeTeamFromContext(team.id),
+ },
+ ]}
+ />
</td>
</tr>
))}
@@ -1245,17 +1253,24 @@ export default function ContextDetailsPage() {
</td>
<td className="cu-table__cell-muted">{user.email || user.id}</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeUserFromContext(user.id)}
- disabled={busy}
- aria-label={`Remove member ${memberLabel}`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for member ${memberLabel}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View member details',
+ onClick: () =>
+ router.push(CONTROL_ROUTES.usersAndTeams.user(user.id)),
+ },
+ {
+ key: 'remove',
+ label: 'Remove member',
+ danger: true,
+ disabled: busy,
+ onClick: () => void removeUserFromContext(user.id),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/app/contexts/__tests__/ContextDetail.spec-preserve.test.tsx b/control-ui/app/contexts/__tests__/ContextDetail.spec-preserve.test.tsx
index 1a1e134bf..2bcbd28ae 100644
--- a/control-ui/app/contexts/__tests__/ContextDetail.spec-preserve.test.tsx
+++ b/control-ui/app/contexts/__tests__/ContextDetail.spec-preserve.test.tsx
@@ -199,7 +199,8 @@ describe('ContextDetailsPage spec preservation on connector/SFS edits (R5-M3)',
render(<ContextDetailsPage />)
// Connectors is the default tab — remove one connector to trigger saveMcpServers.
- fireEvent.click(await screen.findByRole('button', { name: 'Remove connector srv-b' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Actions for connector srv-b' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Remove connector' }))
await waitFor(() => expect(api.updateContext).toHaveBeenCalled())
const spec = lastPutSpec()
diff --git a/control-ui/app/control-admins/new/page.tsx b/control-ui/app/control-admins/new/page.tsx
index 4ed28ddea..995075327 100644
--- a/control-ui/app/control-admins/new/page.tsx
+++ b/control-ui/app/control-admins/new/page.tsx
@@ -2,7 +2,7 @@
import { useEffect, useMemo, useState } from 'react'
import { useRouter, useSearchParams } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, RowActionMenu } from '@clerum/frontend-table-system'
import { AuthGate } from '@components/AuthGate'
import { CreateFlowPanel } from '@components/CreateFlowPanel'
import { CreatePageHeader } from '@components/CreatePageHeader'
@@ -11,7 +11,6 @@ import { DashboardLayout } from '@components/DashboardLayout'
import { SelectionDropdown } from '@components/SelectionDropdown'
import { IconSettings } from '@components/Sidebar/icons'
import { useToast } from '@components/Toast'
-import { IconTrash } from '@components/icons'
import { Button, CheckboxField, Field, TextInput } from '@components/ui'
import { CONTROL_ROUTES } from '@constants/routes'
import { getAdminTeams, inviteControlAdmin } from '@lib/api'
@@ -306,19 +305,21 @@ export default function CreateControlAdminInvitationPage() {
/>
</td>
<td>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() =>
- updateSelectedTeams(
- selectedTeamIds.filter(teamId => teamId !== team.id)
- )
- }
- disabled={saving}
- aria-label={`Remove ${team.name}`}
- >
- <IconTrash width={16} height={16} />
- </button>
+ <RowActionMenu
+ ariaLabel={`Actions for ${team.name}`}
+ actions={[
+ {
+ key: 'remove',
+ label: 'Remove',
+ danger: true,
+ disabled: saving,
+ onSelect: () =>
+ updateSelectedTeams(
+ selectedTeamIds.filter(teamId => teamId !== team.id)
+ ),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/app/plugin-workload-sdk/Views.tsx b/control-ui/app/plugin-workload-sdk/Views.tsx
index 58af442eb..de54c5644 100644
--- a/control-ui/app/plugin-workload-sdk/Views.tsx
+++ b/control-ui/app/plugin-workload-sdk/Views.tsx
@@ -2,9 +2,9 @@
import React from 'react'
import { DataTable } from '@clerum/frontend-table-system'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { TableHeaderRow } from '@components/TableHeaderRow'
import type { TableHeaderColumn } from '@components/TableHeaderRow/types'
-import { IconX } from '@components/icons'
import { Button, SelectInput, TextInput } from '@components/ui'
import type {
PluginWorkloadSdkFamily,
@@ -169,18 +169,19 @@ export function GrantsView({
{/* Per-run caps removed (issue #348). Shows API-set per-minute grant overrides when present (they take precedence over the platform ENV defaults); 'platform defaults' otherwise. The edit form does not manage these overrides. */}
<td>{quotaParts.length === 0 ? 'platform defaults' : quotaParts.join(', ')}</td>
<td className="cu-cell--right">
- <Button type="button" variant="ghost" size="sm" onClick={() => onEdit(grant)}>
- Edit
- </Button>
- <Button
- type="button"
- className="cu-btn--icon cu-btn--danger-icon"
- onClick={() => onDelete(grant)}
- disabled={deletingId === grant.id}
- aria-label={`Delete grant for ${grant.recipeName}`}
- >
- <IconX width={16} height={16} />
- </Button>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${grant.recipeName}`}
+ actions={[
+ { key: 'edit', label: 'Edit', onClick: () => onEdit(grant) },
+ {
+ key: 'delete',
+ label: 'Delete',
+ onClick: () => onDelete(grant),
+ disabled: deletingId === grant.id,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/app/profile-admin/teams/[teamId]/page.tsx b/control-ui/app/profile-admin/teams/[teamId]/page.tsx
index 22919a4f0..950bf91f0 100644
--- a/control-ui/app/profile-admin/teams/[teamId]/page.tsx
+++ b/control-ui/app/profile-admin/teams/[teamId]/page.tsx
@@ -2,7 +2,7 @@
import React, { useEffect, useMemo, useRef, useState } from 'react'
import { useParams, useRouter } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, RecordList, RecordListRow, RowActionMenu } from '@clerum/frontend-table-system'
import { useConfirmDialog } from '@components/ConfirmDialog'
import { DetailPageShell } from '@components/DetailPageShell'
import { SelectionDropdown } from '@components/SelectionDropdown'
@@ -14,7 +14,7 @@ import { partitionVisibleAccess } from '@lib/accessVisibility'
import { getAgentDisplayName } from '@lib/agentName'
import { InviteMemberDialog } from '../../../../components/InviteMemberDialog'
import { IconUsers } from '../../../../components/Sidebar/icons'
-import { IconCheck, IconMoreHorizontal, IconPencil, IconX } from '../../../../components/icons'
+import { IconCheck, IconMoreHorizontal, IconX } from '../../../../components/icons'
import {
AdminTeamPendingInvitation,
HostResource,
@@ -928,36 +928,27 @@ export default function TeamDetailsPage() {
/>
</td>
<td>
- <div
- style={{
- display: 'flex',
- gap: '0.35rem',
- justifyContent: 'flex-end',
- }}
- >
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--ghost"
- onClick={() => {
- setRoleEditMember(member)
- setRoleEditDraft(member.role)
- }}
- disabled={busy}
- aria-label="Edit role"
- >
- <IconPencil width={14} height={14} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeMember(member.id)}
- disabled={busy}
- title="Remove"
- aria-label="Remove member"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionMenu
+ ariaLabel={`Actions for ${member.email}`}
+ actions={[
+ {
+ key: 'edit-role',
+ label: 'Edit role',
+ disabled: busy,
+ onSelect: () => {
+ setRoleEditMember(member)
+ setRoleEditDraft(member.role)
+ },
+ },
+ {
+ key: 'remove',
+ label: 'Remove member',
+ danger: true,
+ disabled: busy,
+ onSelect: () => void removeMember(member.id),
+ },
+ ]}
+ />
</td>
</tr>
)
@@ -1015,9 +1006,9 @@ export default function TeamDetailsPage() {
No contexts linked.
</div>
) : (
- <div role="list">
+ <RecordList>
{assignedContextIds.map(contextId => (
- <div key={contextId} className="cu-access-row" role="listitem">
+ <RecordListRow key={contextId} className="cu-access-row">
<button
type="button"
className="cu-link"
@@ -1025,19 +1016,27 @@ export default function TeamDetailsPage() {
>
{contextId}
</button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeContextAccess(contextId)}
- disabled={busy}
- title="Remove"
- aria-label="Remove context"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionMenu
+ ariaLabel={`Actions for context ${contextId}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View context details',
+ onSelect: () =>
+ router.push(CONTROL_ROUTES.contexts.detail(contextId)),
+ },
+ {
+ key: 'remove',
+ label: 'Remove context',
+ danger: true,
+ disabled: busy,
+ onSelect: () => void removeContextAccess(contextId),
+ },
+ ]}
+ />
+ </RecordListRow>
))}
- </div>
+ </RecordList>
)}
{!initialLoading && deletedContextIds.length > 0 && (
<>
@@ -1099,9 +1098,9 @@ export default function TeamDetailsPage() {
No agent access yet.
</div>
) : (
- <div role="list">
+ <RecordList>
{assignedAgentNames.map(agentName => (
- <div key={agentName} className="cu-access-row" role="listitem">
+ <RecordListRow key={agentName} className="cu-access-row">
<button
type="button"
className="cu-link"
@@ -1109,19 +1108,27 @@ export default function TeamDetailsPage() {
>
{agentName}
</button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void revokeAgentAccess(agentName)}
- disabled={busy}
- title="Revoke"
- aria-label="Revoke agent"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionMenu
+ ariaLabel={`Actions for agent ${agentName}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View agent details',
+ onSelect: () =>
+ router.push(CONTROL_ROUTES.agents.detail(agentName)),
+ },
+ {
+ key: 'revoke',
+ label: 'Revoke agent access',
+ danger: true,
+ disabled: busy,
+ onSelect: () => void revokeAgentAccess(agentName),
+ },
+ ]}
+ />
+ </RecordListRow>
))}
- </div>
+ </RecordList>
)}
</>
)}
diff --git a/control-ui/app/profile-admin/teams/new/page.tsx b/control-ui/app/profile-admin/teams/new/page.tsx
index 5f4d46952..e6b3b198c 100644
--- a/control-ui/app/profile-admin/teams/new/page.tsx
+++ b/control-ui/app/profile-admin/teams/new/page.tsx
@@ -2,7 +2,7 @@
import { useEffect, useMemo, useState } from 'react'
import { useRouter } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, RowActionMenu } from '@clerum/frontend-table-system'
import { AuthGate } from '@components/AuthGate'
import { CreateFlowPanel } from '@components/CreateFlowPanel'
import { CreatePageHeader } from '@components/CreatePageHeader'
@@ -11,7 +11,6 @@ import { DashboardLayout } from '@components/DashboardLayout'
import { SelectionDropdown } from '@components/SelectionDropdown'
import { IconUsers } from '@components/Sidebar/icons'
import { useToast } from '@components/Toast'
-import { IconTrash } from '@components/icons'
import { Button, Field, TextInput } from '@components/ui'
import { CONTROL_ROUTES } from '@constants/routes'
import { getAgentDisplayName } from '@lib/agentName'
@@ -377,15 +376,18 @@ export default function CreateTeamPage() {
/>
</td>
<td>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => removeMember(user.id)}
- disabled={saving}
- aria-label={`Remove ${label}`}
- >
- <IconTrash width={16} height={16} />
- </button>
+ <RowActionMenu
+ ariaLabel={`Actions for ${label}`}
+ actions={[
+ {
+ key: 'remove',
+ label: 'Remove',
+ danger: true,
+ disabled: saving,
+ onSelect: () => removeMember(user.id),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/app/profile-admin/users/[userId]/page.tsx b/control-ui/app/profile-admin/users/[userId]/page.tsx
index 9047687fa..c05753fe7 100644
--- a/control-ui/app/profile-admin/users/[userId]/page.tsx
+++ b/control-ui/app/profile-admin/users/[userId]/page.tsx
@@ -6,6 +6,7 @@ import { useParams, useRouter } from 'next/navigation'
import { DataTable } from '@clerum/frontend-table-system'
import { useConfirmDialog } from '@components/ConfirmDialog'
import { DetailPageShell } from '@components/DetailPageShell'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { SelectionDropdown } from '@components/SelectionDropdown'
import { TeamRolePermissionEditor } from '@components/TeamRolePermissionEditor'
import { useToast } from '@components/Toast'
@@ -17,7 +18,7 @@ import type { DeleteCandidateTeam } from '@lib/profileAdminDelete'
import { formatTeamNames, getSoloMemberTeamsForUser } from '@lib/profileAdminDelete'
import { IconUsers } from '../../../../components/Sidebar/icons'
import { UserApprovalMediumsPanel } from '../../../../components/UserApprovalMediumsPanel'
-import { IconPencil, IconX } from '../../../../components/icons'
+import { IconX } from '../../../../components/icons'
import {
AdminUserChannels,
DeleteAdminUserRequest,
@@ -1009,24 +1010,23 @@ export default function UserDetailsPage() {
</button>
</td>
<td>
- <div
- style={{
- display: 'flex',
- gap: '0.35rem',
- justifyContent: 'flex-end',
- }}
- >
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeContextAccess(contextId)}
- disabled={busy}
- title="Remove"
- aria-label="Remove context"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${contextId}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () => router.push(CONTROL_ROUTES.contexts.detail(contextId)),
+ },
+ {
+ key: 'remove',
+ label: 'Remove access',
+ onClick: () => void removeContextAccess(contextId),
+ disabled: busy,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
))}
@@ -1177,36 +1177,33 @@ export default function UserDetailsPage() {
/>
</td>
<td>
- <div
- style={{
- display: 'flex',
- gap: '0.35rem',
- justifyContent: 'flex-end',
- }}
- >
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--ghost"
- onClick={() => {
- setRoleEditTeam(team)
- setRoleEditDraft(team.role)
- }}
- disabled={busy}
- aria-label={`Edit permissions for ${team.name}`}
- >
- <IconPencil width={14} height={14} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeUserFromTeam(team)}
- disabled={busy}
- aria-label={`Remove member from ${team.name}`}
- title="Remove"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${team.name}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () =>
+ router.push(CONTROL_ROUTES.usersAndTeams.team(team.id)),
+ },
+ {
+ key: 'edit',
+ label: 'Edit permissions',
+ onClick: () => {
+ setRoleEditTeam(team)
+ setRoleEditDraft(team.role)
+ },
+ disabled: busy,
+ },
+ {
+ key: 'remove',
+ label: 'Remove from team',
+ onClick: () => void removeUserFromTeam(team),
+ disabled: busy,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
)
@@ -1292,24 +1289,23 @@ export default function UserDetailsPage() {
</button>
</td>
<td>
- <div
- style={{
- display: 'flex',
- gap: '0.35rem',
- justifyContent: 'flex-end',
- }}
- >
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void revokeAgentAccess(agentName)}
- disabled={busy}
- title="Revoke"
- aria-label="Revoke agent"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${agentName}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () => router.push(CONTROL_ROUTES.agents.detail(agentName)),
+ },
+ {
+ key: 'revoke',
+ label: 'Revoke access',
+ onClick: () => void revokeAgentAccess(agentName),
+ disabled: busy,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
))}
diff --git a/control-ui/app/profile-admin/users/new/page.tsx b/control-ui/app/profile-admin/users/new/page.tsx
index c56759ae8..1cd6e3ef6 100644
--- a/control-ui/app/profile-admin/users/new/page.tsx
+++ b/control-ui/app/profile-admin/users/new/page.tsx
@@ -2,7 +2,7 @@
import { useEffect, useMemo, useRef, useState } from 'react'
import { useRouter, useSearchParams } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, RowActionMenu } from '@clerum/frontend-table-system'
import { AuthGate } from '@components/AuthGate'
import { CreateFlowPanel } from '@components/CreateFlowPanel'
import { CreatePageHeader } from '@components/CreatePageHeader'
@@ -11,7 +11,6 @@ import { DashboardLayout } from '@components/DashboardLayout'
import { SelectionDropdown } from '@components/SelectionDropdown'
import { IconUsers } from '@components/Sidebar/icons'
import { useToast } from '@components/Toast'
-import { IconTrash } from '@components/icons'
import { Button, CheckboxField, Field, TextInput } from '@components/ui'
import { CONTROL_ROUTES } from '@constants/routes'
import { createMemberFromControlAdmin, getAdminTeams, inviteAdminTeamMember } from '@lib/api'
@@ -330,19 +329,23 @@ export default function CreateMemberPage() {
/>
</td>
<td>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() =>
- updateSelectedTeams(
- selectedTeamIds.filter(teamId => teamId !== team.id)
- )
- }
- disabled={saving}
- aria-label={`Remove ${team.name}`}
- >
- <IconTrash width={16} height={16} />
- </button>
+ <RowActionMenu
+ ariaLabel={`Actions for ${team.name}`}
+ actions={[
+ {
+ key: 'remove',
+ label: 'Remove',
+ danger: true,
+ disabled: saving,
+ onSelect: () =>
+ updateSelectedTeams(
+ selectedTeamIds.filter(
+ teamId => teamId !== team.id
+ )
+ ),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/app/shared-filesystems/[name]/page.tsx b/control-ui/app/shared-filesystems/[name]/page.tsx
index 0c1b85afa..9f8633eb7 100644
--- a/control-ui/app/shared-filesystems/[name]/page.tsx
+++ b/control-ui/app/shared-filesystems/[name]/page.tsx
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useParams, useRouter } from 'next/navigation'
import { DataTable } from '@clerum/frontend-table-system'
import { FileUploadModal } from '@components/FileUploadModal'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { CONTROL_ROUTES } from '@constants/routes'
import { useConfirmDialog } from '../../../components/ConfirmDialog'
import { CreateFlowPanel } from '../../../components/CreateFlowPanel'
@@ -14,7 +15,7 @@ import { SkeletonTableRows } from '../../../components/SkeletonTableRows'
import { TableHeaderRow } from '../../../components/TableHeaderRow'
import type { TableHeaderColumn } from '../../../components/TableHeaderRow/types'
import { useToast } from '../../../components/Toast'
-import { IconPencil, IconRefresh, IconX } from '../../../components/icons'
+import { IconRefresh, IconX } from '../../../components/icons'
import {
type SharedFileSystemResource,
type WfcDirEntry,
@@ -591,47 +592,43 @@ export default function SharedFileSystemDetailsPage() {
<td>{isDir ? '—' : formatBytes(entry.size)}</td>
<td>{formatDate(entry.mtime)}</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions cu-row-actions--wrap">
- {!isDir && (
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- disabled={busy}
- onClick={async () => {
- try {
- await sfsDownload(sfsName, targetPath)
- } catch (e) {
- flashError(e, `Failed to download ${entry.name}`)
- }
- }}
- >
- Download
- </button>
- )}
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => {
- setShowRename({ from: entry.name })
- setRenameDraft(entry.name)
- }}
- disabled={busy}
- aria-label={`Rename ${entry.name}`}
- title={`Rename ${entry.name}`}
- >
- <IconPencil width={16} height={16} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void onDelete(entry)}
- disabled={busy}
- aria-label={`Delete ${entry.name}`}
- title={`Delete ${entry.name}`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${entry.name}`}
+ actions={[
+ ...(!isDir
+ ? [
+ {
+ key: 'download',
+ label: 'Download',
+ disabled: busy,
+ onClick: async () => {
+ try {
+ await sfsDownload(sfsName, targetPath)
+ } catch (e) {
+ flashError(e, `Failed to download ${entry.name}`)
+ }
+ },
+ },
+ ]
+ : []),
+ {
+ key: 'rename',
+ label: 'Rename',
+ disabled: busy,
+ onClick: () => {
+ setShowRename({ from: entry.name })
+ setRenameDraft(entry.name)
+ },
+ },
+ {
+ key: 'delete',
+ label: 'Delete',
+ danger: true,
+ disabled: busy,
+ onClick: () => void onDelete(entry),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/app/shared-filesystems/page.tsx b/control-ui/app/shared-filesystems/page.tsx
index e502aa9ab..884f6a5a7 100644
--- a/control-ui/app/shared-filesystems/page.tsx
+++ b/control-ui/app/shared-filesystems/page.tsx
@@ -2,7 +2,7 @@
import React, { useCallback, useEffect, useRef, useState } from 'react'
import { useRouter } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, RowActionMenu } from '@clerum/frontend-table-system'
import { DashboardLayout } from '@components/DashboardLayout'
import { SectionSearchInput } from '@components/SectionSearchInput'
import { IconSharedFiles } from '@components/Sidebar/icons'
@@ -268,17 +268,23 @@ export default function SharedFileSystemsPage() {
: mountedBy.map(c => `${c.namespace}/${c.name}`).join(', ')}
</td>
<td style={{ textAlign: 'right' }} onClick={e => e.stopPropagation()}>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => setDeleteTarget(name)}
- disabled={isDeleting}
- aria-label={
- isDeleting ? `Deleting ${name}` : `Delete shared filesystem ${name}`
- }
- >
- <IconX width={16} height={16} />
- </button>
+ <RowActionMenu
+ ariaLabel={`Actions for shared filesystem ${name}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onSelect: () => router.push(CONTROL_ROUTES.agentFiles.detail(name)),
+ },
+ {
+ key: 'delete',
+ label: isDeleting ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: isDeleting,
+ onSelect: () => setDeleteTarget(name),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/components/CodexSubscriptionHub/index.tsx b/control-ui/components/CodexSubscriptionHub/index.tsx
index a31ec059b..f44e19271 100644
--- a/control-ui/components/CodexSubscriptionHub/index.tsx
+++ b/control-ui/components/CodexSubscriptionHub/index.tsx
@@ -26,14 +26,14 @@ import {
} from '../CodexSubscriptionConnection/types'
import { useConfirmDialog } from '../ConfirmDialog'
import { LlmProviderIcon } from '../LlmProviderIcon'
-import { LlmSecretsSubTabs } from '../LlmSecretsSubTabs'
+import { RowActionsMenu } from '../RowActionsMenu'
import { SecretsScopeTabs } from '../SecretsScopeTabs'
import { SectionSearchInput } from '../SectionSearchInput'
import { SelectionDropdown } from '../SelectionDropdown'
import { IconKey } from '../Sidebar/icons'
import { TablePanelHeader } from '../TablePanelHeader'
import { useToast } from '../Toast'
-import { IconPencil, IconRefresh, IconX } from '../icons'
+import { IconRefresh, IconX } from '../icons'
function grantLabel(row: CodexSubscriptionConnectionView): string {
return row.displayName || row.connectionKey
@@ -285,8 +285,7 @@ export function CodexSubscriptionHub() {
subtitle="Manage LLM, connector, and recipe credentials in one place."
/>
<div className="cu-card__body cu-card__body--auto cu-secrets-strip">
- <SecretsScopeTabs activeValue="llm" />
- <LlmSecretsSubTabs activeValue="subscriptions" />
+ <SecretsScopeTabs activeValue="llm-subscriptions" />
</div>
<div className="cu-empty">
{capability.error || error || 'ChatGPT subscriptions are disabled.'}
@@ -347,8 +346,7 @@ export function CodexSubscriptionHub() {
/>
<div className="cu-card__body cu-card__body--auto cu-secrets-strip">
- <SecretsScopeTabs activeValue="llm" />
- <LlmSecretsSubTabs activeValue="subscriptions" />
+ <SecretsScopeTabs activeValue="llm-subscriptions" />
</div>
{error && !creating && !editing ? (
@@ -409,30 +407,24 @@ export function CodexSubscriptionHub() {
<td>
<span className={statusTagClass(mapped)}>{statusLabel(mapped)}</span>
</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={() => void openEdit(row)}
- aria-label={`Update ChatGPT subscription ${grantLabel(row)}`}
- >
- <IconPencil width={16} height={16} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void handleRevoke(row)}
- disabled={busyKey === row.connectionKey}
- aria-label={
- busyKey === row.connectionKey
- ? 'Deleting…'
- : `Delete ChatGPT subscription ${grantLabel(row)}`
- }
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <td className="cu-table__cell-actions">
+ <RowActionsMenu
+ ariaLabel={`Actions for ChatGPT subscription ${grantLabel(row)}`}
+ actions={[
+ {
+ key: 'edit',
+ label: 'Edit',
+ onClick: () => void openEdit(row),
+ },
+ {
+ key: 'delete',
+ label: busyKey === row.connectionKey ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: busyKey === row.connectionKey,
+ onClick: () => void handleRevoke(row),
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/components/CommunicationChannelConversations/index.tsx b/control-ui/components/CommunicationChannelConversations/index.tsx
index 49d96bea2..455c8cb0b 100644
--- a/control-ui/components/CommunicationChannelConversations/index.tsx
+++ b/control-ui/components/CommunicationChannelConversations/index.tsx
@@ -1,8 +1,7 @@
'use client'
import Link from 'next/link'
-import { DataTable } from '@clerum/frontend-table-system'
-import { IconTrash } from '@components/icons'
+import { DataTable, RowActionMenu } from '@clerum/frontend-table-system'
import { CONTROL_ROUTES } from '@constants/routes'
import { formatCommunicationChannelConfirmedAt } from '@lib/communicationChannels'
import type {
@@ -111,15 +110,17 @@ export function CommunicationChannelConversationsTable({
<td>{formatCommunicationChannelConfirmedAt(conversation.confirmedAt)}</td>
{onDelete ? (
<td className="cu-table__actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => onDelete(conversation)}
- aria-label={`Delete ${displayName(conversation)}`}
- title={`Delete ${displayName(conversation)}`}
- >
- <IconTrash width={16} height={16} />
- </button>
+ <RowActionMenu
+ ariaLabel={`Actions for ${displayName(conversation)}`}
+ actions={[
+ {
+ key: 'delete',
+ label: 'Delete',
+ danger: true,
+ onSelect: () => onDelete(conversation),
+ },
+ ]}
+ />
</td>
) : null}
</tr>
diff --git a/control-ui/components/ContextTable.tsx b/control-ui/components/ContextTable.tsx
index 6473e2c05..21e91557b 100644
--- a/control-ui/components/ContextTable.tsx
+++ b/control-ui/components/ContextTable.tsx
@@ -1,7 +1,7 @@
'use client'
import React, { useMemo, useState } from 'react'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, TableRow, useTableSort } from '@clerum/frontend-table-system'
import { ContextResource } from '../lib/api'
import { RowActionsMenu } from './RowActionsMenu'
import { SectionSearchInput } from './SectionSearchInput'
@@ -16,6 +16,8 @@ type ContextRef = { name: string }
const CONTEXT_COLUMNS: TableHeaderColumn[] = [
{ key: 'name', label: 'Context Name' },
+ { key: 'identifier', label: 'Identifier' },
+ { key: 'description', label: 'Description' },
{ key: 'servers', label: 'Connectors', width: '7rem' },
{ key: 'actions', label: 'Actions', width: '8rem', align: 'right' },
]
@@ -68,6 +70,30 @@ export function ContextTable({
.includes(normalizedSearch)
})
}, [normalizedSearch, rows])
+ const contextSort = useTableSort<
+ (typeof filteredRows)[number],
+ 'name' | 'identifier' | 'description' | 'servers'
+ >({
+ rows: filteredRows,
+ defaultKey: 'name',
+ accessors: {
+ name: row => row.displayName,
+ identifier: row => row.name,
+ description: row => String(row.item.spec?.description || ''),
+ servers: row => row.mcpServers.length,
+ },
+ identity: row => row.key,
+ })
+ const contextColumns = CONTEXT_COLUMNS.map(column => ({
+ ...column,
+ ...(column.key !== 'actions'
+ ? {
+ activeDirection: contextSort.key === column.key ? contextSort.direction : null,
+ onSort: () =>
+ contextSort.sortBy(column.key as 'name' | 'identifier' | 'description' | 'servers'),
+ }
+ : {}),
+ }))
const isInitialLoad = loading && items.length === 0
@@ -75,13 +101,6 @@ export function ContextTable({
onView({ name })
}
- function handleRowKeyDown(event: React.KeyboardEvent<HTMLTableRowElement>, name: string) {
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault()
- openContext(name)
- }
- }
-
return (
<div className="cu-card cu-card--viewport-fill" style={{ marginBottom: '1.25rem' }}>
<TablePanelHeader
@@ -125,10 +144,10 @@ export function ContextTable({
<div className="eft-table-viewport cu-table-wrap">
<DataTable className="eft-table cu-table cu-table--header-band">
<thead>
- <TableHeaderRow columns={CONTEXT_COLUMNS} />
+ <TableHeaderRow columns={contextColumns} />
</thead>
<tbody>
- <SkeletonTableRows columns={CONTEXT_COLUMNS.length} rows={4} />
+ <SkeletonTableRows columns={contextColumns.length} rows={4} />
</tbody>
</DataTable>
</div>
@@ -140,26 +159,22 @@ export function ContextTable({
<div className="eft-table-viewport cu-table-wrap">
<DataTable className="eft-table cu-table cu-table--header-band">
<thead>
- <TableHeaderRow columns={CONTEXT_COLUMNS} />
+ <TableHeaderRow columns={contextColumns} />
</thead>
<tbody>
- {filteredRows.map(({ key, name, displayName, item, mcpServers }) => (
- <tr
+ {contextSort.sortedRows.map(({ key, name, displayName, item, mcpServers }) => (
+ <TableRow
key={key}
className="cu-table__row cu-table__row--clickable"
- onClick={() => openContext(name)}
- onKeyDown={event => handleRowKeyDown(event, name)}
- tabIndex={0}
+ onNavigate={() => openContext(name)}
aria-label={`Open context ${name}`}
>
<td>
<span className="cu-expandable-row__name">{displayName}</span>
- {displayName !== name ? (
- <div className="cu-table__cell-subtle">{name}</div>
- ) : null}
- <div className="cu-registry-description" title={item.spec?.description || '—'}>
- {item.spec?.description || '—'}
- </div>
+ </td>
+ <td className="cu-table__cell-subtle">{name}</td>
+ <td className="cu-registry-description" title={item.spec?.description || '—'}>
+ {item.spec?.description || '—'}
</td>
<td style={{ color: 'var(--cu-text-muted)', fontVariantNumeric: 'tabular-nums' }}>
{mcpServers.length}
@@ -186,7 +201,7 @@ export function ContextTable({
/>
</div>
</td>
- </tr>
+ </TableRow>
))}
</tbody>
</DataTable>
diff --git a/control-ui/components/ControlAdminsPanel/index.tsx b/control-ui/components/ControlAdminsPanel/index.tsx
index 8074a343f..6b4d9ab45 100644
--- a/control-ui/components/ControlAdminsPanel/index.tsx
+++ b/control-ui/components/ControlAdminsPanel/index.tsx
@@ -5,11 +5,10 @@ import { useRouter } from 'next/navigation'
import { DataTable } from '@clerum/frontend-table-system'
import { useAuth } from '@components/AuthContext'
import { useConfirmDialog } from '@components/ConfirmDialog'
-import { IconUsers } from '@components/Sidebar/icons'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { SkeletonTableRows } from '@components/SkeletonTableRows'
import { useToast } from '@components/Toast'
-import { IconAlertTriangle, IconTrash } from '@components/icons'
-import { Button } from '@components/ui'
+import { IconAlertTriangle } from '@components/icons'
import { CONTROL_ROUTES } from '@constants/routes'
import {
type ControlAdminInvitationItem,
@@ -350,17 +349,21 @@ export function ControlAdminsPanel({
<td>{formatDate(invitation.expiresAt)}</td>
<td>{formatDate(invitation.createdAt)}</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <Button
- type="button"
- variant="danger"
- size="sm"
- disabled={cancellingInvitationId === invitation.id}
- onClick={() => void handleCancelInvitation(invitation)}
- >
- {cancellingInvitationId === invitation.id ? 'Canceling...' : 'Cancel'}
- </Button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for invitation ${invitation.email}`}
+ actions={[
+ {
+ key: 'cancel',
+ label:
+ cancellingInvitationId === invitation.id
+ ? 'Canceling…'
+ : 'Cancel invitation',
+ disabled: cancellingInvitationId === invitation.id,
+ onClick: () => void handleCancelInvitation(invitation),
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
))
@@ -390,9 +393,7 @@ export function ControlAdminsPanel({
const label = admin.email ? `${admin.username} (${admin.email})` : admin.username
const memberCreationUnavailable = !admin.email || admin.passwordPending
const memberAccessDisabled = !admin.memberId && memberCreationUnavailable
- const canCreateMember = !admin.memberId && !memberCreationUnavailable
const memberAccessAction = memberAccessActionLabel(admin)
- const memberAccessLabel = `${memberAccessAction} for admin ${label}`
return (
<tr
key={admin.id}
@@ -445,86 +446,59 @@ export function ControlAdminsPanel({
</td>
<td>{formatDate(admin.lastLoginAt)}</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions cu-row-actions--nowrap">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- disabled={memberAccessDisabled}
- onClick={() => openMemberAccess(admin)}
- aria-label={memberAccessLabel}
- title={memberAccessAction}
- >
- <IconUsers createBadge={canCreateMember} relationshipRole="member" />
- </button>
- {admin.gfsOperatorLink?.status === 'active' ? (
- <button
- type="button"
- className="cu-btn cu-btn--danger"
- disabled={revokingGfsLinkAdminId === admin.id}
- onClick={() => void handleRevokeGfsOperatorLink(admin)}
- aria-label={
- revokingGfsLinkAdminId === admin.id
- ? `Revoking Desktop GFS operator access for ${label}`
- : `Revoke Desktop GFS operator access for ${label}`
- }
- title="Remove only GFS operator authority; keep the admin and passwords"
- >
- {revokingGfsLinkAdminId === admin.id ? 'Revoking...' : 'Revoke GFS'}
- </button>
- ) : null}
- {admin.gfsOperatorLink?.status === 'revoked' ? (
- <button
- type="button"
- className="cu-btn"
- disabled={reactivatingGfsLinkAdminId === admin.id}
- onClick={() => void handleReactivateGfsOperatorLink(admin)}
- aria-label={
- reactivatingGfsLinkAdminId === admin.id
- ? `Reactivating Desktop GFS operator access for ${label}`
- : `Reactivate Desktop GFS operator access for ${label}`
- }
- title="Create a new audited GFS operator-link generation"
- >
- {reactivatingGfsLinkAdminId === admin.id
- ? 'Reactivating...'
- : 'Reactivate GFS'}
- </button>
- ) : null}
- {currentAdmin ? (
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- disabled
- aria-label="Current admin cannot be deleted"
- title="Current admin"
- >
- <IconTrash width={16} height={16} />
- </button>
- ) : (
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- disabled={deletingAdminId === admin.id}
- onClick={() => void handleDeleteAdmin(admin)}
- aria-label={
- deletingAdminId === admin.id
- ? `Deleting admin ${label}`
- : `Delete admin ${label}`
- }
- title={
- admin.passwordPending
+ <RowActionsMenu
+ ariaLabel={`Actions for ${label}`}
+ actions={[
+ {
+ key: 'member-access',
+ label: memberAccessAction,
+ disabled: memberAccessDisabled,
+ onClick: () => openMemberAccess(admin),
+ },
+ ...(admin.gfsOperatorLink?.status === 'active'
+ ? [
+ {
+ key: 'revoke-gfs',
+ label:
+ revokingGfsLinkAdminId === admin.id
+ ? 'Revoking GFS…'
+ : 'Revoke GFS',
+ disabled: revokingGfsLinkAdminId === admin.id,
+ onClick: () => void handleRevokeGfsOperatorLink(admin),
+ danger: true,
+ },
+ ]
+ : []),
+ ...(admin.gfsOperatorLink?.status === 'revoked'
+ ? [
+ {
+ key: 'reactivate-gfs',
+ label:
+ reactivatingGfsLinkAdminId === admin.id
+ ? 'Reactivating GFS…'
+ : 'Reactivate GFS',
+ disabled: reactivatingGfsLinkAdminId === admin.id,
+ onClick: () => void handleReactivateGfsOperatorLink(admin),
+ },
+ ]
+ : []),
+ {
+ key: 'delete',
+ label: currentAdmin
+ ? 'Current admin cannot be deleted'
+ : admin.passwordPending
? deletingAdminId === admin.id
- ? 'Canceling setup...'
+ ? 'Canceling setup…'
: 'Cancel admin setup'
: deletingAdminId === admin.id
- ? 'Deleting...'
- : 'Delete admin'
- }
- >
- <IconTrash width={16} height={16} />
- </button>
- )}
- </div>
+ ? 'Deleting…'
+ : 'Delete admin',
+ disabled: currentAdmin || deletingAdminId === admin.id,
+ onClick: () => void handleDeleteAdmin(admin),
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/components/GovernedTraceSurface/GovernedEventExplorer/index.tsx b/control-ui/components/GovernedTraceSurface/GovernedEventExplorer/index.tsx
index 1ebd424b0..5405644dc 100644
--- a/control-ui/components/GovernedTraceSurface/GovernedEventExplorer/index.tsx
+++ b/control-ui/components/GovernedTraceSurface/GovernedEventExplorer/index.tsx
@@ -54,6 +54,7 @@ export function GovernedEventExplorer({ family, subtitle, title }: GovernedEvent
? {
activeDirection: order === 'latest' ? ('desc' as const) : ('asc' as const),
onSort: () => setOrder(current => (current === 'latest' ? 'oldest' : 'latest')),
+ sortLabel: column.label,
}
: {}),
label: definition ? (
diff --git a/control-ui/components/GovernedTraceSurface/SessionReplay/index.tsx b/control-ui/components/GovernedTraceSurface/SessionReplay/index.tsx
index c0ae00cd0..9e60b9363 100644
--- a/control-ui/components/GovernedTraceSurface/SessionReplay/index.tsx
+++ b/control-ui/components/GovernedTraceSurface/SessionReplay/index.tsx
@@ -56,6 +56,7 @@ export function SessionReplay({
? {
activeDirection: order === 'latest' ? ('desc' as const) : ('asc' as const),
onSort: () => setOrder(current => (current === 'latest' ? 'oldest' : 'latest')),
+ sortLabel: column.label,
}
: {}),
label: (
diff --git a/control-ui/components/GuardrailHooksTable.tsx b/control-ui/components/GuardrailHooksTable.tsx
index 9cbdee14c..03a6d637a 100644
--- a/control-ui/components/GuardrailHooksTable.tsx
+++ b/control-ui/components/GuardrailHooksTable.tsx
@@ -3,6 +3,7 @@
import React, { useMemo, useState } from 'react'
import { useRouter } from 'next/navigation'
import { DataTable } from '@clerum/frontend-table-system'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { CONTROL_ROUTES } from '@constants/routes'
import type { LlmHookStatus } from '../lib/api'
import type {
@@ -16,7 +17,7 @@ import { SkeletonTableRows } from './SkeletonTableRows'
import { TableHeaderRow } from './TableHeaderRow'
import type { TableHeaderColumn } from './TableHeaderRow/types'
import { TablePanelHeader } from './TablePanelHeader'
-import { IconChevronRight, IconRefresh, IconX } from './icons'
+import { IconRefresh } from './icons'
const HOOK_COLUMNS: TableHeaderColumn[] = [
{ key: 'name', label: 'Name' },
@@ -25,7 +26,6 @@ const HOOK_COLUMNS: TableHeaderColumn[] = [
{ key: 'failMode', label: 'Fail mode' },
{ key: 'status', label: 'Status' },
{ key: 'actions', align: 'right', ariaLabel: 'Actions' },
- { key: 'navigation', align: 'right', ariaLabel: 'Navigation' },
]
function StatusBadge({ status }: { status?: LlmHookStatus }) {
@@ -240,31 +240,23 @@ export function GuardrailHooksTable({
onClick={event => event.stopPropagation()}
onKeyDown={event => event.stopPropagation()}
>
- <div className="cu-table-actions">
- {onUninstall ? (
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void onUninstall({ name })}
- disabled={uninstallingKey === key}
- aria-label={
- uninstallingKey === key
- ? 'Uninstalling...'
- : `Uninstall guardrail ${name}`
- }
- title={
- uninstallingKey === key
- ? 'Uninstalling...'
- : `Uninstall guardrail ${name}`
- }
- >
- <IconX width={16} height={16} />
- </button>
- ) : null}
- </div>
- </td>
- <td className="cu-installed-plugin__navigation" aria-hidden="true">
- <IconChevronRight width={18} height={18} />
+ <RowActionsMenu
+ ariaLabel={`Actions for guardrail ${name}`}
+ actions={[
+ { key: 'view', label: 'View details', onClick: () => openDetail(name) },
+ ...(onUninstall
+ ? [
+ {
+ key: 'uninstall',
+ label: uninstallingKey === key ? 'Uninstalling…' : 'Uninstall',
+ danger: true,
+ disabled: uninstallingKey === key,
+ onClick: () => void onUninstall({ name }),
+ },
+ ]
+ : []),
+ ]}
+ />
</td>
</tr>
)
diff --git a/control-ui/components/HostAccessTab/index.tsx b/control-ui/components/HostAccessTab/index.tsx
index a5d264107..acfdd76a8 100644
--- a/control-ui/components/HostAccessTab/index.tsx
+++ b/control-ui/components/HostAccessTab/index.tsx
@@ -4,10 +4,10 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useRouter } from 'next/navigation'
import { DataTable } from '@clerum/frontend-table-system'
import { useConfirmDialog } from '@components/ConfirmDialog'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { SelectionModal } from '@components/SelectionModal'
import { TabBar } from '@components/TabBar'
import { useToast } from '@components/Toast'
-import { IconX } from '@components/icons'
import { CONTROL_ROUTES } from '@constants/routes'
import {
getAdminTeamAgents,
@@ -348,18 +348,24 @@ export function HostAccessTab({ hostName }: HostAccessTabProps) {
</button>
</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void revokeUserAccess(user.id)}
- disabled={busy}
- title="Revoke"
- aria-label="Revoke member access"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${user.displayName || user.name || user.email}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () =>
+ router.push(CONTROL_ROUTES.usersAndTeams.user(user.id)),
+ },
+ {
+ key: 'revoke',
+ label: 'Revoke access',
+ onClick: () => void revokeUserAccess(user.id),
+ disabled: busy,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
))
@@ -383,18 +389,23 @@ export function HostAccessTab({ hostName }: HostAccessTabProps) {
</button>
</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void revokeTeamAccess(team.id)}
- disabled={busy}
- title="Revoke"
- aria-label="Revoke team access"
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${team.name}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () => router.push(CONTROL_ROUTES.usersAndTeams.team(team.id)),
+ },
+ {
+ key: 'revoke',
+ label: 'Revoke access',
+ onClick: () => void revokeTeamAccess(team.id),
+ disabled: busy,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
))
diff --git a/control-ui/components/HostEnvTable.tsx b/control-ui/components/HostEnvTable.tsx
index 5f7c04c1d..b5e1a7f72 100644
--- a/control-ui/components/HostEnvTable.tsx
+++ b/control-ui/components/HostEnvTable.tsx
@@ -10,8 +10,9 @@ import {
putHostEnv,
} from '../lib/api'
import { useConfirmDialog } from './ConfirmDialog'
+import { RowActionsMenu } from './RowActionsMenu'
import { useToast } from './Toast'
-import { IconPencil, IconRefresh, IconX } from './icons'
+import { IconRefresh, IconX } from './icons'
import { Button, CheckboxField, Field, TextInput } from './ui'
const RESERVED_PROVIDER_KEYS = new Set([
@@ -292,25 +293,23 @@ export function HostEnvTable({ hostRef }: { hostRef: string }) {
<td>{entry.secret ? 'Secret' : 'Non-secret'}</td>
<td>{entry.updatedAt ? new Date(entry.updatedAt).toLocaleString() : '—'}</td>
<td>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={() => openEdit(entry)}
- aria-label={`Edit ${entry.key}`}
- title={`Edit ${entry.key}`}
- >
- <IconPencil width={16} height={16} />
- </button>{' '}
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void confirmDelete(entry.key)}
- disabled={deletingKey === entry.key}
- aria-label={`Delete ${entry.key}`}
- title={`Delete ${entry.key}`}
- >
- <IconX width={16} height={16} />
- </button>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${entry.key}`}
+ actions={[
+ {
+ key: 'edit',
+ label: 'Edit',
+ onClick: () => openEdit(entry),
+ },
+ {
+ key: 'delete',
+ label: 'Delete',
+ onClick: () => void confirmDelete(entry.key),
+ disabled: deletingKey === entry.key,
+ danger: true,
+ },
+ ]}
+ />
</td>
</tr>
))
diff --git a/control-ui/components/HostGuardrailsSection/index.tsx b/control-ui/components/HostGuardrailsSection/index.tsx
index 09f3e7f21..1c806d605 100644
--- a/control-ui/components/HostGuardrailsSection/index.tsx
+++ b/control-ui/components/HostGuardrailsSection/index.tsx
@@ -4,8 +4,8 @@ import React, { useCallback, useMemo, useRef, useState } from 'react'
import { useRouter } from 'next/navigation'
import { DataTable } from '@clerum/frontend-table-system'
import { useConfirmDialog } from '@components/ConfirmDialog'
+import { RowActionsMenu } from '@components/RowActionsMenu'
import { useToast } from '@components/Toast'
-import { IconX } from '@components/icons'
import { GUARDRAIL_ENTRY_TYPE } from '@constants/marketplaceEntryTypes'
import { CONTROL_ROUTES } from '@constants/routes'
import { GUARDRAIL_PHASES, GUARDRAIL_PHASE_LABELS } from './constants'
@@ -137,20 +137,26 @@ export function HostGuardrailsSection({
</td>
<td>{GUARDRAIL_PHASE_LABELS[row.phase]}</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions">
- {canWrite ? (
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => void removeHook(row)}
- disabled={disabled}
- title="Remove"
- aria-label={`Remove hook ${row.ref.id} from ${GUARDRAIL_PHASE_LABELS[row.phase]}`}
- >
- <IconX width={16} height={16} />
- </button>
- ) : null}
- </div>
+ {canWrite ? (
+ <RowActionsMenu
+ ariaLabel={`Actions for ${row.ref.id}`}
+ actions={[
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () =>
+ router.push(CONTROL_ROUTES.guardrails.detail(row.ref.id)),
+ },
+ {
+ key: 'remove',
+ label: `Remove from ${GUARDRAIL_PHASE_LABELS[row.phase]}`,
+ onClick: () => void removeHook(row),
+ disabled,
+ danger: true,
+ },
+ ]}
+ />
+ ) : null}
</td>
</tr>
))
diff --git a/control-ui/components/HostTable.tsx b/control-ui/components/HostTable.tsx
index 0d535e387..af00c5687 100644
--- a/control-ui/components/HostTable.tsx
+++ b/control-ui/components/HostTable.tsx
@@ -1,7 +1,7 @@
'use client'
import React, { useMemo, useState } from 'react'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, TableRow, useTableSort } from '@clerum/frontend-table-system'
import { getProviderLabel } from '../lib/llm'
import type { HostItem, HostRef } from './HostTable.types'
import { LlmProviderIcon } from './LlmProviderIcon'
@@ -17,6 +17,7 @@ import { IconRefresh } from './icons'
const HOST_COLUMNS: TableHeaderColumn[] = [
{ key: 'name', label: 'Name' },
+ { key: 'identifier', label: 'Identifier' },
{ key: 'context', label: 'Connectors', width: '14%' },
{ key: 'providers', label: 'Providers', minWidth: '8rem' },
{ key: 'actions', width: '3.5rem', align: 'right', ariaLabel: 'Actions' },
@@ -163,6 +164,30 @@ export function HostTable({
.includes(normalizedSearch)
})
}, [normalizedSearch, rows])
+ const hostSort = useTableSort<
+ (typeof filteredRows)[number],
+ 'name' | 'identifier' | 'context' | 'providers'
+ >({
+ rows: filteredRows,
+ defaultKey: 'name',
+ accessors: {
+ name: row => row.displayName,
+ identifier: row => row.name,
+ context: row => contextsByRef?.[String(row.item.spec?.contextRef || '').trim()]?.length ?? 0,
+ providers: row => collectProviderIds(row.item.spec || {}).join(','),
+ },
+ identity: row => row.key,
+ })
+ const hostColumns = HOST_COLUMNS.map(column => ({
+ ...column,
+ ...(column.key !== 'actions'
+ ? {
+ activeDirection: hostSort.key === column.key ? hostSort.direction : null,
+ onSort: () =>
+ hostSort.sortBy(column.key as 'name' | 'identifier' | 'context' | 'providers'),
+ }
+ : {}),
+ }))
const isInitialLoad = loading && items.length === 0
@@ -209,10 +234,10 @@ export function HostTable({
<div className="eft-table-viewport cu-table-wrap">
<DataTable className="eft-table cu-table cu-table--header-band">
<thead>
- <TableHeaderRow columns={HOST_COLUMNS} />
+ <TableHeaderRow columns={hostColumns} />
</thead>
<tbody>
- <SkeletonTableRows columns={4} rows={4} />
+ <SkeletonTableRows columns={hostColumns.length} rows={4} />
</tbody>
</DataTable>
</div>
@@ -220,11 +245,11 @@ export function HostTable({
<div className="eft-table-viewport cu-table-wrap">
<DataTable className="eft-table cu-table cu-table--header-band">
<thead>
- <TableHeaderRow columns={HOST_COLUMNS} />
+ <TableHeaderRow columns={hostColumns} />
</thead>
<tbody>
<TableEmptyRow
- colSpan={HOST_COLUMNS.length}
+ colSpan={hostColumns.length}
message={normalizedSearch ? 'No agents match this search.' : 'No agents found.'}
action={
normalizedSearch
@@ -239,10 +264,10 @@ export function HostTable({
<div className="eft-table-viewport cu-table-wrap">
<DataTable className="eft-table cu-table cu-table--header-band">
<thead>
- <TableHeaderRow columns={HOST_COLUMNS} />
+ <TableHeaderRow columns={hostColumns} />
</thead>
<tbody>
- {filteredRows.map(({ key, namespace, name, displayName, item }) => {
+ {hostSort.sortedRows.map(({ key, namespace, name, displayName, item }) => {
const rawContext = String(item.spec?.contextRef || '').trim()
const contextRef = rawContext || '-'
const contextServers = contextsByRef?.[rawContext]
@@ -251,25 +276,16 @@ export function HostTable({
const providers = collectProviderIds(item.spec || {})
const openAgent = () => onOpen({ namespace, name })
return (
- <tr
+ <TableRow
key={key}
className="cu-table__row cu-table__row--clickable"
- onClick={openAgent}
- onKeyDown={e => {
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault()
- openAgent()
- }
- }}
- tabIndex={0}
+ onNavigate={openAgent}
aria-label={`Open agent ${name}`}
>
<td>
<span className="cu-expandable-row__name">{displayName}</span>
- {displayName !== name ? (
- <div className="cu-table__cell-subtle">{name}</div>
- ) : null}
</td>
+ <td className="cu-table__cell-subtle">{name}</td>
<td>
{contextClickable ? (
<ContextMcpHoverCard
@@ -328,7 +344,7 @@ export function HostTable({
]}
/>
</td>
- </tr>
+ </TableRow>
)
})}
</tbody>
diff --git a/control-ui/components/LlmDiscoveryPanel/index.tsx b/control-ui/components/LlmDiscoveryPanel/index.tsx
index 19c4d4ef5..e52d9e4c2 100644
--- a/control-ui/components/LlmDiscoveryPanel/index.tsx
+++ b/control-ui/components/LlmDiscoveryPanel/index.tsx
@@ -9,7 +9,7 @@ import { TableHeaderRow } from '@components/TableHeaderRow'
import type { TableHeaderColumn } from '@components/TableHeaderRow/types'
import { TablePanelHeader } from '@components/TablePanelHeader'
import { useToast } from '@components/Toast'
-import { IconChevronRight, IconRefresh } from '@components/icons'
+import { IconRefresh } from '@components/icons'
import {
type LlmAllowedModel,
type LlmDiscoveryStatus,
@@ -28,15 +28,7 @@ const CONFIGMAP_DEFERRED_WARNING =
type ProviderModelGroup = [provider: string, models: LlmAllowedModel[]]
-type ProviderGroupRowProps = {
- colSpan: number
- expanded: boolean
- models: LlmAllowedModel[]
- onToggle: () => void
- provider: string
-}
-
-type ReviewSortKey = 'model' | 'vendor' | 'contextWindow'
+type ReviewSortKey = 'provider' | 'model' | 'vendor' | 'contextWindow'
// Numeric columns lead descending (largest context window first); text columns
// lead ascending (alphabetical). Picking a different column resets to that
@@ -44,12 +36,17 @@ type ReviewSortKey = 'model' | 'vendor' | 'contextWindow'
const REVIEW_SORT_DEFAULT_DIR: Record<ReviewSortKey, SortDirection> = {
contextWindow: 'desc',
model: 'asc',
+ provider: 'asc',
vendor: 'asc',
}
function compareReviewByKey(key: ReviewSortKey) {
return (a: LlmAllowedModel, b: LlmAllowedModel): number => {
switch (key) {
+ case 'provider':
+ return getProviderDisplayLabel(a.provider).localeCompare(
+ getProviderDisplayLabel(b.provider)
+ )
case 'model':
return a.model.localeCompare(b.model)
case 'vendor':
@@ -79,70 +76,23 @@ function groupByProvider(
sortKey: ReviewSortKey | null,
sortDir: SortDirection
): ProviderModelGroup[] {
- const groups = new Map<string, LlmAllowedModel[]>()
- for (const model of models) {
- const group = groups.get(model.provider)
- if (group) group.push(model)
- else groups.set(model.provider, [model])
- }
+ const rows = [...models]
if (sortKey) {
const direction = sortDir === 'asc' ? 1 : -1
const byKey = compareReviewByKey(sortKey)
- for (const group of groups.values()) {
- group.sort((a, b) => {
- if (sortKey === 'contextWindow') {
- const nullOrder = compareNullsLast(a.context_window_tokens, b.context_window_tokens)
- if (nullOrder !== null) return nullOrder
- }
- const diff = byKey(a, b) * direction
- if (diff !== 0) return diff
- return compareReviewModel(a, b)
- })
- }
+ rows.sort((a, b) => {
+ if (sortKey === 'contextWindow') {
+ const nullOrder = compareNullsLast(a.context_window_tokens, b.context_window_tokens)
+ if (nullOrder !== null) return nullOrder
+ }
+ const diff = byKey(a, b) * direction
+ if (diff !== 0) return diff
+ return compareReviewModel(a, b)
+ })
+ } else {
+ rows.sort(compareReviewModel)
}
- return Array.from(groups.entries()).sort(([left], [right]) =>
- getProviderDisplayLabel(left).localeCompare(getProviderDisplayLabel(right))
- )
-}
-
-function ProviderGroupRow({
- colSpan,
- expanded,
- models,
- onToggle,
- provider,
-}: ProviderGroupRowProps) {
- const providerLabel = getProviderDisplayLabel(provider)
- return (
- <tr className="cu-llm-model-group__row">
- <td colSpan={colSpan}>
- <button
- type="button"
- className="cu-llm-model-group__toggle"
- onClick={onToggle}
- aria-expanded={expanded}
- aria-label={`${expanded ? 'Collapse' : 'Expand'} ${providerLabel} review models`}
- >
- <span className="cu-llm-model-group__chevron" aria-hidden="true">
- <IconChevronRight
- className={expanded ? 'is-expanded' : undefined}
- width={18}
- height={18}
- />
- </span>
- <LlmProviderIcon provider={provider} label={providerLabel} />
- <span className="cu-llm-model-group__provider">{providerLabel}</span>
- <span className="cu-llm-model-group__count">
- {models.length} model{models.length === 1 ? '' : 's'}
- </span>
- <span className="cu-llm-model-group__summary">Awaiting operator enablement</span>
- <span className="cu-llm-model-group__action" aria-hidden="true">
- {expanded ? 'Hide models' : 'Show models'}
- </span>
- </button>
- </td>
- </tr>
- )
+ return [['_all', rows]]
}
export function LlmDiscoveryPanel({
@@ -160,7 +110,6 @@ export function LlmDiscoveryPanel({
const [pendingId, setPendingId] = useState<string | null>(null)
const [bulkEnabling, setBulkEnabling] = useState(false)
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set())
- const [expandedProviders, setExpandedProviders] = useState<Set<string>>(new Set())
const [sortKey, setSortKey] = useState<ReviewSortKey | null>(null)
const [sortDir, setSortDir] = useState<SortDirection>('asc')
const statusRequestGeneration = useRef(0)
@@ -226,15 +175,6 @@ export function LlmDiscoveryPanel({
})
}
- function toggleProvider(provider: string) {
- setExpandedProviders(previous => {
- const next = new Set(previous)
- if (next.has(provider)) next.delete(provider)
- else next.add(provider)
- return next
- })
- }
-
async function handleRefresh() {
const generation = ++statusRequestGeneration.current
setStatusLoading(true)
@@ -375,6 +315,7 @@ export function LlmDiscoveryPanel({
/>
),
},
+ { key: 'provider', label: renderSortHeader('provider', 'Provider'), minWidth: '9rem' },
{ key: 'model', label: renderSortHeader('model', 'Model'), minWidth: '12rem' },
{ key: 'vendor', label: renderSortHeader('vendor', 'Vendor'), width: '10rem' },
{
@@ -490,46 +431,45 @@ export function LlmDiscoveryPanel({
<TableHeaderRow columns={reviewColumns} />
</thead>
{reviewGroups.map(([provider, models]) => {
- const expanded = expandedProviders.has(provider)
return (
<tbody key={provider} className="cu-llm-model-group">
- <ProviderGroupRow
- colSpan={reviewColumns.length}
- expanded={expanded}
- models={models}
- onToggle={() => toggleProvider(provider)}
- provider={provider}
- />
- {expanded
- ? models.map(model => (
- <tr key={model.id} className="cu-table__row cu-llm-model-row">
- <td>
- <input
- type="checkbox"
- checked={selectedIds.has(model.id)}
- onChange={() => toggleRow(model.id)}
- disabled={bulkEnabling}
- aria-label={`Select ${modelLabel(model)}`}
- />
- </td>
- <td className="cu-px-model">{model.model}</td>
- <td>{model.vendor || '—'}</td>
- <td className="cu-px-num">
- {formatContextWindow(model.context_window_tokens)}
- </td>
- <td className="cu-px-actions">
- <button
- type="button"
- className="cu-btn cu-btn--primary cu-btn--sm"
- onClick={() => void handleEnable(model)}
- disabled={pendingId === model.id || bulkEnabling}
- >
- {pendingId === model.id ? 'Enabling…' : 'Enable'}
- </button>
- </td>
- </tr>
- ))
- : null}
+ {models.map(model => (
+ <tr key={model.id} className="cu-table__row cu-llm-model-row">
+ <td>
+ <input
+ type="checkbox"
+ checked={selectedIds.has(model.id)}
+ onChange={() => toggleRow(model.id)}
+ disabled={bulkEnabling}
+ aria-label={`Select ${modelLabel(model)}`}
+ />
+ </td>
+ <td>
+ <span className="cu-inline-icon-label">
+ <LlmProviderIcon
+ provider={model.provider}
+ label={getProviderDisplayLabel(model.provider)}
+ />
+ {getProviderDisplayLabel(model.provider)}
+ </span>
+ </td>
+ <td className="cu-px-model">{model.model}</td>
+ <td>{model.vendor || '—'}</td>
+ <td className="cu-px-num">
+ {formatContextWindow(model.context_window_tokens)}
+ </td>
+ <td className="cu-px-actions">
+ <button
+ type="button"
+ className="cu-btn cu-btn--primary cu-btn--sm"
+ onClick={() => void handleEnable(model)}
+ disabled={pendingId === model.id || bulkEnabling}
+ >
+ {pendingId === model.id ? 'Enabling…' : 'Enable'}
+ </button>
+ </td>
+ </tr>
+ ))}
</tbody>
)
})}
diff --git a/control-ui/components/LlmModelTable.tsx b/control-ui/components/LlmModelTable.tsx
index 9ca2f95f8..3f98bb0c9 100644
--- a/control-ui/components/LlmModelTable.tsx
+++ b/control-ui/components/LlmModelTable.tsx
@@ -17,10 +17,10 @@ import { SkeletonTableRows } from './SkeletonTableRows'
import { TableHeaderRow } from './TableHeaderRow'
import type { TableHeaderColumn } from './TableHeaderRow/types'
import { TablePanelHeader } from './TablePanelHeader'
-import { IconChevronRight, IconRefresh } from './icons'
+import { IconRefresh } from './icons'
import { SelectInput } from './ui'
-type ModelSortKey = 'model' | 'vendor' | 'displayName' | 'contextWindow'
+type ModelSortKey = 'provider' | 'model' | 'vendor' | 'displayName' | 'contextWindow'
// Natural default direction per column: numeric columns read best descending
// (largest context window first); text columns read best ascending.
@@ -28,12 +28,17 @@ const MODEL_SORT_DEFAULT_DIR: Record<ModelSortKey, SortDirection> = {
contextWindow: 'desc',
displayName: 'asc',
model: 'asc',
+ provider: 'asc',
vendor: 'asc',
}
function compareModelByKey(key: ModelSortKey) {
return (a: LlmAllowedModel, b: LlmAllowedModel): number => {
switch (key) {
+ case 'provider':
+ return getProviderDisplayLabel(catalogGroupKey(a.provider)).localeCompare(
+ getProviderDisplayLabel(catalogGroupKey(b.provider))
+ )
case 'model':
return a.model.localeCompare(b.model)
case 'vendor':
@@ -103,7 +108,6 @@ export function LlmModelTable({
const [providerFilter, setProviderFilter] = useState<string>(ALL_PROVIDERS)
const [enabledFilter, setEnabledFilter] = useState<EnabledFilter>('all')
const [sourceFilter, setSourceFilter] = useState<SourceFilter>('all')
- const [expandedProviders, setExpandedProviders] = useState<Set<string>>(new Set())
const [sortKey, setSortKey] = useState<ModelSortKey | null>(null)
const [sortDir, setSortDir] = useState<SortDirection>('asc')
const normalizedSearch = searchQuery.trim().toLowerCase()
@@ -184,7 +188,7 @@ export function LlmModelTable({
if (group) group.push(model)
else groups.set(family, [model])
}
- const collapsed: Array<[string, DisplayModel[]]> = []
+ const collapsed: DisplayModel[] = []
for (const [family, rows] of groups.entries()) {
const display = collapseFamilyRows(family, rows)
if (sortKey) {
@@ -200,25 +204,12 @@ export function LlmModelTable({
return compareModel(a, b)
})
}
- collapsed.push([family, display])
+ collapsed.push(...display)
}
- return collapsed.sort(([left], [right]) =>
- getProviderDisplayLabel(left).localeCompare(getProviderDisplayLabel(right))
- )
+ if (!sortKey) collapsed.sort(compareModel)
+ return [['_all', collapsed] as [string, DisplayModel[]]]
}, [filteredItems, sortDir, sortKey])
- // Search should reveal results without forcing the operator to open every
- // matching provider first. Keep those groups open after search is cleared so
- // the result the operator was working with does not suddenly disappear.
- useEffect(() => {
- if (!normalizedSearch) return
- setExpandedProviders(current => {
- const next = new Set(current)
- for (const [provider] of groupedItems) next.add(provider)
- return next
- })
- }, [groupedItems, normalizedSearch])
-
const hasActiveFilter =
Boolean(normalizedSearch) ||
providerFilter !== ALL_PROVIDERS ||
@@ -229,17 +220,6 @@ 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 renderSortHeader = (key: ModelSortKey, label: string) => (
@@ -256,6 +236,7 @@ export function LlmModelTable({
)
const modelColumns: TableHeaderColumn[] = [
+ { key: 'provider', label: renderSortHeader('provider', 'Provider'), minWidth: '9rem' },
{ key: 'model', label: renderSortHeader('model', 'Model'), minWidth: '15rem' },
{ key: 'credential', label: 'Credential', width: '11rem' },
{ key: 'vendor', label: renderSortHeader('vendor', 'Vendor'), width: '10rem' },
@@ -373,150 +354,112 @@ export function LlmModelTable({
<TableHeaderRow columns={modelColumns} />
</thead>
{groupedItems.map(([provider, models]) => {
- const providerLabel = getProviderDisplayLabel(provider)
- const providerModels = collapseFamilyRows(
- provider,
- items.filter(model => catalogGroupKey(model.provider) === provider)
- )
- const enabledCount = providerModels.filter(model => model.enabled).length
- const staleCount = providerModels.filter(model => model.stale).length
- const hasFilteredModels = models.length !== providerModels.length
- const expanded = expandedProviders.has(provider)
-
return (
<tbody key={provider} className="cu-llm-model-group">
- <tr className="cu-llm-model-group__row">
- <td colSpan={modelColumns.length}>
- <button
- type="button"
- className="cu-llm-model-group__toggle"
- onClick={() => toggleProvider(provider)}
- aria-expanded={expanded}
- aria-label={`${expanded ? 'Collapse' : 'Expand'} ${providerLabel} models`}
- >
- <span className="cu-llm-model-group__chevron" aria-hidden="true">
- <IconChevronRight
- className={expanded ? 'is-expanded' : undefined}
- width={18}
- height={18}
+ {models.map((model: DisplayModel) => (
+ <tr key={model.id} className="cu-table__row cu-llm-model-row">
+ <td>
+ <span className="cu-inline-icon-label">
+ <LlmProviderIcon
+ provider={catalogGroupKey(model.provider)}
+ label={getProviderDisplayLabel(catalogGroupKey(model.provider))}
/>
+ {getProviderDisplayLabel(catalogGroupKey(model.provider))}
</span>
- <LlmProviderIcon provider={provider} label={providerLabel} />
- <span className="cu-llm-model-group__provider">{providerLabel}</span>
- <span className="cu-llm-model-group__count">
- {providerModels.length} model{providerModels.length === 1 ? '' : 's'}
+ </td>
+ <td className="cu-px-model">
+ <span className="cu-px-model-content">
+ {model.model}
+ {isUnpricedAllowedModel(model, unpricedKeys) ? (
+ <MissingPriceWarning provider={model.provider} model={model.model} />
+ ) : null}
</span>
- <span className="cu-llm-model-group__summary">
- {enabledCount} enabled
- {staleCount > 0 ? ` · ${staleCount} stale` : ''}
- {hasFilteredModels ? ` · ${models.length} matching` : ''}
+ </td>
+ <td>{model.credentialLabel || '—'}</td>
+ <td>{model.vendor || '—'}</td>
+ <td>{model.display_name || '—'}</td>
+ <td className="cu-px-num">
+ {formatContextWindow(model.context_window_tokens)}
+ </td>
+ <td>
+ <span
+ className={
+ model.enabled
+ ? 'cu-px-badge cu-px-badge--on'
+ : 'cu-px-badge cu-px-badge--off'
+ }
+ >
+ {model.enabled ? 'Enabled' : 'Disabled'}
</span>
- <span className="cu-llm-model-group__action" aria-hidden="true">
- {expanded ? 'Hide models' : 'Show models'}
+ </td>
+ <td>
+ <span
+ className={
+ model.source === 'discovery'
+ ? 'cu-px-badge cu-px-badge--info'
+ : 'cu-px-badge cu-px-badge--off'
+ }
+ >
+ {model.source === 'discovery' ? 'Discovered' : 'Manual'}
</span>
- </button>
- </td>
- </tr>
- {expanded
- ? models.map((model: DisplayModel) => (
- <tr key={model.id} className="cu-table__row cu-llm-model-row">
- <td className="cu-px-model">
- <span className="cu-px-model-content">
- {model.model}
- {isUnpricedAllowedModel(model, unpricedKeys) ? (
- <MissingPriceWarning
- provider={model.provider}
- model={model.model}
- />
- ) : null}
- </span>
- </td>
- <td>{model.credentialLabel || '—'}</td>
- <td>{model.vendor || '—'}</td>
- <td>{model.display_name || '—'}</td>
- <td className="cu-px-num">
- {formatContextWindow(model.context_window_tokens)}
- </td>
- <td>
- <span
- className={
- model.enabled
- ? 'cu-px-badge cu-px-badge--on'
- : 'cu-px-badge cu-px-badge--off'
- }
- >
- {model.enabled ? 'Enabled' : 'Disabled'}
- </span>
- </td>
- <td>
- <span
- className={
- model.source === 'discovery'
- ? 'cu-px-badge cu-px-badge--info'
- : 'cu-px-badge cu-px-badge--off'
- }
- >
- {model.source === 'discovery' ? 'Discovered' : 'Manual'}
- </span>
- </td>
- <td className="cu-px-actions">
- <RowActionsMenu
- ariaLabel={`Actions for model ${model.provider}/${model.model}`}
- horizontalTrigger
- actions={
- model.apiKeyRow && model.subscriptionRow
- ? [
- {
- key: 'edit-api-key',
- label: 'Edit API key',
- onClick: () => onEdit(model.apiKeyRow!.id),
- },
- {
- key: 'edit-subscription',
- label: 'Edit subscription',
- onClick: () => onEdit(model.subscriptionRow!.id),
- },
- {
- key: 'delete-api-key',
- label:
- deletingId === model.apiKeyRow.id
- ? 'Deleting…'
- : 'Delete API key',
- danger: true,
- disabled: deletingId === model.apiKeyRow.id,
- onClick: () => void onDelete(model.apiKeyRow!),
- },
- {
- key: 'delete-subscription',
- label:
- deletingId === model.subscriptionRow.id
- ? 'Deleting…'
- : 'Delete subscription',
- danger: true,
- disabled: deletingId === model.subscriptionRow.id,
- onClick: () => void onDelete(model.subscriptionRow!),
- },
- ]
- : [
- {
- key: 'edit',
- label: 'Edit',
- onClick: () => onEdit(model.id),
- },
- {
- key: 'delete',
- label: deletingId === model.id ? 'Deleting…' : 'Delete',
- danger: true,
- disabled: deletingId === model.id,
- onClick: () => void onDelete(model),
- },
- ]
- }
- />
- </td>
- </tr>
- ))
- : null}
+ </td>
+ <td className="cu-px-actions">
+ <RowActionsMenu
+ ariaLabel={`Actions for model ${model.provider}/${model.model}`}
+ horizontalTrigger
+ actions={
+ model.apiKeyRow && model.subscriptionRow
+ ? [
+ {
+ key: 'edit-api-key',
+ label: 'Edit API key',
+ onClick: () => onEdit(model.apiKeyRow!.id),
+ },
+ {
+ key: 'edit-subscription',
+ label: 'Edit subscription',
+ onClick: () => onEdit(model.subscriptionRow!.id),
+ },
+ {
+ key: 'delete-api-key',
+ label:
+ deletingId === model.apiKeyRow.id
+ ? 'Deleting…'
+ : 'Delete API key',
+ danger: true,
+ disabled: deletingId === model.apiKeyRow.id,
+ onClick: () => void onDelete(model.apiKeyRow!),
+ },
+ {
+ key: 'delete-subscription',
+ label:
+ deletingId === model.subscriptionRow.id
+ ? 'Deleting…'
+ : 'Delete subscription',
+ danger: true,
+ disabled: deletingId === model.subscriptionRow.id,
+ onClick: () => void onDelete(model.subscriptionRow!),
+ },
+ ]
+ : [
+ {
+ key: 'edit',
+ label: 'Edit',
+ onClick: () => onEdit(model.id),
+ },
+ {
+ key: 'delete',
+ label: deletingId === model.id ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: deletingId === model.id,
+ onClick: () => void onDelete(model),
+ },
+ ]
+ }
+ />
+ </td>
+ </tr>
+ ))}
</tbody>
)
})}
diff --git a/control-ui/components/LlmSecretsSubTabs/index.tsx b/control-ui/components/LlmSecretsSubTabs/index.tsx
deleted file mode 100644
index f84e590d5..000000000
--- a/control-ui/components/LlmSecretsSubTabs/index.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-'use client'
-
-import { CONTROL_ROUTES } from '@constants/routes'
-import { TabBar } from '../TabBar'
-
-export type LlmSecretsSubTab = 'api-key' | 'subscriptions'
-
-export function LlmSecretsSubTabs({ activeValue }: { activeValue: LlmSecretsSubTab }) {
- return (
- <TabBar<LlmSecretsSubTab>
- ariaLabel="LLM secret kinds"
- activeValue={activeValue}
- className="cu-tabs--flush"
- options={[
- { value: 'api-key', href: CONTROL_ROUTES.secrets.llm, label: 'API-KEY' },
- {
- value: 'subscriptions',
- href: CONTROL_ROUTES.secrets.llmSubscriptions,
- label: 'Subscriptions',
- },
- ]}
- />
- )
-}
diff --git a/control-ui/components/McpServerTable.tsx b/control-ui/components/McpServerTable.tsx
index 164d15cc6..ca808a14c 100644
--- a/control-ui/components/McpServerTable.tsx
+++ b/control-ui/components/McpServerTable.tsx
@@ -1,8 +1,7 @@
'use client'
-import React, { Fragment, useMemo, useState } from 'react'
+import React, { useMemo, useState } from 'react'
import { DataTable } from '@clerum/frontend-table-system'
-import { copyTextToClipboard } from '../lib/clipboard'
import type {
ConnectorAccessSummary,
ConnectorContextBinding,
@@ -17,15 +16,29 @@ import { SkeletonTableRows } from './SkeletonTableRows'
import { TableHeaderRow } from './TableHeaderRow'
import type { TableHeaderColumn } from './TableHeaderRow/types'
import { TablePanelHeader } from './TablePanelHeader'
-import { IconChevronRight, IconCopy, IconRefresh, IconX } from './icons'
+import { IconRefresh, IconX } from './icons'
const ENABLED_TOOLTIP = 'Enabled controls whether this server is available to contexts and agents.'
-type ConnectorSortKey = 'name' | 'enabled' | 'status'
+type ConnectorSortKey =
+ | 'name'
+ | 'description'
+ | 'transport'
+ | 'endpoint'
+ | 'image'
+ | 'access'
+ | 'managed'
+ | 'enabled'
+ | 'status'
type SortDirection = 'asc' | 'desc'
const CONNECTOR_COLUMNS: TableHeaderColumn[] = [
- { key: 'expand', ariaLabel: 'Expand connector' },
{ key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'transport', label: 'Transport' },
+ { key: 'endpoint', label: 'Endpoint' },
+ { key: 'image', label: 'Image' },
+ { key: 'access', label: 'Access' },
+ { key: 'managed', label: 'Managed' },
{ key: 'enabled', label: 'Enabled', title: ENABLED_TOOLTIP },
{ key: 'status', label: 'Status' },
{ key: 'actions', align: 'right', ariaLabel: 'Actions' },
@@ -89,175 +102,10 @@ function StatusBadge({ status }: { status?: McpServerStatus }) {
)
}
-function middleEllipsis(value: string, maxLength = 26): string {
- if (value.length <= maxLength) return value
- const visibleLength = maxLength - 3
- const startLength = Math.ceil(visibleLength * 0.56)
- return `${value.slice(0, startLength)}...${value.slice(-(visibleLength - startLength))}`
-}
-
-function AccessSummary({ summary }: { summary?: ConnectorAccessSummary }) {
- const groups = [
- { key: 'agents', label: 'Agents', items: summary?.agents ?? [] },
- { key: 'teams', label: 'Teams', items: summary?.teams ?? [] },
- { key: 'users', label: 'Users', items: summary?.users ?? [] },
- ]
-
- return (
- <>
- {groups.map(group => (
- <section
- className="cu-registry-context-access__group"
- data-kind={group.key}
- key={group.key}
- >
- <div className="cu-registry-context-access__heading">
- <h4>{group.label}</h4>
- <span>{group.items.length}</span>
- </div>
- {group.items.length > 0 ? (
- <ul className="cu-registry-context-access__list">
- {group.items.map(principal => (
- <li key={principal.id} title={principal.label}>
- <span>{principal.label}</span>
- </li>
- ))}
- </ul>
- ) : (
- <p className="cu-muted">No {group.label.toLowerCase()} have access.</p>
- )}
- </section>
- ))}
- </>
- )
-}
-
-function ConnectorContexts({
- connectorName,
- namespace,
- contexts,
- busy,
- onOpenContext,
- onAdd,
- onRemove,
-}: {
- connectorName: string
- namespace: string
- contexts: ConnectorContextBinding[]
- busy: boolean
- onOpenContext?: (contextName: string) => void
- onAdd?: () => void
- onRemove?: McpServerTableProps['onRemoveFromContext']
-}) {
- const linkedContexts = contexts.map(context => ({ name: context.name, removable: true }))
-
- return (
- <section className="cu-registry-context-access__group" data-kind="contexts">
- <div className="cu-registry-context-access__heading">
- <h4>Contexts</h4>
- <span>{linkedContexts.length}</span>
- </div>
- {linkedContexts.length > 0 ? (
- <ul className="cu-registry-context-access__list cu-connector-context-access__list">
- {linkedContexts.map(context => (
- <li key={context.name}>
- <span className="cu-connector-context-access__name" title={context.name}>
- {onOpenContext ? (
- <button
- type="button"
- className="cu-link"
- onClick={() => onOpenContext(context.name)}
- >
- {context.name}
- </button>
- ) : (
- context.name
- )}
- </span>
- {context.removable && onRemove ? (
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon cu-connector-context-access__remove"
- disabled={busy}
- aria-label={`Remove connector ${connectorName} from context ${context.name}`}
- title={`Remove from ${context.name}`}
- onClick={() => void onRemove({ namespace, name: connectorName }, context.name)}
- >
- <IconX width={14} height={14} />
- </button>
- ) : null}
- </li>
- ))}
- </ul>
- ) : (
- <p className="cu-muted">No contexts linked.</p>
- )}
- {onAdd ? (
- <button
- type="button"
- className="cu-btn cu-btn--sm cu-connector-context-access__add"
- disabled={busy}
- onClick={onAdd}
- >
- Add contexts
- </button>
- ) : null}
- </section>
- )
-}
-
-function CopyableValue({
- copyKey,
- copyLabel,
- value,
- copied,
- onCopy,
- href,
-}: {
- copyKey: string
- copyLabel: string
- value: string
- copied: boolean
- onCopy: (copyKey: string, value: string) => void
- href?: string
-}) {
- if (!value) return <span className="cu-muted">—</span>
-
- return (
- <span className="cu-connector-copyable-value">
- {href ? (
- <a
- className="cu-link cu-expandable-field__code"
- href={href}
- target="_blank"
- rel="noreferrer"
- title={value}
- >
- {middleEllipsis(value)}
- </a>
- ) : (
- <span className="cu-expandable-field__code" title={value}>
- {middleEllipsis(value)}
- </span>
- )}
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--ghost cu-connector-copyable-value__button"
- onClick={() => onCopy(copyKey, value)}
- aria-label={copied ? `${copyLabel} copied` : `Copy ${copyLabel}`}
- title={copied ? 'Copied' : `Copy ${copyLabel}`}
- >
- <IconCopy width={14} height={14} />
- </button>
- </span>
- )
-}
-
export function McpServerTable({
items,
accessByConnectorKey,
contexts = [],
- onOpenContext,
onAddToContexts,
onRemoveFromContext,
updatingContextMembershipKey,
@@ -274,10 +122,9 @@ export function McpServerTable({
const [searchQuery, setSearchQuery] = useState('')
const [sortKey, setSortKey] = useState<ConnectorSortKey | null>(null)
const [sortDirection, setSortDirection] = useState<SortDirection>('asc')
- const [expandedKeys, setExpandedKeys] = useState<Set<string>>(new Set())
const [serverKeyAddingContexts, setServerKeyAddingContexts] = useState<string | null>(null)
+ const [serverKeyViewingAccess, setServerKeyViewingAccess] = useState<string | null>(null)
const [selectedContextNamesToAdd, setSelectedContextNamesToAdd] = useState<string[]>([])
- const [copiedValueKey, setCopiedValueKey] = useState<string | null>(null)
const rows = useMemo(
() =>
items.map(item => {
@@ -324,14 +171,42 @@ export function McpServerTable({
const direction = sortDirection === 'asc' ? 1 : -1
return [...matchingRows].sort((left, right) => {
+ const leftAccess = accessByConnectorKey?.[left.key]
+ const rightAccess = accessByConnectorKey?.[right.key]
+ const accessCount = (access?: ConnectorAccessSummary) =>
+ (access?.agents.length ?? 0) + (access?.teams.length ?? 0) + (access?.users.length ?? 0)
const comparison =
sortKey === 'name'
? left.name.localeCompare(right.name, undefined, { sensitivity: 'base' })
- : sortKey === 'enabled'
- ? Number((left.item.spec?.enabled ?? true) === true) -
- Number((right.item.spec?.enabled ?? true) === true)
- : getStatusLabel(left.item.status).localeCompare(getStatusLabel(right.item.status))
- return comparison * direction
+ : sortKey === 'description'
+ ? (left.item.spec?.description ?? '').localeCompare(
+ right.item.spec?.description ?? '',
+ undefined,
+ { sensitivity: 'base' }
+ )
+ : sortKey === 'transport'
+ ? (left.item.spec?.transport?.type ?? '').localeCompare(
+ right.item.spec?.transport?.type ?? ''
+ )
+ : sortKey === 'endpoint'
+ ? (left.item.spec?.transport?.url ?? left.item.spec?.image ?? '').localeCompare(
+ right.item.spec?.transport?.url ?? right.item.spec?.image ?? ''
+ )
+ : sortKey === 'image'
+ ? (left.item.spec?.image ?? '').localeCompare(right.item.spec?.image ?? '')
+ : sortKey === 'access'
+ ? accessCount(leftAccess) - accessCount(rightAccess)
+ : sortKey === 'managed'
+ ? Number((left.item.spec?.managed ?? true) === true) -
+ Number((right.item.spec?.managed ?? true) === true)
+ : sortKey === 'enabled'
+ ? Number((left.item.spec?.enabled ?? true) === true) -
+ Number((right.item.spec?.enabled ?? true) === true)
+ : getStatusLabel(left.item.status).localeCompare(
+ getStatusLabel(right.item.status)
+ )
+ if (comparison !== 0) return comparison * direction
+ return left.key.localeCompare(right.key)
})
}, [accessByConnectorKey, normalizedSearch, rows, sortDirection, sortKey])
@@ -341,15 +216,6 @@ export function McpServerTable({
return () => clearInterval(id)
}, [onRefresh])
- function toggleExpanded(key: string) {
- setExpandedKeys(current => {
- const next = new Set(current)
- if (next.has(key)) next.delete(key)
- else next.add(key)
- return next
- })
- }
-
function toggleSort(key: ConnectorSortKey) {
if (sortKey === key) {
setSortDirection(direction => (direction === 'asc' ? 'desc' : 'asc'))
@@ -377,8 +243,11 @@ export function McpServerTable({
}
const columns = CONNECTOR_COLUMNS.map(column => {
- if (column.key === 'name' || column.key === 'enabled' || column.key === 'status') {
- return { ...column, label: renderSortHeader(column.key, column.label as string) }
+ if (column.key !== 'actions') {
+ return {
+ ...column,
+ label: renderSortHeader(column.key as ConnectorSortKey, column.label as string),
+ }
}
return column
})
@@ -398,10 +267,6 @@ export function McpServerTable({
setServerKeyAddingContexts(null)
}
- async function copyValue(copyKey: string, value: string) {
- if (await copyTextToClipboard(value)) setCopiedValueKey(copyKey)
- }
-
const isInitialLoad = loading && items.length === 0
return (
@@ -493,146 +358,123 @@ export function McpServerTable({
<tbody>
{filteredRows.map(({ key, namespace, name, item }) => {
const spec = item.spec || {}
- const expanded = expandedKeys.has(key)
const assignedContexts = contextsForConnector(name)
const contextMembershipBusy = updatingContextMembershipKey === key
+ const access = accessByConnectorKey?.[key]
return (
- <Fragment key={key}>
- <tr
- className="cu-table__row cu-table__row--clickable cu-expandable-row"
- role="button"
- onClick={() => toggleExpanded(key)}
- onKeyDown={event => {
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault()
- toggleExpanded(key)
- }
- }}
- tabIndex={0}
- aria-expanded={expanded}
- aria-controls={`connector-details-${key}`}
- aria-label={`${expanded ? 'Collapse' : 'Expand'} connector ${name}`}
+ <tr
+ className={onEdit ? 'cu-table__row cu-table__row--clickable' : undefined}
+ key={key}
+ onClick={onEdit ? () => onEdit({ namespace, name }) : undefined}
+ onKeyDown={
+ onEdit
+ ? event => {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault()
+ onEdit({ namespace, name })
+ }
+ }
+ : undefined
+ }
+ tabIndex={onEdit ? 0 : undefined}
+ >
+ <td>{name}</td>
+ <td>
+ <span className="cu-cell-truncate" title={spec.description}>
+ {spec.description || '—'}
+ </span>
+ </td>
+ <td>
+ <TransportBadge type={spec.transport?.type} />
+ </td>
+ <td className="cu-code-text">
+ <span className="cu-cell-truncate" title={spec.transport?.url || spec.image}>
+ {spec.transport?.url || spec.image || '—'}
+ </span>
+ </td>
+ <td className="cu-code-text">
+ <span className="cu-cell-truncate" title={spec.image || undefined}>
+ {spec.image || '—'}
+ </span>
+ </td>
+ <td>
+ {assignedContexts.length} context{assignedContexts.length === 1 ? '' : 's'} ·{' '}
+ {(access?.agents.length ?? 0) +
+ (access?.teams.length ?? 0) +
+ (access?.users.length ?? 0)}{' '}
+ principal
+ {(access?.agents.length ?? 0) +
+ (access?.teams.length ?? 0) +
+ (access?.users.length ?? 0) ===
+ 1
+ ? ''
+ : 's'}
+ </td>
+ <td>
+ <BoolBadge value={spec.managed} trueLabel="Yes" falseLabel="No" />
+ </td>
+ <td>
+ <BoolBadge value={spec.enabled} trueLabel="Yes" falseLabel="No" />
+ </td>
+ <td>
+ <StatusBadge status={item.status} />
+ </td>
+ <td
+ className="cu-table__cell-actions"
+ onClick={event => event.stopPropagation()}
+ onKeyDown={event => event.stopPropagation()}
>
- <td className="cu-expandable-row__chevron" aria-hidden="true">
- <IconChevronRight
- className={expanded ? 'is-expanded' : undefined}
- width={18}
- height={18}
- />
- </td>
- <td>
- <span className="cu-expandable-row__name">{name}</span>
- <div
- className="cu-registry-description"
- title={spec.description || 'No description provided.'}
- >
- {spec.description || 'No description provided.'}
- </div>
- </td>
- <td>
- <BoolBadge value={spec.enabled} trueLabel="Yes" falseLabel="No" />
- </td>
- <td>
- <StatusBadge status={item.status} />
- </td>
- <td
- className="cu-table__cell-actions"
- onClick={event => event.stopPropagation()}
- onKeyDown={event => event.stopPropagation()}
- >
- <div className="cu-table-actions">
- <RowActionsMenu
- ariaLabel={`Actions for connector ${name}`}
- horizontalTrigger
- actions={[
- ...(onEdit
- ? [
- {
- key: 'edit',
- label: 'Edit',
- onClick: () => onEdit({ namespace, name }),
- },
- ]
- : []),
- ...(onDelete
- ? [
- {
- key: 'remove',
- label: deletingKey === key ? 'Deleting…' : 'Delete',
- danger: true,
- disabled: deletingKey === key,
- onClick: () => void onDelete({ namespace, name }),
- },
- ]
- : []),
- ]}
- />
- </div>
- </td>
- </tr>
- {expanded ? (
- <tr id={`connector-details-${key}`} className="cu-expandable-detail-row">
- <td colSpan={CONNECTOR_COLUMNS.length}>
- <div className="cu-expandable-detail cu-connector-detail">
- <div className="cu-expandable-detail__fields">
- <p className="cu-expandable-detail__description">
- {spec.description || 'No description provided.'}
- </p>
- <div className="cu-connector-detail__metadata">
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">URL</span>
- <CopyableValue
- copyKey={`${key}/url`}
- copyLabel="URL"
- value={spec.transport?.url || ''}
- href={spec.transport?.url}
- copied={copiedValueKey === `${key}/url`}
- onCopy={(copyKey, value) => void copyValue(copyKey, value)}
- />
- </div>
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Image</span>
- <CopyableValue
- copyKey={`${key}/image`}
- copyLabel="image URL"
- value={spec.image || ''}
- copied={copiedValueKey === `${key}/image`}
- onCopy={(copyKey, value) => void copyValue(copyKey, value)}
- />
- </div>
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Transport</span>
- <TransportBadge type={spec.transport?.type} />
- </div>
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Managed</span>
- <BoolBadge value={spec.managed} trueLabel="Yes" falseLabel="No" />
- </div>
- </div>
- <div className="cu-expandable-field cu-expandable-field--wide cu-connector-access-field">
- <span className="cu-expandable-field__label">Access</span>
- <section
- className="cu-registry-context-access cu-connector-access-grid"
- aria-label="Connector access"
- >
- <ConnectorContexts
- connectorName={name}
- namespace={namespace}
- contexts={assignedContexts}
- busy={contextMembershipBusy}
- onOpenContext={onOpenContext}
- onAdd={onAddToContexts ? () => openAddContexts(key) : undefined}
- onRemove={onRemoveFromContext}
- />
- <AccessSummary summary={accessByConnectorKey?.[key]} />
- </section>
- </div>
- </div>
- </div>
- </td>
- </tr>
- ) : null}
- </Fragment>
+ <RowActionsMenu
+ ariaLabel={`Actions for connector ${name}`}
+ actions={[
+ ...(onEdit
+ ? [
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () => onEdit({ namespace, name }),
+ },
+ ]
+ : []),
+ ...(onAddToContexts
+ ? [
+ {
+ key: 'add-contexts',
+ label: 'Add to contexts',
+ disabled: contextMembershipBusy,
+ onClick: () => openAddContexts(key),
+ },
+ ]
+ : []),
+ {
+ key: 'view-access',
+ label: 'View access details',
+ onClick: () => setServerKeyViewingAccess(key),
+ },
+ ...(onRemoveFromContext
+ ? assignedContexts.map(context => ({
+ key: `remove-context-${context.name}`,
+ label: `Remove from ${context.name}`,
+ disabled: contextMembershipBusy,
+ onClick: () =>
+ void onRemoveFromContext({ name, namespace }, context.name),
+ }))
+ : []),
+ ...(onDelete
+ ? [
+ {
+ key: 'remove',
+ label: deletingKey === key ? 'Deleting…' : 'Delete',
+ danger: true,
+ disabled: deletingKey === key,
+ onClick: () => void onDelete({ namespace, name }),
+ },
+ ]
+ : []),
+ ]}
+ />
+ </td>
+ </tr>
)
})}
</tbody>
@@ -731,6 +573,82 @@ export function McpServerTable({
)
})()
: null}
+ {serverKeyViewingAccess
+ ? (() => {
+ const row = rows.find(candidate => candidate.key === serverKeyViewingAccess)
+ if (!row) return null
+ const access = accessByConnectorKey?.[row.key]
+ const linkedContexts = contextsForConnector(row.name)
+ const groups = [
+ { key: 'contexts', label: 'Contexts', items: linkedContexts.map(item => item.name) },
+ {
+ key: 'agents',
+ label: 'Agents',
+ items: (access?.agents ?? []).map(item => item.label),
+ },
+ {
+ key: 'teams',
+ label: 'Teams',
+ items: (access?.teams ?? []).map(item => item.label),
+ },
+ {
+ key: 'users',
+ label: 'Users',
+ items: (access?.users ?? []).map(item => item.label),
+ },
+ ]
+ return (
+ <div
+ className="cu-modal-overlay"
+ role="presentation"
+ onMouseDown={event => {
+ if (event.target === event.currentTarget) setServerKeyViewingAccess(null)
+ }}
+ >
+ <section
+ aria-labelledby="connector-access-title"
+ aria-modal="true"
+ className="cu-modal-panel"
+ role="dialog"
+ >
+ <div className="cu-modal-panel__header">
+ <h3 className="cu-modal-panel__title" id="connector-access-title">
+ Access for {row.name}
+ </h3>
+ </div>
+ <div className="cu-registry-context-access cu-connector-access-grid">
+ {groups.map(group => (
+ <section className="cu-registry-context-access__group" key={group.key}>
+ <div className="cu-registry-context-access__heading">
+ <h4>{group.label}</h4>
+ <span>{group.items.length}</span>
+ </div>
+ {group.items.length ? (
+ <ul className="cu-registry-context-access__list">
+ {group.items.map(item => (
+ <li key={item}>{item}</li>
+ ))}
+ </ul>
+ ) : (
+ <p className="cu-muted">No {group.label.toLowerCase()} linked.</p>
+ )}
+ </section>
+ ))}
+ </div>
+ <div className="cu-modal-panel__actions">
+ <button
+ className="cu-btn cu-btn--primary"
+ onClick={() => setServerKeyViewingAccess(null)}
+ type="button"
+ >
+ Close
+ </button>
+ </div>
+ </section>
+ </div>
+ )
+ })()
+ : null}
</div>
)
}
diff --git a/control-ui/components/ProfileAdminHome.tsx b/control-ui/components/ProfileAdminHome.tsx
index b73d58a6b..3c4805a32 100644
--- a/control-ui/components/ProfileAdminHome.tsx
+++ b/control-ui/components/ProfileAdminHome.tsx
@@ -24,6 +24,7 @@ import { formatTeamNames, getSoloMemberTeamsForUser } from '../lib/profileAdminD
import { formatTeamRole } from '../lib/teamRoles'
import { ControlAdminsPanel } from './ControlAdminsPanel'
import type { ProfileAdminHomeProps, ProfileAdminTab } from './ProfileAdminHome.types'
+import { RowActionsMenu } from './RowActionsMenu'
import { SectionSearchInput } from './SectionSearchInput'
import { IconShield, IconUsers } from './Sidebar/icons'
import { SkeletonTableRows } from './SkeletonTableRows'
@@ -675,21 +676,28 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
>
{teamContextCounts[team.id] ?? 0}
</td>
- <td style={{ textAlign: 'right' }}>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={event => {
- event.stopPropagation()
- setDeleteDialogError('')
- setTeamToDelete(team)
- }}
- onKeyDown={event => event.stopPropagation()}
- disabled={busy && !loaded}
- aria-label={`Delete team ${team.name}`}
- >
- <IconX width={16} height={16} />
- </button>
+ <td className="cu-table__cell-actions">
+ <RowActionsMenu
+ ariaLabel={`Actions for team ${team.name}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'view',
+ label: 'View team details',
+ onClick: () => openTeam(team),
+ },
+ {
+ key: 'delete',
+ label: 'Delete',
+ danger: true,
+ disabled: busy && !loaded,
+ onClick: () => {
+ setDeleteDialogError('')
+ setTeamToDelete(team)
+ },
+ },
+ ]}
+ />
</td>
</tr>
))}
@@ -770,35 +778,38 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
{new Date(invitation.created_at).toLocaleString()}
</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions cu-row-actions--wrap">
- <button
- type="button"
- className="cu-btn cu-btn--sm"
- onClick={() => void resendPendingInvitation(invitation)}
- disabled={
- (busy && !loaded) || resendingInvitationId === invitation.id
- }
- >
- {resendingInvitationId === invitation.id
- ? 'Sending…'
- : 'Resend'}
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--ghost-danger cu-btn--sm"
- onClick={() => {
- setDeleteDialogError('')
- setInvitationToCancel(invitation)
- }}
- disabled={
- (busy && !loaded) || revokingInvitationId === invitation.id
- }
- >
- {revokingInvitationId === invitation.id
- ? 'Cancelling…'
- : 'Cancel'}
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for invitation to ${invitation.email}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'resend',
+ label:
+ resendingInvitationId === invitation.id
+ ? 'Sending…'
+ : 'Resend',
+ disabled:
+ (busy && !loaded) ||
+ resendingInvitationId === invitation.id,
+ onClick: () => void resendPendingInvitation(invitation),
+ },
+ {
+ key: 'cancel',
+ label:
+ revokingInvitationId === invitation.id
+ ? 'Cancelling…'
+ : 'Cancel',
+ danger: true,
+ disabled:
+ (busy && !loaded) ||
+ revokingInvitationId === invitation.id,
+ onClick: () => {
+ setDeleteDialogError('')
+ setInvitationToCancel(invitation)
+ },
+ },
+ ]}
+ />
</td>
</tr>
))}
@@ -899,59 +910,47 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
</button>
</td>
<td className="cu-table__cell-actions">
- <div className="cu-row-actions cu-row-actions--nowrap">
- {user.passwordPendingFromAcceptedInvitation ? (
- <button
- type="button"
- className="cu-btn cu-btn--sm cu-nowrap"
- onClick={event => {
- event.stopPropagation()
- void resendPasswordSetupInvitation(user)
- }}
- onKeyDown={event => event.stopPropagation()}
- disabled={
- (busy && !loaded) ||
- resendingPasswordSetupUserId === user.id
- }
- >
- {resendingPasswordSetupUserId === user.id
- ? 'Sending…'
- : 'Resend invite'}
- </button>
- ) : null}
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
- onClick={event => {
- event.stopPropagation()
- openAdminAccessForUser(user)
- }}
- onKeyDown={event => event.stopPropagation()}
- disabled={busy && !loaded}
- aria-label={`${
- user.controlAdminId ? 'View admin' : 'Create admin'
- } for member ${user.name || user.email}`}
- title={user.controlAdminId ? 'View admin' : 'Create admin'}
- >
- <IconShield
- createBadge={!user.controlAdminId}
- relationshipRole="admin"
- />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={event => {
- event.stopPropagation()
- void openDeleteUserDialog(user)
- }}
- onKeyDown={event => event.stopPropagation()}
- disabled={busy && !loaded}
- aria-label={`Delete member ${user.name || user.email}`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <RowActionsMenu
+ ariaLabel={`Actions for member ${user.name || user.email}`}
+ horizontalTrigger
+ actions={[
+ {
+ key: 'view',
+ label: 'View member details',
+ onClick: () => openUser(user),
+ },
+ ...(user.passwordPendingFromAcceptedInvitation
+ ? [
+ {
+ key: 'resend',
+ label:
+ resendingPasswordSetupUserId === user.id
+ ? 'Sending…'
+ : 'Resend invite',
+ disabled:
+ (busy && !loaded) ||
+ resendingPasswordSetupUserId === user.id,
+ onClick: () => void resendPasswordSetupInvitation(user),
+ },
+ ]
+ : []),
+ {
+ key: 'admin',
+ label: user.controlAdminId
+ ? 'View administrator access'
+ : 'Create administrator access',
+ disabled: busy && !loaded,
+ onClick: () => openAdminAccessForUser(user),
+ },
+ {
+ key: 'delete',
+ label: 'Delete member',
+ danger: true,
+ disabled: busy && !loaded,
+ onClick: () => void openDeleteUserDialog(user),
+ },
+ ]}
+ />
</td>
</tr>
))}
diff --git a/control-ui/components/PublisherView/OwnedEntries.tsx b/control-ui/components/PublisherView/OwnedEntries.tsx
index 719e2a20c..72ffab9f7 100644
--- a/control-ui/components/PublisherView/OwnedEntries.tsx
+++ b/control-ui/components/PublisherView/OwnedEntries.tsx
@@ -1,9 +1,8 @@
'use client'
-import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { useRouter, useSearchParams } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
-import { IconChevronRight } from '@components/icons'
+import { DataTable, TableRow } from '@clerum/frontend-table-system'
import { MARKETPLACE_ENTRY_TYPE_LABELS } from '@constants/marketplaceEntryTypes'
import { CONTROL_ROUTES } from '@constants/routes'
import {
@@ -19,7 +18,6 @@ import { TableHeaderRow } from '../TableHeaderRow'
import type { TableHeaderColumn } from '../TableHeaderRow/types'
import { TablePanelHeader } from '../TablePanelHeader'
import { useToast } from '../Toast'
-import { Button } from '../ui'
import { GrantAccessModal } from './GrantAccessModal'
import { RetryBanner } from './RetryBanner'
@@ -29,7 +27,6 @@ type GrantTarget = {
}
const COLUMNS: TableHeaderColumn[] = [
- { key: 'expand', ariaLabel: 'Expand versions' },
{ key: 'name', label: 'Name' },
{ key: 'type', label: 'Type' },
{ key: 'version', label: 'Version' },
@@ -56,24 +53,6 @@ function compareVersionDesc(a: string, b: string): number {
return b.localeCompare(a)
}
-// Collapse same-named entries into one group. `latest` leads the collapsed row;
-// `versions` holds every version (latest first) so the expanded row can offer
-// the previous ones individually.
-function groupByName(
- entries: OwnedRegistryEntry[]
-): { latest: OwnedRegistryEntry; versions: OwnedRegistryEntry[] }[] {
- const byName = new Map<string, OwnedRegistryEntry[]>()
- for (const e of entries) {
- const list = byName.get(e.name)
- if (list) list.push(e)
- else byName.set(e.name, [e])
- }
- return Array.from(byName.values()).map(list => {
- const versions = [...list].sort((a, b) => compareVersionDesc(a.version, b.version))
- return { latest: versions[0], versions }
- })
-}
-
// The registry's owned-entries payload carries `serverMode` but not `entry_type`
// (mcp-servers always have a serverMode; recipes don't). Prefer an explicit
// entry_type if the registry ever starts sending it, else infer from serverMode.
@@ -117,7 +96,6 @@ export function OwnedEntries({
const [loading, setLoading] = useState(true)
const [error, setError] = useState(false)
const [grantTarget, setGrantTarget] = useState<GrantTarget | null>(null)
- const [expandedNames, setExpandedNames] = useState<Set<string>>(new Set())
// Installed cluster resources (same source the catalog uses to show
// "Installed"). Best-effort: a catalog fetch failure just means no entry is
// marked installed, never an error on the entries list.
@@ -172,15 +150,6 @@ export function OwnedEntries({
[confirm, showToast, load]
)
- const toggleExpanded = useCallback((name: string) => {
- setExpandedNames(prev => {
- const next = new Set(prev)
- if (next.has(name)) next.delete(name)
- else next.add(name)
- return next
- })
- }, [])
-
function isInstalled(e: OwnedRegistryEntry): boolean {
const kind = ownedEntryKind(e)
const key = `${e.name}@${e.version}`
@@ -191,25 +160,6 @@ export function OwnedEntries({
return installedRecipeKeys.has(key)
}
- function renderInstall(e: OwnedRegistryEntry) {
- return isInstalled(e) ? (
- <Button type="button" variant="ghost" size="sm" disabled>
- Installed
- </Button>
- ) : (
- <Button
- type="button"
- variant="primary"
- size="sm"
- onClick={() =>
- router.push(CONTROL_ROUTES.marketplace.install({ entry: e.name, version: e.version }))
- }
- >
- Install
- </Button>
- )
- }
-
// `?type=` narrows the list to a single entry kind — this is how "Add hook"
// on an agent lands here showing only guardrail hooks. An unrecognised value
// filters nothing, so a stale or hand-edited link degrades to the full list
@@ -225,9 +175,15 @@ export function OwnedEntries({
// cross-org sharing does to this org's private entries, so a `?type=` filter
// that happens to hide them all must not make it disappear.
const hasPrivateEntries = entries.some(e => e.visibility === 'private')
- // Collapse same-named entries into one row (latest leads); expanding a row
- // reveals the previous versions, each individually installable.
- const grouped = groupByName(visibleEntries)
+ const sortedEntries = useMemo(
+ () =>
+ [...visibleEntries].sort(
+ (left, right) =>
+ left.name.localeCompare(right.name, undefined, { sensitivity: 'base' }) ||
+ compareVersionDesc(left.version, right.version)
+ ),
+ [visibleEntries]
+ )
return (
<section>
@@ -274,12 +230,50 @@ export function OwnedEntries({
<TableHeaderRow columns={COLUMNS} />
</thead>
<tbody>
- {grouped.map(({ latest: e, versions }) => {
+ {sortedEntries.map(e => {
const isPrivate = e.visibility === 'private'
- const isGranting = grantTarget?.entryName === e.name
- const expanded = expandedNames.has(e.name)
- const hasPrevious = versions.length > 1
+ const detailRoute = CONTROL_ROUTES.marketplace.entry(e.name, e.version)
const rowActions: RowActionMenuItem[] = [
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () => router.push(detailRoute),
+ },
+ ...(isInstalled(e)
+ ? [
+ {
+ key: 'installed',
+ label: 'Installed',
+ disabled: true,
+ onClick: () => undefined,
+ },
+ ]
+ : [
+ {
+ key: 'install',
+ label: 'Install',
+ onClick: () =>
+ router.push(
+ CONTROL_ROUTES.marketplace.install({
+ entry: e.name,
+ version: e.version,
+ })
+ ),
+ },
+ ]),
+ ...(isPrivate && canShare
+ ? [
+ {
+ key: 'share',
+ label: 'Share access',
+ onClick: () =>
+ setGrantTarget({
+ entryName: e.name,
+ opener: document.activeElement as HTMLButtonElement,
+ }),
+ },
+ ]
+ : []),
{
key: 'edit',
label: 'Edit',
@@ -294,113 +288,27 @@ export function OwnedEntries({
},
]
return (
- <Fragment key={e.name}>
- <tr
- className={
- hasPrevious
- ? 'cu-table__row cu-table__row--clickable cu-expandable-row'
- : undefined
- }
- onClick={hasPrevious ? () => toggleExpanded(e.name) : undefined}
- onKeyDown={
- hasPrevious
- ? event => {
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault()
- toggleExpanded(e.name)
- }
- }
- : undefined
- }
- tabIndex={hasPrevious ? 0 : undefined}
- aria-expanded={hasPrevious ? expanded : undefined}
- >
- <td className="cu-expandable-row__chevron" aria-hidden="true">
- {hasPrevious ? (
- <IconChevronRight
- className={expanded ? 'is-expanded' : undefined}
- width={18}
- height={18}
- />
- ) : null}
- </td>
- <td>
- <code>{e.name}</code>
- </td>
- <td>{entryTypeLabel(e)}</td>
- <td>
- {e.version}
- {hasPrevious ? (
- <span className="cu-muted"> +{versions.length - 1} more</span>
- ) : null}
- </td>
- <td>
- <span
- className={`cu-registry-chip cu-registry-chip--visibility-${e.visibility}`}
- >
- {e.visibility}
- </span>
- </td>
- <td>{e.status}</td>
- <td
- onClick={hasPrevious ? event => event.stopPropagation() : undefined}
- onKeyDown={hasPrevious ? event => event.stopPropagation() : undefined}
+ <TableRow key={entryKey(e)} onNavigate={() => router.push(detailRoute)}>
+ <td>
+ <code>{e.name}</code>
+ </td>
+ <td>{entryTypeLabel(e)}</td>
+ <td>{e.version}</td>
+ <td>
+ <span
+ className={`cu-registry-chip cu-registry-chip--visibility-${e.visibility}`}
>
- <div className="cu-table-actions">
- {renderInstall(e)}
- {isPrivate && canShare ? (
- <Button
- type="button"
- variant="ghost"
- size="sm"
- aria-haspopup="dialog"
- aria-expanded={isGranting}
- onClick={event =>
- setGrantTarget({
- entryName: e.name,
- opener: event.currentTarget,
- })
- }
- >
- Share access
- </Button>
- ) : null}
- <RowActionsMenu
- ariaLabel={`Actions for ${e.name} v${e.version}`}
- actions={rowActions}
- />
- </div>
- </td>
- </tr>
- {expanded && hasPrevious ? (
- <tr className="cu-expandable-detail-row">
- <td colSpan={COLUMNS.length}>
- <div className="cu-expandable-detail">
- <div className="cu-marketplace-versions">
- <span className="cu-expandable-field__label">
- Previous versions
- </span>
- {versions.slice(1).map(v => (
- <div
- key={entryKey(v)}
- className="cu-table-actions"
- style={{ justifyContent: 'space-between' }}
- >
- <code className="cu-code-text">
- {v.version}
- {isInstalled(v) ? (
- <span className="cu-muted"> · installed</span>
- ) : null}
- </code>
- {renderInstall(v)}
- </div>
- ))}
- </div>
- </div>
- </td>
- </tr>
- ) : null}
- </Fragment>
+ {e.visibility}
+ </span>
+ </td>
+ <td>{e.status}</td>
+ <td className="cu-table__cell-actions">
+ <RowActionsMenu
+ ariaLabel={`Actions for ${e.name} v${e.version}`}
+ actions={rowActions}
+ />
+ </td>
+ </TableRow>
)
})}
</tbody>
diff --git a/control-ui/components/RecipeIntegrationsPanel/index.tsx b/control-ui/components/RecipeIntegrationsPanel/index.tsx
index 5eaa3ac45..7ecb944aa 100644
--- a/control-ui/components/RecipeIntegrationsPanel/index.tsx
+++ b/control-ui/components/RecipeIntegrationsPanel/index.tsx
@@ -1,6 +1,6 @@
'use client'
-import { Fragment, useCallback, useEffect, useMemo, useState } from 'react'
+import { useCallback, useEffect, useMemo, useState } from 'react'
import { DataTable } from '@clerum/frontend-table-system'
import {
type UserGrant,
@@ -12,6 +12,7 @@ import {
getRecipeOauthStatus,
} from '../../lib/api'
import { useConfirmDialog } from '../ConfirmDialog'
+import { RowActionsMenu } from '../RowActionsMenu'
import { TablePanelHeader } from '../TablePanelHeader'
import { useToast } from '../Toast'
import { IconRefresh } from '../icons'
@@ -35,7 +36,6 @@ type UserGrantsState = 'idle' | 'loading' | 'ready' | 'error'
type UserGrantsRowState = {
loadState: UserGrantsState
users: UserGrant[]
- expanded: boolean
busyUserId: string | null
}
@@ -79,6 +79,7 @@ export function RecipeIntegrationsPanel({ recipe }: { recipe: WorkflowRecipeReso
// Per-client user-grants state, keyed by client.id
const [userGrantsMap, setUserGrantsMap] = useState<Record<string, UserGrantsRowState>>({})
+ const [activeGrantsClientId, setActiveGrantsClientId] = useState<string | null>(null)
const loadStatuses = useCallback(async () => {
if (!recipeName || clients.length === 0) {
@@ -154,7 +155,6 @@ export function RecipeIntegrationsPanel({ recipe }: { recipe: WorkflowRecipeReso
userGrantsMap[clientId] ?? {
loadState: 'idle',
users: [],
- expanded: false,
busyUserId: null,
}
)
@@ -163,7 +163,6 @@ export function RecipeIntegrationsPanel({ recipe }: { recipe: WorkflowRecipeReso
const defaultUserGrantsRowState: UserGrantsRowState = {
loadState: 'idle',
users: [],
- expanded: false,
busyUserId: null,
}
@@ -176,7 +175,8 @@ export function RecipeIntegrationsPanel({ recipe }: { recipe: WorkflowRecipeReso
async function loadUserGrants(client: OAuthClient) {
if (!recipeName) return
- setUserGrantsState(client.id, { loadState: 'loading', expanded: true })
+ setActiveGrantsClientId(client.id)
+ setUserGrantsState(client.id, { loadState: 'loading' })
try {
const { users } = await adminListUserGrants(recipeName, client.id)
setUserGrantsState(client.id, { loadState: 'ready', users })
@@ -185,15 +185,6 @@ export function RecipeIntegrationsPanel({ recipe }: { recipe: WorkflowRecipeReso
}
}
- async function toggleUserGrants(client: OAuthClient) {
- const current = getUserGrantsState(client.id)
- if (current.expanded) {
- setUserGrantsState(client.id, { expanded: false })
- } else {
- await loadUserGrants(client)
- }
- }
-
async function handleRevokeUserGrant(client: OAuthClient, userId: string) {
const shouldRevoke = await confirm({
title: 'Force-Revoke User Grant',
@@ -261,182 +252,174 @@ export function RecipeIntegrationsPanel({ recipe }: { recipe: WorkflowRecipeReso
<tbody>
{rows.map(({ client, state }) => {
const busy = busyClientId === client.id
- const ugState = getUserGrantsState(client.id)
return (
- <Fragment key={client.id}>
- <tr>
- <td style={{ fontFamily: 'monospace', fontSize: '0.85rem' }}>{client.id}</td>
- <td>{client.provider}</td>
- <td>
- <span
- className="cu-chip"
- style={
- state === 'connected'
- ? {
- color: 'var(--cu-ok-text, var(--cu-text))',
- borderColor: 'var(--cu-ok-border, var(--cu-border-subtle))',
- }
- : {
- color: 'var(--cu-text-soft)',
- borderColor: 'var(--cu-border-subtle)',
- }
- }
- >
- {state === 'connected'
- ? 'Connected'
- : state === 'disconnected'
- ? 'Not connected'
- : 'Unknown'}
- </span>
- </td>
- <td style={{ textAlign: 'right' }}>
- <span style={{ display: 'inline-flex', gap: '0.5rem' }}>
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- onClick={() => void toggleUserGrants(client)}
- disabled={!recipeName}
- aria-expanded={ugState.expanded}
- >
- {ugState.expanded ? 'Hide users' : 'Show users'}
- </button>
- {state === 'connected' ? (
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- onClick={() => void handleDisconnect(client)}
- disabled={busy}
- >
- {busy ? 'Working…' : 'Disconnect'}
- </button>
- ) : (
- <button
- type="button"
- className="cu-btn cu-btn--primary cu-btn--sm"
- onClick={() => void handleConnect(client)}
- disabled={busy || !recipeName}
- >
- {busy ? 'Working…' : `Connect ${client.provider}`}
- </button>
- )}
- </span>
- </td>
- </tr>
- {ugState.expanded && (
- <tr key={`${client.id}--user-grants`}>
- <td colSpan={4} style={{ padding: '0 1rem 0.75rem 2rem' }}>
- <div
- style={{
- borderLeft: '2px solid var(--cu-border-subtle)',
- paddingLeft: '0.75rem',
- }}
- >
- <div
- style={{
- fontSize: '0.78rem',
- fontWeight: 600,
+ <tr key={client.id}>
+ <td style={{ fontFamily: 'monospace', fontSize: '0.85rem' }}>{client.id}</td>
+ <td>{client.provider}</td>
+ <td>
+ <span
+ className="cu-chip"
+ style={
+ state === 'connected'
+ ? {
+ color: 'var(--cu-ok-text, var(--cu-text))',
+ borderColor: 'var(--cu-ok-border, var(--cu-border-subtle))',
+ }
+ : {
color: 'var(--cu-text-soft)',
- textTransform: 'uppercase',
- letterSpacing: '0.04em',
- marginBottom: '0.4rem',
- }}
- >
- Per-user connections
- </div>
- {ugState.loadState === 'loading' && (
- <div className="cu-empty" style={{ paddingTop: 0 }}>
- Loading…
- </div>
- )}
- {ugState.loadState === 'error' && (
- <div
- className="cu-banner cu-banner--error"
- style={{ margin: '0.25rem 0' }}
- >
- Could not load user grants.
- </div>
- )}
- {ugState.loadState === 'ready' && ugState.users.length === 0 && (
- <div className="cu-empty" style={{ paddingTop: 0 }}>
- No user grants for this client.
- </div>
- )}
- {ugState.loadState === 'ready' && ugState.users.length > 0 && (
- <DataTable
- className="eft-table cu-table"
- style={{ fontSize: '0.82rem', marginTop: 0 }}
- >
- <thead>
- <tr>
- <th>User ID</th>
- <th>Type</th>
- <th>Granted</th>
- <th
- style={{ width: '8rem', textAlign: 'right' }}
- aria-label="Actions"
- />
- </tr>
- </thead>
- <tbody>
- {ugState.users.map(u => {
- const userBusy = ugState.busyUserId === u.userId
- return (
- <tr key={u.userId}>
- <td style={{ fontFamily: 'monospace' }}>{u.userId}</td>
- <td>
- <span className="cu-chip">
- {u.background ? 'background' : 'interactive'}
- </span>
- </td>
- <td style={{ color: 'var(--cu-text-soft)' }}>
- {new Date(u.updatedAt).toLocaleDateString()}
- </td>
- <td style={{ textAlign: 'right' }}>
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- disabled={userBusy}
- onClick={() =>
- void handleRevokeUserGrant(client, u.userId)
- }
- >
- {userBusy ? 'Working…' : 'Revoke'}
- </button>
- </td>
- </tr>
- )
- })}
- </tbody>
- </DataTable>
- )}
- <div style={{ marginTop: '0.4rem' }}>
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- onClick={() => void loadUserGrants(client)}
- disabled={ugState.loadState === 'loading'}
- aria-label="Refresh user grants"
- >
- <IconRefresh
- className={
- ugState.loadState === 'loading' ? 'cu-spin' : undefined
- }
- width={14}
- height={14}
- />
- </button>
- </div>
- </div>
- </td>
- </tr>
- )}
- </Fragment>
+ borderColor: 'var(--cu-border-subtle)',
+ }
+ }
+ >
+ {state === 'connected'
+ ? 'Connected'
+ : state === 'disconnected'
+ ? 'Not connected'
+ : 'Unknown'}
+ </span>
+ </td>
+ <td style={{ textAlign: 'right' }}>
+ <RowActionsMenu
+ ariaLabel={`Actions for ${client.id}`}
+ actions={[
+ {
+ key: 'user-grants',
+ label: 'Manage user grants',
+ disabled: !recipeName,
+ onClick: () => void loadUserGrants(client),
+ },
+ state === 'connected'
+ ? {
+ key: 'disconnect',
+ label: busy ? 'Working…' : 'Disconnect',
+ danger: true,
+ disabled: busy,
+ onClick: () => void handleDisconnect(client),
+ }
+ : {
+ key: 'connect',
+ label: busy ? 'Working…' : `Connect ${client.provider}`,
+ disabled: busy || !recipeName,
+ onClick: () => void handleConnect(client),
+ },
+ ]}
+ />
+ </td>
+ </tr>
)
})}
</tbody>
</DataTable>
</div>
)}
+ {activeGrantsClientId
+ ? (() => {
+ const client = clients.find(candidate => candidate.id === activeGrantsClientId)
+ if (!client) return null
+ const grants = getUserGrantsState(client.id)
+ return (
+ <div
+ className="cu-modal-backdrop"
+ role="presentation"
+ onClick={event => {
+ if (event.target === event.currentTarget && !grants.busyUserId) {
+ setActiveGrantsClientId(null)
+ }
+ }}
+ >
+ <section
+ aria-labelledby="recipe-user-grants-title"
+ aria-modal="true"
+ className="cu-modal-panel cu-modal-panel--selection"
+ role="dialog"
+ >
+ <div className="cu-modal-panel__head">
+ <div>
+ <h3 className="cu-modal-panel__title" id="recipe-user-grants-title">
+ Per-user connections
+ </h3>
+ <p className="cu-muted">
+ {client.provider} grants for client <code>{client.id}</code>
+ </p>
+ </div>
+ <button
+ aria-label="Close user grants"
+ className="cu-btn cu-btn--ghost cu-btn--sm"
+ disabled={Boolean(grants.busyUserId)}
+ onClick={() => setActiveGrantsClientId(null)}
+ type="button"
+ >
+ Close
+ </button>
+ </div>
+ {grants.loadState === 'loading' ? <div className="cu-empty">Loading…</div> : null}
+ {grants.loadState === 'error' ? (
+ <div className="cu-banner cu-banner--error">Could not load user grants.</div>
+ ) : null}
+ {grants.loadState === 'ready' && grants.users.length === 0 ? (
+ <div className="cu-empty">No user grants for this client.</div>
+ ) : null}
+ {grants.loadState === 'ready' && grants.users.length > 0 ? (
+ <div className="eft-table-viewport cu-table-wrap">
+ <DataTable className="eft-table cu-table" variant="embedded">
+ <thead>
+ <tr>
+ <th>User ID</th>
+ <th>Type</th>
+ <th>Granted</th>
+ <th aria-label="Actions" />
+ </tr>
+ </thead>
+ <tbody>
+ {grants.users.map(user => {
+ const userBusy = grants.busyUserId === user.userId
+ return (
+ <tr key={user.userId}>
+ <td className="cu-code-text">{user.userId}</td>
+ <td>{user.background ? 'Background' : 'Interactive'}</td>
+ <td>{new Date(user.updatedAt).toLocaleDateString()}</td>
+ <td className="cu-table__cell-actions">
+ <RowActionsMenu
+ ariaLabel={`Actions for user ${user.userId}`}
+ actions={[
+ {
+ key: 'revoke',
+ label: userBusy ? 'Working…' : 'Revoke',
+ danger: true,
+ disabled: userBusy,
+ onClick: () =>
+ void handleRevokeUserGrant(client, user.userId),
+ },
+ ]}
+ />
+ </td>
+ </tr>
+ )
+ })}
+ </tbody>
+ </DataTable>
+ </div>
+ ) : null}
+ <div className="cu-create-actions">
+ <button
+ className="cu-btn cu-btn--secondary cu-btn--sm"
+ disabled={grants.loadState === 'loading'}
+ onClick={() => void loadUserGrants(client)}
+ type="button"
+ >
+ <IconRefresh
+ className={grants.loadState === 'loading' ? 'cu-spin' : undefined}
+ height={14}
+ width={14}
+ />
+ Refresh
+ </button>
+ </div>
+ </section>
+ </div>
+ )
+ })()
+ : null}
{confirmDialog}
</div>
)
diff --git a/control-ui/components/RegistryCatalog.tsx b/control-ui/components/RegistryCatalog.tsx
index 7abc50cd2..3796024e8 100644
--- a/control-ui/components/RegistryCatalog.tsx
+++ b/control-ui/components/RegistryCatalog.tsx
@@ -3,7 +3,7 @@
import { Fragment, useEffect, useMemo, useState } from 'react'
import Link from 'next/link'
import { useRouter } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, TableRow } from '@clerum/frontend-table-system'
import { FilterSelect } from '@components/FilterSelect'
import { MarketplaceTabs } from '@components/MarketplaceTabs'
import { type RowActionMenuItem, RowActionsMenu } from '@components/RowActionsMenu'
@@ -14,21 +14,23 @@ import { TableHeaderRow } from '@components/TableHeaderRow'
import type { TableHeaderColumn } from '@components/TableHeaderRow/types'
import { TablePanelHeader } from '@components/TablePanelHeader'
import { useToast } from '@components/Toast'
-import { IconChevronRight } from '@components/icons'
import { CONTROL_ROUTES } from '@constants/routes'
import { type RegistryEntry, deleteRegistryEntry, getRegistryCatalog } from '../lib/api'
import { useRegistryCapability } from '../lib/hooks/useRegistryCapability'
import { trustBgColor, trustColor } from '../lib/trustLevel'
-type CatalogSortKey = 'name' | 'version'
+type CatalogSortKey = 'name' | 'description' | 'type' | 'tags' | 'trust' | 'quality' | 'version'
type SortDirection = 'asc' | 'desc'
const REGISTRY_COLUMNS: TableHeaderColumn[] = [
- { key: 'expand', ariaLabel: 'Expand Marketplace entry' },
{ key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'type', label: 'Type' },
+ { key: 'tags', label: 'Tags' },
+ { key: 'trust', label: 'Trust' },
+ { key: 'quality', label: 'Verification' },
{ key: 'version', label: 'Version' },
- { key: 'install', align: 'right', ariaLabel: 'Installation' },
- { key: 'actions', align: 'right', ariaLabel: 'Edit or remove' },
+ { key: 'actions', align: 'right', ariaLabel: 'Actions' },
]
function compareVersions(left: string, right: string): number {
@@ -58,7 +60,6 @@ export default function RegistryCatalog() {
const [categoryFilter, setCategoryFilter] = useState('all')
const [sortKey, setSortKey] = useState<CatalogSortKey | null>(null)
const [sortDirection, setSortDirection] = useState<SortDirection>('asc')
- const [expandedKeys, setExpandedKeys] = useState<Set<string>>(new Set())
const [removeTarget, setRemoveTarget] = useState<RegistryEntry | null>(null)
const [removing, setRemoving] = useState(false)
const [removeError, setRemoveError] = useState('')
@@ -74,10 +75,16 @@ 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 = (
- isCurator ? REGISTRY_COLUMNS : REGISTRY_COLUMNS.filter(c => c.key !== 'actions')
- ).map(column => {
- if (column.key === 'name' || column.key === 'version') {
+ const columns = 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, label: renderSortHeader(column.key, column.label as string) }
}
return column
@@ -153,10 +160,23 @@ export default function RegistryCatalog() {
const direction = sortDirection === 'asc' ? 1 : -1
return [...visibleEntries].sort((left, right) => {
const comparison =
- sortKey === 'name'
- ? left.name.localeCompare(right.name, undefined, { sensitivity: 'base' })
- : compareVersions(left.version, right.version)
- return comparison * direction
+ sortKey === 'version'
+ ? compareVersions(left.version, right.version)
+ : sortKey === 'description'
+ ? left.description.localeCompare(right.description, undefined, { sensitivity: 'base' })
+ : sortKey === 'type'
+ ? `${left.server_mode ?? ''}/${left.transport ?? ''}`.localeCompare(
+ `${right.server_mode ?? ''}/${right.transport ?? ''}`
+ )
+ : sortKey === 'tags'
+ ? left.tags.join(',').localeCompare(right.tags.join(','))
+ : sortKey === 'trust'
+ ? left.trust_level.localeCompare(right.trust_level)
+ : sortKey === 'quality'
+ ? left.quality_tier.localeCompare(right.quality_tier)
+ : left.name.localeCompare(right.name, undefined, { sensitivity: 'base' })
+ if (comparison !== 0) return comparison * direction
+ return `${left.name}@${left.version}`.localeCompare(`${right.name}@${right.version}`)
})
}, [categoryFilter, connectorEntries, search, sortDirection, sortKey])
@@ -201,42 +221,12 @@ export default function RegistryCatalog() {
)
}
- function renderInstallButton(entry: RegistryEntry) {
- const installed = isEntryInstalled(entry)
- return installed ? (
- <button type="button" className="cu-btn cu-btn--sm" disabled>
- Installed
- </button>
- ) : (
- <button
- type="button"
- className="cu-btn cu-btn--sm cu-btn--primary"
- onClick={() =>
- router.push(
- CONTROL_ROUTES.marketplace.install({ entry: entry.name, version: entry.version })
- )
- }
- >
- Install
- </button>
- )
- }
-
// An entry belongs to this deployment's org when its name carries the org
// scope prefix (publishes are stored as `@org/name`, see applyPublishScope).
function isOwnedEntry(entry: RegistryEntry): boolean {
return !!orgScope && entry.name.startsWith(`${orgScope}/`)
}
- function toggleExpanded(key: string) {
- setExpandedKeys(current => {
- const next = new Set(current)
- if (next.has(key)) next.delete(key)
- else next.add(key)
- return next
- })
- }
-
const showConnectBanner =
connectionMode === 'self-hosted' &&
(connectionState === 'disconnected' || connectionState === 'rejected')
@@ -345,153 +335,125 @@ export default function RegistryCatalog() {
<SkeletonTableRows columns={columns.length} rows={5} />
) : (
filtered.map(entry => {
- const expandKey = `${entry.name}@${entry.version}`
- const expanded = expandedKeys.has(expandKey)
const typeMeta = entry.server_mode
? `${entry.server_mode}${entry.transport ? ` / ${entry.transport}` : ''}`
: '—'
+ const detailRoute = CONTROL_ROUTES.marketplace.entry(entry.name, entry.version)
+ const installed = isEntryInstalled(entry)
return (
- <Fragment key={entry.id}>
- <tr
- className="cu-table__row cu-table__row--clickable cu-expandable-row"
- onClick={() => toggleExpanded(expandKey)}
- onKeyDown={event => {
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault()
- toggleExpanded(expandKey)
- }
- }}
- tabIndex={0}
- aria-expanded={expanded}
- aria-controls={`marketplace-details-${entry.id}`}
- >
- <td className="cu-expandable-row__chevron" aria-hidden="true">
- <IconChevronRight
- className={expanded ? 'is-expanded' : undefined}
- width={18}
- height={18}
- />
- </td>
- <td>
- <Link
- className="cu-registry-name cu-link"
- href={CONTROL_ROUTES.marketplace.entry(entry.name, entry.version)}
- onClick={event => event.stopPropagation()}
- onKeyDown={event => event.stopPropagation()}
- >
- {entry.name}
- </Link>
- <div className="cu-registry-description" title={entry.description}>
- {entry.description}
- </div>
- {!isCurator && isOwnedEntry(entry) ? (
- <div className="cu-registry-owned">
- <Link
- className="cu-link"
- href={CONTROL_ROUTES.publisher.entries}
- onClick={event => event.stopPropagation()}
- onKeyDown={event => event.stopPropagation()}
- >
- You own this
- </Link>
- </div>
- ) : null}
- </td>
- <td className="cu-code-text">{entry.version}</td>
- <td
- className="cu-table__cell-actions cu-marketplace-action-cell"
- onClick={event => event.stopPropagation()}
- onKeyDown={event => event.stopPropagation()}
- >
- {renderInstallButton(entry)}
- </td>
- {isCurator ? (
- <td
- className="cu-table__cell-actions cu-marketplace-action-cell"
- onClick={event => event.stopPropagation()}
- onKeyDown={event => event.stopPropagation()}
- >
- <RowActionsMenu
- ariaLabel={`Actions for ${entry.name} v${entry.version}`}
- actions={
- [
- {
- key: 'edit',
- label: 'Edit',
- onClick: () =>
- router.push(
- CONTROL_ROUTES.marketplace.editEntry(
- entry.name,
- entry.version
- )
- ),
- },
- {
- key: 'remove',
- label: 'Remove from Marketplace',
- danger: true,
- onClick: () => {
- setRemoveError('')
- setRemoveTarget(entry)
- },
- },
- ] satisfies RowActionMenuItem[]
- }
- />
- </td>
+ <TableRow
+ className="cu-table__row cu-table__row--clickable"
+ key={entry.id}
+ onNavigate={() => router.push(detailRoute)}
+ >
+ <td>
+ <span className="cu-registry-name">{entry.name}</span>
+ {!isCurator && isOwnedEntry(entry) ? (
+ <div className="cu-registry-owned">Owned by your organization</div>
) : null}
- </tr>
- {expanded ? (
- <tr
- id={`marketplace-details-${entry.id}`}
- className="cu-expandable-detail-row"
+ </td>
+ <td>
+ <span className="cu-cell-truncate" title={entry.description}>
+ {entry.description || '—'}
+ </span>
+ </td>
+ <td className="cu-registry-type-meta">{typeMeta}</td>
+ <td>{entry.tags.join(', ') || '—'}</td>
+ <td>
+ <span
+ className="cu-registry-chip"
+ style={{
+ color: trustColor(entry.trust_level),
+ background: trustBgColor(entry.trust_level),
+ borderColor: trustColor(entry.trust_level),
+ }}
+ >
+ {entry.trust_level.toUpperCase()}
+ </span>
+ </td>
+ <td>
+ <span
+ className={`cu-registry-chip cu-registry-chip--quality-${entry.quality_tier}`}
>
- <td colSpan={columns.length}>
- <div className="cu-expandable-detail cu-marketplace-row-detail">
- <div className="cu-expandable-detail__fields">
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Type</span>
- <span className="cu-registry-type-meta">{typeMeta}</span>
- </div>
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Trust</span>
- <span
- className="cu-registry-chip"
- style={{
- color: trustColor(entry.trust_level),
- background: trustBgColor(entry.trust_level),
- borderColor: trustColor(entry.trust_level),
- }}
- >
- {entry.trust_level.toUpperCase()}
- </span>
- </div>
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Verification</span>
- <span
- className={`cu-registry-chip cu-registry-chip--quality-${entry.quality_tier}`}
- >
- {entry.quality_tier}
- </span>
- </div>
- {entry.tags.length > 0 && (
- <div className="cu-expandable-field">
- <span className="cu-expandable-field__label">Tags</span>
- <div className="cu-expandable-tags">
- {entry.tags.map(tag => (
- <span key={tag} className="cu-registry-tag">
- {tag}
- </span>
- ))}
- </div>
- </div>
- )}
- </div>
- </div>
- </td>
- </tr>
- ) : null}
- </Fragment>
+ {entry.quality_tier}
+ </span>
+ </td>
+ <td className="cu-code-text">{entry.version}</td>
+ <td
+ className="cu-table__cell-actions"
+ onClick={event => event.stopPropagation()}
+ onKeyDown={event => event.stopPropagation()}
+ >
+ <RowActionsMenu
+ ariaLabel={`Actions for ${entry.name} v${entry.version}`}
+ actions={
+ [
+ {
+ key: 'view',
+ label: 'View details',
+ onClick: () => router.push(detailRoute),
+ },
+ ...(!isCurator && isOwnedEntry(entry)
+ ? [
+ {
+ key: 'manage-owned',
+ label: 'Manage published entry',
+ onClick: () =>
+ router.push(CONTROL_ROUTES.marketplace.orgEntries),
+ },
+ ]
+ : []),
+ ...(installed
+ ? [
+ {
+ key: 'installed',
+ label: 'Installed',
+ disabled: true,
+ onClick: () => undefined,
+ },
+ ]
+ : [
+ {
+ key: 'install',
+ label: 'Install',
+ onClick: () =>
+ router.push(
+ CONTROL_ROUTES.marketplace.install({
+ entry: entry.name,
+ version: entry.version,
+ })
+ ),
+ },
+ ]),
+ ...(isCurator
+ ? [
+ {
+ key: 'edit',
+ label: 'Edit',
+ onClick: () =>
+ router.push(
+ CONTROL_ROUTES.marketplace.editEntry(
+ entry.name,
+ entry.version
+ )
+ ),
+ },
+ {
+ key: 'remove',
+ label: 'Remove from Marketplace',
+ danger: true,
+ onClick: () => {
+ setRemoveError('')
+ setRemoveTarget(entry)
+ },
+ },
+ ]
+ : []),
+ ] satisfies RowActionMenuItem[]
+ }
+ />
+ </td>
+ </TableRow>
)
})
)}
diff --git a/control-ui/components/SecretsScopeTabs/index.tsx b/control-ui/components/SecretsScopeTabs/index.tsx
index d50dbb64e..b5efed590 100644
--- a/control-ui/components/SecretsScopeTabs/index.tsx
+++ b/control-ui/components/SecretsScopeTabs/index.tsx
@@ -3,7 +3,7 @@
import { CONTROL_ROUTES } from '@constants/routes'
import { TabBar } from '../TabBar'
-export type SecretsTabScope = 'llm' | 'mcp' | 'recipe'
+export type SecretsTabScope = 'llm' | 'llm-subscriptions' | 'mcp' | 'recipe'
export function SecretsScopeTabs({ activeValue }: { activeValue: SecretsTabScope }) {
return (
@@ -12,7 +12,12 @@ export function SecretsScopeTabs({ activeValue }: { activeValue: SecretsTabScope
activeValue={activeValue}
className="cu-tabs--flush"
options={[
- { value: 'llm', href: CONTROL_ROUTES.secrets.llm, label: 'LLM' },
+ { value: 'llm', href: CONTROL_ROUTES.secrets.llm, label: 'LLM API keys' },
+ {
+ value: 'llm-subscriptions',
+ href: CONTROL_ROUTES.secrets.llmSubscriptions,
+ label: 'LLM subscriptions',
+ },
{ value: 'mcp', href: CONTROL_ROUTES.secrets.connector, label: 'Connector' },
{ value: 'recipe', href: CONTROL_ROUTES.secrets.recipe, label: 'Recipe' },
]}
diff --git a/control-ui/components/SecretsTable.tsx b/control-ui/components/SecretsTable.tsx
index 5b33c6723..fd1c9d52d 100644
--- a/control-ui/components/SecretsTable.tsx
+++ b/control-ui/components/SecretsTable.tsx
@@ -17,7 +17,6 @@ import { collectWorkflowRecipeSecretRefs } from '../lib/workflowRecipeSecretRefs
import { useConfirmDialog } from './ConfirmDialog'
import { LlmProviderIcon } from './LlmProviderIcon'
import { LlmSecretUpdateModal } from './LlmSecretUpdateModal'
-import { LlmSecretsSubTabs } from './LlmSecretsSubTabs'
import { RowActionsMenu } from './RowActionsMenu'
import { SecretsScopeTabs } from './SecretsScopeTabs'
import { SectionSearchInput } from './SectionSearchInput'
@@ -470,7 +469,6 @@ export function SecretsTable({
<div className="cu-card__body cu-card__body--auto cu-secrets-strip">
<SecretsScopeTabs activeValue={scope} />
- {scope === 'llm' ? <LlmSecretsSubTabs activeValue="api-key" /> : null}
</div>
{scope === 'llm' && error && (
diff --git a/control-ui/components/TableHeaderRow/index.tsx b/control-ui/components/TableHeaderRow/index.tsx
index 38651e14f..e57a9db9d 100644
--- a/control-ui/components/TableHeaderRow/index.tsx
+++ b/control-ui/components/TableHeaderRow/index.tsx
@@ -14,6 +14,7 @@ export function TableHeaderRow({ columns }: { columns: TableHeaderColumn[] }) {
label={column.label}
activeDirection={column.activeDirection}
onSort={column.onSort}
+ sortLabel={column.sortLabel}
style={{
...(column.width ? { width: column.width } : {}),
...(column.minWidth ? { minWidth: column.minWidth } : {}),
diff --git a/control-ui/components/TableHeaderRow/types.ts b/control-ui/components/TableHeaderRow/types.ts
index 8b0c35806..41b290ce0 100644
--- a/control-ui/components/TableHeaderRow/types.ts
+++ b/control-ui/components/TableHeaderRow/types.ts
@@ -11,4 +11,5 @@ export type TableHeaderColumn = {
width?: string
activeDirection?: SortDirection | null
onSort?: () => void
+ sortLabel?: ReactNode
}
diff --git a/control-ui/components/TablePanelHeader/index.tsx b/control-ui/components/TablePanelHeader/index.tsx
index 58665c433..0f036d8b2 100644
--- a/control-ui/components/TablePanelHeader/index.tsx
+++ b/control-ui/components/TablePanelHeader/index.tsx
@@ -18,7 +18,7 @@ export function TablePanelHeader({
className="cu-table-panel__head"
description={subtitle}
title={
- <span className="cu-table-panel__title-row">
+ <span className="cu-panel-title cu-table-panel__title-row">
{title}
{titleActions}
</span>
diff --git a/control-ui/components/UserApprovalMediumsTable.tsx b/control-ui/components/UserApprovalMediumsTable.tsx
index 9e841001e..e92d765a6 100644
--- a/control-ui/components/UserApprovalMediumsTable.tsx
+++ b/control-ui/components/UserApprovalMediumsTable.tsx
@@ -1,9 +1,8 @@
'use client'
import React from 'react'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, RowActionMenu } from '@clerum/frontend-table-system'
import type { WorkflowApprovalMediumAccount } from '../lib/workflowApprovalMediums'
-import { IconX } from './icons'
function formatAccount(account: WorkflowApprovalMediumAccount): string {
if (account.medium === 'telegram') {
@@ -66,29 +65,29 @@ export function UserApprovalMediumsTable({
<td>{account.medium}</td>
<td>{formatAccount(account)}</td>
<td>{account.isPreferred ? 'Preferred' : 'Verified'}</td>
- <td>
- <div style={{ display: 'flex', gap: '0.35rem', justifyContent: 'flex-end' }}>
- {!account.isPreferred && (
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- onClick={() => onPrefer(account.id)}
- disabled={busy}
- >
- Prefer
- </button>
- )}
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--danger-icon"
- onClick={() => onRevoke(account.id)}
- disabled={busy}
- title="Revoke"
- aria-label={`Revoke ${account.medium} approval DM`}
- >
- <IconX width={16} height={16} />
- </button>
- </div>
+ <td className="cu-table__cell-actions">
+ <RowActionMenu
+ ariaLabel={`Actions for ${account.medium} approval account`}
+ actions={[
+ ...(!account.isPreferred
+ ? [
+ {
+ key: 'prefer',
+ label: 'Make preferred',
+ disabled: busy,
+ onSelect: () => onPrefer(account.id),
+ },
+ ]
+ : []),
+ {
+ key: 'revoke',
+ label: 'Revoke',
+ danger: true,
+ disabled: busy,
+ onSelect: () => onRevoke(account.id),
+ },
+ ]}
+ />
</td>
</tr>
))
diff --git a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
index c1c476930..0dbcd2ad8 100644
--- a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
+++ b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
@@ -103,7 +103,7 @@ describe('CodexSubscriptionHub', () => {
expect(revokeCodexSubscription).not.toHaveBeenCalled()
})
- it('renders subscriptions as a Secrets table with pencil and delete actions', async () => {
+ it('renders subscriptions as a Secrets table with row actions', async () => {
render(
<ToastProvider>
<CodexSubscriptionHub />
@@ -112,19 +112,19 @@ describe('CodexSubscriptionHub', () => {
expect(await screen.findByText('Team A')).toBeInTheDocument()
expect(screen.getByRole('columnheader', { name: 'Name' })).toBeInTheDocument()
expect(screen.getByRole('columnheader', { name: 'Status' })).toBeInTheDocument()
- expect(screen.getByRole('tab', { name: 'API-KEY' })).toHaveAttribute('href', '/secrets/llm')
- expect(screen.getByRole('tab', { name: 'Subscriptions' })).toHaveAttribute(
+ expect(screen.getByRole('tab', { name: 'LLM API keys' })).toHaveAttribute(
+ 'href',
+ '/secrets/llm'
+ )
+ expect(screen.getByRole('tab', { name: 'LLM subscriptions' })).toHaveAttribute(
'href',
'/secrets/llm/subscriptions'
)
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 () => {
@@ -155,8 +155,9 @@ describe('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' }))
expect(await screen.findByRole('button', { name: 'Sign in with ChatGPT' })).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'Sync catalog' })).toBeInTheDocument()
expect(listCodexConnectionModels).toHaveBeenCalledWith('codex-aaa')
@@ -188,8 +189,9 @@ describe('CodexSubscriptionHub', () => {
</ToastProvider>
)
fireEvent.click(
- await screen.findByRole('button', { name: 'Delete ChatGPT subscription Team A' })
+ await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Delete' }))
await waitFor(() => {
expect(revokeCodexSubscription).toHaveBeenCalledWith('codex-aaa')
})
diff --git a/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx b/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
index f7553c0b4..d9a075eb0 100644
--- a/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
+++ b/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
@@ -186,7 +186,7 @@ describe('CommunicationChannelsTable — row actions kebab', () => {
const editItem = screen.getByRole('menuitem', { name: 'Edit' })
const deleteItem = screen.getByRole('menuitem', { name: 'Delete' })
- expect(deleteItem).toHaveClass('cu-kebab__item--danger')
+ expect(deleteItem).toHaveClass('eft-row-actions__item--danger')
fireEvent.click(editItem)
expect(onEditChannel).toHaveBeenCalledWith('teams-channel')
diff --git a/control-ui/components/__tests__/ContextTable.test.tsx b/control-ui/components/__tests__/ContextTable.test.tsx
index dc83b36e5..d46d208bd 100644
--- a/control-ui/components/__tests__/ContextTable.test.tsx
+++ b/control-ui/components/__tests__/ContextTable.test.tsx
@@ -50,9 +50,9 @@ describe('ContextTable', () => {
/>
)
- expect(screen.getByText('business')).toHaveClass('cu-expandable-row__name')
+ expect(screen.getAllByText('business')[0]).toHaveClass('cu-expandable-row__name')
expect(screen.getByText('Business context')).toHaveClass('cu-registry-description')
- expect(container.querySelectorAll('thead th')).toHaveLength(3)
+ expect(container.querySelectorAll('thead th')).toHaveLength(5)
expect(screen.queryByRole('button', { name: 'business' })).not.toBeInTheDocument()
})
@@ -80,7 +80,7 @@ describe('ContextTable', () => {
)
// The visible name span renders the identifier, not a blank/whitespace label.
- expect(screen.getByText('business')).toHaveClass('cu-expandable-row__name')
+ expect(screen.getAllByText('business')[0]).toHaveClass('cu-expandable-row__name')
})
it('does not open a context from the row actions kebab', () => {
diff --git a/control-ui/components/__tests__/ControlAdminsPanel.gfsOperatorLink.test.tsx b/control-ui/components/__tests__/ControlAdminsPanel.gfsOperatorLink.test.tsx
index 34df6a3ab..fd73d4de2 100644
--- a/control-ui/components/__tests__/ControlAdminsPanel.gfsOperatorLink.test.tsx
+++ b/control-ui/components/__tests__/ControlAdminsPanel.gfsOperatorLink.test.tsx
@@ -104,17 +104,12 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
await screen.findByText(`Desktop user: ${LINK.desktopUserId}`)
expect(screen.getByText(`Control Admin: ${LINK.controlAdminId}`)).toBeInTheDocument()
- expect(
- screen.getByRole('button', {
- name: 'Revoke Desktop GFS operator access for initial-admin ([email protected])',
- })
- ).toBeInTheDocument()
-
fireEvent.click(
screen.getByRole('button', {
- name: 'Revoke Desktop GFS operator access for initial-admin ([email protected])',
+ name: 'Actions for initial-admin ([email protected])',
})
)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Revoke GFS' }))
await waitFor(() =>
expect(revokeControlAdminGfsOperatorLink).toHaveBeenCalledWith('admin-1', {
@@ -132,10 +127,11 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
confirmMock.mockResolvedValueOnce(false)
render(<ControlAdminsPanel />)
- const revokeButton = await screen.findByRole('button', {
- name: 'Revoke Desktop GFS operator access for initial-admin ([email protected])',
+ const actionsButton = await screen.findByRole('button', {
+ name: 'Actions for initial-admin ([email protected])',
})
- fireEvent.click(revokeButton)
+ fireEvent.click(actionsButton)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Revoke GFS' }))
await waitFor(() => expect(confirmMock).toHaveBeenCalled())
expect(revokeControlAdminGfsOperatorLink).not.toHaveBeenCalled()
@@ -163,20 +159,18 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
expect(await screen.findByTestId('gfs-operator-link-admin-2')).toHaveTextContent('Not linked')
})
- it('views the matching member from an admin with the destination-role SVG', async () => {
+ it('views the matching member from the admin row menu', async () => {
render(<ControlAdminsPanel />)
- const viewMemberButton = await screen.findByRole('button', {
- name: 'View member for admin initial-admin ([email protected])',
- })
- expect(viewMemberButton).toHaveAttribute('title', 'View member')
- expect(viewMemberButton.querySelector('svg')).toHaveAttribute(
- 'data-relationship-role',
- 'member'
+ fireEvent.click(
+ await screen.findByRole('button', {
+ name: 'Actions for initial-admin ([email protected])',
+ })
)
- expect(viewMemberButton.querySelector('svg')).not.toHaveAttribute('data-create-badge')
-
- fireEvent.click(viewMemberButton)
+ const viewMemberItem = screen.getByRole('menuitem', {
+ name: 'View member',
+ })
+ fireEvent.click(viewMemberItem)
expect(mockPush).toHaveBeenCalledWith(
'/users-and-teams/users/11111111-1111-4111-8111-111111111111'
@@ -200,17 +194,15 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
})
render(<ControlAdminsPanel />)
- const createMemberButton = await screen.findByRole('button', {
- name: 'Create member for admin create-member ([email protected])',
- })
- expect(createMemberButton).toHaveAttribute('title', 'Create member')
- expect(createMemberButton.querySelector('svg')).toHaveAttribute(
- 'data-relationship-role',
- 'member'
+ fireEvent.click(
+ await screen.findByRole('button', {
+ name: 'Actions for create-member ([email protected])',
+ })
)
- expect(createMemberButton.querySelector('svg')).toHaveAttribute('data-create-badge', 'true')
-
- fireEvent.click(createMemberButton)
+ const createMemberItem = screen.getByRole('menuitem', {
+ name: 'Create member',
+ })
+ fireEvent.click(createMemberItem)
expect(mockPush).toHaveBeenCalledWith(
'/users-and-teams/users/new?adminId=admin-2&email=create-member%40example.com&name=create-member'
@@ -234,14 +226,17 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
})
render(<ControlAdminsPanel />)
- const createMemberButton = await screen.findByRole('button', {
- name: 'Email required to create member for admin email-missing',
+ fireEvent.click(
+ await screen.findByRole('button', {
+ name: 'Actions for email-missing',
+ })
+ )
+ const createMemberItem = screen.getByRole('menuitem', {
+ name: 'Email required to create member',
})
- expect(createMemberButton).toBeDisabled()
- expect(createMemberButton).toHaveAttribute('title', 'Email required to create member')
- expect(createMemberButton.querySelector('svg')).not.toHaveAttribute('data-create-badge')
+ expect(createMemberItem).toBeDisabled()
- fireEvent.click(createMemberButton)
+ fireEvent.click(createMemberItem)
expect(mockPush).not.toHaveBeenCalled()
})
@@ -263,14 +258,17 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
})
render(<ControlAdminsPanel />)
- const createMemberButton = await screen.findByRole('button', {
- name: 'Complete password setup to create member for admin password-pending ([email protected])',
+ fireEvent.click(
+ await screen.findByRole('button', {
+ name: 'Actions for password-pending ([email protected])',
+ })
+ )
+ const createMemberItem = screen.getByRole('menuitem', {
+ name: 'Complete password setup to create member',
})
- expect(createMemberButton).toBeDisabled()
- expect(createMemberButton).toHaveAttribute('title', 'Complete password setup to create member')
- expect(createMemberButton.querySelector('svg')).not.toHaveAttribute('data-create-badge')
+ expect(createMemberItem).toBeDisabled()
- fireEvent.click(createMemberButton)
+ fireEvent.click(createMemberItem)
expect(mockPush).not.toHaveBeenCalled()
})
@@ -321,10 +319,15 @@ describe('ControlAdminsPanel GFS operator link lifecycle', () => {
})
render(<ControlAdminsPanel />)
- const reactivateButton = await screen.findByRole('button', {
- name: 'Reactivate Desktop GFS operator access for initial-admin ([email protected])',
+ fireEvent.click(
+ await screen.findByRole('button', {
+ name: 'Actions for initial-admin ([email protected])',
+ })
+ )
+ const reactivateItem = screen.getByRole('menuitem', {
+ name: 'Reactivate GFS',
})
- fireEvent.click(reactivateButton)
+ fireEvent.click(reactivateItem)
await waitFor(() =>
expect(reactivateControlAdminGfsOperatorLink).toHaveBeenCalledWith('admin-1', {
diff --git a/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx
index 6b91d63ba..ebe8f0be2 100644
--- a/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx
+++ b/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx
@@ -892,7 +892,8 @@ describe('EditCommunicationChannelPage conversation delete validation', () => {
it('deletes a conversation through the same validation as Save', async () => {
const user = await openTeamsTabWithConversation('My Bot')
- await user.click(screen.getByRole('button', { name: 'Delete General' }))
+ await user.click(screen.getByRole('button', { name: 'Actions for General' }))
+ await user.click(screen.getByRole('menuitem', { name: 'Delete' }))
await user.click(await screen.findByRole('button', { name: 'Delete conversation' }))
await waitFor(() => expect(api.apiSend).toHaveBeenCalled())
@@ -909,7 +910,8 @@ describe('EditCommunicationChannelPage conversation delete validation', () => {
await user.clear(nameInput)
fireEvent.change(nameInput, { target: { value: 'a'.repeat(81) } })
- await user.click(screen.getByRole('button', { name: 'Delete General' }))
+ await user.click(screen.getByRole('button', { name: 'Actions for General' }))
+ await user.click(screen.getByRole('menuitem', { name: 'Delete' }))
await user.click(await screen.findByRole('button', { name: 'Delete conversation' }))
expect(
diff --git a/control-ui/components/__tests__/FrontendTableSystem.test.tsx b/control-ui/components/__tests__/FrontendTableSystem.test.tsx
index bb8de2e69..e5ead509c 100644
--- a/control-ui/components/__tests__/FrontendTableSystem.test.tsx
+++ b/control-ui/components/__tests__/FrontendTableSystem.test.tsx
@@ -1,3 +1,4 @@
+import { describe, expect, it, vi } from 'vitest'
import { fireEvent, render, screen, within } from '@testing-library/react'
import {
DataTable,
diff --git a/control-ui/components/__tests__/GuardrailHooksTable.test.tsx b/control-ui/components/__tests__/GuardrailHooksTable.test.tsx
index 35b9e209d..74469e5c1 100644
--- a/control-ui/components/__tests__/GuardrailHooksTable.test.tsx
+++ b/control-ui/components/__tests__/GuardrailHooksTable.test.tsx
@@ -40,6 +40,8 @@ describe('GuardrailHooksTable', () => {
// borrow the expandable-row vocabulary, which promises in-place detail.
expect(view.container.querySelector('.cu-expandable-row__chevron')).toBeNull()
expect(view.container.querySelector('.cu-expandable-table')).toBeNull()
- expect(view.container.querySelector('.cu-installed-plugin__navigation')).not.toBeNull()
+ expect(
+ view.container.querySelector('[aria-label="View guardrail hook-token-compactor"]')
+ ).not.toBeNull()
})
})
diff --git a/control-ui/components/__tests__/HostAccessTab.test.tsx b/control-ui/components/__tests__/HostAccessTab.test.tsx
index 4c141216d..f1efa63f0 100644
--- a/control-ui/components/__tests__/HostAccessTab.test.tsx
+++ b/control-ui/components/__tests__/HostAccessTab.test.tsx
@@ -135,7 +135,8 @@ describe('HostAccessTab — extracted access behavior', () => {
await waitFor(() => expect(screen.getByText('Alice')).toBeInTheDocument())
- fireEvent.click(screen.getByRole('button', { name: /Revoke member access/i }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Revoke access' }))
// ConfirmDialog opens; click the danger "Revoke" button.
const confirmDialog = await screen.findByRole('alertdialog')
diff --git a/control-ui/components/__tests__/HostGuardrailsSection.test.tsx b/control-ui/components/__tests__/HostGuardrailsSection.test.tsx
index 369f85b7f..c0b335e34 100644
--- a/control-ui/components/__tests__/HostGuardrailsSection.test.tsx
+++ b/control-ui/components/__tests__/HostGuardrailsSection.test.tsx
@@ -107,11 +107,8 @@ describe('HostGuardrailsSection', () => {
<HostGuardrailsSection busy={false} canWrite initialGuardrails={GUARDRAILS} onSave={onSave} />
)
- fireEvent.click(
- await screen.findByRole('button', {
- name: 'Remove hook hook-token-compactor from Pre-call',
- })
- )
+ fireEvent.click(await screen.findByRole('button', { name: 'Actions for hook-token-compactor' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Remove from Pre-call' }))
await waitFor(() => expect(onSave).toHaveBeenCalledTimes(1))
const saved = onSave.mock.calls[0][0] as HostGuardrails
@@ -127,11 +124,8 @@ describe('HostGuardrailsSection', () => {
<HostGuardrailsSection busy={false} canWrite initialGuardrails={GUARDRAILS} onSave={onSave} />
)
- fireEvent.click(
- await screen.findByRole('button', {
- name: 'Remove hook hook-token-compactor from Pre-call',
- })
- )
+ fireEvent.click(await screen.findByRole('button', { name: 'Actions for hook-token-compactor' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Remove from Pre-call' }))
await waitFor(() => expect(confirmMock).toHaveBeenCalled())
expect(onSave).not.toHaveBeenCalled()
diff --git a/control-ui/components/__tests__/HostTable.test.tsx b/control-ui/components/__tests__/HostTable.test.tsx
index a3493cebf..5360281e6 100644
--- a/control-ui/components/__tests__/HostTable.test.tsx
+++ b/control-ui/components/__tests__/HostTable.test.tsx
@@ -194,8 +194,8 @@ describe('HostTable display name column (UT-9)', () => {
renderHostTable([makeDisplayHost('prod-x', ' ')])
const row = screen.getByLabelText('Open agent prod-x')
- // Only the slug renders — no separate secondary line duplicating it.
- expect(within(row).getAllByText('prod-x')).toHaveLength(1)
+ // The fallback is visible in the primary and explicit identifier columns.
+ expect(within(row).getAllByText('prod-x')).toHaveLength(2)
})
it('filters rows by the display name', () => {
@@ -321,7 +321,7 @@ describe('HostTable — row actions kebab', () => {
const viewItem = screen.getByRole('menuitem', { name: 'View agent details' })
const deleteItem = screen.getByRole('menuitem', { name: 'Delete' })
- expect(deleteItem).toHaveClass('cu-kebab__item--danger')
+ expect(deleteItem).toHaveClass('eft-row-actions__item--danger')
fireEvent.click(viewItem)
expect(onOpen).toHaveBeenCalledWith({ namespace: 'mcp-host', name: 'chatllm' })
diff --git a/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx b/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx
index d6c962902..35eb4c7c4 100644
--- a/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx
+++ b/control-ui/components/__tests__/LlmDiscoveryPanel.test.tsx
@@ -72,7 +72,7 @@ afterEach(() => {
})
describe('LlmDiscoveryPanel merged lifecycle workflow', () => {
- it('groups discovery review by provider and excludes stale rows', async () => {
+ it('shows review records with provider identity and excludes stale rows', async () => {
render(
<LlmDiscoveryPanel
items={[reviewModel, staleModel]}
@@ -84,14 +84,10 @@ describe('LlmDiscoveryPanel merged lifecycle workflow', () => {
expect(screen.getByText('LLM Models')).toBeInTheDocument()
expect(screen.getByText(/Newly synced models land here disabled/)).toBeInTheDocument()
- const reviewGroup = screen.getByRole('button', { name: 'Expand OpenAI review models' })
- expect(reviewGroup).toHaveAttribute('aria-expanded', 'false')
- expect(screen.queryByText('gpt-5')).toBeNull()
- expect(screen.queryByText('claude-retired')).toBeNull()
-
- fireEvent.click(reviewGroup)
+ expect(screen.getByRole('columnheader', { name: /Provider/i })).toBeInTheDocument()
expect(screen.getByText('gpt-5')).toBeInTheDocument()
expect(screen.queryByText('claude-retired')).toBeNull()
+ expect(screen.queryByRole('button', { name: /Expand .* review models/ })).toBeNull()
await waitFor(() => expect(screen.getByText('Live catalog')).toBeInTheDocument())
expect(screen.getByText('+3 new')).toBeInTheDocument()
@@ -103,7 +99,6 @@ describe('LlmDiscoveryPanel merged lifecycle workflow', () => {
const onRefresh = vi.fn().mockResolvedValue(undefined)
render(<LlmDiscoveryPanel items={[reviewModel]} loading={false} onRefresh={onRefresh} />)
- fireEvent.click(screen.getByRole('button', { name: 'Expand OpenAI review models' }))
fireEvent.click(screen.getByRole('button', { name: 'Enable' }))
await waitFor(() =>
@@ -168,7 +163,7 @@ describe('LlmDiscoveryPanel sorting', () => {
}
function expandOpenAi() {
- fireEvent.click(screen.getByRole('button', { name: 'Expand OpenAI review models' }))
+ // Review rows are always visible; retained as a no-op for the sorting tests.
}
const discoveryModel = (overrides: Partial<LlmAllowedModel>): LlmAllowedModel => ({
@@ -188,7 +183,7 @@ describe('LlmDiscoveryPanel sorting', () => {
onRefresh={vi.fn().mockResolvedValue(undefined)}
/>
)
- expect(document.querySelector('.cu-panel-title')?.textContent).toContain('LLM Models')
+ expect(screen.getByRole('heading', { name: /LLM Models/ })).toBeInTheDocument()
})
it('sorts queued models by model name ascending when clicked', () => {
diff --git a/control-ui/components/__tests__/LlmModelTable.test.tsx b/control-ui/components/__tests__/LlmModelTable.test.tsx
index 7f3778fc3..8bd2e3e8f 100644
--- a/control-ui/components/__tests__/LlmModelTable.test.tsx
+++ b/control-ui/components/__tests__/LlmModelTable.test.tsx
@@ -36,7 +36,7 @@ function renderTable(items: LlmAllowedModel[], unpricedKeys = new Set<string>())
}
function expandAnthropicModels() {
- fireEvent.click(screen.getByRole('button', { name: 'Expand Anthropic models' }))
+ // Provider rows are no longer collapsed; retained as a no-op for row-focused tests below.
}
describe('LlmModelTable catalog-lifecycle columns', () => {
@@ -68,7 +68,6 @@ describe('LlmModelTable catalog-lifecycle columns', () => {
updated_at: '2026-01-01T00:00:00.000Z',
} as LlmAllowedModel
renderTable([legacy])
- fireEvent.click(screen.getByRole('button', { name: 'Expand OpenAI models' }))
expect(screen.getByText('Manual', { selector: '.cu-px-badge' })).toBeInTheDocument()
expect(screen.queryByText('Discovered')).not.toBeInTheDocument()
expect(screen.queryByText('Stale', { selector: '.cu-px-badge--warn' })).toBeNull()
@@ -104,7 +103,6 @@ describe('LlmModelTable catalog-lifecycle columns', () => {
expect(
screen.queryByRole('button', { name: /OpenAI Codex Subscription/i })
).not.toBeInTheDocument()
- fireEvent.click(screen.getByRole('button', { name: 'Expand OpenAI models' }))
expect(screen.getByText('gpt-5.1')).toBeInTheDocument()
expect(screen.getByText('API key · Subscription')).toBeInTheDocument()
expect(screen.getByText('gpt-5.3-codex').closest('tr')).toHaveTextContent('Subscription')
@@ -142,7 +140,6 @@ describe('LlmModelTable catalog-lifecycle columns', () => {
loading={false}
/>
)
- fireEvent.click(screen.getByRole('button', { name: 'Expand OpenAI models' }))
fireEvent.click(screen.getByRole('button', { name: 'Actions for model openai/gpt-5.1' }))
fireEvent.click(screen.getByRole('menuitem', { name: 'Edit subscription' }))
expect(onEdit).toHaveBeenCalledWith('oa-sub')
@@ -224,7 +221,7 @@ describe('LlmModelTable filters', () => {
await waitFor(() => {
expect(screen.queryByLabelText('Filter by provider')).toBeNull()
- expect(screen.getByRole('button', { name: 'Expand Anthropic models' })).toBeInTheDocument()
+ expect(screen.getByText('claude-enabled')).toBeInTheDocument()
})
expect(screen.queryByText('No models match this filter.')).toBeNull()
})
@@ -271,8 +268,8 @@ describe('LlmModelTable filters', () => {
)
})
expect(screen.queryByText('No models match this filter.')).toBeNull()
- expect(screen.getByRole('button', { name: 'Expand Anthropic models' })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'Expand google models' })).toBeInTheDocument()
+ expect(screen.getByText('claude-enabled')).toBeInTheDocument()
+ expect(screen.getByText('gemini-2.5-pro')).toBeInTheDocument()
})
it('shows the filtered empty state when no row matches', () => {
@@ -284,7 +281,7 @@ describe('LlmModelTable filters', () => {
})
})
-describe('LlmModelTable provider groups', () => {
+describe('LlmModelTable provider columns', () => {
const openAiModel: LlmAllowedModel = {
...baseModel,
id: 'openai-model',
@@ -294,39 +291,22 @@ describe('LlmModelTable provider groups', () => {
display_name: 'GPT-5',
}
- it('starts with compact provider summaries and expands groups independently', () => {
+ it('shows every model as a first-class row with readable provider identity', () => {
renderTable([baseModel, openAiModel])
- expect(screen.getByRole('button', { name: 'Expand Anthropic models' })).toHaveAttribute(
- 'aria-expanded',
- 'false'
- )
- expect(screen.getByRole('button', { name: 'Expand OpenAI models' })).toHaveAttribute(
- 'aria-expanded',
- 'false'
- )
- expect(screen.queryByText('claude-sonnet-4-6')).toBeNull()
- expect(screen.queryByText('gpt-5')).toBeNull()
-
- expandAnthropicModels()
-
expect(screen.getByText('claude-sonnet-4-6')).toBeInTheDocument()
- expect(screen.queryByText('gpt-5')).toBeNull()
- expect(screen.getByRole('button', { name: 'Collapse Anthropic models' })).toHaveAttribute(
- 'aria-expanded',
- 'true'
- )
+ expect(screen.getByText('gpt-5')).toBeInTheDocument()
+ expect(screen.getByRole('columnheader', { name: /Provider/i })).toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: /Expand .* models/ })).toBeNull()
})
- it('surfaces stale counts in the collapsed provider summary', () => {
+ it('surfaces stale state on the affected record instead of a group summary', () => {
renderTable([{ ...baseModel, source: 'discovery', stale: true }])
- expect(screen.getByRole('button', { name: 'Expand Anthropic models' })).toHaveTextContent(
- '1 stale'
- )
+ expect(screen.getByText('claude-sonnet-4-6')).toBeInTheDocument()
})
- it('opens matching groups while searching and shows the match count', () => {
+ it('filters first-class rows without provider disclosure state', () => {
renderTable([
baseModel,
openAiModel,
@@ -343,13 +323,8 @@ describe('LlmModelTable provider groups', () => {
})
expect(screen.getByText('gpt-5')).toBeInTheDocument()
- expect(screen.queryByRole('button', { name: /Anthropic models/ })).toBeNull()
- expect(screen.getByRole('button', { name: 'Collapse OpenAI models' })).toHaveTextContent(
- '2 models'
- )
- expect(screen.getByRole('button', { name: 'Collapse OpenAI models' })).toHaveTextContent(
- '1 matching'
- )
+ expect(screen.queryByText('claude-sonnet-4-6')).toBeNull()
+ expect(screen.queryByText('o3')).toBeNull()
})
it('opens a provider selected from the provider filter', () => {
@@ -365,7 +340,7 @@ describe('LlmModelTable provider groups', () => {
expect(
screen.getByRole('button', { name: 'Filter by provider' }).querySelector('img')
).toHaveAttribute('src', '/provider-icons/openai.svg')
- expect(screen.queryByRole('button', { name: /Anthropic models/ })).toBeNull()
+ expect(screen.queryByText('claude-sonnet-4-6')).toBeNull()
})
it('shows missing-price details and a prefilled CTA only on the affected row', () => {
@@ -406,7 +381,7 @@ describe('LlmModelTable sorting', () => {
it('keeps the static LLM Models title regardless of filters', () => {
renderTable([baseModel])
- expect(document.querySelector('.cu-panel-title')?.textContent).toContain('LLM Models')
+ expect(screen.getByRole('heading', { name: /LLM Models/ })).toBeInTheDocument()
})
it('sorts models inside a provider group by model name when ascending', () => {
diff --git a/control-ui/components/__tests__/McpServerTable.test.tsx b/control-ui/components/__tests__/McpServerTable.test.tsx
index 6cceb78e5..e6448723a 100644
--- a/control-ui/components/__tests__/McpServerTable.test.tsx
+++ b/control-ui/components/__tests__/McpServerTable.test.tsx
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
-import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { buildContextResource } from '../../test/fixtures/contextResource'
import { McpServerTable } from '../McpServerTable'
@@ -184,7 +184,7 @@ describe('McpServerTable — column sorting', () => {
render(<McpServerTable items={items} />)
const listedNames = () =>
- Array.from(document.querySelectorAll('.cu-connectors-table .cu-expandable-row__name')).map(
+ Array.from(document.querySelectorAll('.cu-connectors-table tbody tr > td:first-child')).map(
element => element.textContent
)
@@ -200,8 +200,8 @@ describe('McpServerTable — column sorting', () => {
expect(listedNames()).toEqual([
'alpha-server',
'charlie-server',
- 'zebra-server',
'bravo-server',
+ 'zebra-server',
])
fireEvent.click(screen.getByRole('button', { name: 'Sort by status ascending' }))
@@ -215,7 +215,7 @@ describe('McpServerTable — column sorting', () => {
})
describe('McpServerTable — marketplace-aligned rows', () => {
- it('renders a connector description below its name in the list row', () => {
+ it('renders a connector description in its own data column', () => {
render(
<McpServerTable
items={[makeItem({ name: 'brave-search', description: 'Search the public web.' })]}
@@ -225,26 +225,17 @@ describe('McpServerTable — marketplace-aligned rows', () => {
const row = screen.getByText('brave-search').closest('tr')
expect(row).not.toBeNull()
expect(row).toHaveTextContent('Search the public web.')
- expect(row?.querySelector('.cu-registry-description')).toHaveAttribute(
- 'title',
- 'Search the public web.'
- )
+ expect(within(row!).getByTitle('Search the public web.')).toBeInTheDocument()
})
})
describe('McpServerTable — connector access summaries', () => {
- it('exposes expandable rows as named buttons with their current state', () => {
+ it('renders ordinary rows without inline detail expansion', () => {
const items = [makeItem({ name: 'airtable-server' })]
render(<McpServerTable items={items} />)
- const row = screen.getByRole('button', { name: 'Expand connector airtable-server' })
- expect(row).toHaveAttribute('aria-expanded', 'false')
-
- fireEvent.click(row)
-
- expect(
- screen.getByRole('button', { name: 'Collapse connector airtable-server' })
- ).toHaveAttribute('aria-expanded', 'true')
+ expect(screen.getByText('airtable-server').closest('tr')).not.toHaveAttribute('aria-expanded')
+ expect(screen.queryByRole('button', { name: /Expand connector/ })).toBeNull()
})
it('renders agents, teams, and users in marketplace-style access groups', () => {
@@ -269,9 +260,10 @@ describe('McpServerTable — connector access summaries', () => {
/>
)
- fireEvent.click(screen.getByText('airtable-server').closest('tr')!)
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
- const access = screen.getByRole('region', { name: 'Connector access' })
+ const access = screen.getByRole('dialog', { name: 'Access for airtable-server' })
expect(access).toHaveTextContent('Agents')
expect(access).toHaveTextContent('Teams')
expect(access).toHaveTextContent('Users')
@@ -294,47 +286,25 @@ describe('McpServerTable — connector access summaries', () => {
const items = [makeItem({ name: 'unused-server' })]
render(<McpServerTable items={items} />)
- fireEvent.click(screen.getByText('unused-server').closest('tr')!)
- expect(screen.getByText('No agents have access.')).toBeInTheDocument()
- expect(screen.getByText('No teams have access.')).toBeInTheDocument()
- expect(screen.getByText('No users have access.')).toBeInTheDocument()
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for connector unused-server' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
+ expect(screen.getByText('No agents linked.')).toBeInTheDocument()
+ expect(screen.getByText('No teams linked.')).toBeInTheDocument()
+ expect(screen.getByText('No users linked.')).toBeInTheDocument()
})
- it('orders URL, image, transport, and managed together and copies both full URLs', async () => {
+ it('shows endpoint, image, transport, and managed as explicit columns', () => {
const image =
'us-central1-docker.pkg.dev/example-project/example/nginx-egress-proxy:sha-3cbdf33'
const url = 'http://brave-search.mcp-server.svc.cluster.local:3000/mcp'
- const writeText = vi.fn().mockResolvedValue(undefined)
- Object.defineProperty(navigator, 'clipboard', {
- configurable: true,
- value: { writeText },
- })
render(<McpServerTable items={[makeItem({ name: 'airtable-server', image })]} />)
- fireEvent.click(screen.getByRole('button', { name: 'Expand connector airtable-server' }))
-
- const metadata = document.querySelector('.cu-connector-detail__metadata')
- expect(metadata).not.toBeNull()
- const labels = Array.from(metadata!.querySelectorAll('.cu-expandable-field__label')).map(
- label => label.textContent
- )
- expect(labels).toEqual(['URL', 'Image', 'Transport', 'Managed'])
- expect(metadata).not.toHaveTextContent('Default context')
-
- const compactUrl = screen.getByTitle(url)
- expect(compactUrl.textContent).toContain('...')
- expect(compactUrl).toHaveAttribute('href', url)
- const compactImage = screen.getByTitle(image)
- expect(compactImage.textContent).toContain('...')
- expect(compactImage.textContent).not.toBe(image)
-
- fireEvent.click(screen.getByRole('button', { name: 'Copy image URL' }))
- await waitFor(() => expect(writeText).toHaveBeenCalledWith(image))
- expect(screen.getByRole('button', { name: 'image URL copied' })).toBeInTheDocument()
-
- fireEvent.click(screen.getByRole('button', { name: 'Copy URL' }))
- await waitFor(() => expect(writeText).toHaveBeenCalledWith(url))
- expect(screen.getByRole('button', { name: 'URL copied' })).toBeInTheDocument()
+ expect(screen.getByRole('columnheader', { name: /Endpoint/i })).toBeInTheDocument()
+ expect(screen.getByRole('columnheader', { name: /Image/i })).toBeInTheDocument()
+ expect(screen.getByRole('columnheader', { name: /Transport/i })).toBeInTheDocument()
+ expect(screen.getByRole('columnheader', { name: /Managed/i })).toBeInTheDocument()
+ expect(screen.getByTitle(url)).toBeInTheDocument()
+ expect(screen.getByTitle(image)).toBeInTheDocument()
})
it('filters rows by agent, user, and team access labels', () => {
@@ -389,13 +359,14 @@ describe('McpServerTable — context membership', () => {
/>
)
- fireEvent.click(screen.getByRole('button', { name: 'Expand connector airtable-server' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
expect(screen.queryByText('removed-context')).not.toBeInTheDocument()
expect(screen.getByText('No contexts linked.')).toBeInTheDocument()
- expect(screen.getByText('No agents have access.')).toBeInTheDocument()
- expect(screen.getByText('No teams have access.')).toBeInTheDocument()
- expect(screen.getByText('No users have access.')).toBeInTheDocument()
+ expect(screen.getByText('No agents linked.')).toBeInTheDocument()
+ expect(screen.getByText('No teams linked.')).toBeInTheDocument()
+ expect(screen.getByText('No users linked.')).toBeInTheDocument()
})
it('shows attached contexts and lets an operator remove the connector from one', async () => {
@@ -417,16 +388,8 @@ describe('McpServerTable — context membership', () => {
/>
)
- fireEvent.click(screen.getByRole('button', { name: 'Expand connector airtable-server' }))
-
- expect(screen.getByRole('heading', { name: 'Contexts' })).toBeInTheDocument()
- expect(screen.queryByText('Default', { exact: true })).not.toBeInTheDocument()
- expect(screen.getByText('research')).toBeInTheDocument()
- fireEvent.click(
- screen.getByRole('button', {
- name: 'Remove connector airtable-server from context research',
- })
- )
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Remove from research' }))
expect(onRemoveFromContext).toHaveBeenCalledWith(
{ namespace: 'mcp-server', name: 'airtable-server' },
@@ -449,8 +412,8 @@ describe('McpServerTable — context membership', () => {
/>
)
- fireEvent.click(screen.getByRole('button', { name: 'Expand connector airtable-server' }))
- fireEvent.click(screen.getByRole('button', { name: 'Add contexts' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Add to contexts' }))
const dialog = screen.getByRole('dialog', { name: 'Add connector to contexts' })
expect(dialog).toBeInTheDocument()
@@ -485,9 +448,9 @@ describe('McpServerTable — row actions kebab', () => {
const trigger = screen.getByRole('button', { name: 'Actions for connector airtable-server' })
fireEvent.click(trigger)
- const editItem = await screen.findByRole('menuitem', { name: 'Edit' })
+ const editItem = await screen.findByRole('menuitem', { name: 'View details' })
const deleteItem = screen.getByRole('menuitem', { name: 'Delete' })
- expect(deleteItem).toHaveClass('cu-kebab__item--danger')
+ expect(deleteItem).toHaveClass('eft-row-actions__item--danger')
fireEvent.click(editItem)
expect(onEdit).toHaveBeenCalledWith({ namespace: 'mcp-server', name: 'airtable-server' })
@@ -514,18 +477,18 @@ describe('McpServerTable — row actions kebab', () => {
fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
- const editItem = screen.getByRole('menuitem', { name: 'Edit' })
+ const editItem = screen.getByRole('menuitem', { name: 'View details' })
const deletingItem = screen.getByRole('menuitem', { name: 'Deleting…' })
expect(editItem).not.toBeDisabled()
expect(deletingItem).toBeDisabled()
})
- it('renders no kebab when neither onEdit nor onDelete is provided', () => {
+ it('retains the access-details menu when edit and delete are unavailable', () => {
const items = [makeItem({ name: 'airtable-server' })]
render(<McpServerTable items={items} />)
expect(
- screen.queryByRole('button', { name: 'Actions for connector airtable-server' })
- ).not.toBeInTheDocument()
+ screen.getByRole('button', { name: 'Actions for connector airtable-server' })
+ ).toBeInTheDocument()
})
})
diff --git a/control-ui/components/__tests__/OwnedEntries.test.tsx b/control-ui/components/__tests__/OwnedEntries.test.tsx
index 4e79b10b8..17ff898cb 100644
--- a/control-ui/components/__tests__/OwnedEntries.test.tsx
+++ b/control-ui/components/__tests__/OwnedEntries.test.tsx
@@ -35,6 +35,9 @@ vi.mock('next/navigation', () => ({
function render(ui: React.ReactNode) {
return rtlRender(<ToastProvider>{ui}</ToastProvider>)
}
+async function openActions(entry = '@acme/db', version = '1.0.0') {
+ fireEvent.click(await screen.findByRole('button', { name: `Actions for ${entry} v${version}` }))
+}
afterEach(cleanup)
beforeEach(() => {
vi.clearAllMocks()
@@ -120,8 +123,9 @@ describe('OwnedEntries', () => {
],
})
render(<OwnedEntries orgScope="acme" />)
- await screen.findByText('@acme/db')
- expect(screen.getAllByRole('button', { name: /share access/i })).toHaveLength(1)
+ await screen.findAllByText('@acme/db')
+ await openActions()
+ expect(screen.getByRole('menuitem', { name: /share access/i })).toBeInTheDocument()
expect(screen.queryByText(/no grant needed/i)).toBeNull()
})
@@ -132,7 +136,8 @@ describe('OwnedEntries', () => {
render(<OwnedEntries orgScope="acme" />)
// Modal is not in the DOM until the button is clicked.
expect(screen.queryByRole('dialog')).toBeNull()
- fireEvent.click(await screen.findByRole('button', { name: /share access/i }))
+ await openActions()
+ fireEvent.click(screen.getByRole('menuitem', { name: /share access/i }))
expect(await screen.findByRole('dialog', { name: /grant access/i })).toBeInTheDocument()
expect(await screen.findByLabelText(/grantee org/i)).toBeInTheDocument()
expect(api.listOrgGrants).toHaveBeenCalledWith('@acme/db')
@@ -146,7 +151,8 @@ describe('OwnedEntries', () => {
new Promise(() => undefined) as ReturnType<typeof api.listOrgGrants>
)
const view = render(<OwnedEntries orgScope="acme" />)
- fireEvent.click(await screen.findByRole('button', { name: /share access/i }))
+ await openActions()
+ fireEvent.click(screen.getByRole('menuitem', { name: /share access/i }))
expect(screen.getByRole('status', { name: /loading grants/i })).toBeInTheDocument()
expect(screen.queryByText(/Loading grants/i)).toBeNull()
expect(view.container.querySelectorAll('.cu-skeleton').length).toBeGreaterThan(0)
@@ -157,7 +163,8 @@ describe('OwnedEntries', () => {
data: [{ name: '@acme/db', version: '1.0.0', visibility: 'private', status: 'published' }],
})
render(<OwnedEntries orgScope="acme" />)
- fireEvent.click(await screen.findByRole('button', { name: /share access/i }))
+ await openActions()
+ fireEvent.click(screen.getByRole('menuitem', { name: /share access/i }))
expect(await screen.findByRole('dialog', { name: /grant access/i })).toBeInTheDocument()
// Disambiguate from the icon close button (aria-label="Close") using text.
fireEvent.click(screen.getByText('Close', { selector: 'button' }))
@@ -270,7 +277,8 @@ describe('OwnedEntries', () => {
data: [{ name: '@acme/db', version: '1.0.0', visibility: 'private', status: 'published' }],
})
render(<OwnedEntries orgScope="acme" />)
- fireEvent.click(await screen.findByRole('button', { name: 'Install' }))
+ await openActions()
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Install' }))
expect(navigation.push).toHaveBeenCalledWith(expect.stringContaining('/marketplace/install'))
})
@@ -284,8 +292,9 @@ describe('OwnedEntries', () => {
installed: { catalogKeys: [], serverNames: [], recipeKeys: ['@acme/[email protected]'] },
} as never)
render(<OwnedEntries orgScope="acme" />)
- expect(await screen.findByRole('button', { name: 'Installed' })).toBeDisabled()
- expect(screen.queryByRole('button', { name: 'Install' })).toBeNull()
+ await openActions()
+ expect(screen.getByRole('menuitem', { name: 'Installed' })).toBeDisabled()
+ expect(screen.queryByRole('menuitem', { name: 'Install' })).toBeNull()
})
it('removes an entry from the row actions menu after confirmation', async () => {
@@ -314,7 +323,7 @@ describe('OwnedEntries', () => {
expect(api.deleteRegistryEntry).not.toHaveBeenCalled()
})
- it('collapses same-named versions into one row showing the latest, expandable to previous', async () => {
+ it('renders every published version as a first-class record row', async () => {
vi.mocked(api.getOwnedRegistryEntries).mockResolvedValue({
data: [
{ name: '@acme/db', version: '1.0.0', visibility: 'private', status: 'published' },
@@ -323,21 +332,15 @@ describe('OwnedEntries', () => {
],
})
render(<OwnedEntries orgScope="acme" />)
- await screen.findByText('@acme/db')
- // One collapsed row: latest version leads, previous count summarized.
+ await screen.findAllByText('@acme/db')
+ expect(screen.getAllByText('@acme/db')).toHaveLength(3)
expect(screen.getByText('1.2.0')).toBeInTheDocument()
- expect(screen.getByText('+2 more')).toBeInTheDocument()
- // Previous versions are hidden until the row is expanded.
- expect(screen.queryByText('1.1.0')).toBeNull()
- expect(screen.queryByText('1.0.0')).toBeNull()
-
- fireEvent.click(screen.getByText('@acme/db'))
- expect(await screen.findByText('Previous versions')).toBeInTheDocument()
expect(screen.getByText('1.1.0')).toBeInTheDocument()
expect(screen.getByText('1.0.0')).toBeInTheDocument()
+ expect(screen.queryByText('Previous versions')).toBeNull()
})
- it('row Install targets the latest version; expanded rows install previous versions', async () => {
+ it('each version row installs that exact published version', async () => {
vi.mocked(api.getOwnedRegistryEntries).mockResolvedValue({
data: [
{ name: '@acme/db', version: '1.0.0', visibility: 'private', status: 'published' },
@@ -345,18 +348,14 @@ describe('OwnedEntries', () => {
],
})
render(<OwnedEntries orgScope="acme" />)
- await screen.findByText('@acme/db')
- // Collapsed row's Install goes to the latest version.
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
+ await screen.findAllByText('@acme/db')
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for @acme/db v2.0.0' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Install' }))
expect(navigation.push).toHaveBeenCalledWith(expect.stringContaining('version=2.0.0'))
navigation.push.mockClear()
- fireEvent.click(screen.getByText('@acme/db'))
- await screen.findByText('Previous versions')
- // Now there are two Installs: the latest (main row) then the previous (detail).
- const installs = screen.getAllByRole('button', { name: 'Install' })
- expect(installs).toHaveLength(2)
- fireEvent.click(installs[1])
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for @acme/db v1.0.0' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Install' }))
expect(navigation.push).toHaveBeenCalledWith(expect.stringContaining('version=1.0.0'))
})
diff --git a/control-ui/components/__tests__/ProfileAdminHome.test.tsx b/control-ui/components/__tests__/ProfileAdminHome.test.tsx
index e8beece45..f360bda34 100644
--- a/control-ui/components/__tests__/ProfileAdminHome.test.tsx
+++ b/control-ui/components/__tests__/ProfileAdminHome.test.tsx
@@ -119,7 +119,10 @@ describe('ProfileAdminHome — members invitations', () => {
expect(screen.queryByText('Pending Invitee')).not.toBeInTheDocument()
expect(screen.getByText('Accepted Invitee')).toBeInTheDocument()
expect(screen.getByLabelText('Invitation accepted, password setup pending')).toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'Resend invite' })).toBeInTheDocument()
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Actions for invitation to [email protected]' })
+ )
+ expect(screen.getByRole('menuitem', { name: 'Resend' })).toBeInTheDocument()
})
it('keeps the new create member route as the add-member flow', async () => {
@@ -154,7 +157,7 @@ describe('ProfileAdminHome — members invitations', () => {
await screen.findByLabelText('Open member Accepted Invitee')
- fireEvent.click(screen.getByRole('button', { name: 'Delete member Accepted Invitee' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for member Accepted Invitee' }))
expect(mockPush).not.toHaveBeenCalled()
})
@@ -164,17 +167,8 @@ describe('ProfileAdminHome — members invitations', () => {
await screen.findByLabelText('Open member Accepted Invitee')
- const createAdminButton = screen.getByRole('button', {
- name: 'Create admin for member Accepted Invitee',
- })
- expect(createAdminButton).toHaveAttribute('title', 'Create admin')
- expect(createAdminButton.querySelector('svg')).toHaveAttribute(
- 'data-relationship-role',
- 'admin'
- )
- expect(createAdminButton.querySelector('svg')).toHaveAttribute('data-create-badge', 'true')
-
- fireEvent.click(createAdminButton)
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for member Accepted Invitee' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Create administrator access' }))
expect(mockPush).toHaveBeenCalledWith(
'/users-and-teams/admins/new?email=accepted%40example.com&name=Accepted+Invitee&step=review&source=member'
@@ -201,14 +195,8 @@ describe('ProfileAdminHome — members invitations', () => {
})
renderProfileAdminHome()
- const viewAdminButton = await screen.findByRole('button', {
- name: 'View admin for member Member',
- })
- expect(viewAdminButton).toHaveAttribute('title', 'View admin')
- expect(viewAdminButton.querySelector('svg')).toHaveAttribute('data-relationship-role', 'admin')
- expect(viewAdminButton.querySelector('svg')).not.toHaveAttribute('data-create-badge')
-
- fireEvent.click(viewAdminButton)
+ fireEvent.click(await screen.findByRole('button', { name: 'Actions for member Member' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'View administrator access' }))
expect(mockPush).toHaveBeenCalledWith('/users-and-teams/admins?highlightAdminId=admin-1')
})
@@ -231,7 +219,7 @@ describe('ProfileAdminHome — members invitations', () => {
await screen.findByLabelText('Open team Marketing')
- fireEvent.click(screen.getByRole('button', { name: 'Delete team Marketing' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for team Marketing' }))
expect(mockPush).not.toHaveBeenCalled()
})
@@ -307,7 +295,10 @@ describe('ProfileAdminHome — members invitations', () => {
await waitFor(() => expect(screen.getByText('Pending invitations')).toBeInTheDocument())
- fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Actions for invitation to [email protected]' })
+ )
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Cancel' }))
expect(screen.getByRole('alertdialog', { name: 'Cancel invitation?' })).toBeInTheDocument()
@@ -323,7 +314,8 @@ describe('ProfileAdminHome — members invitations', () => {
await waitFor(() => expect(screen.getByText('Accepted Invitee')).toBeInTheDocument())
- fireEvent.click(screen.getByLabelText('Delete member Accepted Invitee'))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for member Accepted Invitee' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Delete member' }))
await waitFor(() => {
expect(screen.getByRole('checkbox', { name: /Delete empty teams too/ })).toBeInTheDocument()
@@ -355,7 +347,8 @@ describe('ProfileAdminHome — members invitations', () => {
renderProfileAdminHome()
await waitFor(() => expect(screen.getByText('Accepted Invitee')).toBeInTheDocument())
- fireEvent.click(screen.getByLabelText('Delete member Accepted Invitee'))
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for member Accepted Invitee' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Delete member' }))
await waitFor(() =>
expect(screen.getByRole('button', { name: 'Delete account' })).toBeEnabled()
)
diff --git a/control-ui/components/__tests__/RecipeIntegrationsPanel.userGrants.test.tsx b/control-ui/components/__tests__/RecipeIntegrationsPanel.userGrants.test.tsx
index 88b91a899..ae1ea725f 100644
--- a/control-ui/components/__tests__/RecipeIntegrationsPanel.userGrants.test.tsx
+++ b/control-ui/components/__tests__/RecipeIntegrationsPanel.userGrants.test.tsx
@@ -1,15 +1,16 @@
/**
* Tests for RecipeIntegrationsPanel — per-user background grants subsection.
*
- * These tests cover the "Show users" toggle, user row rendering, and the
- * Revoke admin action on the per-user grants subsection that appears when
+ * These tests cover the user-grants action, user row rendering, and the
+ * Revoke admin action in the grants dialog that appears when
* an oauthClient has backgroundAccess: true.
*/
import React from 'react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { act, cleanup, render, screen, waitFor } from '@testing-library/react'
+import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import type { WorkflowRecipeResource } from '../../lib/api'
+import { RecipeIntegrationsPanel } from '../RecipeIntegrationsPanel'
import { ToastProvider } from '../Toast'
// ── Mock declarations ────────────────────────────────────────────────────────
@@ -50,8 +51,6 @@ vi.mock('../icons', () => ({
IconRefresh: () => <span data-testid="icon-refresh" />,
}))
-import { RecipeIntegrationsPanel } from '../RecipeIntegrationsPanel'
-
// ── Fixtures ─────────────────────────────────────────────────────────────────
const recipe: WorkflowRecipeResource = {
@@ -71,14 +70,14 @@ function renderPanel() {
...render(
<ToastProvider>
<RecipeIntegrationsPanel recipe={recipe} />
- </ToastProvider>,
+ </ToastProvider>
),
user,
}
}
/**
- * Render the panel, wait for status to load, click "Show users", and wait for
+ * Render the panel, wait for status to load, open "Manage user grants", and wait for
* the resolved user grants to appear. Returns `user` for further interactions.
*/
async function renderAndExpandGrants() {
@@ -95,8 +94,8 @@ async function renderAndExpandGrants() {
// Wait for initial status fetch ("Not connected" or any status chip appears)
await screen.findByText('Not connected')
- // Click "Show users" to trigger loadUserGrants()
- await user.click(screen.getByRole('button', { name: /Show users/i }))
+ await user.click(screen.getByRole('button', { name: 'Actions for salesforce' }))
+ await user.click(screen.getByRole('menuitem', { name: 'Manage user grants' }))
// Confirm the subsection is expanded and loading
await screen.findByText('Per-user connections')
@@ -134,17 +133,17 @@ describe('RecipeIntegrationsPanel — per-user grants subsection', () => {
expect(screen.getByText('Salesforce')).toBeInTheDocument()
expect(screen.getByText('Not connected')).toBeInTheDocument()
- // "Show users" button present and enabled when recipeName is set
- const showBtn = screen.getByRole('button', { name: /Show users/i })
- expect(showBtn).toBeInTheDocument()
- expect(showBtn).not.toBeDisabled()
+ const actions = screen.getByRole('button', { name: 'Actions for salesforce' })
+ expect(actions).toBeInTheDocument()
+ expect(actions).not.toBeDisabled()
})
- it('clicking "Show users" calls adminListUserGrants(recipeName, oauthClientId)', async () => {
+ it('selecting "Manage user grants" calls adminListUserGrants', async () => {
const { user } = renderPanel()
await screen.findByText('Not connected')
- await user.click(screen.getByRole('button', { name: /Show users/i }))
+ await user.click(screen.getByRole('button', { name: 'Actions for salesforce' }))
+ await user.click(screen.getByRole('menuitem', { name: 'Manage user grants' }))
await waitFor(() =>
expect(mocks.adminListUserGrants).toHaveBeenCalledWith('crm-recipe', 'salesforce')
@@ -158,19 +157,20 @@ describe('RecipeIntegrationsPanel — per-user grants subsection', () => {
const { user } = renderPanel()
await screen.findByText('Not connected')
- await user.click(screen.getByRole('button', { name: /Show users/i }))
+ await user.click(screen.getByRole('button', { name: 'Actions for salesforce' }))
+ await user.click(screen.getByRole('menuitem', { name: 'Manage user grants' }))
await screen.findByText('Per-user connections')
expect(screen.getByText('Loading…')).toBeInTheDocument()
- // Toggle button flips to "Hide users" while expanded
- expect(screen.getByRole('button', { name: /Hide users/i })).toBeInTheDocument()
+ expect(screen.getByRole('dialog', { name: 'Per-user connections' })).toBeInTheDocument()
})
it('renders the user row after adminListUserGrants resolves', async () => {
await renderAndExpandGrants()
await waitFor(() => expect(screen.getByText('user-abc-123')).toBeInTheDocument())
- expect(screen.getByRole('button', { name: /Revoke/i })).toBeInTheDocument()
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
+ expect(screen.getByRole('menuitem', { name: /Revoke/i })).toBeInTheDocument()
})
it('calls adminRevokeUserGrant when admin confirms the revoke dialog', async () => {
@@ -178,13 +178,14 @@ describe('RecipeIntegrationsPanel — per-user grants subsection', () => {
await renderAndExpandGrants()
- await waitFor(() => screen.getByRole('button', { name: /Revoke/i }))
+ await waitFor(() => screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
// Reset after initial load so the post-revoke reload doesn't confuse assertions
mocks.adminListUserGrants.mockResolvedValue({ users: [] })
const { user } = { user: userEvent.setup({ delay: null }) }
- await user.click(screen.getByRole('button', { name: /Revoke/i }))
+ await user.click(screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
+ await user.click(screen.getByRole('menuitem', { name: /Revoke/i }))
await waitFor(() =>
expect(mocks.adminRevokeUserGrant).toHaveBeenCalledWith(
@@ -200,10 +201,11 @@ describe('RecipeIntegrationsPanel — per-user grants subsection', () => {
await renderAndExpandGrants()
- await waitFor(() => screen.getByRole('button', { name: /Revoke/i }))
+ await waitFor(() => screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
const { user } = { user: userEvent.setup({ delay: null }) }
- await user.click(screen.getByRole('button', { name: /Revoke/i }))
+ await user.click(screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
+ await user.click(screen.getByRole('menuitem', { name: /Revoke/i }))
// Give any pending promises a tick to settle
await new Promise(r => setTimeout(r, 0))
@@ -219,10 +221,11 @@ describe('RecipeIntegrationsPanel — per-user grants subsection', () => {
await renderAndExpandGrants()
- await waitFor(() => screen.getByRole('button', { name: /Revoke/i }))
+ await waitFor(() => screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
const { user } = { user: userEvent.setup({ delay: null }) }
- await user.click(screen.getByRole('button', { name: /Revoke/i }))
+ await user.click(screen.getByRole('button', { name: 'Actions for user user-abc-123' }))
+ await user.click(screen.getByRole('menuitem', { name: /Revoke/i }))
await waitFor(() => expect(mocks.confirm).toHaveBeenCalled())
})
diff --git a/control-ui/components/__tests__/RegistryCatalog.test.tsx b/control-ui/components/__tests__/RegistryCatalog.test.tsx
index 59c1e3953..99e4d2be4 100644
--- a/control-ui/components/__tests__/RegistryCatalog.test.tsx
+++ b/control-ui/components/__tests__/RegistryCatalog.test.tsx
@@ -146,21 +146,23 @@ describe('RegistryCatalog tabs and columns', () => {
expect(screen.queryByText('market-report')).not.toBeInTheDocument()
})
- it('uses compact connector columns', async () => {
+ it('uses explicit record columns and one actions column', async () => {
mockApiSuccess()
render(<RegistryCatalog />)
await screen.findByText('brave-search')
- for (const heading of ['Name', 'Version']) {
+ for (const heading of [
+ 'Name',
+ 'Description',
+ 'Type',
+ 'Tags',
+ 'Trust',
+ 'Verification',
+ 'Version',
+ ]) {
expect(screen.getByRole('columnheader', { name: heading })).toBeInTheDocument()
}
- for (const actionHeading of ['Installation', 'Edit or remove']) {
- expect(screen.getByRole('columnheader', { name: actionHeading })).toBeInTheDocument()
- }
- expect(screen.queryByRole('columnheader', { name: 'View details' })).not.toBeInTheDocument()
- for (const removed of ['Type', 'Category', 'Trust', 'Quality', 'Downloads', 'Visibility']) {
- expect(screen.queryByRole('columnheader', { name: removed })).not.toBeInTheDocument()
- }
+ expect(screen.getByRole('columnheader', { name: 'Actions' })).toBeInTheDocument()
})
it('excludes private entries from the Marketplace', async () => {
@@ -202,14 +204,12 @@ describe('RegistryCatalog tabs and columns', () => {
)
})
- it('links entry names to their shareable detail routes', async () => {
+ it('navigates a record row to its shareable detail route', async () => {
mockApiSuccess()
render(<RegistryCatalog />)
- expect(await screen.findByRole('link', { name: 'brave-search' })).toHaveAttribute(
- 'href',
- '/marketplace/entries/brave-search/1.0.0'
- )
+ fireEvent.click((await screen.findByText('brave-search')).closest('tr')!)
+ expect(navigation.push).toHaveBeenCalledWith('/marketplace/entries/brave-search/1.0.0')
})
it('sorts connectors by name and version from their headers', async () => {
@@ -237,52 +237,44 @@ describe('RegistryCatalog tabs and columns', () => {
})
})
-describe('RegistryCatalog expansion and actions', () => {
- it('keeps installation and metadata actions in separate columns', async () => {
+describe('RegistryCatalog record navigation and actions', () => {
+ it('keeps all record actions in one overflow menu', async () => {
mockApiSuccess()
render(<RegistryCatalog />)
const row = (await screen.findByText('brave-search')).closest('tr')!
- const installCell = within(row).getByRole('button', { name: 'Install' }).closest('td')
- const actionsCell = within(row)
- .getByRole('button', { name: 'Actions for brave-search v1.0.0' })
- .closest('td')
-
- expect(installCell).not.toBe(actionsCell)
- expect(within(row).queryByRole('button', { name: 'View details' })).not.toBeInTheDocument()
+ const trigger = within(row).getByRole('button', {
+ name: 'Actions for brave-search v1.0.0',
+ })
+ expect(within(row).queryByRole('button', { name: 'Install' })).toBeNull()
+ fireEvent.click(trigger)
+ expect(screen.getByRole('menuitem', { name: 'View details' })).toBeInTheDocument()
+ expect(screen.getByRole('menuitem', { name: 'Install' })).toBeInTheDocument()
})
- it('reveals metadata only after the full row is expanded', async () => {
+ it('shows former detail metadata in ordinary columns without expansion', async () => {
mockApiSuccess()
render(<RegistryCatalog />)
const row = (await screen.findByText('brave-search')).closest('tr')!
- expect(screen.queryByText('local / streamableHttp')).not.toBeInTheDocument()
- fireEvent.click(row)
-
- expect(screen.getByText('Type')).toBeInTheDocument()
- const detailRow = screen.getByText('Type').closest('tr')!
- expect(within(detailRow).getAllByText('search')).toHaveLength(1)
- expect(screen.getByText('Trust')).toBeInTheDocument()
- expect(screen.getByText('Verification')).toBeInTheDocument()
- expect(screen.getByText('Tags')).toBeInTheDocument()
- expect(screen.getByText('HIGH')).toBeInTheDocument()
- expect(screen.getByText('verified')).toBeInTheDocument()
- expect(screen.getByText('web')).toBeInTheDocument()
- expect(screen.getByText('local / streamableHttp')).toBeInTheDocument()
- expect(row).toHaveAttribute('aria-expanded', 'true')
+ expect(within(row).getByText('local / streamableHttp')).toBeInTheDocument()
+ expect(within(row).getByText('HIGH')).toBeInTheDocument()
+ expect(within(row).getByText('verified')).toBeInTheDocument()
+ expect(within(row).getByText('search, web')).toBeInTheDocument()
+ expect(row).not.toHaveAttribute('aria-expanded')
})
- it('opens the connector install flow without expanding the row', async () => {
+ it('opens the connector install flow from the overflow menu', async () => {
mockApiSuccess()
render(<RegistryCatalog />)
const row = (await screen.findByText('brave-search')).closest('tr')!
- fireEvent.click(within(row).getByRole('button', { name: 'Install' }))
+ fireEvent.click(within(row).getByRole('button', { name: 'Actions for brave-search v1.0.0' }))
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Install' }))
expect(navigation.push).toHaveBeenCalledWith(
'/marketplace/install?entry=brave-search&version=1.0.0'
)
- expect(row).toHaveAttribute('aria-expanded', 'false')
+ expect(row).not.toHaveAttribute('aria-expanded')
})
it('marks installed connectors as unavailable for repeat installation', async () => {
@@ -290,7 +282,9 @@ describe('RegistryCatalog expansion and actions', () => {
render(<RegistryCatalog />)
const row = (await screen.findByText('brave-search')).closest('tr')!
- expect(within(row).getByRole('button', { name: 'Installed' })).toBeDisabled()
+ fireEvent.click(within(row).getByRole('button', { name: 'Actions for brave-search v1.0.0' }))
+ expect(screen.getByRole('menuitem', { name: 'Installed' })).toBeDisabled()
+ expect(screen.queryByRole('menuitem', { name: 'Install' })).toBeNull()
})
it('removes an entry after confirmation', async () => {
@@ -354,7 +348,7 @@ describe('RegistryCatalog state handling', () => {
vi.mocked(api.getPublishScope).mockReturnValue(new Promise(() => {}))
const { container } = render(<RegistryCatalog />)
- expect(container.querySelectorAll('.cu-skeleton')).toHaveLength(20)
+ expect(container.querySelectorAll('.cu-skeleton')).toHaveLength(40)
})
it('shows an API error', async () => {
@@ -466,10 +460,10 @@ describe('RegistryCatalog - capability-gated controls (§5.1)', () => {
expect(screen.queryByRole('button', { name: 'Marketplace actions' })).not.toBeInTheDocument()
// Editing/removing moves to the ownership area, so the discovery row no
// longer offers them (design spec §5.4).
- expect(
- within(row).queryByRole('button', { name: 'Actions for brave-search v1.0.0' })
- ).not.toBeInTheDocument()
- expect(screen.queryByRole('columnheader', { name: 'Edit or remove' })).not.toBeInTheDocument()
+ fireEvent.click(within(row).getByRole('button', { name: 'Actions for brave-search v1.0.0' }))
+ expect(screen.getByRole('menuitem', { name: 'View details' })).toBeInTheDocument()
+ expect(screen.queryByRole('menuitem', { name: 'Edit' })).toBeNull()
+ expect(screen.queryByRole('menuitem', { name: 'Remove from Marketplace' })).toBeNull()
})
it('org owner: owned entries are badged and lead to the ownership area', async () => {
@@ -478,10 +472,14 @@ describe('RegistryCatalog - capability-gated controls (§5.1)', () => {
render(<RegistryCatalog />)
const ownedRow = (await screen.findByText('@acme/internal-tool')).closest('tr')!
- expect(within(ownedRow).getByRole('link', { name: 'You own this' })).toHaveAttribute(
- 'href',
- '/publisher/entries'
+ expect(within(ownedRow).getByText('Owned by your organization')).toBeInTheDocument()
+ fireEvent.click(
+ within(ownedRow).getByRole('button', {
+ name: 'Actions for @acme/internal-tool v1.0.0',
+ })
)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Manage published entry' }))
+ expect(navigation.push).toHaveBeenCalledWith('/marketplace/org/entries')
// A catalog entry the org does not own carries no ownership badge.
const otherRow = screen.getByText('brave-search').closest('tr')!
expect(within(otherRow).queryByRole('link', { name: 'You own this' })).not.toBeInTheDocument()
diff --git a/control-ui/components/__tests__/SecretsTable.test.tsx b/control-ui/components/__tests__/SecretsTable.test.tsx
index 805d8b4aa..8d27a6cdf 100644
--- a/control-ui/components/__tests__/SecretsTable.test.tsx
+++ b/control-ui/components/__tests__/SecretsTable.test.tsx
@@ -516,7 +516,7 @@ describe('SecretsTable — recipe pending refs', () => {
})
describe('SecretsTable — LLM empty state', () => {
- it('keeps LLM nested under API-KEY without a sibling Subscription scope', async () => {
+ it('keeps API keys and subscriptions as explicit LLM sibling scopes', async () => {
rtlRender(
<ToastProvider>
<SecretsTable
@@ -531,12 +531,13 @@ describe('SecretsTable — LLM empty state', () => {
</ToastProvider>
)
expect(await screen.findByText('No LLM secrets found.')).toBeInTheDocument()
- expect(screen.getByRole('tab', { name: 'API-KEY' })).toHaveAttribute('aria-selected', 'true')
- expect(screen.getByRole('tab', { name: 'Subscriptions' })).toHaveAttribute(
+ expect(screen.getByRole('tab', { name: 'LLM API keys' })).toHaveAttribute(
+ 'aria-selected',
+ 'true'
+ )
+ expect(screen.getByRole('tab', { name: 'LLM subscriptions' })).toHaveAttribute(
'href',
'/secrets/llm/subscriptions'
)
- expect(screen.getByRole('tab', { name: 'LLM' })).toBeInTheDocument()
- expect(screen.queryByRole('tab', { name: /^Subscription$/ })).not.toBeInTheDocument()
})
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index b8ff6885d..0f597b5f1 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.478",
+ "version": "0.1.479",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.478",
+ "version": "0.1.479",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-table-system": "file:../packages/frontend-table-system",
diff --git a/control-ui/package.json b/control-ui/package.json
index a649e2177..31cb91d5a 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.478",
+ "version": "0.1.479",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/packages/frontend-table-system/src/index.tsx b/packages/frontend-table-system/src/index.tsx
index ebd80599c..2c5fe009f 100644
--- a/packages/frontend-table-system/src/index.tsx
+++ b/packages/frontend-table-system/src/index.tsx
@@ -103,7 +103,9 @@ export function RecordList({ className, ...props }: HTMLAttributes<HTMLDivElemen
}
export function RecordListRow({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
- return <div {...props} className={classNames('eft-record-list__row', className)} role="listitem" />
+ return (
+ <div {...props} className={classNames('eft-record-list__row', className)} role="listitem" />
+ )
}
export function DataTable({
@@ -111,7 +113,9 @@ export function DataTable({
variant = 'standard',
...props
}: TableHTMLAttributes<HTMLTableElement> & { variant?: TableVariant }) {
- return <table {...props} className={classNames('eft-table', `eft-table--${variant}`, className)} />
+ return (
+ <table {...props} className={classNames('eft-table', `eft-table--${variant}`, className)} />
+ )
}
export function TableRow({
@@ -121,7 +125,8 @@ export function TableRow({
}: React.HTMLAttributes<HTMLTableRowElement> & { onNavigate?: () => void }) {
const activate = (event: KeyboardEvent<HTMLTableRowElement>) => {
props.onKeyDown?.(event)
- if (event.defaultPrevented || !onNavigate || (event.key !== 'Enter' && event.key !== ' ')) return
+ if (event.defaultPrevented || !onNavigate || (event.key !== 'Enter' && event.key !== ' '))
+ return
event.preventDefault()
onNavigate()
}
@@ -133,7 +138,8 @@ export function TableRow({
props.onClick?.(event)
if (event.defaultPrevented || !onNavigate) return
const target = event.target as HTMLElement
- if (target.closest('a,button,input,select,textarea,[role="button"],[role="menuitem"]')) return
+ if (target.closest('a,button,input,select,textarea,[role="button"],[role="menuitem"]'))
+ return
onNavigate()
}}
onKeyDown={activate}
@@ -156,12 +162,14 @@ export function TableHeaderCell({
kind = 'text',
label,
onSort,
+ sortLabel,
...props
}: Omit<ThHTMLAttributes<HTMLTableCellElement>, 'children'> & {
activeDirection?: SortDirection | null
kind?: CellKind
label: ReactNode
onSort?: () => void
+ sortLabel?: ReactNode
}) {
const ariaSort = activeDirection
? activeDirection === 'asc'
@@ -177,7 +185,21 @@ export function TableHeaderCell({
className={classNames(`eft-table__header--${kind}`, className)}
scope={props.scope ?? 'col'}
>
- {onSort ? (
+ {onSort && sortLabel ? (
+ <span className="eft-table__sort-group">
+ {label}
+ <button
+ aria-label={`Sort by ${String(sortLabel)}`}
+ className="eft-table__sort eft-table__sort--icon"
+ onClick={onSort}
+ type="button"
+ >
+ <span aria-hidden="true" className="eft-table__sort-indicator">
+ {activeDirection === 'asc' ? '↑' : activeDirection === 'desc' ? '↓' : '↕'}
+ </span>
+ </button>
+ </span>
+ ) : onSort ? (
<button className="eft-table__sort" onClick={onSort} type="button">
<span>{label}</span>
<span aria-hidden="true" className="eft-table__sort-indicator">
@@ -274,8 +296,12 @@ export function RowActionMenu({
const anchor = trigger.getBoundingClientRect()
const bounds = menu.getBoundingClientRect()
const inset = 8
- const left = Math.max(inset, Math.min(anchor.right - bounds.width, innerWidth - bounds.width - inset))
- const above = anchor.bottom + bounds.height + inset > innerHeight && anchor.top > bounds.height
+ const left = Math.max(
+ inset,
+ Math.min(anchor.right - bounds.width, innerWidth - bounds.width - inset)
+ )
+ const above =
+ anchor.bottom + bounds.height + inset > innerHeight && anchor.top > bounds.height
setPosition({ left, top: above ? anchor.top - bounds.height - inset : anchor.bottom + inset })
}
place()
@@ -374,7 +400,8 @@ export function compareSortValues(left: SortValue, right: SortValue): number {
if (left == null) return right == null ? 0 : 1
if (right == null) return -1
const a = left instanceof Date ? left.getTime() : typeof left === 'boolean' ? Number(left) : left
- const b = right instanceof Date ? right.getTime() : typeof right === 'boolean' ? Number(right) : right
+ const b =
+ right instanceof Date ? right.getTime() : typeof right === 'boolean' ? Number(right) : right
if (typeof a === 'number' && typeof b === 'number') return a - b
return String(a).localeCompare(String(b), undefined, { numeric: true, sensitivity: 'base' })
}
diff --git a/packages/frontend-table-system/styles.css b/packages/frontend-table-system/styles.css
index 3b3fbac8d..fc08ab3c2 100644
--- a/packages/frontend-table-system/styles.css
+++ b/packages/frontend-table-system/styles.css
@@ -9,51 +9,277 @@
--eft-focus: var(--cu-focus-ring, var(--focus-ring, #9bb5ff));
}
-.eft-data-view-header { display: flex; flex-direction: column; min-width: 0; }
-.eft-data-view-header__main { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; }
-.eft-data-view-header__identity { align-items: flex-start; display: flex; gap: .75rem; min-width: 0; }
-.eft-data-view-header__icon { color: var(--eft-muted); display: inline-flex; margin-top: .125rem; }
-.eft-data-view-header__title { color: var(--eft-text); font-size: 1rem; font-weight: 650; line-height: 1.35; margin: 0; }
-.eft-data-view-header__description { color: var(--eft-muted); font-size: .8125rem; line-height: 1.45; margin: .25rem 0 0; }
-.eft-data-view-header__actions { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
-.eft-data-view-header__tabs { border-bottom: 1px solid var(--eft-border); margin-top: .75rem; }
-.eft-search { background: var(--eft-surface-muted); border: 1px solid var(--eft-border); border-radius: .375rem; color: var(--eft-text); font: inherit; min-height: 2rem; min-width: 13rem; padding: .375rem .625rem; }
-.eft-search:focus-visible, .eft-row-actions__trigger:focus-visible, .eft-table__sort:focus-visible, .eft-table__row--navigable:focus-visible { outline: 2px solid var(--eft-focus); outline-offset: 2px; }
-.eft-table-viewport { background: var(--eft-surface); border: 1px solid var(--eft-border); border-radius: .5rem; max-width: 100%; min-height: 0; overflow: auto; width: 100%; }
-.eft-table-viewport:not(.eft-table-viewport--embedded) { flex: 1 1 auto; }
-.eft-record-list { background: var(--eft-surface); border: 1px solid var(--eft-border); border-radius: .5rem; display: grid; overflow: hidden; width: 100%; }
-.eft-record-list__row { align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--eft-border) 75%, transparent); display: flex; gap: .75rem; justify-content: space-between; min-height: 2.75rem; padding: .625rem .75rem; }
-.eft-record-list__row:last-child { border-bottom: 0; }
-.eft-record-list__row:hover { background: color-mix(in srgb, var(--eft-surface-muted) 55%, transparent); }
-.eft-table { border-collapse: separate; border-spacing: 0; color: var(--eft-text); table-layout: auto; width: 100%; }
-.eft-table thead th { background: var(--eft-surface-muted); border-bottom: 1px solid var(--eft-border); color: var(--eft-muted); font-size: .6875rem; font-weight: 700; letter-spacing: .055em; padding: .625rem .75rem; position: sticky; text-align: left; text-transform: uppercase; top: 0; white-space: nowrap; z-index: 2; }
-.eft-table tbody td { border-bottom: 1px solid color-mix(in srgb, var(--eft-border) 75%, transparent); font-size: .8125rem; line-height: 1.35; padding: .625rem .75rem; vertical-align: middle; }
-.eft-table tbody tr:last-child td { border-bottom: 0; }
-.eft-table tbody tr:hover > td { background: color-mix(in srgb, var(--eft-surface-muted) 55%, transparent); }
-.eft-table tr[data-selected='true'] > td { background: color-mix(in srgb, var(--eft-accent) 12%, var(--eft-surface)); }
-.eft-table__row--navigable { cursor: pointer; }
-.eft-table__row--navigable:focus-visible > td { background: color-mix(in srgb, var(--eft-accent) 10%, var(--eft-surface)); }
-.eft-table__header--numeric, .eft-table__cell--numeric { text-align: right; }
-.eft-table__header--selection, .eft-table__cell--selection { width: 2.75rem; }
-.eft-table__header--actions, .eft-table__cell--actions { text-align: right; width: 3rem; }
-.eft-table__cell--fixed { white-space: nowrap; width: 1%; }
-.eft-table__sort { align-items: center; appearance: none; background: none; border: 0; color: inherit; cursor: pointer; display: inline-flex; font: inherit; font-weight: inherit; gap: .35rem; letter-spacing: inherit; padding: 0; text-transform: inherit; }
-.eft-table__sort-indicator { color: var(--eft-accent); font-size: .75rem; min-width: .75rem; }
-.eft-table__state { color: var(--eft-muted); padding: 1.5rem !important; text-align: center; }
-.eft-table__state--error { color: var(--eft-danger); }
-.eft-table__state-action { display: block; margin-top: .5rem; }
-.eft-row-actions { display: inline-flex; position: relative; }
-.eft-row-actions__trigger { align-items: center; background: transparent; border: 1px solid transparent; border-radius: .375rem; color: var(--eft-muted); cursor: pointer; display: inline-flex; font-size: 1.15rem; height: 1.75rem; justify-content: center; line-height: 1; width: 1.75rem; }
-.eft-row-actions__trigger:hover, .eft-row-actions__trigger[aria-expanded='true'] { background: var(--eft-surface-muted); border-color: var(--eft-border); color: var(--eft-text); }
-.eft-row-actions__menu { background: var(--eft-surface); border: 1px solid var(--eft-border); border-radius: .5rem; box-shadow: 0 .75rem 2rem rgba(0,0,0,.35); display: grid; min-width: 10rem; padding: .25rem; position: fixed; z-index: 1000; }
-.eft-row-actions__item { background: transparent; border: 0; border-radius: .3rem; color: var(--eft-text); cursor: pointer; font: inherit; font-size: .8125rem; padding: .5rem .625rem; text-align: left; }
-.eft-row-actions__item:hover:not(:disabled), .eft-row-actions__item:focus-visible { background: var(--eft-surface-muted); outline: none; }
-.eft-row-actions__item--danger { color: var(--eft-danger); }
-.eft-row-actions__item:disabled { cursor: not-allowed; opacity: .5; }
+.eft-data-view-header {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+}
+.eft-data-view-header__main {
+ align-items: flex-start;
+ display: flex;
+ gap: 1rem;
+ justify-content: space-between;
+}
+.eft-data-view-header__identity {
+ align-items: flex-start;
+ display: flex;
+ gap: 0.75rem;
+ min-width: 0;
+}
+.eft-data-view-header__icon {
+ color: var(--eft-muted);
+ display: inline-flex;
+ margin-top: 0.125rem;
+}
+.eft-data-view-header__title {
+ color: var(--eft-text);
+ font-size: 1rem;
+ font-weight: 650;
+ line-height: 1.35;
+ margin: 0;
+}
+.eft-data-view-header__description {
+ color: var(--eft-muted);
+ font-size: 0.8125rem;
+ line-height: 1.45;
+ margin: 0.25rem 0 0;
+}
+.eft-data-view-header__actions {
+ align-items: center;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem;
+ justify-content: flex-end;
+}
+.eft-data-view-header__tabs {
+ border-bottom: 1px solid var(--eft-border);
+ margin-top: 0.75rem;
+}
+.eft-search {
+ background: var(--eft-surface-muted);
+ border: 1px solid var(--eft-border);
+ border-radius: 0.375rem;
+ color: var(--eft-text);
+ font: inherit;
+ min-height: 2rem;
+ min-width: 13rem;
+ padding: 0.375rem 0.625rem;
+}
+.eft-search:focus-visible,
+.eft-row-actions__trigger:focus-visible,
+.eft-table__sort:focus-visible,
+.eft-table__row--navigable:focus-visible {
+ outline: 2px solid var(--eft-focus);
+ outline-offset: 2px;
+}
+.eft-table-viewport {
+ background: var(--eft-surface);
+ border: 1px solid var(--eft-border);
+ border-radius: 0.5rem;
+ max-width: 100%;
+ min-height: 0;
+ overflow: auto;
+ width: 100%;
+}
+.eft-table-viewport:not(.eft-table-viewport--embedded) {
+ flex: 1 1 auto;
+}
+.eft-record-list {
+ background: var(--eft-surface);
+ border: 1px solid var(--eft-border);
+ border-radius: 0.5rem;
+ display: grid;
+ overflow: hidden;
+ width: 100%;
+}
+.eft-record-list__row {
+ align-items: center;
+ border-bottom: 1px solid color-mix(in srgb, var(--eft-border) 75%, transparent);
+ display: flex;
+ gap: 0.75rem;
+ justify-content: space-between;
+ min-height: 2.75rem;
+ padding: 0.625rem 0.75rem;
+}
+.eft-record-list__row:last-child {
+ border-bottom: 0;
+}
+.eft-record-list__row:hover {
+ background: color-mix(in srgb, var(--eft-surface-muted) 55%, transparent);
+}
+.eft-table {
+ border-collapse: separate;
+ border-spacing: 0;
+ color: var(--eft-text);
+ table-layout: auto;
+ width: 100%;
+}
+.eft-table thead th {
+ background: var(--eft-surface-muted);
+ border-bottom: 1px solid var(--eft-border);
+ color: var(--eft-muted);
+ font-size: 0.6875rem;
+ font-weight: 700;
+ letter-spacing: 0.055em;
+ padding: 0.625rem 0.75rem;
+ position: sticky;
+ text-align: left;
+ text-transform: uppercase;
+ top: 0;
+ white-space: nowrap;
+ z-index: 2;
+}
+.eft-table tbody td {
+ border-bottom: 1px solid color-mix(in srgb, var(--eft-border) 75%, transparent);
+ font-size: 0.8125rem;
+ line-height: 1.35;
+ padding: 0.625rem 0.75rem;
+ vertical-align: middle;
+}
+.eft-table tbody tr:last-child td {
+ border-bottom: 0;
+}
+.eft-table tbody tr:hover > td {
+ background: color-mix(in srgb, var(--eft-surface-muted) 55%, transparent);
+}
+.eft-table tr[data-selected='true'] > td {
+ background: color-mix(in srgb, var(--eft-accent) 12%, var(--eft-surface));
+}
+.eft-table__row--navigable {
+ cursor: pointer;
+}
+.eft-table__row--navigable:focus-visible > td {
+ background: color-mix(in srgb, var(--eft-accent) 10%, var(--eft-surface));
+}
+.eft-table__header--numeric,
+.eft-table__cell--numeric {
+ text-align: right;
+}
+.eft-table__header--selection,
+.eft-table__cell--selection {
+ width: 2.75rem;
+}
+.eft-table__header--actions,
+.eft-table__cell--actions {
+ text-align: right;
+ width: 3rem;
+}
+.eft-table__cell--fixed {
+ white-space: nowrap;
+ width: 1%;
+}
+.eft-table__sort {
+ align-items: center;
+ appearance: none;
+ background: none;
+ border: 0;
+ color: inherit;
+ cursor: pointer;
+ display: inline-flex;
+ font: inherit;
+ font-weight: inherit;
+ gap: 0.35rem;
+ letter-spacing: inherit;
+ padding: 0;
+ text-transform: inherit;
+}
+.eft-table__sort-group {
+ align-items: center;
+ display: inline-flex;
+ gap: 0.35rem;
+}
+.eft-table__sort--icon {
+ flex: 0 0 auto;
+}
+.eft-table__sort-indicator {
+ color: var(--eft-accent);
+ font-size: 0.75rem;
+ min-width: 0.75rem;
+}
+.eft-table__state {
+ color: var(--eft-muted);
+ padding: 1.5rem !important;
+ text-align: center;
+}
+.eft-table__state--error {
+ color: var(--eft-danger);
+}
+.eft-table__state-action {
+ display: block;
+ margin-top: 0.5rem;
+}
+.eft-row-actions {
+ display: inline-flex;
+ position: relative;
+}
+.eft-row-actions__trigger {
+ align-items: center;
+ background: transparent;
+ border: 1px solid transparent;
+ border-radius: 0.375rem;
+ color: var(--eft-muted);
+ cursor: pointer;
+ display: inline-flex;
+ font-size: 1.15rem;
+ height: 1.75rem;
+ justify-content: center;
+ line-height: 1;
+ width: 1.75rem;
+}
+.eft-row-actions__trigger:hover,
+.eft-row-actions__trigger[aria-expanded='true'] {
+ background: var(--eft-surface-muted);
+ border-color: var(--eft-border);
+ color: var(--eft-text);
+}
+.eft-row-actions__menu {
+ background: var(--eft-surface);
+ border: 1px solid var(--eft-border);
+ border-radius: 0.5rem;
+ box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
+ display: grid;
+ min-width: 10rem;
+ padding: 0.25rem;
+ position: fixed;
+ z-index: 1000;
+}
+.eft-row-actions__item {
+ background: transparent;
+ border: 0;
+ border-radius: 0.3rem;
+ color: var(--eft-text);
+ cursor: pointer;
+ font: inherit;
+ font-size: 0.8125rem;
+ padding: 0.5rem 0.625rem;
+ text-align: left;
+}
+.eft-row-actions__item:hover:not(:disabled),
+.eft-row-actions__item:focus-visible {
+ background: var(--eft-surface-muted);
+ outline: none;
+}
+.eft-row-actions__item--danger {
+ color: var(--eft-danger);
+}
+.eft-row-actions__item:disabled {
+ cursor: not-allowed;
+ opacity: 0.5;
+}
@media (max-width: 720px) {
- .eft-data-view-header__main { align-items: stretch; flex-direction: column; }
- .eft-data-view-header__actions { justify-content: flex-start; }
- .eft-search { min-width: min(100%, 13rem); width: 100%; }
- .eft-table-viewport { overscroll-behavior-x: contain; }
+ .eft-data-view-header__main {
+ align-items: stretch;
+ flex-direction: column;
+ }
+ .eft-data-view-header__actions {
+ justify-content: flex-start;
+ }
+ .eft-search {
+ min-width: min(100%, 13rem);
+ width: 100%;
+ }
+ .eft-table-viewport {
+ overscroll-behavior-x: contain;
+ }
}