Skip to content

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

TypeScript

fix(gfs): align grant action rows

Miguelon Peluchond57a7160ad4e
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index f9c40f304..e763c0357 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -12302,11 +12302,20 @@ button.cu-gfs-tree__button:focus-visible,
padding: var(--cu-space-1) 0;
}
+.cu-gfs-grant__scope-actions {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ gap: var(--cu-space-2);
+}
+
.cu-gfs-grant__actions {
display: flex;
flex-wrap: wrap;
gap: var(--cu-space-2);
justify-content: flex-end;
+ margin-left: auto;
}
.cu-gfs-existing-access {
@@ -12429,6 +12438,29 @@ button.cu-gfs-tree__button:focus-visible,
white-space: nowrap;
}
+.cu-gfs-existing-access__revoke.cu-btn {
+ min-width: 1.5rem;
+ min-height: 1.5rem;
+ padding: 0;
+ border: 0;
+ border-radius: 999px;
+ background: transparent;
+ color: var(--cu-danger);
+ font-size: 0.9rem;
+ font-weight: 700;
+ line-height: 1;
+}
+
+.cu-gfs-existing-access__revoke.cu-btn:hover:not(:disabled) {
+ border-color: transparent;
+ background: transparent;
+ color: var(--cu-danger-hover);
+}
+
+.cu-gfs-existing-access__revoke.cu-btn:focus-visible {
+ border-color: transparent;
+}
+
.cu-gfs-existing-access__error {
display: flex;
align-items: center;
diff --git a/control-ui/components/GfsGrantPanel.tsx b/control-ui/components/GfsGrantPanel.tsx
index 0b75b0a52..a18729195 100644
--- a/control-ui/components/GfsGrantPanel.tsx
+++ b/control-ui/components/GfsGrantPanel.tsx
@@ -393,19 +393,21 @@ export function GfsGrantPanel({
removed.
</p>
) : null}
- {canIncludeDescendants ? (
- <CheckboxField
- className="cu-gfs-grant__scope"
- label="Include contents of this folder"
- checked={includeDescendants}
- onChange={() => setIncludeDescendants(current => !current)}
- disabled={actionPending}
- />
- ) : null}
- <div className="cu-gfs-grant__actions">
- <Button variant="primary" disabled={!canSubmit} onClick={() => submit('grant')}>
- Grant access
- </Button>
+ <div className="cu-gfs-grant__scope-actions">
+ {canIncludeDescendants ? (
+ <CheckboxField
+ className="cu-gfs-grant__scope"
+ label="Include contents of this folder"
+ checked={includeDescendants}
+ onChange={() => setIncludeDescendants(current => !current)}
+ disabled={actionPending}
+ />
+ ) : null}
+ <div className="cu-gfs-grant__actions">
+ <Button variant="primary" disabled={!canSubmit} onClick={() => submit('grant')}>
+ Grant access
+ </Button>
+ </div>
</div>
{error ? (
<p role="alert" className="cu-field__error">
@@ -468,11 +470,13 @@ export function GfsGrantPanel({
</span>
<Button
aria-label={`Remove ${item.kind} access for ${label}`}
+ className="cu-gfs-existing-access__revoke"
data-testid={`gfs-revoke-${item.kind}-${item.id}`}
title={`Remove ${item.kind} access for ${label}`}
size="sm"
disabled={actionPending}
onClick={() => void revokeAccess(item)}
+ variant="ghost"
>
X
</Button>
diff --git a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx
index a033c0949..2bef23b65 100644
--- a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx
+++ b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx
@@ -185,6 +185,10 @@ describe('GfsGrantPanel bulk access', () => {
expect(within(existing).getByText('Read')).toBeTruthy()
expect(within(existing).getByText('Write')).toBeTruthy()
expect(within(existing).getByText('X')).toBeTruthy()
+ expect(
+ within(existing).getByRole('button', { name: 'Remove grant access for Ada Lovelace' })
+ .className
+ ).toContain('cu-gfs-existing-access__revoke')
fireEvent.click(
within(existing).getByRole('button', { name: 'Remove grant access for Ada Lovelace' })
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 6a2c37b1d..2ec4fe8e5 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.453",
+ "version": "0.1.454",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.453",
+ "version": "0.1.454",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-ui/package.json b/control-ui/package.json
index 5d0f54fc2..1d989a4b6 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.453",
+ "version": "0.1.454",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/desktop-app/ui/src/gfs/GfsGrantList/index.tsx b/desktop-app/ui/src/gfs/GfsGrantList/index.tsx
index 5760dbd38..417615bcc 100644
--- a/desktop-app/ui/src/gfs/GfsGrantList/index.tsx
+++ b/desktop-app/ui/src/gfs/GfsGrantList/index.tsx
@@ -1,4 +1,4 @@
-import { Badge, Button, Pill, StatusBanner } from '@components/Common'
+import { Badge, IconButton, Pill, StatusBanner } from '@components/Common'
import { GFS_PERMISSION_LABELS } from '@/gfs/GfsPermissionDropdown/constants'
import type {
GfsAgentSubjectOption,
@@ -97,18 +97,18 @@ export function GfsGrantList({
</span>
{item.inherit ? <Badge tone="accent">Includes contents</Badge> : null}
</span>
- <Button
- aria-label={`Revoke access for ${label}`}
+ <IconButton
color="danger"
+ className="da-gfs-grant-list__revoke"
data-testid={`gfs-revoke-grant-${item.id}`}
disabled={revoking}
+ label={`Revoke access for ${label}`}
onClick={() => void onRevoke(item, label)}
- size="sm"
- type="button"
- variant="outline"
+ size="xs"
+ variant="ghost"
>
X
- </Button>
+ </IconButton>
</li>
)
})}
@@ -134,18 +134,18 @@ export function GfsGrantList({
</span>
{item.includeDescendants ? <Badge tone="accent">Includes contents</Badge> : null}
</span>
- <Button
- aria-label={`Revoke shared access for ${label}`}
+ <IconButton
color="danger"
+ className="da-gfs-grant-list__revoke"
data-testid={`gfs-revoke-share-${item.id}`}
disabled={revokingShare || !onRevokeShare}
+ label={`Revoke shared access for ${label}`}
onClick={() => void onRevokeShare?.(item, label)}
- size="sm"
- type="button"
- variant="outline"
+ size="xs"
+ variant="ghost"
>
X
- </Button>
+ </IconButton>
</li>
)
})}
diff --git a/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx b/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx
index 7275a52f0..d7a4a8082 100644
--- a/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx
+++ b/desktop-app/ui/src/gfs/__tests__/GfsGrantList.test.tsx
@@ -67,6 +67,9 @@ describe('GfsGrantList', () => {
expect(within(agentRow).getByText('Write')).toBeTruthy()
expect(within(agentRow).getByText('Includes contents')).toBeTruthy()
expect(within(agentRow).getByText('X')).toBeTruthy()
+ expect(
+ within(agentRow).getByRole('button', { name: 'Revoke access for Chat LLM' }).className
+ ).toContain('da-gfs-grant-list__revoke')
const userRow = screen.getByText('Test Two').closest('li')!
expect(within(userRow).getByText('Read')).toBeTruthy()
diff --git a/desktop-app/ui/src/gfs/delegation.tsx b/desktop-app/ui/src/gfs/delegation.tsx
index 2a57a0615..7563d927f 100644
--- a/desktop-app/ui/src/gfs/delegation.tsx
+++ b/desktop-app/ui/src/gfs/delegation.tsx
@@ -136,27 +136,29 @@ export function GfsDelegationPanel({
Agent selections are limited to read and write. Incompatible permissions were removed.
</p>
) : null}
- {isDirectory ? (
- <label className="da-gfs-delegation__inherit">
- <input
- checked={inherit}
- disabled={busy}
- onChange={event => setInherit(event.target.checked)}
- type="checkbox"
- />
- <span>Include contents of this folder</span>
- </label>
- ) : null}
{subjectOptionsError ? <StatusBanner tone="error" text={subjectOptionsError} /> : null}
- <div className="da-gfs-delegation__actions">
- <Button
- type="button"
- loading={busy}
- disabled={busy || subjectKeys.length === 0 || bits.length === 0}
- onClick={() => run(() => onGrant(subjectKeys, bits, isDirectory ? inherit : false))}
- >
- Grant access
- </Button>
+ <div className="da-gfs-delegation__scope-actions">
+ {isDirectory ? (
+ <label className="da-gfs-delegation__inherit">
+ <input
+ checked={inherit}
+ disabled={busy}
+ onChange={event => setInherit(event.target.checked)}
+ type="checkbox"
+ />
+ <span>Include contents of this folder</span>
+ </label>
+ ) : null}
+ <div className="da-gfs-delegation__actions">
+ <Button
+ type="button"
+ loading={busy}
+ disabled={busy || subjectKeys.length === 0 || bits.length === 0}
+ onClick={() => run(() => onGrant(subjectKeys, bits, isDirectory ? inherit : false))}
+ >
+ Grant access
+ </Button>
+ </div>
</div>
{error !== null && <StatusBanner tone="error" text={error} />}
</div>
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index 7a479a609..13ddc0361 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -13741,6 +13741,15 @@ pre {
flex-wrap: wrap;
gap: var(--space-2);
justify-content: flex-end;
+ margin-left: auto;
+}
+
+.da-gfs-delegation__scope-actions {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ gap: var(--space-2);
}
.da-gfs-footer-actions {
@@ -14796,6 +14805,21 @@ pre {
gap: var(--space-1);
}
+.da-gfs-grant-list__revoke.ui-icon-button {
+ color: var(--danger);
+ border-color: transparent;
+ background: transparent;
+ font-size: var(--font-size-sm);
+ font-weight: var(--font-weight-semibold);
+}
+
+.da-gfs-grant-list__revoke.ui-icon-button:hover:enabled,
+.da-gfs-grant-list__revoke.ui-icon-button:focus-visible {
+ border-color: transparent;
+ background: transparent;
+ color: var(--danger);
+}
+
@media (max-width: 940px) {
.da-gfs-manage-dialog__body {
padding: var(--space-4);