Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(desktop): files page and appheader improvements in progress
Miguelon Peluchondf3e2421b853
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.cssindex d72d00381..560588754 100644--- a/control-ui/app/globals.css+++ b/control-ui/app/globals.css@@ -11137,6 +11137,15 @@ button.cu-gfs-tree__button:focus-visible,background: var(--cu-surface-hover);}+.cu-gfs-list__row--clickable {+ cursor: pointer;+}++.cu-gfs-list__row--clickable:focus-visible {+ outline: 2px solid rgba(var(--cu-focus-rgb), 0.8);+ outline-offset: -2px;+}+.cu-gfs-list__icon {width: 2.25rem;height: 2.25rem;diff --git a/control-ui/components/GfsBrowser.tsx b/control-ui/components/GfsBrowser.tsxindex 93cd82abf..379e02f99 100644--- a/control-ui/components/GfsBrowser.tsx+++ b/control-ui/components/GfsBrowser.tsx@@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'import { FileUploadModal } from '@components/FileUploadModal'import { GfsImagePreview } from '@components/GfsImagePreview'import { GfsMarkdownPreview } from '@components/GfsMarkdownPreview'-import { IconFolder, IconServer } from '@components/Sidebar/icons'+import { IconFolder, IconImage, IconServer } from '@components/Sidebar/icons'import { useToast } from '@components/Toast'import { IconChevronRight, IconDownload, IconPaperclip, IconUpload, IconX } from '@components/icons'import { Button, TextInput } from '@components/ui'@@ -89,6 +89,17 @@ function isGfsPreviewFile(fileName: string): boolean {return gfsImagePreviewMimeType(fileName) !== null || isGfsMarkdownPreviewFile(fileName)}+function isEventFromNestedInteractive(+ event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>+): boolean {+ const target = event.target+ if (!(target instanceof Element)) return false+ return (+ target.closest('button, a, input, select, textarea, [role="button"], [role="menuitem"]') !==+ null+ )+}+export function GfsBrowser(): React.JSX.Element {const { showToast } = useToast()const [crumbs, setCrumbs] = useState<Crumb[]>([{ id: null, rid: null, name: '/' }])@@ -559,82 +570,119 @@ export function GfsBrowser(): React.JSX.Element {<span className="cu-gfs-list__head-actions">Actions</span></div><ul className="cu-gfs-list" aria-label="Current folder resources">- {items.map(child => (- <li className="cu-gfs-list__row" key={child.resourceId}>- <span className="cu-gfs-list__icon" aria-hidden="true">- {child.kind === 'directory' ? <IconFolder /> : <IconServer />}- </span>- <span className="cu-gfs-list__identity">- <span className="cu-gfs-list__name">+ {items.map(child => {+ const rowOpenable = child.kind === 'directory' || isGfsPreviewFile(child.name)+ const openRow = () => {+ if (child.kind === 'directory') openDirectory(child)+ else openFilePreview(child)+ }+ return (+ <li+ className={`cu-gfs-list__row${rowOpenable ? ' cu-gfs-list__row--clickable' : ''}`}+ key={child.resourceId}+ role={rowOpenable ? 'button' : undefined}+ tabIndex={rowOpenable ? 0 : undefined}+ aria-label={rowOpenable ? `Open ${child.name}` : undefined}+ onClick={+ rowOpenable+ ? event => {+ if (isEventFromNestedInteractive(event)) return+ openRow()+ }+ : undefined+ }+ onKeyDown={+ rowOpenable+ ? event => {+ if (event.key !== 'Enter' && event.key !== ' ') return+ if (isEventFromNestedInteractive(event)) return+ event.preventDefault()+ openRow()+ }+ : undefined+ }+ >+ <span className="cu-gfs-list__icon" aria-hidden="true">{child.kind === 'directory' ? (- <button- className="cu-gfs-list__name-button"- type="button"- onClick={() => openDirectory(child)}- >- {child.name}- </button>+ <IconFolder />+ ) : gfsImagePreviewMimeType(child.name) ? (+ <IconImage />) : (- <>- {isGfsPreviewFile(child.name) ? (- <button- className="cu-gfs-list__name-button"- type="button"- onClick={() => openFilePreview(child)}- >- {child.name}- </button>- ) : (- <span>{child.name}</span>- )}- </>+ <IconServer />)}</span>- <span className="cu-gfs-list__meta">Version {child.version}</span>- </span>- <span className="cu-gfs-list__value">- {child.kind === 'directory' ? 'Folder' : 'File'}- </span>- <span className="cu-gfs-list__value">- {child.kind === 'directory' ? '—' : formatBytes(child.bytes)}- </span>- <span className="cu-gfs-list__actions">- {child.kind !== 'directory' ? (- <Button- className="cu-gfs-list__download"- size="sm"- variant="ghost"- title={`Download ${child.name}`}- aria-label={`Download ${child.name}`}- disabled={downloadingIds.has(child.resourceId)}- onClick={() => void downloadFile(child)}- >- <IconDownload width={18} height={18} />- </Button>- ) : null}- <GfsResourceMenu- resourceName={child.name}- resourceUri={child.gfsUri}- downloading={downloadingIds.has(child.resourceId)}- onManage={() => openManage(child)}- onPreview={- isGfsPreviewFile(child.name) ? () => openFilePreview(child) : undefined- }- onDownload={- child.kind !== 'directory' ? () => void downloadFile(child) : undefined- }- onReplace={- child.kind !== 'directory'- ? file => void replaceFile(child, file)- : undefined- }- onCopyLink={() => void copyGfsUri(child.gfsUri)}- onRename={() => openManage(child, 'rename')}- onDelete={() => openManage(child, 'delete')}- />- </span>- </li>- ))}+ <span className="cu-gfs-list__identity">+ <span className="cu-gfs-list__name">+ {child.kind === 'directory' ? (+ <button+ className="cu-gfs-list__name-button"+ type="button"+ onClick={() => openDirectory(child)}+ >+ {child.name}+ </button>+ ) : (+ <>+ {isGfsPreviewFile(child.name) ? (+ <button+ className="cu-gfs-list__name-button"+ type="button"+ onClick={() => openFilePreview(child)}+ >+ {child.name}+ </button>+ ) : (+ <span>{child.name}</span>+ )}+ </>+ )}+ </span>+ <span className="cu-gfs-list__meta">Version {child.version}</span>+ </span>+ <span className="cu-gfs-list__value">+ {child.kind === 'directory' ? 'Folder' : 'File'}+ </span>+ <span className="cu-gfs-list__value">+ {child.kind === 'directory' ? '—' : formatBytes(child.bytes)}+ </span>+ <span className="cu-gfs-list__actions">+ {child.kind !== 'directory' ? (+ <Button+ className="cu-gfs-list__download"+ size="sm"+ variant="ghost"+ title={`Download ${child.name}`}+ aria-label={`Download ${child.name}`}+ disabled={downloadingIds.has(child.resourceId)}+ onClick={() => void downloadFile(child)}+ >+ <IconDownload width={18} height={18} />+ </Button>+ ) : null}+ <GfsResourceMenu+ resourceName={child.name}+ resourceUri={child.gfsUri}+ downloading={downloadingIds.has(child.resourceId)}+ onManage={() => openManage(child)}+ onPreview={+ isGfsPreviewFile(child.name) ? () => openFilePreview(child) : undefined+ }+ onDownload={+ child.kind !== 'directory' ? () => void downloadFile(child) : undefined+ }+ onReplace={+ child.kind !== 'directory'+ ? file => void replaceFile(child, file)+ : undefined+ }+ onCopyLink={() => void copyGfsUri(child.gfsUri)}+ onRename={() => openManage(child, 'rename')}+ onDelete={() => openManage(child, 'delete')}+ />+ </span>+ </li>+ )+ })}{items.length === 0 && !loading ? (<li className="cu-gfs-list__empty">No resources are visible in this folder.</li>) : null}@@ -677,7 +725,13 @@ export function GfsBrowser(): React.JSX.Element {}`}aria-hidden="true">- {selected.kind === 'directory' ? <IconFolder /> : <IconPaperclip />}+ {selected.kind === 'directory' ? (+ <IconFolder />+ ) : gfsImagePreviewMimeType(selected.name) ? (+ <IconImage />+ ) : (+ <IconPaperclip />+ )}</span><span className="cu-gfs-manage-dialog__heading">{renameOpen ? (diff --git a/control-ui/components/Sidebar/icons.tsx b/control-ui/components/Sidebar/icons.tsxindex f758a6510..3c3287bf7 100644--- a/control-ui/components/Sidebar/icons.tsx+++ b/control-ui/components/Sidebar/icons.tsx@@ -330,6 +330,25 @@ export function IconServer() {)}+export function IconImage() {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="18"+ height="18"+ viewBox="0 0 24 24"+ fill="currentColor"+ stroke="currentColor"+ strokeWidth="0"+ >+ <g>+ <path d="M18.435,3.06H5.565a2.5,2.5,0,0,0-2.5,2.5V18.44a2.507,2.507,0,0,0,2.5,2.5h12.87a2.507,2.507,0,0,0,2.5-2.5V5.56A2.5,2.5,0,0,0,18.435,3.06ZM4.065,5.56a1.5,1.5,0,0,1,1.5-1.5h12.87a1.5,1.5,0,0,1,1.5,1.5v8.66l-3.88-3.88a1.509,1.509,0,0,0-2.12,0l-4.56,4.57a.513.513,0,0,1-.71,0l-.56-.56a1.522,1.522,0,0,0-2.12,0l-1.92,1.92Zm15.87,12.88a1.5,1.5,0,0,1-1.5,1.5H5.565a1.5,1.5,0,0,1-1.5-1.5v-.75L6.7,15.06a.5.5,0,0,1,.35-.14.524.524,0,0,1,.36.14l.55.56a1.509,1.509,0,0,0,2.12,0l4.57-4.57a.5.5,0,0,1,.71,0l4.58,4.58Z" />+ <path d="M8.062,10.565a2.5,2.5,0,1,1,2.5-2.5A2.5,2.5,0,0,1,8.062,10.565Zm0-4a1.5,1.5,0,1,0,1.5,1.5A1.5,1.5,0,0,0,8.062,6.565Z" />+ </g>+ </svg>+ )+}+export function IconBroadcast() {return (<svgdiff --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 568daba9b..003f1ba51 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.404",+ "version": "0.1.405","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.404",+ "version": "0.1.405","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 16a2a9d7d..796d59291 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.404",+ "version": "0.1.405","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/desktop-app/package-lock.json b/desktop-app/package-lock.jsonindex c0bba8f23..449e47891 100644--- a/desktop-app/package-lock.json+++ b/desktop-app/package-lock.json@@ -50,7 +50,10 @@},"../packages/desktop-app-links": {"name": "@clerum/desktop-app-links",- "version": "0.1.1"+ "version": "0.1.1",+ "devDependencies": {+ "fast-check": "^4.9.0"+ }},"node_modules/@adobe/css-tools": {"version": "4.4.4",diff --git a/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx b/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsxindex fa1d9c2a4..05b863a66 100644--- a/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx+++ b/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx@@ -26,6 +26,16 @@ vi.mock('@hooks/domain/useMcpServersDataController', () => ({useMcpServersDataController: () => ({ globalMcpServers: [], mcpServersByAgent: {} }),}))+vi.mock('@hooks/domain/useSearchPluginsAppsController', () => ({+ useSearchPluginsAppsController: () => ({+ plugins: [],+ apps: [],+ loading: false,+ error: null,+ ensureLoaded: vi.fn(async () => undefined),+ }),+}))+vi.mock('@hooks/domain/useTeamsDataController', () => ({useTeamsDataController: () => ({teams: [],diff --git a/desktop-app/ui/src/components/AppHeader/index.tsx b/desktop-app/ui/src/components/AppHeader/index.tsxindex 856379a01..384de247b 100644--- a/desktop-app/ui/src/components/AppHeader/index.tsx+++ b/desktop-app/ui/src/components/AppHeader/index.tsx@@ -8,14 +8,17 @@ import { DESKTOP_ROUTES } from '@constants/navigation'import { useAgentsDataController } from '@hooks/domain/useAgentsDataController'import { useContextsDataController } from '@hooks/domain/useContextsDataController'import { useMcpServersDataController } from '@hooks/domain/useMcpServersDataController'+import { useSearchPluginsAppsController } from '@hooks/domain/useSearchPluginsAppsController'import { useTeamsDataController } from '@hooks/domain/useTeamsDataController'import { useClickOutside } from '@hooks/useClickOutside'import { notificationKindLabel, notificationPreviewText } from '@/lib/notifications'import type { AppNotificationKind } from '@/uiTypes'import type {AppHeaderProps,+ SearchAppResult,SearchEntityResult,SearchMemberResult,+ SearchPluginResult,SearchTeamResult,} from './types'@@ -96,6 +99,12 @@ export const AppHeader = React.memo(function AppHeader({currentTeamId,ensureHydrated: onEnsureTeamDirectory,} = useTeamsDataController()+ const {+ plugins: searchPlugins,+ apps: searchApps,+ loading: pluginsAppsLoading,+ ensureLoaded: ensurePluginsAppsLoaded,+ } = useSearchPluginsAppsController()const { navItem, handleNavSelect, handleOpenContextDetails, handleOpenTeamDetails } =useNavigationContext()const {@@ -468,13 +477,52 @@ export const AppHeader = React.memo(function AppHeader({: [],[currentTeamId, hasSearch, normalizedSearch, teamDirectory, teamMembers.length, teams])+ const filteredPlugins = useMemo<SearchPluginResult[]>(+ () =>+ hasSearch+ ? searchPlugins+ .filter(+ plugin =>+ plugin.name.toLowerCase().includes(normalizedSearch) ||+ plugin.namespace.toLowerCase().includes(normalizedSearch)+ )+ .sort((left, right) => left.name.localeCompare(right.name))+ .map(plugin => ({+ key: `${plugin.namespace}/${plugin.name}`,+ name: plugin.name,+ namespace: plugin.namespace,+ status: plugin.status ?? null,+ }))+ : [],+ [hasSearch, normalizedSearch, searchPlugins]+ )+ const filteredApps = useMemo<SearchAppResult[]>(() => {+ if (!hasSearch) return []+ return searchApps+ .map(app => ({+ key: app.appRef,+ appRef: app.appRef,+ label: (app.title ?? '').trim() || app.appRef,+ description: (app.description ?? '').trim() || null,+ ready: app.ready,+ }))+ .filter(+ app =>+ app.label.toLowerCase().includes(normalizedSearch) ||+ app.appRef.toLowerCase().includes(normalizedSearch) ||+ (app.description?.toLowerCase().includes(normalizedSearch) ?? false)+ )+ .sort((left, right) => left.label.localeCompare(right.label))+ }, [hasSearch, normalizedSearch, searchApps])const totalMatches =filteredTeams.length +filteredMembers.length +filteredAgents.length +filteredContexts.length +- filteredConnectors.length+ filteredConnectors.length ++ filteredPlugins.length ++ filteredApps.lengthconst pendingApprovalsCount = pendingApprovals.lengthconst inboxNotificationCount = notifications.lengthconst totalAttentionCount = pendingApprovalsCount + unreadNotificationCount@@ -483,13 +531,17 @@ export const AppHeader = React.memo(function AppHeader({? 'Inbox': `${totalAttentionCount} item${totalAttentionCount === 1 ? '' : 's'} in inbox`- const navigateToSection = (target: 'agents' | 'connectors') => {+ const navigateToSection = (target: 'agents' | 'connectors' | 'plugins' | 'apps') => {setSearchOpen(false)if (target === 'agents') {onOpenAgents()return}- onOpenConnectors()+ if (target === 'connectors') {+ onOpenConnectors()+ return+ }+ handleNavSelect(target === 'plugins' ? DESKTOP_ROUTES.plugins : DESKTOP_ROUTES.apps)}const navigateToTeam = (teamId: string) => {@@ -519,13 +571,18 @@ export const AppHeader = React.memo(function AppHeader({})}, [hasSearch, normalizedSearch, onEnsureTeamDirectory, searchOpen, teamDirectoryLoading])+ useEffect(() => {+ if (!searchOpen || !hasSearch) return+ void ensurePluginsAppsLoaded()+ }, [ensurePluginsAppsLoaded, hasSearch, searchOpen])+return (<header className="top-bar"><div className="header-left"><div className="global-search" ref={searchRef}><TextInputtype="text"- placeholder="Search teams, contexts, members, agents or connectors..."+ placeholder="Search teams, contexts, members, agents, connectors, plugins or apps..."className="search-input"aria-label="Search"value={searchQuery}@@ -556,6 +613,10 @@ export const AppHeader = React.memo(function AppHeader({</p>)}+ {pluginsAppsLoading && !searchPlugins.length && !searchApps.length && (+ <p className="search-results-loading">Loading plugins and apps...</p>+ )}+{Boolean(filteredTeams.length) && (<section className="search-results-group"><header className="search-results-group-title">Teams</header>@@ -690,10 +751,59 @@ export const AppHeader = React.memo(function AppHeader({</section>)}- {!totalMatches && !teamDirectoryLoading && (+ {Boolean(filteredPlugins.length) && (+ <section className="search-results-group">+ <header className="search-results-group-title">Plugins</header>+ <div className="search-results-list">+ {filteredPlugins.map(plugin => (+ <SelectableOption+ key={plugin.key}+ className="search-result-item search-result-item-button"+ onClick={() => navigateToSection('plugins')}+ size="sm"+ >+ <div className="search-result-main">+ <strong>{plugin.name}</strong>+ <span className="search-result-subline">+ {plugin.namespace} · {plugin.status ?? 'Status unknown'}+ </span>+ </div>+ <span className="search-result-tag">Plugin</span>+ </SelectableOption>+ ))}+ </div>+ </section>+ )}++ {Boolean(filteredApps.length) && (+ <section className="search-results-group">+ <header className="search-results-group-title">Apps</header>+ <div className="search-results-list">+ {filteredApps.map(app => (+ <SelectableOption+ key={app.key}+ className="search-result-item search-result-item-button"+ onClick={() => navigateToSection('apps')}+ size="sm"+ >+ <div className="search-result-main">+ <strong>{app.label}</strong>+ <span className="search-result-subline">+ {app.description ? `${app.description} · ` : ''}+ {app.ready ? 'Ready' : 'Starting up'}+ </span>+ </div>+ <span className="search-result-tag">App</span>+ </SelectableOption>+ ))}+ </div>+ </section>+ )}++ {!totalMatches && !teamDirectoryLoading && !pluginsAppsLoading && (<p className="search-results-empty">No matches for "{searchQuery.trim()}". Try a member email, team name, context,- agent, or connector.+ agent, connector, plugin, or app.</p>)}</div>diff --git a/desktop-app/ui/src/components/AppHeader/types.ts b/desktop-app/ui/src/components/AppHeader/types.tsindex fc7fcb49b..c7e460168 100644--- a/desktop-app/ui/src/components/AppHeader/types.ts+++ b/desktop-app/ui/src/components/AppHeader/types.ts@@ -28,3 +28,18 @@ export type SearchTeamResult = {name: stringmemberCount: number}++export type SearchPluginResult = {+ key: string+ name: string+ namespace: string+ status: string | null+}++export type SearchAppResult = {+ key: string+ appRef: string+ label: string+ description: string | null+ ready: boolean+}diff --git a/desktop-app/ui/src/components/SidebarNav/icons.tsx b/desktop-app/ui/src/components/SidebarNav/icons.tsxindex af43f69d8..a363ae66c 100644--- a/desktop-app/ui/src/components/SidebarNav/icons.tsx+++ b/desktop-app/ui/src/components/SidebarNav/icons.tsx@@ -328,3 +328,21 @@ export function IconEye(props: IconProps) {</svg>)}++export function IconImage(props: IconProps) {+ return (+ <svg+ viewBox="0 0 24 24"+ aria-hidden="true"+ fill="currentColor"+ stroke="currentColor"+ strokeWidth="0"+ {...props}+ >+ <g>+ <path d="M18.435,3.06H5.565a2.5,2.5,0,0,0-2.5,2.5V18.44a2.507,2.507,0,0,0,2.5,2.5h12.87a2.507,2.507,0,0,0,2.5-2.5V5.56A2.5,2.5,0,0,0,18.435,3.06ZM4.065,5.56a1.5,1.5,0,0,1,1.5-1.5h12.87a1.5,1.5,0,0,1,1.5,1.5v8.66l-3.88-3.88a1.509,1.509,0,0,0-2.12,0l-4.56,4.57a.513.513,0,0,1-.71,0l-.56-.56a1.522,1.522,0,0,0-2.12,0l-1.92,1.92Zm15.87,12.88a1.5,1.5,0,0,1-1.5,1.5H5.565a1.5,1.5,0,0,1-1.5-1.5v-.75L6.7,15.06a.5.5,0,0,1,.35-.14.524.524,0,0,1,.36.14l.55.56a1.509,1.509,0,0,0,2.12,0l4.57-4.57a.5.5,0,0,1,.71,0l4.58,4.58Z" />+ <path d="M8.062,10.565a2.5,2.5,0,1,1,2.5-2.5A2.5,2.5,0,0,1,8.062,10.565Zm0-4a1.5,1.5,0,1,0,1.5,1.5A1.5,1.5,0,0,0,8.062,6.565Z" />+ </g>+ </svg>+ )+}diff --git a/desktop-app/ui/src/hooks/domain/__tests__/useSearchPluginsAppsController.test.tsx b/desktop-app/ui/src/hooks/domain/__tests__/useSearchPluginsAppsController.test.tsxnew file mode 100644index 000000000..6f3d9cd3b--- /dev/null+++ b/desktop-app/ui/src/hooks/domain/__tests__/useSearchPluginsAppsController.test.tsx@@ -0,0 +1,102 @@+// @vitest-environment jsdom+import type { ReactNode } from 'react'+import { afterEach, describe, expect, it, vi } from 'vitest'+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'+import { act, renderHook, waitFor } from '@testing-library/react'+import type { SandboxUiApp, WorkflowRecipeResource } from '../../../../../src/types'+import { useSearchPluginsAppsController } from '../useSearchPluginsAppsController'++const WORKFLOW_RESOURCE: WorkflowRecipeResource = {+ metadata: {+ namespace: 'sandbox-recipes',+ name: 'inbox-triage',+ creationTimestamp: '2026-08-01T00:00:00Z',+ },+ spec: { triggers: { onDemand: { allowedActors: ['user'] } } },+ status: { phase: 'Active' },+}++const APP: SandboxUiApp = {+ appRef: 'sandbox-recipes/review-board',+ title: 'Review Board',+ description: 'Approve requests fast',+ defaultPath: '/',+ ready: true,+ phase: 'active',+ updatedAt: '2026-08-01T00:00:00Z',+}++function installClerumHarness(+ options: { workflows?: Promise<unknown>; apps?: Promise<unknown> } = {}+) {+ Object.defineProperty(window, 'clerum', {+ configurable: true,+ writable: true,+ value: {+ workflows: {+ list: vi.fn(+ () => options.workflows ?? Promise.resolve({ items: [WORKFLOW_RESOURCE], count: 1 })+ ),+ },+ sandboxUi: {+ listApps: vi.fn(() => options.apps ?? Promise.resolve({ apps: [APP] })),+ },+ },+ })+}++function createWrapper(queryClient: QueryClient) {+ return function Wrapper({ children }: { children: ReactNode }) {+ return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>+ }+}++describe('useSearchPluginsAppsController', () => {+ afterEach(() => {+ delete (window as { clerum?: unknown }).clerum+ })++ it('loads summarized plugins and raw apps through ensureLoaded', async () => {+ installClerumHarness()+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } })+ const { result } = renderHook(() => useSearchPluginsAppsController(), {+ wrapper: createWrapper(queryClient),+ })++ await act(async () => {+ await result.current.ensureLoaded()+ })++ await waitFor(() => expect(result.current.plugins).toHaveLength(1))+ expect(result.current.plugins).toEqual([+ {+ namespace: 'sandbox-recipes',+ name: 'inbox-triage',+ status: 'Active',+ createdAt: '2026-08-01T00:00:00Z',+ triggerableByUser: true,+ },+ ])+ expect(result.current.apps).toEqual([APP])+ expect(result.current.error).toBeNull()+ expect(result.current.loading).toBe(false)+ })++ it('keeps apps available when the workflow list fails and surfaces the error', async () => {+ installClerumHarness({+ workflows: Promise.reject(new Error('workflows unavailable')),+ })+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } })+ const { result } = renderHook(() => useSearchPluginsAppsController(), {+ wrapper: createWrapper(queryClient),+ })++ await act(async () => {+ await result.current.ensureLoaded()+ })++ await waitFor(() => expect(result.current.error).toBe('workflows unavailable'))+ expect(result.current.plugins).toEqual([])+ expect(result.current.apps).toEqual([APP])+ })+})diff --git a/desktop-app/ui/src/hooks/domain/queryKeys.ts b/desktop-app/ui/src/hooks/domain/queryKeys.tsindex 88da02d27..1e3451ed3 100644--- a/desktop-app/ui/src/hooks/domain/queryKeys.ts+++ b/desktop-app/ui/src/hooks/domain/queryKeys.ts@@ -5,6 +5,7 @@ export const desktopQueryKeys = {['desktop-app', 'mcp-servers-preview', ...hostRefs] as const,teamsDirectory: ['desktop-app', 'teams-directory'] as const,myAgents: ['desktop-app', 'my-agents'] as const,+ sandboxApps: ['desktop-app', 'sandbox-apps'] as const,workflows: ['desktop-app', 'workflows'] as const,workflowSelection: ['desktop-app', 'workflow-selection'] as const,workflowDetail: (namespace: string, name: string) =>diff --git a/desktop-app/ui/src/hooks/domain/useSearchPluginsAppsController.ts b/desktop-app/ui/src/hooks/domain/useSearchPluginsAppsController.tsnew file mode 100644index 000000000..62d91c659--- /dev/null+++ b/desktop-app/ui/src/hooks/domain/useSearchPluginsAppsController.ts@@ -0,0 +1,84 @@+import { useCallback, useMemo } from 'react'+import { useQuery, useQueryClient } from '@tanstack/react-query'+import type { SandboxUiApp, WorkflowRecipeListResult } from '../../../../src/types'+import { summarizeWorkflowResource } from '../../lib/workflows'+import type { WorkflowSummary } from '../../workflows.types'+import { desktopQueryKeys } from './queryKeys'++const EMPTY_PLUGINS: WorkflowSummary[] = []+const EMPTY_APPS: SandboxUiApp[] = []++function toErrorMessage(error: unknown): string {+ return error instanceof Error ? error.message : String(error)+}++export function useSearchPluginsAppsController() {+ const queryClient = useQueryClient()++ const workflowsQuery = useQuery({+ queryKey: desktopQueryKeys.workflows,+ queryFn: () => window.clerum.workflows.list() as Promise<WorkflowRecipeListResult>,+ enabled: false,+ })++ const appsQuery = useQuery({+ queryKey: desktopQueryKeys.sandboxApps,+ queryFn: () => window.clerum.sandboxUi.listApps(),+ enabled: false,+ })++ const ensureLoaded = useCallback(async () => {+ await Promise.all([+ queryClient+ .fetchQuery({+ queryKey: desktopQueryKeys.workflows,+ queryFn: () => window.clerum.workflows.list() as Promise<WorkflowRecipeListResult>,+ staleTime: 0,+ })+ .catch(() => undefined),+ queryClient+ .fetchQuery({+ queryKey: desktopQueryKeys.sandboxApps,+ queryFn: () => window.clerum.sandboxUi.listApps(),+ staleTime: 0,+ })+ .catch(() => undefined),+ ])+ }, [queryClient])++ const plugins = useMemo(() => {+ const items = Array.isArray(workflowsQuery.data?.items) ? workflowsQuery.data.items : []+ if (!items.length) return EMPTY_PLUGINS+ return items.map(item => summarizeWorkflowResource(item))+ }, [workflowsQuery.data])++ const apps = useMemo(() => appsQuery.data?.apps ?? EMPTY_APPS, [appsQuery.data])++ return useMemo(+ () => ({+ loading:+ workflowsQuery.fetchStatus === 'fetching' ||+ workflowsQuery.status === 'pending' ||+ appsQuery.fetchStatus === 'fetching' ||+ appsQuery.status === 'pending',+ error:+ workflowsQuery.error || appsQuery.error+ ? toErrorMessage(workflowsQuery.error ?? appsQuery.error)+ : null,+ plugins,+ apps,+ ensureLoaded,+ }),+ [+ apps,+ appsQuery.error,+ appsQuery.fetchStatus,+ appsQuery.status,+ ensureLoaded,+ plugins,+ workflowsQuery.error,+ workflowsQuery.fetchStatus,+ workflowsQuery.status,+ ]+ )+}diff --git a/desktop-app/ui/src/lib/clickableRowProps.ts b/desktop-app/ui/src/lib/clickableRowProps.tsindex dec839275..83d8ad000 100644--- a/desktop-app/ui/src/lib/clickableRowProps.ts+++ b/desktop-app/ui/src/lib/clickableRowProps.ts@@ -1,4 +1,4 @@-import type { KeyboardEvent } from 'react'+import type { KeyboardEvent, MouseEvent as ReactMouseEvent } from 'react'export type ClickableRowProps = {role: 'button'@@ -52,3 +52,20 @@ export function clickableRowProps(...(selected ? { 'aria-pressed': true as const } : {}),}}++/**+ * True when a click/keydown inside a clickable row originated from a nested+ * interactive element (button, link, menu item…). Rows that contain their own+ * controls use this to activate only on clicks in the row surface itself, so a+ * nested control never triggers the row action as well.+ */+export function isEventFromNestedInteractive(+ event: KeyboardEvent<HTMLElement> | ReactMouseEvent<HTMLElement>+): boolean {+ const target = event.target+ if (!(target instanceof Element)) return false+ return (+ target.closest('button, a, input, select, textarea, [role="button"], [role="menuitem"]') !==+ null+ )+}diff --git a/desktop-app/ui/src/pages/FilesPage.tsx b/desktop-app/ui/src/pages/FilesPage.tsxindex ad2075de2..3842f3176 100644--- a/desktop-app/ui/src/pages/FilesPage.tsx+++ b/desktop-app/ui/src/pages/FilesPage.tsx@@ -12,9 +12,11 @@ import {IconContexts,IconDownload,IconEye,+ IconImage,} from '@components/SidebarNav/icons'import { desktopQueryKeys } from '@hooks/domain/queryKeys'import { useGfsBrowserController } from '@hooks/domain/useGfsBrowserController'+import { isEventFromNestedInteractive } from '@lib/clickableRowProps'import { assertGfsFileUploadSize } from '@lib/gfsFileUpload'import { describeGfsGrantError } from '@lib/gfsGrantErrors'import { gfsImagePreviewMimeType } from '@lib/gfsImagePreview'@@ -501,44 +503,35 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:onDrop={event => void handleGfsDrop(event)}><div className="page-card__header da-gfs-drive__header">- <nav className="da-gfs-drive__breadcrumbs" aria-label="File location">- <Button- className="da-gfs-drive__breadcrumb"- color="neutral"- disabled={!current}- onClick={() => {- setManageOpen(false)- ctrl.reset()- }}- variant="text"- >- Shared with me- </Button>- {crumbs.map((crumb, index) => (- <span className="da-gfs-drive__crumb-group" key={crumb.resourceId}>- <IconChevronRight aria-hidden="true" />- <Button- className="da-gfs-drive__breadcrumb"- color="neutral"- disabled={index === crumbs.length - 1}- onClick={() => ctrl.goToCrumb(index)}- variant="text"- >- {crumb.name}- </Button>- </span>- ))}- </nav>- <div className="da-gfs-drive__header-actions">- <Button- color="neutral"- onClick={() => setOpenLinkOpen(true)}- size="sm"- variant="outline"- >- <IconEye width={16} height={16} />- Open GFS link- </Button>+ <div className="da-gfs-drive__title-row">+ <nav className="da-gfs-drive__breadcrumbs" aria-label="File location">+ <Button+ className="da-gfs-drive__breadcrumb"+ color="neutral"+ disabled={!current}+ onClick={() => {+ setManageOpen(false)+ ctrl.reset()+ }}+ variant="text"+ >+ Shared with me+ </Button>+ {crumbs.map((crumb, index) => (+ <span className="da-gfs-drive__crumb-group" key={crumb.resourceId}>+ <IconChevronRight aria-hidden="true" />+ <Button+ className="da-gfs-drive__breadcrumb"+ color="neutral"+ disabled={index === crumbs.length - 1}+ onClick={() => ctrl.goToCrumb(index)}+ variant="text"+ >+ {crumb.name}+ </Button>+ </span>+ ))}+ </nav>{current && !currentIsFile ? (<GfsResourceMenuresourceName={current.name}@@ -549,14 +542,20 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:setManageOpen(true)}}onCopyLink={() => void handleCopyLink(current.gfsUri)}- onDownload={- currentIsFile- ? () => void handleDownload(current.gfsUri, current.name)- : undefined- }/>) : null}</div>+ <div className="da-gfs-drive__header-actions">+ <Button+ color="neutral"+ onClick={() => setOpenLinkOpen(true)}+ size="sm"+ variant="outline"+ >+ <IconEye width={16} height={16} />+ Open GFS link+ </Button>+ </div></div>{dragActive || droppedUploadCount > 0 ? (@@ -588,7 +587,11 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:) : currentIsFile ? (<div className="da-gfs-current-file"><span className="da-gfs-current-file__icon" aria-hidden="true">- <IconAttachFile />+ {currentIsFile && gfsImagePreviewMimeType(current.name) ? (+ <IconImage />+ ) : (+ <IconAttachFile />+ )}</span><div className="da-gfs-current-file__copy"><div className="da-gfs-current-file__title-row">@@ -640,9 +643,31 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:</div><div className="da-grid__body">{visibleResources.map(resource => (- <div className="da-grid__row da-grid__row--compact" key={resource.resourceId}>+ <div+ className="da-grid__row da-grid__row--clickable da-grid__row--compact"+ key={resource.resourceId}+ role="button"+ tabIndex={0}+ aria-label={`Open ${resource.name || resource.drive}`}+ onClick={event => {+ if (isEventFromNestedInteractive(event)) return+ openResource(resource)+ }}+ onKeyDown={event => {+ if (event.key !== 'Enter' && event.key !== ' ') return+ if (isEventFromNestedInteractive(event)) return+ event.preventDefault()+ openResource(resource)+ }}+ ><span className="da-gfs-list__icon da-grid__cell" aria-hidden="true">- {resource.kind === 'directory' ? <IconContexts /> : <IconAttachFile />}+ {resource.kind === 'directory' ? (+ <IconContexts />+ ) : gfsImagePreviewMimeType(resource.name) ? (+ <IconImage />+ ) : (+ <IconAttachFile />+ )}</span><span className="da-gfs-list__identity da-grid__cell"><span className="da-gfs-list__name">@@ -782,7 +807,13 @@ export function FilesPage({ pushToast, pendingGfsUri, onPendingGfsUriHandled }:className={`da-gfs-manage-dialog__icon${currentIsFolder ? ' da-gfs-manage-dialog__icon--folder' : ''}`}aria-hidden="true">- {currentIsFolder ? <IconContexts /> : <IconAttachFile />}+ {currentIsFolder ? (+ <IconContexts />+ ) : currentIsFile && gfsImagePreviewMimeType(current.name) ? (+ <IconImage />+ ) : (+ <IconAttachFile />+ )}</span><span className="da-gfs-manage-dialog__heading">{renameOpen ? (diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.cssindex adc40b219..ffe61c77b 100644--- a/desktop-app/ui/src/styles.css+++ b/desktop-app/ui/src/styles.css@@ -13751,6 +13751,13 @@ pre {border-bottom: 0;}+.da-gfs-drive__title-row {+ min-width: 0;+ display: flex;+ align-items: center;+ gap: var(--space-0-5);+}+.da-gfs-drive__breadcrumbs {min-width: 0;display: flex;@@ -14145,7 +14152,7 @@ pre {min-height: 0;overflow: auto;padding: var(--space-5);- background: rgba(var(--overlay-rgb), 0.32);+ background: var(--panel);}.da-gfs-markdown-preview-dialog__loading {diff --git a/package-lock.json b/package-lock.jsonindex 6a43c5ebb..1d6c79b45 100644--- a/package-lock.json+++ b/package-lock.json@@ -13,214 +13,6 @@"prettier": "^3.0.0"}},- "channel-reader": {- "name": "clerum-channel-reader",- "version": "0.1.0",- "extraneous": true,- "license": "MIT",- "dependencies": {- "@kubernetes/client-node": "^1.0.0",- "@slack/web-api": "^7.0.0",- "grammy": "^1.21.0",- "imapflow": "^1.0.164",- "nodemailer": "^6.9.0"- },- "devDependencies": {- "@types/node": "^20.10.0",- "@types/nodemailer": "^6.4.0",- "typescript": "^5.3.0",- "vitest": "^4.1.0"- },- "engines": {- "node": ">=24"- }- },- "control-api": {- "name": "clerum-control-api",- "version": "0.1.0",- "extraneous": true,- "dependencies": {- "@kubernetes/client-node": "^1.3.0",- "bcryptjs": "^3.0.3",- "express": "^4.21.2",- "google-auth-library": "^10.6.1",- "jsonwebtoken": "^9.0.2",- "pg": "^8.13.1"- },- "devDependencies": {- "@types/express": "^4.17.21",- "@types/jsonwebtoken": "^9.0.10",- "@types/node": "^24.3.0",- "@types/pg": "^8.11.10",- "@types/supertest": "^7.2.0",- "supertest": "^7.2.2",- "ts-node": "^10.9.2",- "typescript": "^5.9.2",- "vitest": "^4.0.18"- },- "engines": {- "node": ">=24"- }- },- "control-ui": {- "name": "clerum-control-ui",- "version": "0.1.0",- "extraneous": true,- "dependencies": {- "next": "^14.2.12",- "react": "^18.3.1",- "react-dom": "^18.3.1"- },- "devDependencies": {- "@playwright/test": "^1.58.2",- "@testing-library/jest-dom": "^6.9.1",- "@testing-library/react": "^16.3.2",- "@testing-library/user-event": "^14.6.1",- "@types/node": "^24.3.0",- "@types/react": "^18.3.5",- "@types/react-dom": "^18.3.0",- "jsdom": "^28.1.0",- "typescript": "^5.9.2",- "vitest": "^4.0.18"- }- },- "desktop-app": {- "name": "evenfire",- "version": "0.1.0",- "extraneous": true,- "dependencies": {- "electron": "^31.7.7",- "js-yaml": "^4.1.1",- "keytar": "^7.9.0",- "react": "^19.1.1",- "react-dom": "^19.1.1"- },- "devDependencies": {- "@playwright/test": "^1.58.2",- "@testing-library/jest-dom": "^6.9.1",- "@testing-library/react": "^16.3.2",- "@testing-library/user-event": "^14.6.1",- "@types/js-yaml": "^4.0.9",- "@types/node": "^24.3.0",- "@types/react": "^19.1.10",- "@types/react-dom": "^19.1.7",- "@vitejs/plugin-react": "^5.0.2",- "concurrently": "^9.2.1",- "cross-env": "^10.0.0",- "jsdom": "^29.0.2",- "typescript": "^5.9.2",- "vite": "^7.1.7",- "vitest": "^3.2.4",- "wait-on": "^8.0.5"- }- },- "external-rest-api": {- "name": "clerum-external-rest-api",- "version": "0.1.0",- "extraneous": true,- "dependencies": {- "cors": "^2.8.5",- "express": "^4.21.2",- "google-auth-library": "^9.15.1",- "jsonwebtoken": "^9.0.3",- "pg": "^8.13.1"- },- "devDependencies": {- "@types/cors": "^2.8.17",- "@types/express": "^4.17.21",- "@types/jsonwebtoken": "^9.0.10",- "@types/node": "^24.3.0",- "@types/pg": "^8.11.10",- "@types/supertest": "^7.2.0",- "supertest": "^7.2.2",- "ts-node": "^10.9.2",- "tsx": "^4.21.0",- "typescript": "^5.9.2",- "vitest": "^4.0.18"- },- "engines": {- "node": ">=24"- }- },- "host-context-controller": {- "name": "clerum-host-context-controller",- "version": "0.1.0",- "extraneous": true,- "license": "MIT",- "dependencies": {- "@kubernetes/client-node": "^1.0.0",- "prom-client": "^15.1.3"- },- "devDependencies": {- "@types/node": "^20.10.0",- "ts-node": "^10.9.2",- "typescript": "^5.3.0",- "vitest": "^4.0.18"- },- "engines": {- "node": ">=24"- }- },- "mcp-host": {- "name": "clerum-mcp-host",- "version": "0.1.0",- "extraneous": true,- "license": "MIT",- "dependencies": {- "@anthropic-ai/sdk": "^0.32.0",- "@kubernetes/client-node": "^1.0.0",- "@modelcontextprotocol/sdk": "^1.0.0",- "cron-parser": "^5.5.0",- "docx": "^9.6.1",- "exceljs": "^4.4.0",- "express": "^5.2.1",- "jose": "^6.2.1",- "jsonwebtoken": "^9.0.2",- "openai": "^4.70.0",- "pdf-lib": "^1.17.1",- "prom-client": "^15.1.3",- "uuid": "^9.0.0"- },- "devDependencies": {- "@types/express": "^5.0.6",- "@types/jsonwebtoken": "^9.0.9",- "@types/node": "^20.10.0",- "@types/uuid": "^9.0.0",- "typescript": "^5.3.0",- "vitest": "^4.0.18"- },- "engines": {- "node": ">=24"- }- },- "mcp-proxy": {- "name": "clerum-mcp-proxy",- "version": "0.1.0",- "extraneous": true,- "license": "MIT",- "devDependencies": {- "@types/node": "^20.10.0",- "typescript": "^5.3.0",- "vitest": "^4.0.18"- },- "engines": {- "node": ">=24"- }- },- "mcp-servers": {- "name": "@clerum/mcp-servers",- "version": "1.0.0",- "extraneous": true,- "dependencies": {- "js-yaml": "^4.1.1"- },- "devDependencies": {- "@types/js-yaml": "^4.0.9",- "@types/node": "^20.10.0",- "typescript": "^5.3.0",- "vitest": "^4.0.18"- }- },"mcp-servers/doc-generator": {"name": "@clerum/doc-generator-mcp","version": "1.0.0",@@ -727,7 +519,6 @@"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"undici-types": "~7.19.0"}@@ -909,7 +700,6 @@"integrity": "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"env-paths": "^2.2.1","import-fresh": "^3.3.0",@@ -1516,7 +1306,6 @@"integrity": "sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q==","dev": true,"license": "MIT",- "peer": true,"bin": {"prettier": "bin/prettier.cjs"},@@ -1743,89 +1532,6 @@"url": "https://github.com/sponsors/sindresorhus"}},- "packages/workflow-sdk": {- "name": "@clerum/workflow-sdk",- "version": "1.0.0-beta.0",- "extraneous": true,- "license": "MIT",- "devDependencies": {- "@types/node": "^20.10.0",- "typescript": "^5.3.0",- "vitest": "^3.0.0"- },- "engines": {- "node": ">=20"- }- },- "profile-ui": {- "name": "clerum-profile-ui",- "version": "0.1.0",- "extraneous": true,- "dependencies": {- "next": "^14.2.12",- "react": "^18.3.1",- "react-dom": "^18.3.1"- },- "devDependencies": {- "@types/node": "^24.3.0",- "@types/react": "^18.3.5",- "@types/react-dom": "^18.3.0",- "typescript": "^5.9.2"- }- },- "rpc-proxy": {- "name": "clerum-rpc-proxy",- "version": "0.1.0",- "extraneous": true,- "dependencies": {- "cors": "^2.8.5",- "express": "^4.21.2",- "jsonwebtoken": "^9.0.2"- },- "devDependencies": {- "@types/cors": "^2.8.17",- "@types/express": "^4.17.21",- "@types/jsonwebtoken": "^9.0.10",- "@types/node": "^24.3.0",- "@types/supertest": "^6.0.3",- "supertest": "^7.1.4",- "tsx": "^4.21.0",- "typescript": "^5.9.2",- "vitest": "^3.2.4"- },- "engines": {- "node": ">=24"- }- },- "stdio-bridge": {- "name": "clerum-stdio-bridge",- "version": "0.1.0",- "extraneous": true,- "license": "MIT",- "dependencies": {- "@modelcontextprotocol/sdk": "^1.0.0"- },- "devDependencies": {- "@types/node": "^20.10.0",- "typescript": "^5.3.0",- "vitest": "^4.0.18"- },- "engines": {- "node": ">=24"- }- },- "tests/e2e": {- "name": "clerum-e2e-tests",- "version": "0.1.0",- "extraneous": true,- "devDependencies": {- "@types/jsonwebtoken": "^9.0.10",- "@types/node": "^22.0.0",- "jsonwebtoken": "^9.0.2",- "typescript": "^5.6.0",- "vitest": "^3.0.0"- }- },"tests/e2e/fixtures": {"name": "@clerum/e2e-test-fixtures","version": "1.0.0",@@ -1892,28 +1598,6 @@"@types/node": "^22.0.0"}},- "workflow-recipes": {- "version": "0.1.1",- "extraneous": true,- "license": "MIT",- "dependencies": {- "@aws-sdk/client-s3": "^3.1009.0",- "@kubernetes/client-node": "^1.0.0",- "@modelcontextprotocol/sdk": "^1.12.1",- "jose": "^6.2.1",- "prom-client": "^15.1.3",- "zod": "^3.24.0"- },- "devDependencies": {- "@types/node": "^20.10.0",- "ts-node": "^10.9.2",- "typescript": "^5.3.0",- "vitest": "^3.0.0"- },- "engines": {- "node": ">=24"- }- },"workflow-recipes/tests/e2e": {"name": "workflow-recipes-e2e","version": "0.1.0",