From 8517721adb692746cf09d717465cfddd2fe853aa Mon Sep 17 00:00:00 2001 From: Michael Han <107991372+shimmyshimmer@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:25:56 -0700 Subject: [PATCH] Studio: move sidebar search into the header (#7304) * Studio: move sidebar search into the header Put the search action as an icon button next to the sidebar toggle in the header instead of a full-width nav row, so New Chat is the only fixed row above the scrolling list. The search row is kept for the collapsed icon rail only. Also add a small bottom gap under New Chat when it is pinned during scroll. * Studio: keep search row on custom-titlebar platforms The header search button only renders on mac/web where the brand row shows. On win/linux custom titlebars there's no header button, so keep the full-width search row visible instead of hiding it. * Studio: address review on sidebar search tooltip - Hide the search tooltip on mobile (hidden={isMobile}), matching the SidebarMenuButton tooltip convention. - Show Cmd K on Mac and Ctrl K elsewhere instead of a hardcoded glyph; the search dialog binds both meta and ctrl. Uses getClientPlatform so it is correct on web too, not just Tauri. --- .../frontend/src/components/app-sidebar.tsx | 57 ++++++++++++++++--- .../src/components/tauri/window-titlebar.tsx | 2 +- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx index a13828b06b..f4226760a2 100644 --- a/studio/frontend/src/components/app-sidebar.tsx +++ b/studio/frontend/src/components/app-sidebar.tsx @@ -45,6 +45,7 @@ import { Spinner } from "@/components/ui/spinner"; import { Switch } from "@/components/ui/switch"; import { useAnimatedThemeToggle } from "@/components/ui/animated-theme-toggler"; import { + getClientPlatform, shouldUseCustomWindowTitlebar, shouldUseNativeMacWindowTitlebar, } from "@/components/tauri/window-titlebar"; @@ -343,6 +344,8 @@ export function AppSidebar() { ); const [usesCustomTitlebar] = useState(shouldUseCustomWindowTitlebar); const [usesNativeMacTitlebar] = useState(shouldUseNativeMacWindowTitlebar); + // Mac uses Cmd, others use Ctrl. Not Tauri-gated, so it's right on web too. + const [isMacPlatform] = useState(() => getClientPlatform().includes("mac")); const { pathname, search } = useRouterState({ select: (s) => ({ pathname: s.location.pathname, @@ -1194,27 +1197,55 @@ export function AppSidebar() { )} - {!isMobile && ( +