fix(desktop): show icons in thread context menus #10504
main fromrefs/pull/10504/head·opened View on GitHubThread context-menu items already carry icon keywords for the web fallback, but the desktop Electron menu dropped them during normalization, so native macOS context menus rendered text-only. This maps those keywords to SF Symbols via nativeImage.createMenuSymbol (Electron 44) and attaches them to top-level actions and nested submenu items.
ElectronMenupreservesiconwhile normalizing items, resolves each keyword through a cached SF Symbol map, and keeps the existingtrashnamed-image fallback for destructive items without a recognized icon. Non-macOS platforms are unchanged.- Snooze presets get
clockicons so every thread action and submenu entry has an icon. ContextMenuItem.iconcontract comment updated: icons are resolved per client menu implementation rather than stripped on desktop.
After (real native menu in the dev desktop client, invoked through desktopBridge.showContextMenu):
![]()
Before media could not be captured: the host session was locked, so native window backing stores rendered blank. The before state is the same menu with no icon column — icons were stripped entirely except the destructive trash fallback.
Verification:
vp test run apps/desktop/src/electron/ElectronMenu.test.ts apps/web/src/components/threadActionMenu.logic.test.ts— 20 tests pass- Targeted lint, format, and typecheck on touched packages — clean
- Independent review: gpt-5.6-sol (codex-review skill, read-only) — no actionable findings
Model: swe-2-high (T3 Code, Cursor harness)
Coordination trace: T3 thread 9477becb-828f-4860-ba3c-f658bcaa838f
Summary by CodeRabbit#
- Enhancements
- Improved context-menu icon support on macOS with SF Symbols, including trash icons for destructive actions and submenu items.
- Added icons to snooze presets and custom snooze actions for more consistent thread menus.
- Documentation
- Clarified how context-menu icon keywords are resolved across clients.
- Tests
- Added coverage for macOS menu-symbol behavior and icons across thread actions and submenu options.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
94020820-abc8-4c86-b92f-8b3ee5ca75d5📥 Commits
Reviewing files that changed from the base of the PR and between e52258554c0caee3fd47a5e0c16b09fdc244a26d and c1410e38c510faad4f6214a0c1ce3aed09960907.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
apps/web/src/components/threadActionMenu.logic.test.tsapps/web/src/components/threadActionMenu.logic.tspackages/contracts/src/ipc.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/contracts/src/ipc.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough#
Context menu items now retain icon names across clients. Web snooze presets include
clockandpencilicons. macOS menus map supported names to cached SF Symbols and usetrashfor destructive items without explicit icons.Changes#
Context menu icon resolution
Layer / File(s) Summary Menu icon data contract and producers
packages/contracts/src/ipc.ts,apps/web/src/components/threadActionMenu.logic.ts,apps/web/src/components/threadActionMenu.logic.test.tsThe ContextMenuItem.icondocumentation assigns resolution to each client. Snooze preset items includeclock, and the custom item includespencil. Tests verify icons on nested thread actions.macOS symbol resolution and menu integration
apps/desktop/src/electron/ElectronMenu.ts,apps/desktop/src/electron/ElectronMenu.test.tsDesktop menus preserve icon names, map supported names to macOS SF Symbols, cache createMenuSymbolresults, and usetrashfor destructive items without explicit icons. Tests cover nested symbols and destructive fallback.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)#
sequenceDiagram participant ThreadActionMenu participant ElectronMenu participant nativeImage ThreadActionMenu->>ElectronMenu: Provide items with icon names ElectronMenu->>ElectronMenu: Map names to SF Symbols ElectronMenu->>nativeImage: Call createMenuSymbol nativeImage-->>ElectronMenu: Return native icon ElectronMenu-->>ThreadActionMenu: Build menu template with iconsSuggested reviewers:
maria-rcks,juliusmarmingeMerge Risk: ⚪ Minimal · up to
c1410The change preserves context-menu icons across web and macOS desktop paths without an identified user-facing regression.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
Check name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (4 passed)
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: showing icons in desktop thread context menus. Description check ✅ Passed The description explains what changed, why it changed, the UI result, verification steps, and platform behavior. It does not use the template headings or include the checklist, but the required inform… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. - Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Comment `@coderabbitai help` to get the list of available commands.Friendly review nudge @juliusmarminge @maria-rcks — this is mergeable and hasn't had a maintainer pass yet. Independent bot/agent reviews have run with findings triaged in-commit (see receipts in earlier comments). Full queue context and status: #10688.
too many tests
@juliusmarminge done — consolidated the two new ElectronMenu tests into one (
maps icon keywords to macOS menu symbols and keeps the trash fallback), so the test file grows by a single case instead of two. Kept the small invariant test inthreadActionMenu.logic.test.tssince it guards the regression this PR fixes (a new action or submenu item without aniconsilently renders iconless in native menus).Heads-up on the
Release Smokefailure — it's unrelated to this diff (no dependency or manifest changes here).expo-audio@57.0.5was published to npm ~26h ago, so the~57.0.4range inapps/mobilenow resolves past the pinnedpatchedDependenciesentry whenscripts/release-smoke.tsregenerates the lockfile, producingERR_PNPM_UNUSED_PATCH. It's failing identically on other open PRs right now (e.g.fix/prperf-14-filecache). Reproduced locally from unmodifiedorigin/mainmanifests. Should clear once the patch pin is bumped on main, or this can be re-run after that lands.Bugbot is paused — on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
julius wants us to use native as much as possible on the app, so closing this
maria-rcks closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
c1410e3Macroscope's review found this PR approvable — This is a contained context-menu presentation fix: macOS native menus now resolve existing icon keywords, while non-macOS behavior and menu actions remain unchanged. The added coverage verifies native symbol mapping, nested submenu icons, fallback behavior, and complete thread-menu icon metadata.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).