Skip to content

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

TypeScript

feat(gfs): add row share and rename actions

M363a469494cc
diff --git a/desktop-app/ui/src/pages/FilesPage.tsx b/desktop-app/ui/src/pages/FilesPage.tsx
index 19c965d12..0788dcb6c 100644
--- a/desktop-app/ui/src/pages/FilesPage.tsx
+++ b/desktop-app/ui/src/pages/FilesPage.tsx
@@ -22,6 +22,8 @@ import {
IconConnectors,
IconContexts,
IconDownload,
+ IconEdit,
+ IconShare,
IconUpload,
} from '@components/SidebarNav/icons'
import { desktopQueryKeys } from '@hooks/domain/queryKeys'
@@ -1262,7 +1264,7 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:
className="da-grid da-gfs-drive__grid"
style={{
'--da-grid-cols':
- 'calc(var(--space-5) + var(--space-1)) minmax(0, 1fr) minmax(4.5rem, auto) 4.5rem',
+ 'calc(var(--space-5) + var(--space-1)) minmax(0, 1fr) minmax(4.5rem, auto) 9.5rem',
}}
>
<div className="da-grid__head">
@@ -1374,6 +1376,16 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:
{formatSharedFileSize(resource.bytes)}
</span>
<span className="da-gfs-list__actions da-grid__cell da-grid__cell--right">
+ {rowCanManage(resource) ? (
+ <IconButton
+ label={`Share ${resource.name || resource.drive}`}
+ onClick={() => openManage(resource)}
+ size="sm"
+ variant="ghost"
+ >
+ <IconShare width={16} height={16} />
+ </IconButton>
+ ) : null}
{resource.kind === 'file' ? (
<IconButton
label={`Download ${resource.name}`}
@@ -1385,6 +1397,16 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:
<IconDownload width={16} height={16} />
</IconButton>
) : null}
+ {rowCanRename(resource) ? (
+ <IconButton
+ label={`Rename ${resource.name || resource.drive}`}
+ onClick={() => openRenameTarget(resource)}
+ size="sm"
+ variant="ghost"
+ >
+ <IconEdit width={16} height={16} />
+ </IconButton>
+ ) : null}
<GfsResourceMenu
resourceName={resource.name}
onManage={rowCanManage(resource) ? () => openManage(resource) : undefined}
diff --git a/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx b/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx
index bfe91d271..deb11016e 100644
--- a/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx
+++ b/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx
@@ -226,6 +226,45 @@ describe('FilesPage', () => {
expect(screen.queryByRole('tab')).toBeNull()
})
+ it('shows share and rename row actions when the resource permissions allow them', () => {
+ hookMock.useGfsBrowserController.mockReturnValue({
+ ...baseController(),
+ accessibleResources: [
+ {
+ resourceId: 'file-1',
+ rid: 'file-1',
+ gfsUri: 'gfs://main/file-1',
+ drive: 'main',
+ parentResourceId: null,
+ name: 'report.txt',
+ kind: 'file',
+ path: '/report.txt',
+ version: 1,
+ bytes: 12,
+ permissions: ['read', 'write', 'manage_acl'],
+ },
+ ],
+ })
+
+ renderFilesPage()
+
+ const row = screen.getByRole('button', { name: 'Open report.txt' }).closest('.da-grid__row')
+ expect(row).not.toBeNull()
+ expect(within(row!).getByRole('button', { name: 'Share report.txt' })).toBeTruthy()
+ expect(within(row!).getByRole('button', { name: 'Download report.txt' })).toBeTruthy()
+ expect(within(row!).getByRole('button', { name: 'Rename report.txt' })).toBeTruthy()
+ expect(
+ Array.from(row!.querySelectorAll('.da-gfs-list__actions button')).map(button =>
+ button.getAttribute('aria-label')
+ )
+ ).toEqual([
+ 'Share report.txt',
+ 'Download report.txt',
+ 'Rename report.txt',
+ 'Options for report.txt',
+ ])
+ })
+
it('orders directories before files, both alphabetically by name', async () => {
hookMock.useGfsBrowserController.mockReturnValue({
...baseController(),
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index a36bba821..05e3307f4 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -14127,7 +14127,7 @@ pre {
.da-gfs-list__actions {
display: flex;
align-items: center;
- flex-wrap: wrap;
+ flex-wrap: nowrap;
gap: var(--space-2);
justify-self: end;
}
@@ -15918,6 +15918,10 @@ pre {
grid-template-columns: calc(var(--space-5) + var(--space-1)) minmax(0, 1fr) 4.5rem;
}
+ .da-gfs-list__actions {
+ flex-wrap: wrap;
+ }
+
.da-gfs-drive__size-column,
.da-gfs-drive__size {
display: none;