Align titlebar accessory hints
Merged
AZ
4mo ago+69+69+01234567890123456789-77-77-01234567890123456789
Summary
Align the titlebar shortcut hint pills, titlebar icons, and accessory button hit targets to the same center X.
Root cause: the shortcut hint overlay positioned pills by right-edge spacer math, while the visible accessory buttons and hidden AppKit hit layer used separate leading offsets. The titlebar accessory host also reapplied traffic-light spacing that AppKit had already handled.
Validation
./scripts/reload.sh --tag titlebarx --swift-frontend-workaround- Dogfooded tagged build
titlebarxvisually against the misaligned top-left titlebar accessory controls.
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.
Summary by cubic
Aligns titlebar shortcut hint pills, accessory icons, and hidden hit regions to the same center X for crisp visuals and correct click targets. Removes duplicate traffic‑light spacing and ad‑hoc offsets for a consistent layout.
- Bug Fixes
- Center each hint pill over its button using a shared centerX; remove right-edge planner and safety/base X shifts.
- Use
HeaderChromeControlMetrics.titlebarControlsLeadingPaddingfor both visible controls and hit regions. - Stop double-applying traffic-light spacing; rely on AppKit’s traffic-light position.
- Set default titlebar hint X offset to 0; update content widths (classic 136, compact 126) and tests to match.
Summary by CodeRabbit
Release Notes
-
Bug Fixes
- Improved titlebar shortcut hint positioning and alignment with toolbar controls for more consistent visual layout
-
Chores
- Refactored internal layout metrics system for better consistency and maintainability