fix(ui): prevent logo from overlapping macOS traffic light buttons

Add platform detection to apply additional left padding (pl-20) and top
padding (pt-4) on macOS to prevent the sidebar header/logo from
overlapping with the native window control buttons (close, minimize,
maximize).

Fixes #176
This commit is contained in:
James
2025-12-22 12:28:06 -05:00
parent a85dec6dbb
commit f17d062440

View File

@@ -3,6 +3,10 @@ import { cn } from '@/lib/utils';
import { AutomakerLogo } from './automaker-logo';
import { BugReportButton } from './bug-report-button';
// Detect if running on macOS for traffic light button spacing
const isMac =
typeof navigator !== 'undefined' && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
interface SidebarHeaderProps {
sidebarOpen: boolean;
navigate: (opts: NavigateOptions) => void;
@@ -20,7 +24,9 @@ export function SidebarHeader({ sidebarOpen, navigate }: SidebarHeaderProps) {
// Background gradient for depth
'bg-gradient-to-b from-transparent to-background/5',
'flex items-center',
sidebarOpen ? 'px-3 lg:px-5 justify-start' : 'px-3 justify-center'
sidebarOpen ? 'px-3 lg:px-5 justify-start' : 'px-3 justify-center',
// Add left padding on macOS to avoid overlapping with traffic light buttons
isMac && 'pt-4 pl-20'
)}
>
<AutomakerLogo sidebarOpen={sidebarOpen} navigate={navigate} />