Skip to content
This repository was archived by the owner on Sep 4, 2026. It is now read-only.

fix(macos): keep traffic lights centered through zoom and fullscreen - #403

Merged
ElbertePlinio merged 1 commit into
mainfrom
fix/402-traffic-light-alignment
Aug 3, 2026
Merged

fix(macos): keep traffic lights centered through zoom and fullscreen#403
ElbertePlinio merged 1 commit into
mainfrom
fix/402-traffic-light-alignment

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Jul 31, 2026

Copy link
Copy Markdown
Member

Closes #402

What changed

  • Replaced the static trafficLightPosition override with native macOS positioning driven by window-level AppKit notifications.
  • Keep the native 14pt horizontal inset while centering the standard close/minimize/zoom buttons in the zoomed titlebar height.
  • Protect the fullscreen strip during entry, then realign on the first windowed update during exit so the controls do not snap after the animation.
  • Added a bounded fallback for failed fullscreen transitions and reinstall observers if the main NSWindow is recreated.
  • Apply native geometry after WebView zoom changes and when persisted zoom is restored.
  • Added Rust geometry coverage, TypeScript zoom/IPC coverage, macOS config drift checks, and an AppleScript smoke test for startup, two fullscreen round trips, top-edge resizing, and window-state restoration.

Why

AppKit can reset titlebar container/button frames during resize and fullscreen layout. The previous PR implementation observed replaceable titlebar views and raced AppKit's final layout, so it could become stale and briefly show the default control position during fullscreen exit. The replacement owns placement from the stable NSWindow lifecycle instead.

Validated

  • Live startup, resize, and two fullscreen round trips at 100%, 125%, and 150% interface zoom.
  • AppleScript smoke at 125%: left=13 center=23 both initially and after fullscreen/resizing.
  • Native 60fps fullscreen-exit capture: the previous build showed controls around 31–33px from the window top before jumping to 47px; every post-fix frame with windowed controls visible measured about 46–50px (47.5px target at 125%).
  • bun run build
  • Full Vitest unit suite
  • TypeScript and ESLint/token checks
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --locked --all-targets
  • Simulated non-macOS rustc -D warnings compile for cfg-gated helpers
  • Local correctness/KISS review with all actionable findings resolved

Notes

Local VRT completed 51 functional tests; 34 screenshot assertions could not compare because this checkout has no Darwin baselines, as documented by the repository. Generated local baselines were removed. This change does not modify web layout.

The superseded implementation remains available at backup/pr-403-observer-attempt-20260731.

@ElbertePlinio
ElbertePlinio force-pushed the fix/402-traffic-light-alignment branch from 66dbc12 to a073f49 Compare July 31, 2026 20:15
@ElbertePlinio ElbertePlinio changed the title fix(macos): traffic lights centered in the titlebar at every zoom, owned by native observers fix(macos): keep traffic lights centered through zoom and fullscreen Jul 31, 2026
@ElbertePlinio
ElbertePlinio merged commit a8fb155 into main Aug 3, 2026
6 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/402-traffic-light-alignment branch August 3, 2026 22:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS traffic lights misaligned with the titlebar; fixed native position ignores interface zoom

1 participant