Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(gfs): simplify shared member rows
M19d150148f63
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.cssindex 405c5c01a..32c2cbc17 100644--- a/control-ui/app/globals.css+++ b/control-ui/app/globals.css@@ -13788,7 +13788,7 @@ button.cu-gfs-tree__button:focus-visible,.cu-gfs-existing-access__list {display: grid;- gap: var(--cu-space-1);+ gap: var(--cu-space-2);max-height: calc((((var(--cu-space-5) * 2) + var(--cu-space-2)) * 3) + (var(--cu-space-1) * 2));margin: 0;overflow-y: auto;@@ -13802,16 +13802,43 @@ button.cu-gfs-tree__button:focus-visible,align-items: center;gap: var(--cu-space-2);min-width: 0;- padding: var(--cu-space-2);+ min-height: 3.25rem;+ padding: var(--cu-space-2) var(--cu-space-3);border: 0;border-radius: var(--cu-radius-sm);background: transparent;}+.cu-gfs-existing-access__avatar {+ width: 1.875rem;+ height: 1.875rem;+ flex: 0 0 1.875rem;+ display: grid;+ place-items: center;+ border-radius: 999px;+ background: rgba(var(--cu-accent-rgb), 0.18);+ color: var(--cu-accent);+}++.cu-gfs-existing-access__avatar--team {+ background: rgba(var(--cu-warning-rgb), 0.15);+ color: var(--cu-warning);+}++.cu-gfs-existing-access__avatar--agent,+.cu-gfs-existing-access__avatar--workflow {+ background: rgba(var(--cu-success-rgb), 0.15);+ color: var(--cu-success);+}++.cu-gfs-existing-access__avatar svg {+ width: 1rem;+ height: 1rem;+}+.cu-gfs-existing-access__identity {min-width: 0;display: grid;- gap: calc(var(--cu-space-1) / 2);flex: 1 1 auto;}@@ -13824,15 +13851,6 @@ button.cu-gfs-tree__button:focus-visible,white-space: nowrap;}-.cu-gfs-existing-access__detail {- overflow: hidden;- color: var(--cu-text-soft);- font-size: 0.75rem;- text-overflow: ellipsis;- text-transform: capitalize;- white-space: nowrap;-}-.cu-gfs-existing-access__meta {display: flex;align-items: center;diff --git a/control-ui/components/GfsGrantPanel.tsx b/control-ui/components/GfsGrantPanel.tsxindex 706e972b6..cda443ce5 100644--- a/control-ui/components/GfsGrantPanel.tsx+++ b/control-ui/components/GfsGrantPanel.tsx@@ -6,6 +6,14 @@ import { useConfirmDialog } from '@components/ConfirmDialog'import { GfsSubjectPicker } from '@components/GfsSubjectPicker'import { SelectionDropdown } from '@components/SelectionDropdown'import type { SelectionDropdownOption } from '@components/SelectionDropdown/types'+import {+ IconFolder,+ IconRobot,+ IconShield,+ IconUser,+ IconUsers,+ IconWorkflow,+} from '@components/Sidebar/icons'import { useToast } from '@components/Toast'import { Button, CheckboxField } from '@components/ui'import { GFS_MAX_BULK_SUBJECTS } from '@constants/gfsGrantSubjects'@@ -42,6 +50,16 @@ import { buildGfsBulkSubjectOptions, toGfsBulkSubjectInputs } from './gfsGrantSuconst OPERATOR_VALUE = 'operator'const DRIVE = 'main'type AccessRole = 'read' | 'editor'+type AccessSubjectKind = 'agent' | 'context' | 'operator' | 'team' | 'user' | 'workflow'++function AccessSubjectIcon({ kind }: { kind: AccessSubjectKind }): React.JSX.Element {+ if (kind === 'agent') return <IconRobot />+ if (kind === 'context') return <IconFolder />+ if (kind === 'operator') return <IconShield />+ if (kind === 'team') return <IconUsers />+ if (kind === 'workflow') return <IconWorkflow />+ return <IconUser />+}function rolePermissions(role: AccessRole, hostOnly: boolean): string[] {if (hostOnly) return role === 'editor' ? ['read', 'write'] : ['read']@@ -312,15 +330,29 @@ export function GfsGrantPanel({ resource }: GfsGrantPanelProps): React.JSX.Elemecandidate.subject.type === item.subject.type && candidate.subject.id === item.subject.id)if (option) return option.label- const typeLabel =- item.subject.type === 'host'- ? 'Agent or workflow'- : item.subject.type.charAt(0).toUpperCase() + item.subject.type.slice(1)+ if (item.subject.type === 'host') {+ return item.subject.id?.split('/').at(-1) || 'Agent or workflow'+ }+ const typeLabel = item.subject.type.charAt(0).toUpperCase() + item.subject.type.slice(1)return item.subject.id ? `${typeLabel} · ${item.subject.id}` : typeLabel},[bulkSubjectOptions])+ const subjectKind = useCallback(+ (item: GfsExistingAccessItem): AccessSubjectKind => {+ if (item.subject.type !== 'host') return item.subject.type+ const option = bulkSubjectOptions.find(+ candidate =>+ candidate.subject.type === item.subject.type && candidate.subject.id === item.subject.id+ )+ return option?.badge.toLowerCase() === 'workflow' || item.subject.id?.startsWith('3rd:')+ ? 'workflow'+ : 'agent'+ },+ [bulkSubjectOptions]+ )+const sortedExistingAccess = useMemo(() =>[...existingAccess].sort(@@ -487,12 +519,12 @@ export function GfsGrantPanel({ resource }: GfsGrantPanelProps): React.JSX.Eleme</Button></div>) : existingAccess.length === 0 ? (- <p className="cu-gfs-existing-access__empty">No direct grants or shares yet.</p>+ <p className="cu-gfs-existing-access__empty">No one has access yet.</p>) : (<RecordList className="cu-gfs-existing-access__list" aria-label="Resource access">{sortedExistingAccess.map(item => {const label = subjectLabel(item)- const kindLabel = item.grantId ? 'direct grant' : 'direct share'+ const kind = subjectKind(item)return (<RecordListRowclassName="cu-gfs-existing-access__item"@@ -500,11 +532,15 @@ export function GfsGrantPanel({ resource }: GfsGrantPanelProps): React.JSX.Elemedata-access-id={item.grantId ?? item.shareIds[0]}key={`${item.subject.type}:${item.grantId ?? item.shareIds[0]}`}>+ <span+ aria-hidden="true"+ className={`cu-gfs-existing-access__avatar cu-gfs-existing-access__avatar--${kind}`}+ data-subject-kind={kind}+ >+ <AccessSubjectIcon kind={kind} />+ </span><span className="cu-gfs-existing-access__identity"><span className="cu-gfs-existing-access__subject">{label}</span>- <span className="cu-gfs-existing-access__detail">- {item.grantId ? 'Direct grant' : 'Direct share'} · {item.subject.type}- </span></span><span className="cu-gfs-existing-access__meta"><SelectionDropdown@@ -532,7 +568,7 @@ export function GfsGrantPanel({ resource }: GfsGrantPanelProps): React.JSX.ElemeonSelect: () => void revokeAccess(item),},]}- ariaLabel={`Actions for ${kindLabel} to ${label}`}+ ariaLabel={`Actions for ${label}`}/></RecordListRow>)diff --git a/control-ui/components/GfsSubjectPicker/index.tsx b/control-ui/components/GfsSubjectPicker/index.tsxindex ff61eba40..23226ae51 100644--- a/control-ui/components/GfsSubjectPicker/index.tsx+++ b/control-ui/components/GfsSubjectPicker/index.tsx@@ -2,7 +2,7 @@import { useEffect, useMemo, useRef, useState } from 'react'import type { SelectionDropdownOption } from '@components/SelectionDropdown/types'-import { IconRobot, IconShield, IconUsers, IconWorkflow } from '@components/Sidebar/icons'+import { IconRobot, IconShield, IconUser, IconUsers, IconWorkflow } from '@components/Sidebar/icons'import { IconX } from '@components/icons'import { Button, TextInput } from '@components/ui'import type { GfsSubjectPickerProps } from './types'@@ -32,7 +32,7 @@ function subjectAvatarContent(option: SelectionDropdownOption): React.ReactNodecase 'workflow':return <IconWorkflow />default:- return option.label.charAt(0).toUpperCase()+ return <IconUser />}}diff --git a/control-ui/components/Sidebar/icons.tsx b/control-ui/components/Sidebar/icons.tsxindex 93fa36f0e..f7918c9c0 100644--- a/control-ui/components/Sidebar/icons.tsx+++ b/control-ui/components/Sidebar/icons.tsx@@ -481,6 +481,26 @@ export function IconUsers({)}+export function IconUser() {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="18"+ height="18"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ aria-hidden="true"+ >+ <circle cx="12" cy="8" r="4" />+ <path d="M4 21a8 8 0 0 1 16 0" />+ </svg>+ )+}+export function IconShield({createBadge = false,relationshipRole,diff --git a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsxindex 2e5d2c1de..f5c4f22c8 100644--- a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx+++ b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx@@ -145,13 +145,13 @@ describe('GfsGrantPanel bulk access', () => {const existing = await screen.findByRole('region', { name: 'People with access' })expect(within(existing).getByText('Ada Lovelace')).toBeTruthy()- expect(within(existing).getByText('Direct grant · user')).toBeTruthy()+ const userRow = within(existing).getByTestId('gfs-access-row-user')+ expect(userRow.querySelector('[data-subject-kind="user"] svg')).not.toBeNull()+ expect(within(userRow).queryByText(/direct grant|\buser\b/i)).toBeNull()expect(within(existing).getByRole('button', { name: 'Access role for Ada Lovelace' })).toHaveTextContent('Editor')- fireEvent.click(- within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })- )+ fireEvent.click(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' }))fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove access' }))const dialog = await screen.findByRole('alertdialog')fireEvent.click(within(dialog).getByRole('button', { name: 'Remove access' }))@@ -159,13 +159,72 @@ describe('GfsGrantPanel bulk access', () => {await waitFor(() =>expect(mockDeleteGfsGrant).toHaveBeenCalledWith('33333333-3333-3333-3333-333333333333'))- await waitFor(() =>- expect(within(existing).getByText('No direct grants or shares yet.')).toBeTruthy()- )+ await waitFor(() => expect(within(existing).getByText('No one has access yet.')).toBeTruthy())expect(mockGetGfsGrants).toHaveBeenCalledTimes(2)expect(mockGetGfsShares).toHaveBeenCalledTimes(2)})+ it('shows each existing principal with its entity icon and no access-source metadata', async () => {+ mockGetGfsGrants.mockResolvedValue({+ items: [+ {+ id: '10000000-0000-0000-0000-000000000001',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: userSubject,+ permissions: ['read'],+ inherit: false,+ },+ {+ id: '10000000-0000-0000-0000-000000000002',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: teamSubject,+ permissions: ['read'],+ inherit: false,+ },+ {+ id: '10000000-0000-0000-0000-000000000003',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: statefulHostSubject,+ permissions: ['read'],+ inherit: false,+ },+ {+ id: '10000000-0000-0000-0000-000000000004',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: workflowHostSubject,+ permissions: ['read'],+ inherit: false,+ },+ {+ id: '10000000-0000-0000-0000-000000000005',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: operatorSubject,+ permissions: ['read'],+ inherit: false,+ },+ ],+ })+ renderPanel()++ const expectedKinds = [+ ['Ada Lovelace', 'user'],+ ['Research', 'team'],+ ['chatllm (Stateful)', 'agent'],+ ['sandbox-ui-hello', 'workflow'],+ ['Operator', 'operator'],+ ] as const+ for (const [label, kind] of expectedKinds) {+ const row = (await screen.findByText(label)).closest('[data-testid^="gfs-access-row-"]')+ expect(row?.querySelector(`[data-subject-kind="${kind}"] svg`)).not.toBeNull()+ }+ expect(screen.queryByText(/direct grant|direct share/i)).toBeNull()+ })+it('changes an existing member between Editor and Read', async () => {const persistedGrant = {id: '33333333-3333-3333-3333-333333333333',@@ -234,13 +293,8 @@ describe('GfsGrantPanel bulk access', () => {const existing = await screen.findByRole('region', { name: 'People with access' })// ONE row for the principal — not one per backend row kind.expect(within(existing).getAllByText('Ada Lovelace')).toHaveLength(1)- expect(within(existing).getByText('Direct grant · user')).toBeTruthy()- expect(- within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })- ).toBeTruthy()- expect(- within(existing).queryByRole('button', { name: 'Actions for direct share to Ada Lovelace' })- ).toBeNull()+ expect(within(existing).queryByText(/direct grant|direct share|\buser\b/i)).toBeNull()+ expect(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' })).toBeTruthy()// The descendant-coverage badge stays out of the row.expect(within(existing).queryByText('Includes contents')).toBeNull()@@ -284,7 +338,7 @@ describe('GfsGrantPanel bulk access', () => {name: 'Access role for Ada Lovelace',})expect(role).toHaveTextContent('Read')- expect(within(existing).getByText('Direct share · user')).toBeTruthy()+ expect(within(existing).queryByText(/direct share|\buser\b/i)).toBeNull()fireEvent.click(role)fireEvent.click(screen.getByRole('option', { name: 'Editor' }))@@ -392,17 +446,13 @@ describe('GfsGrantPanel bulk access', () => {)renderPanel()const existing = await screen.findByRole('region', { name: 'People with access' })- fireEvent.click(- within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })- )+ fireEvent.click(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' }))fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove access' }))const dialog = await screen.findByRole('alertdialog')fireEvent.click(within(dialog).getByRole('button', { name: 'Remove access' }))expect(await screen.findByText('Access was already removed.')).toBeTruthy()- await waitFor(() =>- expect(within(existing).getByText('No direct grants or shares yet.')).toBeTruthy()- )+ await waitFor(() => expect(within(existing).getByText('No one has access yet.')).toBeTruthy())expect(screen.queryByRole('alert')).toBeNull()expect(mockGetGfsGrants).toHaveBeenCalledTimes(2)})@@ -428,9 +478,7 @@ describe('GfsGrantPanel bulk access', () => {)renderPanel()const existing = await screen.findByRole('region', { name: 'People with access' })- fireEvent.click(- within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })- )+ fireEvent.click(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' }))fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove access' }))const dialog = await screen.findByRole('alertdialog')fireEvent.click(within(dialog).getByRole('button', { name: 'Remove access' }))@@ -467,12 +515,12 @@ describe('GfsGrantPanel bulk access', () => {await submit('Share')const existing = await screen.findByRole('region', { name: 'People with access' })- expect(await within(existing).findByText('Direct grant · user')).toBeTruthy()+ expect(await within(existing).findByTestId('gfs-access-row-user')).toBeTruthy()expect(initialSignal?.aborted).toBe(true)resolveInitialGrants({ items: [] })- await waitFor(() => expect(within(existing).getByText('Direct grant · user')).toBeTruthy())- expect(within(existing).queryByText('No direct grants or shares yet.')).toBeNull()+ await waitFor(() => expect(within(existing).getByText('Ada Lovelace')).toBeTruthy())+ expect(within(existing).queryByText('No one has access yet.')).toBeNull()})it('aborts the active access hydration when the panel unmounts', async () => {diff --git a/control-ui/components/__tests__/GfsSubjectPicker.test.tsx b/control-ui/components/__tests__/GfsSubjectPicker.test.tsxindex 34c9923f7..edd6f32a1 100644--- a/control-ui/components/__tests__/GfsSubjectPicker.test.tsx+++ b/control-ui/components/__tests__/GfsSubjectPicker.test.tsx@@ -54,8 +54,6 @@ describe('GfsSubjectPicker', () => {expect(screen.getByRole('option', { name: 'Workflow runtime' }).querySelector('svg')).not.toBeNull()- expect(screen.getByRole('option', { name: 'Ada Lovelace' }).textContent).toContain(- 'Ada Lovelace'- )+ expect(screen.getByRole('option', { name: 'Ada Lovelace' }).querySelector('svg')).not.toBeNull()})})diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex d399cc875..0c20b72d1 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.570",+ "version": "0.1.571","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.570",+ "version": "0.1.571","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 8f01207f0..f81d352f2 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.570",+ "version": "0.1.571","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/desktop-app/ui/src/components/SidebarNav/icons.tsx b/desktop-app/ui/src/components/SidebarNav/icons.tsxindex 2f3540ff1..b49f1c05d 100644--- a/desktop-app/ui/src/components/SidebarNav/icons.tsx+++ b/desktop-app/ui/src/components/SidebarNav/icons.tsx@@ -47,6 +47,15 @@ export function IconTeams(props: IconProps) {)}+export function IconUser(props: IconProps) {+ return (+ <svg viewBox="0 0 24 24" aria-hidden="true" {...BASE_STROKE_PROPS} {...props}>+ <circle cx="12" cy="8" r="4" />+ <path d="M4 21a8 8 0 0 1 16 0" />+ </svg>+ )+}+export function IconShare(props: IconProps) {return (<svg viewBox="0 0 24 24" aria-hidden="true" {...BASE_STROKE_PROPS} {...props}>diff --git a/desktop-app/ui/src/gfs/GfsGrantList/index.tsx b/desktop-app/ui/src/gfs/GfsGrantList/index.tsxindex 90b372fa8..358ca3cf6 100644--- a/desktop-app/ui/src/gfs/GfsGrantList/index.tsx+++ b/desktop-app/ui/src/gfs/GfsGrantList/index.tsx@@ -1,4 +1,11 @@import { DropdownSelect, IconButton, StatusBanner } from '@components/Common'+import {+ IconAgents,+ IconContexts,+ IconTeams,+ IconUser,+ IconWorkflows,+} from '@components/SidebarNav/icons'import type {GfsAgentSubjectOption,GfsDelegationSubjectOption,@@ -8,6 +15,25 @@ import type {import type { GfsGrantListProps } from './types'import type { GfsAccessRole } from './types'+type AccessSubjectKind = 'agent' | 'context' | 'team' | 'user' | 'workflow'++function subjectKind(+ subject: GfsGrantListItem['subject'] | GfsShareListItem['subject']+): AccessSubjectKind {+ if (subject.type === 'team') return 'team'+ if (subject.type === 'host') return subject.id?.startsWith('3rd:') ? 'workflow' : 'agent'+ if (subject.type === 'context') return 'context'+ return 'user'+}++function AccessSubjectIcon({ kind }: { kind: AccessSubjectKind }) {+ if (kind === 'agent') return <IconAgents />+ if (kind === 'context') return <IconContexts />+ if (kind === 'team') return <IconTeams />+ if (kind === 'workflow') return <IconWorkflows />+ return <IconUser />+}+/*** "Who has access" — the resource's current grants, sourced from the user-plane* grants GET (the only revoke-id source: the grant PUT returns no ids). Subject@@ -26,6 +52,7 @@ function subjectLabel(// Visible agent name (spec.displayName); fall back to the id-based `name`// when the displayName is absent or blank/whitespace-only.if (agent) return (agent.displayName ?? '').trim() || agent.name+ if (subject.id.startsWith('3rd:')) return subject.id.split('/').at(-1) || subject.id}if ((subject.type === 'user' || subject.type === 'team') && subject.id) {const match = subjects.find(@@ -93,17 +120,22 @@ export function GfsGrantList({{showGrantRows? items.map(item => {const label = subjectLabel(item.subject, agents, subjects)+ const kind = subjectKind(item.subject)return (<liclassName="da-gfs-grant-list__row"data-testid={`gfs-access-row-grant-${item.id}`}key={`grant:${item.id}`}>+ <span+ aria-hidden="true"+ className={`da-gfs-grant-list__avatar da-gfs-grant-list__avatar--${kind}`}+ data-subject-kind={kind}+ >+ <AccessSubjectIcon kind={kind} />+ </span><span className="da-gfs-grant-list__identity"><span className="da-gfs-grant-list__label">{label}</span>- <span className="da-gfs-grant-list__subject-type">- Direct grant · {item.subject.type}- </span></span><span className="da-gfs-grant-list__meta"><DropdownSelect@@ -134,17 +166,22 @@ export function GfsGrantList({{showShareRows? shares.map(item => {const label = subjectLabel(item.subject, agents, subjects)+ const kind = subjectKind(item.subject)return (<liclassName="da-gfs-grant-list__row"data-testid={`gfs-access-row-share-${item.id}`}key={`share:${item.id}`}>+ <span+ aria-hidden="true"+ className={`da-gfs-grant-list__avatar da-gfs-grant-list__avatar--${kind}`}+ data-subject-kind={kind}+ >+ <AccessSubjectIcon kind={kind} />+ </span><span className="da-gfs-grant-list__identity"><span className="da-gfs-grant-list__label">{label}</span>- <span className="da-gfs-grant-list__subject-type">- Share · {item.subject.type}- </span></span><span className="da-gfs-grant-list__meta"><span className="da-gfs-grant-list__role-label">@@ -171,7 +208,7 @@ export function GfsGrantList({loading ? (<p className="muted">Loading access…</p>) : (- <p className="muted">No direct grants or shares yet.</p>+ <p className="muted">No one has access yet.</p>)) : null}</>diff --git a/desktop-app/ui/src/gfs/GfsSubjectPicker/index.tsx b/desktop-app/ui/src/gfs/GfsSubjectPicker/index.tsxindex cab68a6d4..5c6d67e11 100644--- a/desktop-app/ui/src/gfs/GfsSubjectPicker/index.tsx+++ b/desktop-app/ui/src/gfs/GfsSubjectPicker/index.tsx@@ -1,6 +1,6 @@import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { IconButton, MenuItem, TextInput } from '@components/Common'-import { IconAgents, IconClose, IconTeams } from '@components/SidebarNav/icons'+import { IconAgents, IconClose, IconTeams, IconUser } from '@components/SidebarNav/icons'import { useClickOutside } from '@hooks/useClickOutside'import type { GfsDelegationSubjectOption } from '@/gfs/delegation.types'import type { GfsSubjectPickerProps } from './types'@@ -16,7 +16,7 @@ function subjectBadge(subject: GfsDelegationSubjectOption): string {function avatarContent(subject: GfsDelegationSubjectOption): React.ReactNode {if (subject.type === 'team') return <IconTeams />if (subject.type === 'host') return <IconAgents />- return subject.label.charAt(0).toUpperCase()+ return <IconUser />}function matchesQuery(subject: GfsDelegationSubjectOption, query: string): boolean {diff --git a/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx b/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsxindex e39b4a123..4046114f6 100644--- a/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx+++ b/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx@@ -56,6 +56,10 @@ describe('GfsGrantList', () => {permissions: ['read'],}),grantItem({ id: 'grant-3', subject: { type: 'host', id: '1st:mcp-host/unknown' } }),+ grantItem({+ id: 'grant-4',+ subject: { type: 'host', id: '3rd:sandbox-recipes/monthly-report' },+ }),]}onRevoke={vi.fn()}subjects={subjects}@@ -63,6 +67,8 @@ describe('GfsGrantList', () => {)const agentRow = screen.getByText('Chat LLM').closest('li')!+ expect(agentRow.querySelector('[data-subject-kind="agent"] svg')).not.toBeNull()+ expect(within(agentRow).queryByText(/direct grant|\bhost\b/i)).toBeNull()expect(within(agentRow).getByRole('button', { name: 'Access role for Chat LLM' }).textContent).toContain('Editor')@@ -73,6 +79,8 @@ describe('GfsGrantList', () => {).toContain('da-gfs-grant-list__revoke')const userRow = screen.getByText('Test Two').closest('li')!+ expect(userRow.querySelector('[data-subject-kind="user"] svg')).not.toBeNull()+ expect(within(userRow).queryByText(/direct grant|\buser\b/i)).toBeNull()expect(within(userRow).getByRole('button', { name: 'Access role for Test Two' }).textContent).toContain('Read')@@ -80,6 +88,8 @@ describe('GfsGrantList', () => {// Unresolvable subject ids stay visible as raw ids — never hidden.expect(screen.getByText('1st:mcp-host/unknown')).toBeTruthy()+ const workflowRow = screen.getByText('monthly-report').closest('li')!+ expect(workflowRow.querySelector('[data-subject-kind="workflow"] svg')).not.toBeNull()})it('labels a host subject by its displayName, falling back to the identifier when blank', () => {@@ -148,7 +158,8 @@ describe('GfsGrantList', () => {)const shareRow = screen.getByTestId('gfs-access-row-share-share-1')- expect(within(shareRow).getByText('Share · team')).toBeTruthy()+ expect(shareRow.querySelector('[data-subject-kind="team"] svg')).not.toBeNull()+ expect(within(shareRow).queryByText('Share · team')).toBeNull()expect(within(shareRow).queryByText('Includes contents')).toBeNull()fireEvent.click(within(shareRow).getByRole('button', { name: 'Revoke shared access for Core Team' })@@ -197,7 +208,7 @@ describe('GfsGrantList', () => {it('renders an empty notice when nothing has been granted', () => {render(<GfsGrantList agents={agents} items={[]} onRevoke={vi.fn()} subjects={subjects} />)- expect(screen.getByText('No direct grants or shares yet.')).toBeTruthy()+ expect(screen.getByText('No one has access yet.')).toBeTruthy()})// R4 spec §2 — grants and shares fail independently: a share-list errordiff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.cssindex 0b9f6a25e..008fd3961 100644--- a/desktop-app/ui/src/styles.css+++ b/desktop-app/ui/src/styles.css@@ -15676,7 +15676,7 @@ pre {.da-gfs-grant-list {display: grid;- gap: var(--space-1);+ gap: var(--space-2);max-height: calc(((var(--space-5) + var(--space-4) + var(--space-2)) * 3) + (var(--space-1) * 2));margin: 0;overflow-y: auto;@@ -15690,15 +15690,42 @@ pre {align-items: center;gap: var(--space-2);min-width: 0;- padding: var(--space-2);+ min-height: 52px;+ padding: var(--space-2) var(--space-3);border: 0;border-radius: var(--radius-md);background: transparent;}+.da-gfs-grant-list__avatar {+ width: 30px;+ height: 30px;+ flex: 0 0 30px;+ display: grid;+ place-items: center;+ border-radius: 999px;+ background: rgba(var(--accent-rgb), 0.18);+ color: var(--accent-strong);+}++.da-gfs-grant-list__avatar--team {+ background: rgba(var(--warning-rgb), 0.15);+ color: var(--warning);+}++.da-gfs-grant-list__avatar--agent,+.da-gfs-grant-list__avatar--workflow {+ background: rgba(var(--success-rgb), 0.16);+ color: var(--success);+}++.da-gfs-grant-list__avatar svg {+ width: var(--space-4);+ height: var(--space-4);+}+.da-gfs-grant-list__identity {display: grid;- gap: var(--space-0-5);min-width: 0;flex: 1 1 auto;}@@ -15712,12 +15739,6 @@ pre {white-space: nowrap;}-.da-gfs-grant-list__subject-type {- color: var(--text-muted);- font-size: var(--font-size-xs);- text-transform: capitalize;-}-.da-gfs-grant-list__meta {display: flex;align-items: center;