Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(desktop-app): revert notification tray to popover form while the chat drawer is visible
Diego Zacarias6098ddd3952c
diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsxindex c2d542317..714ffe1d0 100644--- a/desktop-app/ui/src/App.tsx+++ b/desktop-app/ui/src/App.tsx@@ -487,8 +487,6 @@ export function App() {const isAgentChatView =(vm.navItem === DESKTOP_ROUTES.agents && Boolean(vm.selectedAgent)) ||(vm.navItem === DESKTOP_ROUTES.chat && Boolean(vm.selectedAgent))- const notificationTrayUsesDrawer = Boolean(activeSandboxUiApp)- const appNotificationDrawerOpen = notificationTrayUsesDrawer && headerNotificationTrayOpen// The chat drawer coexists with the live app only on the `apps` route. It is// an orthogonal boolean axis over the shared `chatViewTabs`/<ChatPage> — never// a second tab store, never a foreground/background precedence module.@@ -496,6 +494,14 @@ export function App() {const chatDrawerVisible = chatDrawerAvailable && chatDrawerOpenchatDrawerVisibleRef.current = chatDrawerVisiblechatDrawerAvailableRef.current = chatDrawerAvailable+ // The notification tray's drawer form occupies the same fixed right-rail rect+ // as the chat drawer, so it only takes drawer form when the chat drawer is NOT+ // visible; while the chat drawer is up it reverts to its popover/overlay form+ // (the existing shell-overlay freeze covers that case) to avoid two stacked+ // drawers fighting for the same rect. AppHeader's tray open-state is its own+ // internal `notificationsOpen`, so flipping the mode never closes an open tray.+ const notificationTrayUsesDrawer = Boolean(activeSandboxUiApp) && !chatDrawerVisible+ const appNotificationDrawerOpen = notificationTrayUsesDrawer && headerNotificationTrayOpenconst activeConversationOrigin = React.useMemo<SandboxUiConversationOrigin | null>(() => {if (vm.navItem !== DESKTOP_ROUTES.chat || !vm.selectedAgent || !vm.activeChatId) {return nulldiff --git a/desktop-app/ui/src/__tests__/App.chatDrawer.test.tsx b/desktop-app/ui/src/__tests__/App.chatDrawer.test.tsxindex 55a7b313c..00f37162f 100644--- a/desktop-app/ui/src/__tests__/App.chatDrawer.test.tsx+++ b/desktop-app/ui/src/__tests__/App.chatDrawer.test.tsx@@ -20,10 +20,18 @@ const sandboxUiPageHarness = vi.hoisted(() => ({onEmbeddedAppMounted?: () => void},}))+const appHeaderHarness = vi.hoisted(() => ({+ props: null as null | { notificationTrayMode?: 'drawer' | 'overlay' },+}))vi.mock('@hooks/useAppController', () => ({ useAppController: vi.fn() }))vi.mock('@hooks/useAgentChatActionsValue', () => ({ useAgentChatActionsValue: () => ({}) }))-vi.mock('@components/AppHeader', () => ({ AppHeader: () => null }))+vi.mock('@components/AppHeader', () => ({+ AppHeader: (props: NonNullable<typeof appHeaderHarness.props>) => {+ appHeaderHarness.props = props+ return null+ },+}))vi.mock('@components/ChatLocalSearch', () => ({ ChatLocalSearch: () => null }))vi.mock('@components/CommandPalette', () => ({ CommandPalette: () => null }))vi.mock('@components/BootSplash', () => ({ BootSplash: () => null }))@@ -127,6 +135,7 @@ describe('App chat drawer — reopen preserves the last-viewed chat', () => {vi.clearAllMocks()sidebarHarness.props = nullsandboxUiPageHarness.props = null+ appHeaderHarness.props = nullcurrentController = makeController()vi.mocked(useAppController).mockImplementation(() => currentController)Object.defineProperty(window, 'clerum', {@@ -198,4 +207,33 @@ describe('App chat drawer — reopen preserves the last-viewed chat', () => {// Reopen must preserve chat-2, not jump back to the chat-1 origin.expect(screen.getByRole('button', { name: 'Open chats' }).textContent).toContain('Second chat')})++ it('reverts the notification tray to overlay form while the chat drawer is visible', () => {+ currentController = makeController({+ selectedAgent: 'alpha',+ activeChatId: 'chat-1',+ navItem: DESKTOP_ROUTES.chat,+ chatList: CHAT_LIST,+ } as Partial<AppController>)+ render(<App />)++ // Launch from chat-1: the chat drawer becomes visible over the live embed.+ act(() => {+ sidebarHarness.props?.onOpenSandboxUiApp?.({+ appRef: 'ns/app',+ label: 'App',+ defaultPath: '/',+ })+ })+ expect(sandboxUiPageHarness.props?.chatDrawerOpen).toBe(true)+ // Both drawers share the same fixed right-rail rect, so the notification tray+ // must NOT use its drawer form while the chat drawer is up — it reverts to the+ // overlay/popover form (handled by the existing shell-overlay freeze).+ expect(appHeaderHarness.props?.notificationTrayMode).toBe('overlay')++ // Closing the chat drawer (app still mounted) restores the tray's drawer form.+ act(() => sandboxUiPageHarness.props?.onToggleChatDrawer?.())+ expect(sandboxUiPageHarness.props?.chatDrawerOpen).toBe(false)+ expect(appHeaderHarness.props?.notificationTrayMode).toBe('drawer')+ })})