From 42b58efc5ce8b90e326331d52ae593e45461d33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A4=A7=E7=8C=AB?= <16399091+binaricat@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:07:07 +0800 Subject: [PATCH] fix: align top bar right-side icon buttons (#1298) (#1303) * fix: align top bar right-side icon buttons (#1298) Unify AI/sync/theme/settings buttons to h-7 in one row aligned with tabs. SyncStatusButton was h-8 and settings lived in a separate container, causing misalignment. Preserve Windows spacing before window controls (mr-2). Fixes #1298 Co-authored-by: Cursor * fix: align window controls with utility icons in top bar Merge window controls into the same row as utility buttons, match h-7 height, add left margin separation, and restore rectangular gray hover for all three buttons. Co-authored-by: Cursor --------- Co-authored-by: Cursor --- components/SyncStatusButton.tsx | 5 ++++- components/TopTabs.tsx | 28 ++++++++++++++++------------ components/top-tabs/TopTabItems.tsx | 29 +++++++++-------------------- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/components/SyncStatusButton.tsx b/components/SyncStatusButton.tsx index 1e80e7645..1f955a722 100644 --- a/components/SyncStatusButton.tsx +++ b/components/SyncStatusButton.tsx @@ -107,12 +107,14 @@ interface SyncStatusButtonProps { onOpenSettings?: () => void; onSyncNow?: () => Promise; // Callback to trigger sync with current data className?: string; + style?: React.CSSProperties; } export const SyncStatusButton: React.FC = ({ onOpenSettings, onSyncNow, className, + style, }) => { const { t } = useI18n(); const [isOpen, setIsOpen] = useState(false); @@ -177,9 +179,10 @@ export const SyncStatusButton: React.FC = ({ variant="ghost" size="icon" className={cn( - "h-8 w-8 relative text-muted-foreground hover:text-foreground app-no-drag", + "h-7 w-7 relative text-muted-foreground hover:text-foreground app-no-drag", className )} + style={style} > {getButtonIcon()} diff --git a/components/TopTabs.tsx b/components/TopTabs.tsx index 302603872..cc12a69b3 100644 --- a/components/TopTabs.tsx +++ b/components/TopTabs.tsx @@ -591,14 +591,17 @@ const TopTabsInner: React.FC = ({ )} - {/* Fixed right controls */} -
+ {/* Fixed right controls — utility icons + window controls share one row */} +
- {/* Settings gear button - sits to the left of WindowControls on win/linux, at the right edge on mac */} -
- {/* Custom window controls for Windows/Linux */} - {!isMacClient &&
} {/* Small drag shim to the right edge (macOS only – on Windows the close button should touch the edge) */} - {isMacClient &&
} + {isMacClient &&
}
); diff --git a/components/top-tabs/TopTabItems.tsx b/components/top-tabs/TopTabItems.tsx index 0a886419e..4f4e28234 100644 --- a/components/top-tabs/TopTabItems.tsx +++ b/components/top-tabs/TopTabItems.tsx @@ -161,30 +161,19 @@ export const WindowControls: React.FC = memo(() => { close(); }; + const controlStyle = { color: 'var(--top-tabs-muted, hsl(var(--muted-foreground)))' }; + const controlClassName = + 'h-7 w-10 flex items-center justify-center rounded-none hover:bg-foreground/10 transition-colors app-no-drag'; + return ( -
- - -