Mark macOS bin icons as template images(fixes dark theme bin icon in right-click menu)#2759
Mark macOS bin icons as template images(fixes dark theme bin icon in right-click menu)#2759jamesx0416 wants to merge 1 commit into
Conversation
- fixes macOS context menu icon rendering - adds regression coverage
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Approved Single-line change calling a standard Electron API to mark icons as template images on macOS, enabling proper light/dark mode adaptation. The change is purely visual with comprehensive test coverage. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Why
The native trash icon was rendering as a fixed black bitmap in dark mode after being resized. Calling
setTemplateImage(true)lets macOS tint the menu icon correctly for the current menuappearance.
UI Changes
This fixes the dark-mode color of the trash icon shown next to destructive native context menu actions, such as removing a project from the sidebar.
Before:

After:

Checklist
Note
Low Risk
Low risk: macOS-only UI tinting change for a native menu icon plus a targeted regression test; no changes to menu selection logic or data handling.
Overview
Fixes macOS destructive context menu icon rendering by calling
setTemplateImage(true)on the resized nativetrashicon so it can be tinted correctly (e.g., in dark mode).Adds a regression test that forces
process.platformtodarwinand asserts the icon is created, resized, marked as a template image, and passed through to the built menu template.Reviewed by Cursor Bugbot for commit 13d02f6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Mark destructive macOS context menu icons as template images
Calls
setTemplateImage(true)on the resized trash icon ingetDestructiveMenuIconbefore caching it, so macOS renders it correctly in both light and dark menu appearances. A corresponding test in ElectronMenu.test.ts verifies the full icon creation, resize, and template-marking sequence on darwin.Macroscope summarized 13d02f6.