fix(menubar): realign tray icon geometry#49
Conversation
The old tray glyph placed a lock badge outside the keyboard shape, which pulled the optical center low in the macOS menu bar. Replace it with a centered keyhole panel so both states share the same frame and alignment. Update the generator to write directly into the asset catalog and regenerate the template PNGs from that source of truth. Closes #47 Signed-off-by: Kevin Cui <bh@bugs.cc>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
WalkthroughThis change updates the menu bar app comment to describe centered template glyph tinting, and rewrites the tray icon generator to render a centered rounded panel with a keyhole glyph for locked and unlocked states. The script now maps outputs to Related issues: Suggested labels: enhancement, design Suggested reviewers: none identified 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/icon-tools/MakeTrayIcon.swift`:
- Around line 133-142: The write step in MakeTrayIcon’s state/scale loop is
swallowing failures via try?, which can incorrectly print a success message
after a failed output write. Update the png.write(to:) call to handle the thrown
error explicitly in this generator flow, and log the failure to stderr using the
same print-based error reporting pattern used by the other icon-tools CLI code
(for example, by referencing outputURL(for:scale:) and the existing “wrote” log
path). Only emit the success message after a successful write, so a missing
directory or permission error is surfaced instead of discarded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 24706263-ce6e-4a03-9a51-7509e97ba133
⛔ Files ignored due to path filters (4)
Sources/LockIME/Assets.xcassets/TrayLocked.imageset/tray-locked.pngis excluded by!**/*.pngSources/LockIME/Assets.xcassets/TrayLocked.imageset/tray-locked@2x.pngis excluded by!**/*.pngSources/LockIME/Assets.xcassets/TrayUnlocked.imageset/tray-unlocked.pngis excluded by!**/*.pngSources/LockIME/Assets.xcassets/TrayUnlocked.imageset/tray-unlocked@2x.pngis excluded by!**/*.png
📒 Files selected for processing (2)
Sources/LockIME/LockIMEApp.swiftscripts/icon-tools/MakeTrayIcon.swift
Signed-off-by: Kevin Cui <bh@bugs.cc>
LockIME's previous tray glyph used a keyboard with an external lock badge, which made the icon sit lower than neighboring macOS menu bar items. This replaces the composition with a centered keyhole panel: locked and unlocked now share the same frame and differ only in the keyhole fill, so state changes keep the same optical alignment.
The tray icon generator now writes directly into the asset catalog and regenerates the template PNGs from that source of truth.
Closes #47