Skip to content

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

TypeScript

fix(frontend): r2-h2 isolate manual row controls

Josué0bb50651c94f
diff --git a/control-ui/app/shared-filesystems/page.tsx b/control-ui/app/shared-filesystems/page.tsx
index 2ff4eef0e..0bf477cf8 100644
--- a/control-ui/app/shared-filesystems/page.tsx
+++ b/control-ui/app/shared-filesystems/page.tsx
@@ -5,6 +5,7 @@ import { useRouter } from 'next/navigation'
import {
DataTable,
RowActionMenu,
+ TableRow,
TableStateRow,
useTableSort,
} from '@clerum/frontend-table-system'
@@ -275,22 +276,14 @@ export default function SharedFileSystemsPage() {
? 'cu-badge cu-badge--error'
: 'cu-badge'
return (
- <tr
+ <TableRow
key={name}
className="cu-table__row cu-table__row--clickable"
- onClick={() => {
+ onNavigate={() => {
if (!isDeleting) {
router.push(CONTROL_ROUTES.agentFiles.detail(name))
}
}}
- onKeyDown={e => {
- if (isDeleting) return
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault()
- router.push(CONTROL_ROUTES.agentFiles.detail(name))
- }
- }}
- tabIndex={0}
role="link"
aria-label={`Open shared filesystem ${name}`}
>
@@ -326,7 +319,7 @@ export default function SharedFileSystemsPage() {
]}
/>
</td>
- </tr>
+ </TableRow>
)
})
)}
diff --git a/control-ui/components/McpServerTable.tsx b/control-ui/components/McpServerTable.tsx
index b2766b947..e1c30b8f8 100644
--- a/control-ui/components/McpServerTable.tsx
+++ b/control-ui/components/McpServerTable.tsx
@@ -1,7 +1,7 @@
'use client'
import React, { useMemo, useState } from 'react'
-import { DataTable, TableStateRow } from '@clerum/frontend-table-system'
+import { DataTable, TableRow, TableStateRow } from '@clerum/frontend-table-system'
import { copyTextToClipboard } from '@lib/clipboard'
import type {
ConnectorAccessSummary,
@@ -436,21 +436,10 @@ export function McpServerTable({
const contextMembershipBusy = updatingContextMembershipKey === key
const access = accessByConnectorKey?.[key]
return (
- <tr
+ <TableRow
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}
+ onNavigate={onEdit ? () => onEdit({ namespace, name }) : undefined}
>
<td>{name}</td>
<td>
@@ -557,7 +546,7 @@ export function McpServerTable({
]}
/>
</td>
- </tr>
+ </TableRow>
)
})
)}
diff --git a/control-ui/components/ProfileAdminHome.tsx b/control-ui/components/ProfileAdminHome.tsx
index 3c4805a32..367f08658 100644
--- a/control-ui/components/ProfileAdminHome.tsx
+++ b/control-ui/components/ProfileAdminHome.tsx
@@ -2,7 +2,7 @@
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useRouter } from 'next/navigation'
-import { DataTable } from '@clerum/frontend-table-system'
+import { DataTable, TableRow } from '@clerum/frontend-table-system'
import { CONTROL_ROUTES } from '@constants/routes'
import {
AdminPendingInvitationListItem,
@@ -248,13 +248,6 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
router.push(CONTROL_ROUTES.usersAndTeams.newAdmin(Object.fromEntries(searchParams)))
}
- function handleRowKeyDown(event: React.KeyboardEvent<HTMLTableRowElement>, open: () => void) {
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault()
- open()
- }
- }
-
function toggleTeamSort(nextKey: TeamSortKey) {
if (teamSortKey === nextKey) {
setTeamSortDir(prev => (prev === 'asc' ? 'desc' : 'asc'))
@@ -628,12 +621,10 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
</thead>
<tbody>
{sortedTeams.map(team => (
- <tr
+ <TableRow
key={team.id}
className="cu-table__row cu-table__row--clickable"
- onClick={() => openTeam(team)}
- onKeyDown={event => handleRowKeyDown(event, () => openTeam(team))}
- tabIndex={0}
+ onNavigate={() => openTeam(team)}
aria-label={`Open team ${team.name}`}
>
<td>
@@ -699,7 +690,7 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
]}
/>
</td>
- </tr>
+ </TableRow>
))}
</tbody>
</DataTable>
@@ -863,12 +854,10 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
</thead>
<tbody>
{sortedUsers.map(user => (
- <tr
+ <TableRow
key={user.id}
className="cu-table__row cu-table__row--clickable"
- onClick={() => openUser(user)}
- onKeyDown={event => handleRowKeyDown(event, () => openUser(user))}
- tabIndex={0}
+ onNavigate={() => openUser(user)}
aria-label={`Open member ${user.name || user.email}`}
>
<td>
@@ -952,7 +941,7 @@ export function ProfileAdminHome({ activeTab, highlightedAdminId = '' }: Profile
]}
/>
</td>
- </tr>
+ </TableRow>
))}
</tbody>
</DataTable>
diff --git a/control-ui/components/__tests__/McpServerTable.test.tsx b/control-ui/components/__tests__/McpServerTable.test.tsx
index 957ed7fe5..54ca5ab99 100644
--- a/control-ui/components/__tests__/McpServerTable.test.tsx
+++ b/control-ui/components/__tests__/McpServerTable.test.tsx
@@ -317,21 +317,30 @@ describe('McpServerTable — connector access summaries', () => {
})
it('keeps connector endpoint links and image copy actions available', async () => {
+ const onEdit = vi.fn()
const writeText = vi.fn().mockResolvedValue(undefined)
Object.defineProperty(navigator, 'clipboard', {
configurable: true,
value: { writeText },
})
const image = 'ghcr.io/example/mcp:1.0'
- render(<McpServerTable items={[makeItem({ name: 'airtable-server', image })]} />)
+ render(
+ <McpServerTable items={[makeItem({ name: 'airtable-server', image })]} onEdit={onEdit} />
+ )
- expect(screen.getByRole('link', { name: /brave-search\.mcp-server/ })).toHaveAttribute(
+ const endpointLink = screen.getByRole('link', { name: /brave-search\.mcp-server/ })
+ expect(endpointLink).toHaveAttribute(
'href',
'http://brave-search.mcp-server.svc.cluster.local:3000/mcp'
)
- fireEvent.click(screen.getByRole('button', { name: 'Copy image reference' }))
+ fireEvent.click(endpointLink)
+ fireEvent.keyDown(endpointLink, { key: 'Enter' })
+ const copyButton = screen.getByRole('button', { name: 'Copy image reference' })
+ fireEvent.click(copyButton)
+ fireEvent.keyDown(copyButton, { key: 'Enter' })
await waitFor(() => expect(writeText).toHaveBeenCalledWith(image))
expect(screen.getByRole('button', { name: 'image reference copied' })).toBeInTheDocument()
+ expect(onEdit).not.toHaveBeenCalled()
})
it('renders an empty access state when no principals are mapped', () => {
diff --git a/control-ui/components/__tests__/ProfileAdminHome.test.tsx b/control-ui/components/__tests__/ProfileAdminHome.test.tsx
index f360bda34..2d918a9b0 100644
--- a/control-ui/components/__tests__/ProfileAdminHome.test.tsx
+++ b/control-ui/components/__tests__/ProfileAdminHome.test.tsx
@@ -157,7 +157,9 @@ describe('ProfileAdminHome — members invitations', () => {
await screen.findByLabelText('Open member Accepted Invitee')
- fireEvent.click(screen.getByRole('button', { name: 'Actions for member Accepted Invitee' }))
+ const trigger = screen.getByRole('button', { name: 'Actions for member Accepted Invitee' })
+ fireEvent.keyDown(trigger, { key: 'Enter' })
+ fireEvent.click(trigger)
expect(mockPush).not.toHaveBeenCalled()
})
@@ -219,7 +221,9 @@ describe('ProfileAdminHome — members invitations', () => {
await screen.findByLabelText('Open team Marketing')
- fireEvent.click(screen.getByRole('button', { name: 'Actions for team Marketing' }))
+ const trigger = screen.getByRole('button', { name: 'Actions for team Marketing' })
+ fireEvent.keyDown(trigger, { key: 'Enter' })
+ fireEvent.click(trigger)
expect(mockPush).not.toHaveBeenCalled()
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 29a9fe657..59a890558 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.486",
+ "version": "0.1.487",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.486",
+ "version": "0.1.487",
"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 5fa50b91e..95156dd99 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.486",
+ "version": "0.1.487",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",