Skip to content

fix(desktop): Mac window buttons stay centred in the header at every zoom - #2491

Merged
arul28 merged 3 commits into
mainfrom
worktree-crisp-plum-inlet
Nov 25, 2026
Merged

arul28 merged 3 commits into
mainfrom
worktree-crisp-plum-inlet

Conversation

@arul28

@arul28 arul28 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Why

On the Mac, zooming ADE in or out (Cmd +/-) resizes the header, but the window's close/minimize/zoom buttons stayed pinned where they were. At 70% they hung below the header into the banner. At 150% they sat at the top of a much taller header, out of line with the logo and tabs.

What changed

The three buttons now move with zoom, so they stay centred in the header at every level from 70% to 150%. macOS draws them at a fixed size and nothing can scale them, so only their position changes. The gap between the buttons and the logo was already kept constant across zoom levels and is unchanged.

At 100% the buttons sit 1 point higher than before: the old spot was about 1.4 points below the header's centre.

Windows and Linux are unchanged. On Windows the same zoom message already resized the title-bar strip; macOS now reuses that message to move the buttons.

Traffic lights before (left) and after (right) at 70%, 100%, 150% zoom

proof-2.mp4

Evidence

  • Ran the dev app on macOS and captured the window at 70/80/100/120/150%, both after a reload (startup path) and by stepping the app's own zoom in/out functions live.
  • npm --prefix apps/desktop run typecheck and lint:ci: pass, no ade-ui warnings in touched files.
  • /quality: 3 Low maintainability findings, all fixed; no correctness findings; gate empty.
  • /test: removed windowAppearance.test.ts, which only pinned pixel sizes, colours and constants; no new test, since window-button placement isn't a critical path. Docs updated (ARCHITECTURE.md, the Windows port doc).
  • CI green on the first push; Greptile, CodeRabbit, Bugbot and Devin finished with no open findings.

Not checked

  • Fullscreen: the buttons are hidden there, so I didn't check it.
  • Windows: that path is unchanged, so the native Windows CI job didn't run.

Authored with Claude Opus 5.5 via Claude Code.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

macOS window buttons now follow renderer zoom and stay centred in the header. Windows keeps its existing behavior.

  • macOS window buttons stay centred in the header at every zoom level.

Reviews (2) · Last reviewed commit: "test: drop window chrome pixel pins; doc..." · Reviewed by Greptile

Summary by CodeRabbit

  • New Features
    • macOS traffic-light controls now stay centered in the header as you change display zoom.
    • Title-bar controls now synchronize with display zoom on both macOS and Windows.
  • Bug Fixes
    • macOS title-bar positioning now accounts for zoom, with a safe fallback for invalid zoom settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Devin Review: 3 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds zoom-based positioning for macOS traffic lights and extends title-bar synchronization to macOS. Renderer call sites use the renamed native syncer. Windows title-bar behavior remains supported.

Changes: Native title bar zoom synchronization

Layer / File(s) Summary
Calculate macOS traffic-light position
apps/desktop/src/main/windowAppearance.ts, apps/desktop/src/main/windowAppearance.test.ts
A helper calculates the macOS traffic-light position from the zoom factor. Window creation uses the helper with the default zoom factor. The former window appearance tests are removed.
Route zoom synchronization to native title bars
apps/desktop/src/main/main.ts, apps/desktop/src/renderer/lib/windowControlsOverlay.ts, apps/desktop/src/renderer/components/app/AppShell.tsx, apps/desktop/src/renderer/components/app/ThemeDocumentSync.tsx, apps/desktop/src/renderer/lib/appZoom.ts, apps/desktop/src/preload/preload.ts
The renderer syncer supports Windows and macOS, and its call sites use syncNativeTitleBar. The main-process handler applies the calculated macOS position for numeric zoom factors. The preload documentation describes the Windows and macOS behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: desktop, docs

Suggested reviewers: nsxdavid

Merge Risk: Minimal · up to ee9cb · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the primary change: on macOS, window buttons stay centred in the header at every zoom level. The raw summary shows a new macTrafficLightPosition function that recomputes traffic-light…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the primary change: on macOS, window buttons stay centred in the header at every zoom level. The raw summary shows a new macTrafficLightPosition function that recomputes traffic-light coordinates from the zoom-scaled header height, and the renderer sync now runs on darwin. The title names the same change, so it is related and specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/desktop/src/main/windowAppearance.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

YAMLException: Cannot read config file: /apps/desktop/eslint.config.mjs
Error: end of the stream or a document separator is expected (8:12)

5 |
6 | export default [
7 | {
8 | ignores: [
----------------^
9 | "dist/",
10 | "release/
",
at generateError (/apps/desktop/node_modules/js-yaml/lib/loader.js:199:10)
at throwError (/apps/desktop/node_modules/js-yaml/lib/loader.js:203:9)
at readDocument (/apps/desktop/node_modules/js-yaml/lib/loader.js:1651:5)
at loadDocuments (/apps/desktop/node_modules/js-yaml/lib/loader.js:1694:5)
at Object.load (/apps/desktop/node_modules/js-yaml/lib/loader.js:1720:19)
at loadLegacyConfigFile (/apps/desktop/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2565:21)
at loadConfigFile (/apps/desktop/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2680:20)
at ConfigArrayFactory._loadConfigData (/apps/desktop/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2984:42)
at ConfigArrayFactory.loadFile (/apps/desktop/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2850:40)
at createCLIConfigArray (/apps/desktop/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3660:35)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 43c3aa6 and ee9cbc3.

Files ignored due to path filters: 2

  • docs/ARCHITECTURE.md is excluded by !docs/**
  • docs/development/windows-port-lane.md is excluded by !docs/**
Files selected for processing: 2

  • apps/desktop/src/main/windowAppearance.test.ts
  • apps/desktop/src/main/windowAppearance.ts
Files with no reviewable changes: 1

  • apps/desktop/src/main/windowAppearance.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

arul28 and others added 2 commits November 24, 2026 22:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arul28
arul28 merged commit ac88db1 into main Nov 25, 2026
28 checks passed
@arul28
arul28 deleted the worktree-crisp-plum-inlet branch November 25, 2026 01:48
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