Skip to content

Commit 6a8b206

Browse files
authored
Merge pull request #217 from JBotwina/fix/176-logo-macos-buttons-overlap
fix(ui): prevent logo from overlapping macOS traffic light buttons
2 parents 3f3f029 + 53c1a46 commit 6a8b206

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

apps/ui/src/components/layout/sidebar/components/sidebar-header.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { NavigateOptions } from '@tanstack/react-router';
2-
import { cn } from '@/lib/utils';
2+
import { cn, isMac } from '@/lib/utils';
33
import { AutomakerLogo } from './automaker-logo';
44
import { BugReportButton } from './bug-report-button';
55

@@ -20,7 +20,9 @@ export function SidebarHeader({ sidebarOpen, navigate }: SidebarHeaderProps) {
2020
// Background gradient for depth
2121
'bg-gradient-to-b from-transparent to-background/5',
2222
'flex items-center',
23-
sidebarOpen ? 'px-3 lg:px-5 justify-start' : 'px-3 justify-center'
23+
sidebarOpen ? 'px-3 lg:px-5 justify-start' : 'px-3 justify-center',
24+
// Add left padding on macOS to avoid overlapping with traffic light buttons
25+
isMac && 'pt-4 pl-20'
2426
)}
2527
>
2628
<AutomakerLogo sidebarOpen={sidebarOpen} navigate={navigate} />

apps/ui/src/lib/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ export function pathsEqual(p1: string | undefined | null, p2: string | undefined
5252
if (!p1 || !p2) return p1 === p2;
5353
return normalizePath(p1) === normalizePath(p2);
5454
}
55+
56+
/**
57+
* Detect if running on macOS.
58+
* Checks Electron process.platform first, then falls back to navigator APIs.
59+
*/
60+
export const isMac =
61+
typeof process !== 'undefined' && process.platform === 'darwin'
62+
? true
63+
: typeof navigator !== 'undefined' &&
64+
(/Mac/.test(navigator.userAgent) ||
65+
(navigator.platform ? navigator.platform.toLowerCase().includes('mac') : false));

0 commit comments

Comments
 (0)