Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(desktop): focus the composer for new chats
Josué30e9e8f686d2
diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsxindex 30d7cde98..eaffc4a08 100644--- a/desktop-app/ui/src/App.tsx+++ b/desktop-app/ui/src/App.tsx@@ -350,6 +350,7 @@ export function App() {const next = addBlankChatViewTab(chatViewTabsRef.current, nextChatTabId(), vm.selectedAgent)setChatViewTabs(next)revealChatViewTab(activeChatViewTab(next))+ setComposerFocusRequestId(value => value + 1)}, [nextChatTabId, revealChatViewTab, vm.selectedAgent])const closeChatLocalSearch = React.useCallback((restoreFocus = true) => {@@ -1798,6 +1799,7 @@ export function App() {availableSandboxUiApps={availableSandboxUiApps}collapsed={sidebarCollapsed}onCollapsedChange={setSidebarCollapsed}+ onNewChat={handleNewChatViewTab}onOpenSandboxUiApp={handleOpenSandboxUiApp}onSettingsMenuOpenChange={setSidebarSettingsMenuOpen}onSelect={handleSidebarNavSelect}diff --git a/desktop-app/ui/src/components/SidebarNav/index.tsx b/desktop-app/ui/src/components/SidebarNav/index.tsxindex bf4f454af..6b5118476 100644--- a/desktop-app/ui/src/components/SidebarNav/index.tsx+++ b/desktop-app/ui/src/components/SidebarNav/index.tsx@@ -42,6 +42,7 @@ export function SidebarNav({activeSandboxUiApp,availableSandboxUiApps,onCollapsedChange,+ onNewChat,onOpenSandboxUiApp,onSettingsMenuOpenChange,onSelect,@@ -365,7 +366,7 @@ export function SidebarNav({data-testid="nav-new-chat"onClick={event => {event.stopPropagation()- handleSelect(DESKTOP_ROUTES.chat)+ onNewChat()}}variant="ghost">diff --git a/desktop-app/ui/src/components/SidebarNav/types.ts b/desktop-app/ui/src/components/SidebarNav/types.tsindex 03b12d210..36fe2840f 100644--- a/desktop-app/ui/src/components/SidebarNav/types.ts+++ b/desktop-app/ui/src/components/SidebarNav/types.ts@@ -6,6 +6,7 @@ export type SidebarNavProps = {activeSandboxUiApp: ActiveSandboxUiApp | nullavailableSandboxUiApps: ActiveSandboxUiApp[]onCollapsedChange: (collapsed: boolean) => void+ onNewChat: () => voidonOpenSandboxUiApp: (app: ActiveSandboxUiApp) => voidonSettingsMenuOpenChange?: (open: boolean) => voidonSelect: (item: NavItem) => voiddiff --git a/desktop-app/ui/src/components/__tests__/SidebarNav.test.tsx b/desktop-app/ui/src/components/__tests__/SidebarNav.test.tsxindex cb57d5108..1c315b9fc 100644--- a/desktop-app/ui/src/components/__tests__/SidebarNav.test.tsx+++ b/desktop-app/ui/src/components/__tests__/SidebarNav.test.tsx@@ -42,6 +42,7 @@ function baseProps(overrides: Partial<SidebarNavProps> = {}): SidebarNavProps {activeSandboxUiApp: null,availableSandboxUiApps: [],onCollapsedChange: vi.fn(),+ onNewChat: vi.fn(),onOpenSandboxUiApp: vi.fn(),onSelect: vi.fn(),...overrides,@@ -176,16 +177,18 @@ describe('SidebarNav new-chat affordance', () => {cleanup()})- it('renders a new-chat button on the chat nav row that selects chat', () => {+ it('routes the new-chat button through the dedicated new-chat owner', () => {const onSelect = vi.fn()- render(<SidebarNav {...baseProps({ navItem: 'chat', onSelect })} />)+ const onNewChat = vi.fn()+ render(<SidebarNav {...baseProps({ navItem: 'chat', onSelect })} onNewChat={onNewChat} />)const newChatBtn = screen.getByTestId('nav-new-chat')expect(newChatBtn).not.toBeNull()expect(newChatBtn.getAttribute('title')).toBe('New chat')fireEvent.click(newChatBtn)- expect(onSelect).toHaveBeenCalledWith('chat')+ expect(onNewChat).toHaveBeenCalledOnce()+ expect(onSelect).not.toHaveBeenCalled()})it('renders exactly one new-chat button (on the chat nav row)', () => {