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 && ( +
- )} + {!isMobile && ( + + + + + + {t("shell.aria.closeSidebar")} + + + )} +
{!isMobile && (
@@ -1246,8 +1277,10 @@ export function AppSidebar() { {/* Uniform pl-1.5 pr-2 keeps every hover pill the same width, inset from the edge. */} @@ -1280,10 +1313,18 @@ export function AppSidebar() { openNewChat(null); }} /> + {/* Search sits in the header when the brand row is shown (mac/web). + Hide this row there, but keep it in the collapsed rail. On custom + titlebars (win/linux) there's no header button, so keep the row. */} { useChatSearchStore.getState().open(); closeMobileIfOpen(); diff --git a/studio/frontend/src/components/tauri/window-titlebar.tsx b/studio/frontend/src/components/tauri/window-titlebar.tsx index 8d11bbd229..d5c74df463 100644 --- a/studio/frontend/src/components/tauri/window-titlebar.tsx +++ b/studio/frontend/src/components/tauri/window-titlebar.tsx @@ -40,7 +40,7 @@ type NavigatorWithUserAgentData = Navigator & { }; }; -function getClientPlatform(): string { +export function getClientPlatform(): string { if (typeof navigator === "undefined") { return ""; }