Skip to content

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

TypeScript

fix(desktop): drop per-row Move button from sidebar file explorer tree

Ma064fd91f020
diff --git a/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/__tests__/FileExplorerTree.test.tsx b/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/__tests__/FileExplorerTree.test.tsx
index bb5834611..39a2b5bba 100644
--- a/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/__tests__/FileExplorerTree.test.tsx
+++ b/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/__tests__/FileExplorerTree.test.tsx
@@ -15,6 +15,9 @@ import {
listChildrenPage,
resolvedFile,
} from '@/gfs/__fixtures__/gfsProducerFixtures'
+// ── drag-and-drop (rev-2 D1) ─────────────────────────────────────────────────
+
+import { GfsDragSessionProvider } from '@/gfs/dragSession'
import { FileExplorerTree } from '..'
// useGfsBrowserController only reads { isAuthenticated, me, runtimeConfigState }
@@ -727,10 +730,6 @@ describe('FileExplorerTree — download-path authority wiring (R1-H8)', () => {
})
})
-// ── drag-and-drop (rev-2 D1) ─────────────────────────────────────────────────
-
-import { GfsDragSessionProvider } from '@/gfs/dragSession'
-
type DndProducers = Producers & {
affordances?: (resourceId: string, drive?: string) => Promise<unknown>
resolve?: (uri: string) => Promise<unknown>
@@ -754,8 +753,13 @@ function installDndClerum(producers: DndProducers) {
producers.download ??
vi.fn(async () => downloadResult(resolvedFile('fallback', 'fallback.bin'))),
affordances: producers.affordances ?? vi.fn(async () => ({ held: ['read'] })),
- resolve: producers.resolve ?? vi.fn(async () => { throw new Error('resolve not stubbed') }),
- moveResource: producers.moveResource ?? vi.fn(async () => ({ resourceId: 'x', version: 2 })),
+ resolve:
+ producers.resolve ??
+ vi.fn(async () => {
+ throw new Error('resolve not stubbed')
+ }),
+ moveResource:
+ producers.moveResource ?? vi.fn(async () => ({ resourceId: 'x', version: 2 })),
},
},
})
@@ -843,7 +847,9 @@ describe('FileExplorerTree — drag-and-drop moves', () => {
const dialog = await screen.findByRole('dialog', { name: 'Move folder A to B' })
expect(
- within(dialog).getByText(/Inherited access to this folder and its contents follows the new location/)
+ within(dialog).getByText(
+ /Inherited access to this folder and its contents follows the new location/
+ )
).toBeTruthy()
await act(async () => {
fireEvent.click(within(dialog).getByRole('button', { name: 'Move' }))
@@ -852,9 +858,7 @@ describe('FileExplorerTree — drag-and-drop moves', () => {
await waitFor(() => {
expect(moveResource).toHaveBeenCalledWith('foldera', 'folderb', 'main', 4, undefined)
})
- await waitFor(() =>
- expect(pushToast).toHaveBeenCalledWith('Moved A to B', 'success')
- )
+ await waitFor(() => expect(pushToast).toHaveBeenCalledWith('Moved A to B', 'success'))
// Folder-impact info accompanies the success toast (rev-2 §1/§8).
expect(pushToast).toHaveBeenCalledWith(
'Moving a folder changes who can access its contents — access now follows the new location.',
@@ -871,7 +875,9 @@ describe('FileExplorerTree — drag-and-drop moves', () => {
listAccessiblePage([accessibleResource('parent-1', 'P', 'directory')])
),
listChildren: vi.fn(async () =>
- listChildrenPage([childView('folder-a', 'A', 'directory', { parentResourceId: 'parent-1' })])
+ listChildrenPage([
+ childView('folder-a', 'A', 'directory', { parentResourceId: 'parent-1' }),
+ ])
),
affordances,
moveResource,
@@ -963,7 +969,7 @@ describe('FileExplorerTree — drag-and-drop moves', () => {
expect(treeItem.getAttribute('aria-expanded')).toBe('false')
})
- it('row Move action and Shift+F10 open the existing Move dialog', async () => {
+ it('Shift+F10 opens the existing Move dialog from the tree row', async () => {
installDndClerum({
listAccessible: vi.fn(async () =>
listAccessiblePage([accessibleResource('folder-a', 'A', 'directory')])
@@ -971,15 +977,10 @@ describe('FileExplorerTree — drag-and-drop moves', () => {
})
renderTreeWithSession()
- await act(async () => {
- fireEvent.click(
- await screen.findByRole('button', { name: 'Move A to another folder' })
- )
- })
- expect(await screen.findByRole('dialog', { name: 'Move folder A' })).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Close move dialog' }))
+ // The rejected per-row Move affordance stays gone: no row button renders.
+ await screen.findByRole('button', { name: 'A' })
+ expect(screen.queryByRole('button', { name: 'Move A to another folder' })).toBeNull()
- // Shift+F10 on the row label opens the same dialog.
await act(async () => {
fireEvent.keyDown(await screen.findByRole('button', { name: 'A' }), {
key: 'F10',
diff --git a/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/index.tsx b/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/index.tsx
index 4c05ce72d..f8c948985 100644
--- a/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/index.tsx
+++ b/desktop-app/ui/src/components/SidebarNav/FileExplorerTree/index.tsx
@@ -20,15 +20,11 @@ import { isGfsChildrenDenied, purgeDeniedGfsChildren } from '@/gfs/deniedChildre
import { useGfsDragAdjudication } from '@/gfs/dragAdjudication'
import type { GfsDragSource } from '@/gfs/dragSession'
import { useGfsDragSession } from '@/gfs/dragSession'
-import { GfsMoveConfirmDialog } from '@/gfs/moveConfirmDialog'
import { commitGfsMove, moveDenialMessage, toastMoveOutcome } from '@/gfs/moveCommit'
+import { GfsMoveConfirmDialog } from '@/gfs/moveConfirmDialog'
import { GfsMoveDialog } from '@/gfs/moveDialog'
-import { IconChevronRight, IconContexts, IconMoreHorizontal } from '../icons'
-import type {
- FileExplorerDropState,
- FileExplorerNodeProps,
- FileExplorerTreeProps,
-} from './types'
+import { IconChevronRight, IconContexts } from '../icons'
+import type { FileExplorerDropState, FileExplorerNodeProps, FileExplorerTreeProps } from './types'
// A folder's single-click (toggle) must not act before we know a double-click
// (open its files tab) is not coming, so it is deferred by this window to let a
@@ -190,8 +186,8 @@ function FileExplorerNode({
runActivate()
return
}
- // Shift+F10 opens the row's Move action contextually, matching the
- // row-action discoverability of the Files page.
+ // Shift+F10 opens the Move dialog for the focused row — the keyboard
+ // path after the visible per-row Move button was rejected as clutter.
if (event.shiftKey && event.key === 'F10') {
event.preventDefault()
clearClickTimer()
@@ -357,18 +353,6 @@ function FileExplorerNode({
</Badge>
) : null}
</Button>
- <IconButton
- className="da-file-explorer__move-action"
- label={`Move ${label} to another folder`}
- onClick={() => {
- clearClickTimer()
- onRequestMove(node, ancestorCrumbs)
- }}
- size="sm"
- variant="ghost"
- >
- <IconMoreHorizontal />
- </IconButton>
</div>
{isExpanded ? (
<div className="da-file-explorer__group" role="group">
@@ -890,9 +874,7 @@ export function FileExplorerTree({
onClose={() => setMoveDialogTarget(null)}
onMove={async (destinationId, destinationName) => {
const target = moveDialogTarget
- const allowNumberedRename = await adjudication.probeSourceWrite(
- target.node.resourceId
- )
+ const allowNumberedRename = await adjudication.probeSourceWrite(target.node.resourceId)
const source: GfsDragSource = {
resourceId: target.node.resourceId,
gfsUri: target.node.gfsUri,
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index c9426d10f..eb82238d0 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -2010,24 +2010,6 @@ h3 {
background: rgba(var(--accent-rgb), 0.12);
}
-/* The per-row Move action is revealed on hover/focus-within so the compact
- chrome is unchanged at rest (keyboard users reach it via Tab). */
-.da-file-explorer__move-action {
- flex: 0 0 auto;
- opacity: 0;
-}
-
-.da-file-explorer__row:hover .da-file-explorer__move-action,
-.da-file-explorer__row:focus-within .da-file-explorer__move-action {
- opacity: 1;
-}
-
-@media (prefers-reduced-motion: no-preference) {
- .da-file-explorer__move-action {
- transition: opacity var(--motion-fast, 120ms) ease;
- }
-}
-
/* Draggable tree labels and grid rows show the grab affordance. */
.da-file-explorer__label.ui-button[draggable='true'] {
cursor: grab;