Skip to content

fix(window): align traffic lights with the sidebar icon column - #2144

Merged
jackwener merged 1 commit into
mainfrom
pr-trafficlight-align-11
Aug 4, 2026
Merged

fix(window): align traffic lights with the sidebar icon column#2144
jackwener merged 1 commit into
mainfrom
pr-trafficlight-align-11

Conversation

@jackwener

Copy link
Copy Markdown
Member

改了什么

main-window.tsMAIN_WINDOW_TRAFFIC_LIGHT_POSITION.x 14 → 17。y 不动。

为什么

关闭按钮圆心比侧栏图标列中心偏左 3pt,窗口左上角读起来是两条差一点的竖线,不是一条。

是 17 不是 18:首灯中心 = x + 7,因为灯径实测 14pt,不是常被引用的 12pt。
对齐目标是图标列中心 24(item 左缘 8 + 32pt 图标槽的一半),所以 x = 24 − 7 = 17。

收起态不需要单独处理:收起轨宽 --spacing-12 = 48 = 8 + 32 + 8,图标槽中心同样是 24,
一个常量两态都对。

怎么验的

Playwright 截不到 OS 原生 chrome,所以直接读运行窗口截图的像素(Retina 2x,量差值不量绝对坐标)。

三个值都改常量 + 重新构建 + 重启 + 重新量,没有靠外推:

x 首灯中心 相对图标列
14(改前) 1009.5 偏左 3.08pt
17 1015.5 0.08pt
18 1017.5 偏右 0.92pt

测量自检:红盘 bbox 中心 == 亮度加权质心(差 0.00px);图标列取 3 个图标,sd = 0.24 物理像素。

build / typecheck / format:check / lint / check:release 全绿。全仓无任何测试引用这个常量。

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.
@jackwener
jackwener merged commit 1c64185 into main Aug 4, 2026
11 checks passed
@jackwener
jackwener deleted the pr-trafficlight-align-11 branch August 4, 2026 12:08
AidenNovak pushed a commit to AidenNovak/maka-agent that referenced this pull request Aug 7, 2026
…c lights

The macOS traffic-light cluster is ~54px wide (x 17..71: 14px discs on
20px centres — main-window.ts, apache#2144) but the collapsed rail is 48px,
so the yellow disc straddled the rail/plate seam and the green disc sat
on the plate's own top-left corner. No position fits the cluster inside
a 48px rail, so the seam is removed from under it instead.

Collapsed, the rail puts on the plate's material
(--agents-content-area-bg) and the plate docks flush under the
titlebar (top margin and top corners to zero): one continuous surface
where the lights sit. All three properties ease with the existing
collapse width animation (--duration-large). Expanded keeps the
floating-plate design untouched.

This is the deliberate successor to the repaint apache#2187 removed: that one
wore --color-background-surface, which light mode happened to share
with the plate and dark mode did not — a third tone under the light
cluster. Wearing the plate's own token fuses light and dark by
construction.

The sidebar-geometry material contract moves with the change: expanded
still asserts rail == column (the apache#2187 regression lock), collapsed now
asserts rail == plate plus flush margin/radius, compared as painted
RGBA bytes so palettes and themes survive.
AidenNovak pushed a commit to AidenNovak/maka-agent that referenced this pull request Aug 9, 2026
…c lights

The macOS traffic-light cluster is ~54px wide (x 17..71: 14px discs on
20px centres — main-window.ts, apache#2144) but the collapsed rail is 48px,
so the yellow disc straddled the rail/plate seam and the green disc sat
on the plate's own top-left corner. No position fits the cluster inside
a 48px rail, so the seam is removed from under it instead.

Collapsed, the rail puts on the plate's material
(--agents-content-area-bg) and the plate docks flush under the
titlebar (top margin and top corners to zero): one continuous surface
where the lights sit. All three properties ease with the existing
collapse width animation (--duration-large). Expanded keeps the
floating-plate design untouched.

This is the deliberate successor to the repaint apache#2187 removed: that one
wore --color-background-surface, which light mode happened to share
with the plate and dark mode did not — a third tone under the light
cluster. Wearing the plate's own token fuses light and dark by
construction.

The sidebar-geometry material contract moves with the change: expanded
still asserts rail == column (the apache#2187 regression lock), collapsed now
asserts rail == plate plus flush margin/radius, compared as painted
RGBA bytes so palettes and themes survive.
M4n5ter pushed a commit to AidenNovak/maka-agent that referenced this pull request Aug 26, 2026
…c lights

The macOS traffic-light cluster is ~54px wide (x 17..71: 14px discs on
20px centres — main-window.ts, apache#2144) but the collapsed rail is 48px,
so the yellow disc straddled the rail/plate seam and the green disc sat
on the plate's own top-left corner. No position fits the cluster inside
a 48px rail, so the seam is removed from under it instead.

Collapsed, the rail puts on the plate's material
(--agents-content-area-bg) and the plate docks flush under the
titlebar (top margin and top corners to zero): one continuous surface
where the lights sit. All three properties ease with the existing
collapse width animation (--duration-large). Expanded keeps the
floating-plate design untouched.

This is the deliberate successor to the repaint apache#2187 removed: that one
wore --color-background-surface, which light mode happened to share
with the plate and dark mode did not — a third tone under the light
cluster. Wearing the plate's own token fuses light and dark by
construction.

The sidebar-geometry material contract moves with the change: expanded
still asserts rail == column (the apache#2187 regression lock), collapsed now
asserts rail == plate plus flush margin/radius, compared as painted
RGBA bytes so palettes and themes survive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant