Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat: more adjustments
Mfb8534973aa9
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.cssindex 9c6bb1df1..553cbd98a 100644--- a/control-ui/app/globals.css+++ b/control-ui/app/globals.css@@ -13056,23 +13056,12 @@ button.cu-gfs-tree__button:focus-visible,.cu-gfs-manage-dialog__heading h3 {margin: 0;overflow: hidden;+ overflow-wrap: anywhere;color: var(--cu-text);font-size: 1.375rem;font-weight: 600;line-height: 1.2;text-overflow: ellipsis;- white-space: nowrap;-}--.cu-gfs-manage-dialog__title-row {- min-width: 0;- display: flex;- align-items: center;- gap: var(--cu-space-1);-}--.cu-gfs-manage-dialog__title-row h3 {- min-width: 0;white-space: normal;}@@ -13124,10 +13113,6 @@ button.cu-gfs-tree__button:focus-visible,gap: var(--cu-space-1);}-.cu-gfs-manage-dialog__title-row .cu-gfs-resource-menu {- z-index: 40;-}-.cu-gfs-manage-dialog__close.cu-btn {width: 2.25rem;min-width: 2.25rem;@@ -13346,7 +13331,11 @@ button.cu-gfs-tree__button:focus-visible,flex: 0 0 1.25rem;display: grid;place-items: center;- color: var(--cu-warning);+ color: var(--cu-accent);+}++.cu-gfs-move-dialog__tree-root + .cu-gfs-move-dialog__tree-item {+ margin-top: calc(var(--cu-space-1) / 2);}.cu-gfs-move-dialog__tree-folder-icon svg {@@ -13468,7 +13457,7 @@ button.cu-gfs-tree__button:focus-visible,.cu-gfs-grant__composer {display: grid;grid-template-columns: minmax(0, 1fr) 12.75rem;- align-items: stretch;+ align-items: start;gap: var(--cu-space-2);}@@ -13479,9 +13468,11 @@ button.cu-gfs-tree__button:focus-visible,.cu-gfs-role-select {width: 100%;min-width: 0;+ align-self: start;}.cu-gfs-role-select .cu-selection-dropdown__button {+ height: 2.875rem;min-height: 2.875rem;background-color: var(--cu-bg-elevated);font-weight: 500;diff --git a/control-ui/components/GfsBrowser.tsx b/control-ui/components/GfsBrowser.tsxindex 02839cc19..bf50de102 100644--- a/control-ui/components/GfsBrowser.tsx+++ b/control-ui/components/GfsBrowser.tsx@@ -1475,41 +1475,7 @@ export function GfsBrowser(): React.JSX.Element {busy={renaming}/>) : (- <span className="cu-gfs-manage-dialog__title-row">- <h3>Share “{selected.name}”</h3>- <GfsResourceMenu- resourceName={selected.name}- resourceUri={selected.gfsUri}- downloading={downloadingIds.has(selected.resourceId)}- onPreview={- selected.kind !== 'directory' && isGfsPreviewFile(selected.name)- ? () => openFilePreview(selected)- : undefined- }- onDownload={- selected.kind !== 'directory'- ? () => void downloadFile(selected)- : undefined- }- onCopyLink={() => void copyGfsUri(selected.gfsUri)}- onRename={() => {- setRenameName(selected.name)- setRenameTarget(null)- setRenameOpen(true)- setDeleteOpen(false)- }}- onMove={() => openMove(selected)}- onReplace={- selected.kind !== 'directory'- ? file => void replaceFile(selected, file)- : undefined- }- onDelete={() => {- setDeleteOpen(true)- setRenameOpen(false)- }}- />- </span>+ <h3>Share “{selected.name}”</h3>)}</span><span className="cu-gfs-manage-dialog__top-actions">@@ -1615,7 +1581,6 @@ export function GfsBrowser(): React.JSX.Element {fileSummary={uploadCandidate ? `${formatBytes(uploadCandidate.size)} selected` : undefined}- guidance="Before upload starts, the 1 GiB Upload v2 protocol ceiling is the local safety bound. When upload begins, the writer resolves and enforces the actual product file limit. Each request is streamed in 8 MiB parts (16 MiB hard maximum)."progress={uploadSnapshot? {diff --git a/control-ui/components/GfsMoveDialog/index.tsx b/control-ui/components/GfsMoveDialog/index.tsxindex bece8f862..4f7b1f456 100644--- a/control-ui/components/GfsMoveDialog/index.tsx+++ b/control-ui/components/GfsMoveDialog/index.tsx@@ -23,6 +23,7 @@ type MoveCrumb = {}type TreePage = {+ rootResourceId?: stringitems: MoveFolder[]nextCursor: string | null}@@ -221,6 +222,7 @@ export function GfsMoveDialog({() => new Set(initialCrumbs.flatMap(crumb => (crumb.id ? [crumb.id] : []))))const [rootFolders, setRootFolders] = useState<MoveFolder[]>([])+ const [rootResourceId, setRootResourceId] = useState<string | null>(null)const [nextCursor, setNextCursor] = useState<string | null>(null)const [loading, setLoading] = useState(false)const [loaded, setLoaded] = useState(false)@@ -234,6 +236,7 @@ export function GfsMoveDialog({if (cursor) query.cursor = cursorconst page = (await apiGet('/api/v1/gfs/tree', query)) as TreePagesetRootFolders(previous => (cursor ? [...previous, ...page.items] : page.items))+ if (page.rootResourceId) setRootResourceId(page.rootResourceId)setNextCursor(page.nextCursor)setLoaded(true)} catch (loadError) {@@ -287,6 +290,7 @@ export function GfsMoveDialog({}const isNoOpDestination = Boolean(selected && selected.resourceId === currentParentId)+ const rootSelected = Boolean(rootResourceId && selected?.resourceId === rootResourceId)return (<div@@ -335,6 +339,36 @@ export function GfsMoveDialog({<div className="cu-gfs-move-dialog__tree-heading">Global File System</div><div className="cu-gfs-move-dialog__tree" role="tree" aria-label="GFS destination folders">+ {rootResourceId && rootResourceId !== target.resourceId ? (+ <div+ aria-expanded="true"+ aria-level={1}+ aria-selected={rootSelected}+ className="cu-gfs-move-dialog__tree-item cu-gfs-move-dialog__tree-root"+ role="treeitem"+ >+ <div className="cu-gfs-move-dialog__tree-row">+ <span className="cu-gfs-move-dialog__tree-toggle-placeholder" aria-hidden="true" />+ <button+ aria-label="main"+ aria-selected={rootSelected}+ className="cu-gfs-move-dialog__tree-select"+ onClick={() =>+ selectFolder({ resourceId: rootResourceId, name: DRIVE, kind: 'directory' })+ }+ type="button"+ >+ <span className="cu-gfs-move-dialog__tree-folder-icon" aria-hidden="true">+ <IconFolder />+ </span>+ <span className="cu-gfs-move-dialog__tree-folder-name">main</span>+ <span className="cu-gfs-move-dialog__tree-selected-icon" aria-hidden="true">+ {rootSelected ? <IconCheck /> : null}+ </span>+ </button>+ </div>+ </div>+ ) : null}{loading && !loaded ? (<p className="cu-gfs-move-dialog__notice" role="status">Loading folders…@@ -348,7 +382,7 @@ export function GfsMoveDialog({expandedIds={expandedIds}folder={folder}key={folder.resourceId}- level={1}+ level={rootResourceId ? 2 : 1}onSelect={selectFolder}onToggle={toggleFolder}selected={selected}diff --git a/control-ui/components/NewFolderModal/index.tsx b/control-ui/components/NewFolderModal/index.tsxindex dabe3b4be..b2c2ae740 100644--- a/control-ui/components/NewFolderModal/index.tsx+++ b/control-ui/components/NewFolderModal/index.tsx@@ -2,7 +2,6 @@import { useEffect, useId, useState } from 'react'import { Button, Field, TextInput } from '@components/ui'-import { GFS_RESOURCE_NAME_MAX_LENGTH } from '@lib/gfsResourceName'import type { NewFolderModalProps } from './types'/**@@ -70,11 +69,7 @@ export function NewFolderModal({<p id={descriptionId} className="cu-modal-copy">Create a new folder in {folderLabel}.</p>- <Field- label="Folder name"- htmlFor={inputId}- description={`Names longer than ${GFS_RESOURCE_NAME_MAX_LENGTH} characters are shortened automatically.`}- >+ <Field label="Folder name" htmlFor={inputId}><TextInputid={inputId}autoFocusdiff --git a/control-ui/components/__tests__/GfsBrowser.test.tsx b/control-ui/components/__tests__/GfsBrowser.test.tsxindex 16dde8fce..8c0a4055e 100644--- a/control-ui/components/__tests__/GfsBrowser.test.tsx+++ b/control-ui/components/__tests__/GfsBrowser.test.tsx@@ -367,12 +367,7 @@ describe('GfsBrowser', () => {fireEvent.click(newFile)const uploadDialog = await screen.findByRole('dialog', { name: 'Upload file' })- expect(- within(uploadDialog).getByText(/1 GiB Upload v2 protocol ceiling is the local safety bound/i)- ).toBeTruthy()- expect(- within(uploadDialog).getByText(/writer resolves and enforces the actual product file limit/i)- ).toBeTruthy()+ expect(within(uploadDialog).queryByText(/Upload v2 protocol ceiling/i)).toBeNull()expect(within(uploadDialog).getByText(/drag and drop, or click to browse/i)).toBeTruthy()fireEvent.click(within(uploadDialog).getByRole('button', { name: 'Cancel' }))@@ -911,7 +906,7 @@ describe('GfsBrowser', () => {)})- it('keeps manage-dialog rename inline with the shared confirmation controls', async () => {+ it('keeps the share dialog focused on sharing without resource actions', async () => {mockApiGet.mockResolvedValueOnce({items: [child('report.txt', 'file', 2)],nextCursor: null,@@ -920,17 +915,11 @@ describe('GfsBrowser', () => {await openManage('report.txt')const manageDialog = await screen.findByRole('dialog', { name: 'Share file report.txt' })- const manageMenuTrigger = within(manageDialog).getByRole('button', {- name: 'Actions for report.txt',- })- fireEvent.click(manageMenuTrigger)- fireEvent.click(within(screen.getByRole('menu')).getByRole('menuitem', { name: 'Rename' }))-- const renameForm = within(manageDialog).getByRole('form', { name: 'Rename resource' })- expect(within(renameForm).getByRole('button', { name: 'Save name' })).toBeTruthy()- expect(within(renameForm).getByRole('button', { name: 'Cancel rename' })).toBeTruthy()- fireEvent.click(within(renameForm).getByRole('button', { name: 'Cancel rename' }))- expect(within(manageDialog).queryByRole('form', { name: 'Rename resource' })).toBeNull()+ expect(within(manageDialog).getByRole('heading', { name: 'Share “report.txt”' })).toBeTruthy()+ expect(+ within(manageDialog).queryByRole('button', { name: 'Actions for report.txt' })+ ).toBeNull()+ expect(within(manageDialog).queryByRole('menu')).toBeNull()})it('downloads a file through the operator content proxy using rid + name', async () => {@@ -1516,20 +1505,7 @@ describe('GfsBrowser', () => {await waitFor(() => expect(mockGetAdminUsers).toHaveBeenCalledWith(''))await waitFor(() => expect(mockGetAdminTeams).toHaveBeenCalled())const manageDialog = screen.getByRole('dialog', { name: 'Share file report.md' })- const manageMenuTrigger = within(manageDialog).getByRole('button', {- name: 'Actions for report.md',- })- expect(within(manageDialog).queryByRole('button', { name: 'Replace file' })).toBeNull()- expect(within(manageDialog).queryByText('Quick actions')).toBeNull()- fireEvent.click(manageMenuTrigger)- const manageMenu = screen.getByRole('menu')- expect(within(manageMenu).getByRole('menuitem', { name: 'Download' })).toBeTruthy()- expect(within(manageMenu).getByRole('menuitem', { name: 'Replace file' })).toBeTruthy()- expect(within(manageMenu).getByRole('menuitem', { name: 'Copy link' })).toBeTruthy()- expect(within(manageMenu).getByRole('menuitem', { name: 'Rename' })).toBeTruthy()- expect(within(manageMenu).getByRole('menuitem', { name: 'Delete' })).toBeTruthy()- expect(within(manageMenu).queryByRole('menuitem', { name: 'Share' })).toBeNull()- fireEvent.click(manageMenuTrigger)+ expect(within(manageDialog).queryByRole('button', { name: 'Actions for report.md' })).toBeNull()await openSubjectPicker()fireEvent.click(await screen.findByRole('option', { name: 'Ada Lovelace' }))selectPermission('Read')@@ -1582,13 +1558,10 @@ describe('GfsBrowser', () => {await waitFor(() => expect(mockGetAdminUsers).toHaveBeenCalledWith(''))expect(screen.queryByRole('checkbox', { name: /Include contents of this folder/ })).toBeNull()const manageDialog = screen.getByRole('dialog', { name: 'Share folder team-folder' })- const manageMenuTrigger = within(manageDialog).getByRole('button', {- name: 'Actions for team-folder',- })+ expect(+ within(manageDialog).queryByRole('button', { name: 'Actions for team-folder' })+ ).toBeNull()expect(within(manageDialog).queryByRole('button', { name: 'Upload file' })).toBeNull()- fireEvent.click(manageMenuTrigger)- expect(within(manageDialog).queryByRole('menuitem', { name: 'Create share' })).toBeNull()- fireEvent.click(manageMenuTrigger)await openSubjectPicker()fireEvent.click(await screen.findByRole('option', { name: 'Ada Lovelace' }))selectPermission('Read')diff --git a/control-ui/components/__tests__/GfsMoveDialog.test.tsx b/control-ui/components/__tests__/GfsMoveDialog.test.tsxindex 2c8dfa55d..78459f3ef 100644--- a/control-ui/components/__tests__/GfsMoveDialog.test.tsx+++ b/control-ui/components/__tests__/GfsMoveDialog.test.tsx@@ -18,6 +18,7 @@ describe('GfsMoveDialog', () => {mockApiGet.mockImplementation(async path => {if (path === '/api/v1/gfs/tree') {return {+ rootResourceId: 'root-1',items: [{resourceId: 'archive-1',@@ -63,6 +64,30 @@ describe('GfsMoveDialog', () => {await waitFor(() => expect(onMove).toHaveBeenCalledWith('archive-1', 'Archive'))})+ it('moves a file to the main root', async () => {+ mockApiGet.mockResolvedValue({+ rootResourceId: 'root-1',+ items: [{ resourceId: 'archive-1', name: 'Archive', kind: 'directory' }],+ nextCursor: null,+ })+ const onMove = vi.fn(async () => undefined)++ render(+ <GfsMoveDialog+ initialCrumbs={[{ id: 'product-1', name: 'Product' }]}+ onClose={vi.fn()}+ onMove={onMove}+ target={{ resourceId: 'file-1', name: 'notes.txt', kind: 'file' }}+ />+ )++ const dialog = screen.getByRole('dialog', { name: 'Move file notes.txt' })+ fireEvent.click(await within(dialog).findByRole('button', { name: 'main' }))+ fireEvent.click(within(dialog).getByRole('button', { name: 'Move here (main)' }))++ await waitFor(() => expect(onMove).toHaveBeenCalledWith('root-1', 'main'))+ })+it('refuses a no-op move into the folder that already contains the target', async () => {mockApiGet.mockImplementation(async path => {if (path === '/api/v1/gfs/tree') {diff --git a/control-ui/next-env.d.ts b/control-ui/next-env.d.tsindex 9edff1c7c..c4b7818fb 100644--- a/control-ui/next-env.d.ts+++ b/control-ui/next-env.d.ts@@ -1,6 +1,6 @@/// <reference types="next" />/// <reference types="next/image-types/global" />-import "./.next/types/routes.d.ts";+import "./.next/dev/types/routes.d.ts";// NOTE: This file should not be edited// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 50ce100e7..fe7797ced 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.508",+ "version": "0.1.509","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.508",+ "version": "0.1.509","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.jsonindex b25028709..b747ab7dd 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.508",+ "version": "0.1.509","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsxindex 36dfc9107..98bb53f5a 100644--- a/desktop-app/ui/src/App.tsx+++ b/desktop-app/ui/src/App.tsx@@ -27,6 +27,7 @@ import { THEME_STORAGE_KEY } from '@constants/theme'import { useAgentChatActionsValue } from '@hooks/useAgentChatActionsValue'import { useAppController } from '@hooks/useAppController'import { useChatDrawerResize } from '@hooks/useChatDrawerResize'+import { useWindowFocusBridge } from '@hooks/useWindowFocusBridge'import type { ChatLocalMatch } from '@lib/chatLocalSearch'import { buildLoadedChatSemanticModels } from '@lib/chatMessageSemantics'import {@@ -246,6 +247,9 @@ function DesktopUpdateRequiredDialog({export function App() {const vm = useAppController()+ // Electron never fires `visibilitychange` on OS-window switching; bridge+ // DOM focus/blur so focus-aware query revalidation actually runs.+ useWindowFocusBridge()const [themeMode, setThemeMode] = React.useState<ThemeMode>(getInitialThemeMode)const [sidebarCollapsed, setSidebarCollapsed] = React.useState<boolean>(getInitialSidebarCollapseddiff --git a/desktop-app/ui/src/hooks/__tests__/useWindowFocusBridge.test.tsx b/desktop-app/ui/src/hooks/__tests__/useWindowFocusBridge.test.tsxnew file mode 100644index 000000000..b8ed68872--- /dev/null+++ b/desktop-app/ui/src/hooks/__tests__/useWindowFocusBridge.test.tsx@@ -0,0 +1,45 @@+// @vitest-environment jsdom+import { describe, expect, it, vi } from 'vitest'+import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query'+import { fireEvent, render, waitFor } from '@testing-library/react'+import { desktopQueryDefaults } from '@lib/queryClient'+import { useWindowFocusBridge } from '../useWindowFocusBridge'++/**+ * Electron renderers keep `visibilityState: 'visible'` while their window+ * loses/gains OS focus, so query-core's visibilitychange listener never runs+ * there. The bridge forwards DOM focus/blur to focusManager, which is what+ * makes `refetchOnWindowFocus` policies (GFS listing freshness) work in the+ * desktop app. This test drives the REAL DOM events, not focusManager+ * directly, to pin the bridging itself.+ */+describe('useWindowFocusBridge', () => {+ it('revalidates focus-aware queries on window focus events under production defaults', async () => {+ const fetcher = vi.fn(async () => ({ value: Date.now() }))++ function Probe() {+ useWindowFocusBridge()+ const query = useQuery({+ queryKey: ['focus-bridge-probe'],+ queryFn: fetcher,+ refetchOnWindowFocus: 'always',+ })+ return <div data-testid="fetches">{query.dataFetchStatus}</div>+ }++ const client = new QueryClient({ defaultOptions: desktopQueryDefaults })+ render(+ <QueryClientProvider client={client}>+ <Probe />+ </QueryClientProvider>+ )++ await waitFor(() => expect(fetcher).toHaveBeenCalledTimes(1))++ // Leaving and returning to the window (as Electron fires it).+ fireEvent(window, new Event('blur'))+ fireEvent(window, new Event('focus'))++ await waitFor(() => expect(fetcher).toHaveBeenCalledTimes(2))+ })+})diff --git a/desktop-app/ui/src/hooks/useWindowFocusBridge.ts b/desktop-app/ui/src/hooks/useWindowFocusBridge.tsnew file mode 100644index 000000000..3e98b9da0--- /dev/null+++ b/desktop-app/ui/src/hooks/useWindowFocusBridge.ts@@ -0,0 +1,28 @@+import { useEffect } from 'react'+import { focusManager } from '@tanstack/react-query'++/**+ * Bridge OS-window focus into TanStack Query's focusManager.+ *+ * query-core's focusManager listens only for `visibilitychange`. Browsers+ * fire that when the tab is hidden, but an Electron renderer stays+ * `visibilityState: 'visible'` while its window merely loses or gains OS+ * focus — so switching between the desktop app and another window (control-ui,+ * a browser) never notified the manager, and `refetchOnWindowFocus` policies+ * never ran. The renderer DOES receive DOM `focus`/`blur` on window+ * activation; forwarding them keeps every focus-aware query (GFS listings,+ * accessible resources) revalidating exactly when the user looks at the app+ * again after changing something elsewhere.+ */+export function useWindowFocusBridge(): void {+ useEffect(() => {+ const onFocus = (): void => focusManager.setFocused(true)+ const onBlur = (): void => focusManager.setFocused(false)+ window.addEventListener('focus', onFocus)+ window.addEventListener('blur', onBlur)+ return () => {+ window.removeEventListener('focus', onFocus)+ window.removeEventListener('blur', onBlur)+ }+ }, [])+}diff --git a/desktop-app/ui/src/pages/FilesPage.tsx b/desktop-app/ui/src/pages/FilesPage.tsxindex b82ba70f0..90cc3181b 100644--- a/desktop-app/ui/src/pages/FilesPage.tsx+++ b/desktop-app/ui/src/pages/FilesPage.tsx@@ -1286,6 +1286,9 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:}onCopyLink={() => void handleCopyLink(current.gfsUri)}onDelete={canDeleteCurrent ? () => setDeleteTarget(current) : undefined}+ onReplace={+ canWriteCurrent ? file => void handleReplaceCurrentFile(file) : undefined+ }onRename={canWriteCurrent ? () => openRenameTarget(current) : undefined}onMove={requestMoveCurrent}onPreview={@@ -1607,50 +1610,7 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:</Button></form>) : (- <span className="da-gfs-manage-dialog__title-row">- <h3>Share “{current.name}”</h3>- <GfsResourceMenu- resourceName={current.name}- onCopyLink={() => void handleCopyLink(current.gfsUri)}- onCreateFolder={- currentIsFolder && canWriteCurrent ? openCreateFolder : undefined- }- onDelete={- canDeleteCurrent- ? () => {- setDeleteOpen(true)- setCreateFolderOpen(false)- }- : undefined- }- onMove={requestMoveCurrent}- onDownload={- currentIsFile- ? () => void handleDownload(current.gfsUri, current.name)- : undefined- }- onPreview={- currentIsFile && currentPreviewAvailable- ? () => void openFilePreview(current)- : undefined- }- onRename={- canWriteCurrent- ? () => {- setRenameName(current.name)- setRenameOpen(true)- setCreateFolderOpen(false)- setDeleteOpen(false)- }- : undefined- }- onReplace={- currentIsFile && canWriteCurrent- ? file => void handleReplaceCurrentFile(file)- : undefined- }- />- </span>+ <h3>Share “{current.name}”</h3>)}</span><span className="da-gfs-manage-dialog__top-actions">diff --git a/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx b/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsxindex a985278ef..6109f8ea8 100644--- a/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx+++ b/desktop-app/ui/src/pages/__tests__/FilesPage.test.tsx@@ -106,10 +106,9 @@ async function openManageDialog(resourceName: string) {})}-async function chooseManageAction(resourceName: string, actionName: string) {- const dialog = screen.getByRole('dialog', { name: new RegExp(`Share .* ${resourceName}`) })+async function chooseResourceAction(resourceName: string, actionName: string) {await act(async () => {- fireEvent.click(within(dialog).getByRole('button', { name: `Options for ${resourceName}` }))+ fireEvent.click(screen.getByRole('button', { name: `Options for ${resourceName}` }))})await act(async () => {fireEvent.click(screen.getByRole('menuitem', { name: actionName }))@@ -586,9 +585,8 @@ describe('FilesPage', () => {renderFilesPage()- await openManageDialog('Team folder')expect(screen.queryByText('Manage folder')).toBeNull()- await chooseManageAction('Team folder', 'New folder')+ fireEvent.click(screen.getByRole('button', { name: 'New folder' }))const newFolderDialog = screen.getByRole('dialog', { name: 'New folder' })const createFolderForm = screen.getByRole('form', { name: 'Create folder' })expect(within(newFolderDialog).queryByText('People with access')).toBeNull()@@ -598,18 +596,17 @@ describe('FilesPage', () => {fireEvent.click(createFolderForm.querySelector('button[type="submit"]')!)})- await openManageDialog('Team folder')- await chooseManageAction('Team folder', 'Rename')+ await chooseResourceAction('Team folder', 'Rename')const renameForm = screen.getByRole('form', { name: 'Rename resource' })await act(async () => {fireEvent.change(screen.getByLabelText('New name'), { target: { value: 'renamed' } })fireEvent.click(renameForm.querySelector('button[type="submit"]')!)})- await chooseManageAction('Team folder', 'Delete')- const deleteDialog = screen.getByRole('alertdialog', { name: 'Delete resource' })+ await chooseResourceAction('Team folder', 'Delete')+ const deleteDialog = screen.getByRole('dialog', { name: 'Delete Team folder?' })await act(async () => {- fireEvent.click(deleteDialog.querySelector('button')!)+ fireEvent.click(within(deleteDialog).getByRole('button', { name: 'Delete' }))})expect(createFolder).toHaveBeenCalledWith('new-folder')@@ -1185,17 +1182,16 @@ describe('FilesPage', () => {renderFilesPage(pushToast)- await openManageDialog('Team folder')- await chooseManageAction('Team folder', 'Delete')- const deleteDialog = screen.getByRole('alertdialog', { name: 'Delete resource' })+ await chooseResourceAction('Team folder', 'Delete')+ const deleteDialog = screen.getByRole('dialog', { name: 'Delete Team folder?' })await act(async () => {- fireEvent.click(deleteDialog.querySelector('button')!)+ fireEvent.click(within(deleteDialog).getByRole('button', { name: 'Delete' }))await Promise.resolve()})expect(deleteResource).toHaveBeenCalledWith('folder-1', 7)expect(pushToast).toHaveBeenCalledWith('not_empty: folder has children', 'error')- expect(screen.getByRole('alertdialog', { name: 'Delete resource' })).toBeTruthy()+ expect(screen.queryByRole('dialog', { name: 'Delete Team folder?' })).toBeNull()})it('surfaces stale replace and rename precondition failures for the current file', async () => {@@ -1229,8 +1225,11 @@ describe('FilesPage', () => {await openManageDialog('report.txt')const manageDialog = screen.getByRole('dialog', { name: 'Share file report.txt' })- expect(within(manageDialog).queryByRole('button', { name: 'Replace file' })).toBeNull()- await chooseManageAction('report.txt', 'Replace file')+ expect(+ within(manageDialog).queryByRole('button', { name: 'Options for report.txt' })+ ).toBeNull()+ fireEvent.click(within(manageDialog).getByRole('button', { name: 'Close share dialog' }))+ await chooseResourceAction('report.txt', 'Replace file')await act(async () => {fireEvent.change(screen.getByLabelText('Replace report.txt'), {target: {@@ -1239,7 +1238,7 @@ describe('FilesPage', () => {})await Promise.resolve()})- await chooseManageAction('report.txt', 'Rename')+ await chooseResourceAction('report.txt', 'Rename')const renameForm = screen.getByRole('form', { name: 'Rename resource' })await act(async () => {fireEvent.change(screen.getByLabelText('New name'), {@@ -1662,7 +1661,7 @@ describe('FilesPage', () => {expect(pushToast).toHaveBeenCalledWith('Access granted to 1 subject', 'success')})- it('does not offer Create share from the manage dialog resource menu', async () => {+ it('does not render resource options inside the share dialog', async () => {Object.defineProperty(window, 'clerum', {configurable: true,value: {@@ -1711,11 +1710,8 @@ describe('FilesPage', () => {await openManageDialog('Team folder')const dialog = screen.getByRole('dialog', { name: 'Share folder Team folder' })- const menuTrigger = within(dialog).getByRole('button', { name: 'Options for Team folder' })- await act(async () => {- fireEvent.click(menuTrigger)- })- expect(within(dialog).queryByRole('menuitem', { name: 'Create share' })).toBeNull()+ expect(within(dialog).queryByRole('button', { name: 'Options for Team folder' })).toBeNull()+ expect(within(dialog).queryByRole('menu')).toBeNull()})it('issues ONE atomic bulk grant and does not refetch or toast when it is rejected', async () => {@@ -2039,7 +2035,7 @@ describe('FilesPage', () => {expect(await screen.findByText('File access is not authorized')).toBeTruthy()})- it('closes the move dialog and manage dialog when authority is revoked mid-session', async () => {+ it('closes the move dialog when authority is revoked mid-session', async () => {const moveResource = vi.fn(async () => ({}))const controllerState = {...baseController(),@@ -2080,18 +2076,7 @@ describe('FilesPage', () => {)const { rerender } = render(makeElement())- // Open the manage dialog, then the move dialog from its menu.- await openManageDialog('Product')- await act(async () => {- fireEvent.click(- within(screen.getByRole('dialog', { name: 'Share folder Product' })).getByRole('button', {- name: 'Options for Product',- })- )- })- await act(async () => {- fireEvent.click(screen.getByRole('menuitem', { name: 'Move to…' }))- })+ await chooseResourceAction('Product', 'Move to…')expect(await screen.findByRole('dialog', { name: 'Move folder Product' })).toBeTruthy()controllerState.accessState = 'revoked'@@ -2100,9 +2085,6 @@ describe('FilesPage', () => {await waitFor(() =>expect(screen.queryByRole('dialog', { name: 'Move folder Product' })).toBeNull())- await waitFor(() =>- expect(screen.queryByRole('dialog', { name: 'Share folder Product' })).toBeNull()- )expect(await screen.findByText('File access is not authorized')).toBeTruthy()expect(moveResource).not.toHaveBeenCalled()})@@ -3260,8 +3242,7 @@ describe('FilesPage', () => {})renderFilesPage()- await openManageDialog('Product')- await chooseManageAction('Product', 'New folder')+ fireEvent.click(screen.getByRole('button', { name: 'New folder' }))fireEvent.change(screen.getByLabelText('Folder name'), { target: { value: 'unfinished' } })fireEvent.click(within(screen.getByRole('form', { name: 'Create folder' })).getByRole('button', {diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.cssindex 05acfb1fc..0e4f44cd2 100644--- a/desktop-app/ui/src/styles.css+++ b/desktop-app/ui/src/styles.css@@ -15228,23 +15228,12 @@ pre {.da-gfs-manage-dialog__heading h3 {margin: 0;overflow: hidden;+ overflow-wrap: anywhere;color: var(--text);font-size: var(--font-size-2xl);font-weight: var(--font-weight-semibold);line-height: var(--line-height-tight);text-overflow: ellipsis;- white-space: nowrap;-}--.da-gfs-manage-dialog__title-row {- min-width: 0;- display: flex;- align-items: center;- gap: var(--space-1);-}--.da-gfs-manage-dialog__title-row h3 {- min-width: 0;white-space: normal;}@@ -15446,48 +15435,57 @@ pre {background: var(--surface-soft);}-.da-gfs-manage-dialog__body > .da-gfs-inline-form.da-gfs-create-folder-form {- display: grid;- grid-template-columns: minmax(0, 1fr);- align-items: stretch;- gap: var(--space-3);- border: 1px solid rgba(var(--accent-rgb), 0.24);- border-radius: var(--radius-md);- background: rgba(var(--accent-rgb), 0.06);+.da-gfs-new-folder-modal {+ z-index: calc(var(--layer-chat-overlay) + 3);}-.da-gfs-create-folder-form__heading {+.da-gfs-new-folder-dialog {+ width: min(420px, 94vw);display: grid;- gap: var(--space-0-5);+ gap: var(--space-4);+ padding: var(--space-5);+ border: 1px solid rgba(var(--edge-rgb), 0.42);+ border-radius: var(--radius-xl);+ background: var(--bg-elev);+ box-shadow: var(--shadow-hard);}-.da-gfs-create-folder-form__heading h4,-.da-gfs-create-folder-form__heading p {+.da-gfs-new-folder-dialog__header h3,+.da-gfs-new-folder-dialog__copy {margin: 0;}-.da-gfs-create-folder-form__heading h4 {+.da-gfs-new-folder-dialog__header h3 {color: var(--text);- font-size: var(--font-size-lg);+ font-size: var(--font-size-xl);font-weight: var(--font-weight-semibold);line-height: var(--line-height-tight);}-.da-gfs-create-folder-form__heading p {+.da-gfs-new-folder-dialog__copy {+ color: var(--text-muted);font-size: var(--font-size-sm);}-.da-gfs-create-folder-form__field {+.da-gfs-new-folder-dialog__form,+.da-gfs-new-folder-dialog__field {min-width: 0;+ display: grid;+ gap: var(--space-2);+}++.da-gfs-new-folder-dialog__field > span {+ color: var(--text);+ font-size: var(--font-size-sm);+ font-weight: var(--font-weight-medium);}-.da-gfs-create-folder-form__actions {+.da-gfs-new-folder-dialog__actions {display: flex;align-items: center;justify-content: flex-end;gap: var(--space-2);- padding-top: var(--space-3);- border-top: 1px solid rgba(var(--edge-rgb), 0.2);+ margin-top: var(--space-2);}/* Compact Drive-style move picker. The hierarchy stays inline, but rows read