From 54d8d3010b16db8207206fd5f3de07f712408d84 Mon Sep 17 00:00:00 2001 From: chengyongru Date: Thu, 4 Jun 2026 11:03:06 +0800 Subject: [PATCH] fix: close search when starting new chats maintainer edit: Close the session search dialog when the global new-chat shortcut navigates to the blank chat route, and expose the new shortcut through the sidebar button title so the shortcut is discoverable. --- webui/src/App.tsx | 1 + webui/src/components/Sidebar.tsx | 7 ++++- webui/src/tests/app-layout.test.tsx | 45 +++++++++++++++++++++++++++-- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 8c128828f..8fa428a7b 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -813,6 +813,7 @@ function Shell({ navigate(defaultShellRoute()); setDraftWorkspaceScope(null); setWorkspaceError(null); + setSessionSearchOpen(false); setMobileSidebarOpen(false); }, [navigate]); diff --git a/webui/src/components/Sidebar.tsx b/webui/src/components/Sidebar.tsx index 57cf42a84..3d4f7a6d2 100644 --- a/webui/src/components/Sidebar.tsx +++ b/webui/src/components/Sidebar.tsx @@ -124,6 +124,7 @@ export function Sidebar(props: SidebarProps) { label={t("sidebar.newChat")} onClick={props.onNewChat} icon={} + shortcut="Cmd/Ctrl+Shift+O" /> void; active?: boolean; className?: string; + shortcut?: string; }) { + const title = shortcut ? `${label} (${shortcut})` : collapsed ? label : undefined; + return (