From 037d6e95e8221d067859e967ecc64b4a1939813f Mon Sep 17 00:00:00 2001 From: jackwener Date: Tue, 4 Aug 2026 20:00:46 +0800 Subject: [PATCH] fix(window): align traffic lights with the sidebar icon column The close button's centre sat 3pt left of the sidebar icon column, so the window's top-left read as two near-miss columns. Moves trafficLightPosition.x 14 -> 17 to put the two on one vertical line. 17 rather than 18: the centre is x + 7, because the disc measures 14pt, not the 12pt it is usually quoted as. Read off screenshots of the running window (Playwright cannot capture OS chrome), and all three values were built and re-measured rather than extrapolated: x=14 is off by 3.08pt, x=17 by 0.08pt, x=18 by 0.92pt the other way. Collapsed state needs no separate value: the collapsed rail is --spacing-12 = 48 = 8 + 32 + 8, so the icon slot centres on 24 in both states. --- apps/desktop/src/main/main-window.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/main/main-window.ts b/apps/desktop/src/main/main-window.ts index 813e1185ff..a6ff93c632 100644 --- a/apps/desktop/src/main/main-window.ts +++ b/apps/desktop/src/main/main-window.ts @@ -87,7 +87,14 @@ export function safeSendToRenderer(channel: string, ...args: unknown[]): void { wc.send(channel, ...args); } -const MAIN_WINDOW_TRAFFIC_LIGHT_POSITION = { x: 14, y: 14 } as const; +// The close button's centre sits on the same vertical line as the sidebar's +// icon column, so the window's top-left reads as one column rather than two +// near-misses. Contract: centre = x + 7 (the disc measures 14pt, not the 12pt +// it is often quoted as), and the icon column centres on 24 (item edge 8 + +// half of the 32pt icon slot) — so x = 24 - 7 = 17. Both numbers were read off +// a screenshot of the running window, not derived. Move the sidebar's left +// padding or icon slot and this has to move with it. +const MAIN_WINDOW_TRAFFIC_LIGHT_POSITION = { x: 17, y: 14 } as const; const HIDDEN_TRAFFIC_LIGHT_POSITION = { x: -100, y: -100 } as const; // PR-SHOW-AFTER-FIRST-COMMIT: fallback reveal delay for a renderer that never