Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): show icons in thread context menus #10504

Closedsaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/10504/headopened View on GitHub

Thread 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.

  • ElectronMenu preserves icon while normalizing items, resolves each keyword through a cached SF Symbol map, and keeps the existing trash named-image fallback for destructive items without a recognized icon. Non-macOS platforms are unchanged.
  • Snooze presets get clock icons so every thread action and submenu entry has an icon.
  • ContextMenuItem.icon contract 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):

native thread context menu with icons

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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at c1410e3

      Macroscope'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).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review Change StackReview Change Stack

      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.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (3)
      • apps/web/src/components/threadActionMenu.logic.test.ts
      • apps/web/src/components/threadActionMenu.logic.ts
      • packages/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 clock and pencil icons. macOS menus map supported names to cached SF Symbols and use trash for 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.ts
      The ContextMenuItem.icon documentation assigns resolution to each client. Snooze preset items include clock, and the custom item includes pencil. 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.ts
      Desktop menus preserve icon names, map supported names to macOS SF Symbols, cache createMenuSymbol results, and use trash for 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 icons

      Suggested reviewers: maria-rcks, juliusmarminge

      Merge Risk: ⚪ Minimal · up to c1410

      The 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 nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main change: showing icons in desktop thread context menus.
      Description check✅ PassedThe 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✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck 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.
    4. 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.

    5. too many tests

    6. @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 in threadActionMenu.logic.test.ts since it guards the regression this PR fixes (a new action or submenu item without an icon silently renders iconless in native menus).

    7. Heads-up on the Release Smoke failure — it's unrelated to this diff (no dependency or manifest changes here). expo-audio@57.0.5 was published to npm ~26h ago, so the ~57.0.4 range in apps/mobile now resolves past the pinned patchedDependencies entry when scripts/release-smoke.ts regenerates the lockfile, producing ERR_PNPM_UNUSED_PATCH. It's failing identically on other open PRs right now (e.g. fix/prperf-14-filecache). Reproduced locally from unmodified origin/main manifests. Should clear once the patch pin is bumped on main, or this can be re-run after that lands.

    8. 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.

    9. julius wants us to use native as much as possible on the app, so closing this

    10. maria-rcks closed this

Sign in to join this conversation.