Skip to content

Align the macOS title bar with the traffic lights and rail - #5459

Closed
brsbl wants to merge 5 commits into
bb/compact-app-frame-thr_eigbyjruhsfrom
bb/macos-traffic-light-alignment-thr_eigbyjruhs
Closed

brsbl wants to merge 5 commits into
bb/compact-app-frame-thr_eigbyjruhsfrom
bb/macos-traffic-light-alignment-thr_eigbyjruhs

Conversation

@brsbl

@brsbl brsbl commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The macOS title bar was laid out for pre-Tahoe traffic lights. On macOS 26 each light is 14×14 with 9px gaps (measured from standardWindowButton on macOS 26.5), so with the 18px inset the cluster ends at x=78 and the Back button at x=84 had 6px of clearance (#4145). The title-bar controls sat 1px below the lights' center line, the red light was not over the rail icon column, and the narrow-window right-panel toggles ignored the traffic-light axis entirely.

What changed

  • The traffic-light geometry lives once in @bb/desktop-contract (macos-window-chrome.ts). The desktop shell places the lights 16px from the left and 15px from the top (the position ChatGPT's desktop app uses), which puts the close button over the rail icons (both centered at x=23). It reports both insets to the renderer as bbDesktop.macosTrafficLightInset and bbDesktop.macosTrafficLightTopInset.
  • The title bar is 44px, twice the lights' center, so the lights sit in the middle of it the way every native title row centers them. The app derives the title-bar height, control axis and traffic-light reserves from the reported insets and sets them as CSS variables at startup. A desktop build that reports no insets gets the previous 18px diagonal geometry, so older desktop shells stay aligned with a newer web UI.
  • Title-bar controls are 28×28 at y=8–36, centered on the lights and 8px from the window top and the cards, and clear the lights by 12px. The home and split-view right-panel toggles follow the same axis in narrow windows. On framed layouts the sidebar's New thread row stays centered in its own row instead of following the lights' axis.
  • No server/daemon wire change; the new bridge fields are optional.

Fixes #4145

How you verified

  • Branch desktop dev app (Electron) on macOS 26.5.2, rebuilt at each revision so the shell really placed the lights. Screen Recording isn't granted to the process running the capture, so native lights can't be captured; the screenshots draw stand-in lights (colored dots) at the exact geometry the shell reports.
  • Measured after: lights at (16, 15) and every title-bar control centered at y=22 in a 44px bar, controls at y=8–36, red light and rail icons centered at x=23, Back starts at x=88, 12px after the cluster.
  • The native reference positions come from AppKit windows measured on macOS 26.5.2: compact toolbar lights at (12, 13) in a 40px row, no-toolbar windows at (9, 9) in 32px, unified toolbar at (19, 19); ChatGPT's desktop app uses (16, 15) in a 44px bar. A 40px version of this layer felt too tight in use, so it uses ChatGPT's 44px setup.
  • Remote CI runs the tests; nothing was run locally.

Layer 2 · Traffic-light alignment

Before: 335a53d9b (layer 1) · After: 6ad0c5852 · 2× PNGs, same seeded fixture, route and window in each pair.

Screen / state Viewport Before After
Thread · sidebar expanded macOS desktop · 1280×800 Before thread expanded After thread expanded
Thread · sidebar collapsed macOS desktop · 1280×800 Before thread collapsed After thread collapsed
Home · sidebar expanded macOS desktop · 1280×800 Before home After home
Top-left corner (zoom) macOS desktop · 1280×800 Before top-left After top-left

Alignment guides

The top-left zoom with measurements drawn over it. Pink lines mark the traffic-light center (y=) and the rail axis (rail x=); the blue line marks the light cluster's edge and its gap to Back; the green line marks the card top and the title-bar height.

Corner Viewport Before After
Top-left macOS desktop · 1280×800 Before top-left guides After top-left guides

Merge order with "Keep New thread clear of the macOS traffic lights in the narrow sidebar drawer" (#5495)

Resolved: the PRs can merge in either order. #5495 used to pad the narrow-window drawer header with a literal 88px, which assumed the sidebar toggle sits at the 84px reserve; with this stack's 88px reserve New thread would have started 4px under the toggle. #5495 now includes 5bd8c8b85, which derives that padding from --bb-macos-traffic-light-reserve (falling back to 84px), so New thread starts 4px after the toggle under either geometry. Measured on a real Mac at 700px:

Build Sidebar toggle New thread
#5495 head 5bd8c8b85 on main x=84–112 x=116
stack + #5495 without 5bd8c8b85 x=88–116 x=112 (overlaps)
stack + #5495 with 5bd8c8b85 x=88–116 x=120

Follow-ups (P2, not in this PR)

  • Older desktop app, newer server: a desktop build that reports no insets keeps its lights at (18, 18), so the app falls back to a 50px bar (center 25) instead of 44px. Controls stay on the lights' line and Back keeps its 12px gap; the rail icons (x=23) sit 2px left of the red light (x=25). It lasts until the desktop app updates.
  • Newer desktop app, older server: the new shell puts the lights at (16, 15), but an older server's app still centers its controls at y=26, 4px below the lights (no overlap or clipping). Avoiding it would need the shell to keep (18, 18) until the app opts in; needs a product decision.

BB-Thread-ID: thr_eigbyjruhs

🤖 Generated with Claude Code

AGENT GENERATED

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T00:55:35.394996Z 57714df PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@brsbl
brsbl added this pull request to stack #5463 October 14, 2026 00:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57714dfc9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +24 to +26
const MACOS_TRAFFIC_LIGHT_POSITION = {
x: MACOS_TRAFFIC_LIGHT_DIAGONAL_INSET,
y: MACOS_TRAFFIC_LIGHT_DIAGONAL_INSET,
x: MACOS_TRAFFIC_LIGHT_INSET_PX,
y: MACOS_TRAFFIC_LIGHT_INSET_PX,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve pre-Tahoe traffic-light geometry

The desktop supports macOS 13 and newer (apps/desktop/README.md:49-50), but this position is now applied to every macOS window without checking the OS version. On macOS 13–15, the native controls retain the smaller pre-Tahoe geometry while the preload unconditionally reports this inset and the renderer assumes 14px lights and 9px gaps, so controls and reserved spacing are calculated for macOS 26 and become misaligned on supported older systems. Select and report the geometry according to the running macOS version.

Useful? React with 👍 / 👎.

@brsbl
brsbl force-pushed the bb/macos-traffic-light-alignment-thr_eigbyjruhs branch 2 times, most recently from 2d0be4a to d5a45b5 Compare October 14, 2026 03:16
@brsbl
brsbl force-pushed the bb/macos-traffic-light-alignment-thr_eigbyjruhs branch 3 times, most recently from 2e28267 to f4514ac Compare October 14, 2026 17:45
@brsbl
brsbl force-pushed the bb/macos-traffic-light-alignment-thr_eigbyjruhs branch 3 times, most recently from 42690c4 to ffc05c2 Compare October 14, 2026 23:35
brsbl and others added 5 commits October 14, 2026 23:35
The title bar assumed pre-Tahoe traffic-light spacing, so on macOS 26 the
Back button sat 6px from the zoom button (#4145) and the controls sat 1px
below the lights' center. The red light was also off the rail icon column.

Move the traffic lights to a 13px inset so the close button sits over the
rail icons, report that inset through the desktop bridge, and derive the
title bar height, control axis, and traffic-light reserves from it. Older
desktop builds that report no inset keep the 18px geometry.

Fixes #4145

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rail icons are now centered 18px from the window edge, so place the
traffic lights 11px in to keep the close button over them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the native compact-toolbar left inset on macOS 26 so the lights clear
the window's rounded corner, and keep the close button over the rail
icons, which are now centered 19px from the window edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every macOS title row centers its window buttons: the compact toolbar
puts them 12px from the left and 13px from the top of a 40px bar. Place
the lights there, report the top inset to the renderer as
macosTrafficLightTopInset, and size the title bar at twice the lights'
center so its 28px controls sit 6px from the window top and the panels.
Older desktop builds that report no top inset keep their diagonal inset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A 40px bar felt tight. Place the lights at (16, 15), the setup ChatGPT's
desktop app uses, so they center at y=22 in a 44px bar with the 28px
title-bar controls 8px from the window top and the panels. With the rail
at 11px padding the red light stays over the rail icons at x=23.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl

brsbl commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #5529 (Compact the macOS app frame and move headers into the title bar), which combines the frame layers (#5458, #5459, #5462) into one PR from main with the frame geometry in one place. Its description carries over this layer's review results, follow-ups and the #5495 merge-order note.

@brsbl brsbl closed this Oct 15, 2026
brsbl added a commit that referenced this pull request Oct 16, 2026
…s into the title bar (#5529)

## Human comments

## What was wrong

On macOS the app frame used more space than its controls needed and was
laid out for pre-Tahoe traffic lights, so Back sat 6px from the lights
(#4145), title-bar icons sat below the lights' center line, and every
page spent an extra 48px header row inside the card.

## What changed

- The window frame is compact: a 44px title bar, a 48px rail and an 8px
frame.
- Page, thread and right-panel headers now sit in the title bar, giving
content 48px more height.
- Title-bar icons line up with the traffic lights and sit 24px apart.
- The right-panel toggle mirrors the red light at the top-right corner.
- Settings and the footer actions mirror the red light at the
bottom-left corner.
- Card corners are 8px, concentric with the window's 16px corner.
- Card edges and split dividers run their full length; the title band is
one color.
- Framed card edges and pane dividers use the `border` token, so panes
stay distinct in dark mode.
- Footer actions use 28px click areas with focus rings drawn inside
them.
- The desktop shell places the lights at (17, 15) and reports both
insets to the app.
- Frame geometry lives in one file,
`packages/desktop-contract/src/macos-window-chrome.ts`.

> **Older desktop apps:** until the desktop app updates, its window
buttons sit 3px below the title-bar icons. Nothing overlaps or loses its
click area.
>
> | Desktop shell | Top-left, marked |
> | --- | --- |
> | Current shell (lights 17, 15) | ![Current
shell](https://github.com/user-attachments/assets/6d6cc5a9-5ef5-4a80-892b-7984723b6408)
|
> | Older shell (lights 18, 18) | ![Older
shell](https://github.com/user-attachments/assets/21be9a8c-8b74-47fa-94c2-7787ac13f7f1)
|

## How you verified

- Remote CI passed on the head.
- Branch desktop dev app on macOS 26.5.2 matched the measured layout at
rest (table below).
- Native light frames read from AppKit: 14×14 at x=17, 40, 63, matching
the 9px gap constant.
- Window corner radius read from AppKit: 16px, the macOS 26 value for
windows without a toolbar.
- DOM drag map: none of the 20 title-bar buttons is a window-drag area;
empty bar stretches are.
- Footer focus rings stay inside their boxes; Settings keeps its full
outset ring.
- Light and dark themes keep the title band one color.
- At 700px the narrow drawer still shows New thread 4px after its
sidebar toggle.
- brsbl passed QA on the final screenshots. Her QA did not cover
dragging or full screen.
- Screenshots draw stand-in traffic lights; native lights need Screen
Recording permission to capture.

### Manual checks still open

- **Full screen** (green light or ⌃⌘F): the lights hide, Back moves to
the left edge, and the bar stays 44px.
- **Window dragging**, thread page, panel closed: drag from left of
Back, between the sidebar toggle and the title, between the thread menu
and the right-side buttons, the right edge, and the strips above and
below the controls.
- **Then click** Back, Forward, the sidebar toggle, the title menu, the
open-in-app buttons and the right-panel toggle; none should move the
window.

<details>
<summary>Measured gaps at rest: main vs this PR (px, 1280×800)</summary>

| Gap | main `c01608d00` | This PR `1f3863b76` |
| --- | --- | --- |
| Lights above / below (to card top) | 18 / 8 | 15 / 15 |
| Title-bar hit boxes above / below | 12 / 0 | 8 / 8 |
| Title-bar glyphs above / below | 22 / 10 | 18 / 18 |
| Lights → Back (hit / glyph) | 6 / 18 | 12 / 24 |
| Between drawn icons (Back→Forward, Forward→sidebar) | 28 / 23.3 | 24 /
24.3 |
| Rail width · rail x · red light x | 44 · 22 · 25 | 48 · 24 · 24 |
| Right toggle icon center to right edge · y | 39 · 26 | 24 · 22 |
| Settings icon center x · from bottom | 22 · 33 | 24 · 22 |
| Footer icons center from bottom · box | 33 · 32×32 | 22 · 28×28 |
| Card corner radius (window 16) | 12 | 8 |
| Window frame right / bottom | 8 / 8 | 8 / 8 |
| Card bottoms (sidebar · thread) | 792 · 792 | 792 · 792 |

</details>

### Before and after

Before: `4363ba27d` (merge base) · After: `df5f51b87` (head) · macOS
desktop dev app, 1280×900 window, captured at 2×, same seeded fixture
and route in each pair.

| Screen / state | Viewport | Before | After |
| --- | --- | --- | --- |
| Thread · panel closed | macOS desktop · 1280×900 | ![Before thread,
panel
closed](https://github.com/user-attachments/assets/186e34d4-5402-4e45-80bd-aaba871d2377)
| ![After thread, panel
closed](https://github.com/user-attachments/assets/cc8eca57-bd47-44c6-ad49-c87c7985d25d)
|
| Thread · panel open | macOS desktop · 1280×900 | ![Before thread,
panel
open](https://github.com/user-attachments/assets/17ca79fa-bb40-48a5-a14c-f54abd44c24c)
| ![After thread, panel
open](https://github.com/user-attachments/assets/5dc85832-3ffa-4c5b-b949-ae9bcd7bed52)
|
| Home | macOS desktop · 1280×900 | ![Before
Home](https://github.com/user-attachments/assets/66a18d29-a0e3-463d-9d33-2c5f6141f49a)
| ![After
Home](https://github.com/user-attachments/assets/63299d84-fc68-45bd-a624-73b9ca0cc30f)
|
| Split view · two threads | macOS desktop · 1280×900 | ![Before split
view](https://github.com/user-attachments/assets/c4e13d40-f397-4930-adf9-a6ca906a1efc)
| ![After split
view](https://github.com/user-attachments/assets/0d519175-b516-4a1d-95cb-8153523a3710)
|

#### Alignment guides

At rest, thread page, panel closed. Pink crosses mark the red light's
center and its mirror at each corner; blue boxes are drawn icons; dashed
orange boxes are click areas; blue curves are the window's 16px corner.

| Corner | Before | After |
| --- | --- | --- |
| Top-left | ![Before
top-left](https://github.com/user-attachments/assets/66bc4cb3-5977-4c4b-931e-c9acb7a723d7)
| ![After
top-left](https://github.com/user-attachments/assets/71727a12-7b53-4530-9db3-6848714bef12)
|
| Top-right | ![Before
top-right](https://github.com/user-attachments/assets/d292255e-c2d1-4aa3-b358-9ba85a7a7667)
| ![After
top-right](https://github.com/user-attachments/assets/86f9eb17-7183-4079-be96-f1fa30faa93a)
|
| Bottom-left | ![Before
bottom-left](https://github.com/user-attachments/assets/e1981a1d-ae7d-42c6-928c-ef439920207e)
| ![After
bottom-left](https://github.com/user-attachments/assets/2b213ff6-4398-4000-9f15-689976142700)
|
| Bottom-right | ![Before
bottom-right](https://github.com/user-attachments/assets/31ca34f5-35a9-46f4-be1b-bf78c059d567)
| ![After
bottom-right](https://github.com/user-attachments/assets/83f032a9-ca6f-4a4b-9c6d-db7b92094c21)
|

#### Dark mode

Split view at `df5f51b87`, dark theme.

![After split view,
dark](https://github.com/user-attachments/assets/37fc7a80-95c2-451d-9896-1496f79f2196)

### Follow-ups (P2, not in this PR)

- **Newer desktop app, older server:** the new shell puts the lights at
(17, 15), while an older server's app centers its controls at y=26, 4px
below the lights (no overlap or clipping). Avoiding it needs the shell
to keep (18, 18) until the app opts in; needs a product decision.
- `MACOS_TITLE_BAR_CONTROL_SIZE_CLASS` sets every button in the band to
the control height, which also stretches the panel tab's close button
(found by code inspection).
- `RootComposePanelCommandHandlers` still accepts an `isOpen` prop that
nothing reads since the title bar's own toggle was removed.
- In macOS full screen with the sidebar collapsed, page and thread
titles start about 91px after the sidebar toggle instead of 12px; the
header reserve is computed for the windowed layout.

Supersedes #5458, #5459 and #5462.

Fixes #4145

BB-Thread-ID: thr_eigbyjruhs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

macOS: sidebar toggle is obstructed by traffic-light controls

1 participant