Skip to content

fix(tray): stop the macOS menu bar item taking half again the width of its neighbours - #508

Merged
GeiserX merged 1 commit into
mainfrom
fix/tray-width
Nov 2, 2026
Merged

GeiserX merged 1 commit into
mainfrom
fix/tray-width

Conversation

@GeiserX

@GeiserX GeiserX commented Nov 2, 2026

Copy link
Copy Markdown
Owner

akou's menu bar item on macOS was 48 pt wide, with blank space beside the mark, while the items around it are 24 to 40 pt.

The cause is the order in which the SDK builds the status item. It gives the button the file's image, then shrinks that image to 16 pt. The button keeps the width of the first image. Our template is 32 px at the default 72 dpi, so it loads at 32 pt and the item stays sized for that.

Measured with a minimal AppKit program that does the same as the SDK:

Template file Item width
32 px, 72 dpi (shipped until 1.7.4) 48 pt
32 px, 144 dpi (this PR) 32 pt

The fix: scripts/tray-icons.ts writes a pHYs chunk of 144 dpi into the two macOS templates. The same 32 px file now loads at 16 pt, so the item is 32 pt and the mark stays sharp on a Retina display. The Windows and Linux icons are unchanged.

Test: [DK-T1] A wide tray item in tests/shell.test.ts checks both templates load at 16 pt. A PNG with no pHYs is the positive control, and the old icon file fails the test (expected 16, received 32). The trap is in docs/TRAPS.md.

…m is 32 pt, not 48

The SDK gives the status item the file's image and only then shrinks it to 16 pt; the item keeps
the first width. A 32 px template at the default 72 dpi loads at 32 pt, so the idle item was 48 pt
wide with blank space beside the mark. Writing a pHYs chunk of 144 dpi makes the same 32 px file
load at 16 pt: the item is 32 pt and the mark stays sharp on a Retina display.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between d0057e3 and 57f3e9c.

Files ignored due to path filters: 2
  • src/main/window/tray/akou-recording-template.png is excluded by !**/*.png
  • src/main/window/tray/akou-template.png is excluded by !**/*.png
Files selected for processing: 3
  • docs/TRAPS.md
  • scripts/tray-icons.ts
  • tests/shell.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@GeiserX
GeiserX merged commit c9ede0a into main Nov 2, 2026
30 checks passed
@GeiserX
GeiserX deleted the fix/tray-width branch November 2, 2026 19:34
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