Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(desktop): pad main top-bar when sidebar collapses so tabs don't sit under traffic lights
Naiyuan Qing7ade4b432d49
diff --git a/apps/desktop/src/renderer/src/components/desktop-layout.tsx b/apps/desktop/src/renderer/src/components/desktop-layout.tsxindex e52d9b56fd..252e9f9e3f 100644--- a/apps/desktop/src/renderer/src/components/desktop-layout.tsx+++ b/apps/desktop/src/renderer/src/components/desktop-layout.tsx@@ -1,9 +1,13 @@import { useEffect } from "react";import { ChevronLeft, ChevronRight } from "lucide-react";+import { cn } from "@multica/ui/lib/utils";import { useTabHistory } from "@/hooks/use-tab-history";import { useActiveTitleSync } from "@/hooks/use-tab-sync";import { useTabStore, resolveRouteIcon } from "@/stores/tab-store";-import { SidebarProvider } from "@multica/ui/components/ui/sidebar";+import {+ SidebarProvider,+ useSidebar,+} from "@multica/ui/components/ui/sidebar";import { ModalRegistry } from "@multica/views/modals/registry";import { AppSidebar, DashboardGuard } from "@multica/views/layout";import { SearchCommand, SearchTrigger } from "@multica/views/search";@@ -28,6 +32,7 @@ function SidebarTopBar() {<buttononClick={goBack}disabled={!canGoBack}+ aria-label="Go back"className="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-30 disabled:pointer-events-none"><ChevronLeft className="size-4" />@@ -35,6 +40,7 @@ function SidebarTopBar() {<buttononClick={goForward}disabled={!canGoForward}+ aria-label="Go forward"className="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-30 disabled:pointer-events-none"><ChevronRight className="size-4" />@@ -44,6 +50,23 @@ function SidebarTopBar() {);}+// The main area's top bar doubles as a window drag region. When the sidebar+// is collapsed, we pad the left side so tabs don't land under the macOS+// traffic lights (which live at roughly x=16..68 and always hit-test above HTML).+function MainTopBar() {+ const { state } = useSidebar();+ const sidebarCollapsed = state === "collapsed";++ return (+ <header+ className={cn("h-12 shrink-0", sidebarCollapsed && "pl-20")}+ style={{ WebkitAppRegion: "drag" } as React.CSSProperties}+ >+ <TabBar />+ </header>+ );+}+function useInternalLinkHandler() {useEffect(() => {const handler = (e: Event) => {@@ -78,13 +101,7 @@ export function DesktopShell() {<AppSidebar topSlot={<SidebarTopBar />} searchSlot={<SearchTrigger />} />{/* Right side: header + content container */}<div className="flex flex-1 min-w-0 flex-col">- {/* Tab bar + drag region */}- <header- className="h-12 shrink-0"- style={{ WebkitAppRegion: "drag" } as React.CSSProperties}- >- <TabBar />- </header>+ <MainTopBar />{/* Content area with inset styling — relative so ChatWindow/ChatFab are constrained here */}<div className="relative flex flex-1 min-h-0 flex-col overflow-hidden mr-2 mb-2 ml-0.5 rounded-xl shadow-sm bg-background"><TabContent />