Skip to content

Mark macOS bin icons as template images(fixes dark theme bin icon in right-click menu)#2759

Open
jamesx0416 wants to merge 1 commit into
pingdotgg:mainfrom
jamesx0416:t3code/052f1583
Open

Mark macOS bin icons as template images(fixes dark theme bin icon in right-click menu)#2759
jamesx0416 wants to merge 1 commit into
pingdotgg:mainfrom
jamesx0416:t3code/052f1583

Conversation

@jamesx0416
Copy link
Copy Markdown
Contributor

@jamesx0416 jamesx0416 commented May 19, 2026

What Changed

  • Mark the resized macOS native trash icon used for destructive Electron context menu items as a template image.
  • Add a regression test covering destructive macOS context menu icon creation.

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 menu
appearance.

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:
Screenshot 2026-05-19 at 8 18 23 pm

After:
Screenshot 2026-05-19 at 8 18 12 pm

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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 native trash icon so it can be tinted correctly (e.g., in dark mode).

Adds a regression test that forces process.platform to darwin and 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 in getDestructiveMenuIcon before 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.

- fixes macOS context menu icon rendering
- adds regression coverage
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 71e20aa9-8e95-4cca-bfc9-f44433988f5f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels May 19, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 19, 2026

Approvability

Verdict: 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.

@jamesx0416 jamesx0416 changed the title Mark macOS destructive menu icons as template images Mark macOS bin icons as template images(fixes dark theme bin icon in right-click menu) May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant