Skip to content

Add native right-click context menus (copy/paste, spellcheck, links, images) #795

Description

@hrsvrn

Problem

Right-click does almost nothing in the app today. Electron doesn't provide context menus by default — apps must wire them up themselves, and we currently don't. Concretely:

  • No Cut/Copy/Paste menu in text inputs, including the chat composer
  • No "Copy" on selected text in emails, chat messages, or notes
  • No spell-check suggestions (Chromium's spellchecker is on, but suggestions only surface via a context menu)
  • No "Copy Link Address" on links, no "Save Image" on images
  • No context menu in the embedded browser pane

The only right-click menus that exist are custom in-app (Radix UI) menus on a few list rows — chat history entries, notes, knowledge items, workspace files — plus the tray icon menu. Those should keep working as-is.

Suggested approach

Use the electron-context-menu package — it provides editing, spellcheck, link, and image menus out of the box:

  1. cd apps/x/apps/main && pnpm add electron-context-menu
  2. Initialize it in the main process (apps/x/apps/main/src/main.ts); esbuild bundles the dependency automatically
  3. Make sure it also attaches to the browser pane's WebContentsView, not just the main window
  4. Check it doesn't fight the existing custom Radix menus — the native menu naturally only shows for editable fields, selected text, links, and images, which shouldn't overlap with the list-row menus

Acceptance criteria

  • Right-click in a text input shows Cut/Copy/Paste (and spellcheck suggestions on a misspelled word)
  • Right-click on selected text anywhere shows Copy
  • Right-click on a link/image in the browser pane offers Copy Link / Save Image
  • Existing custom right-click menus (chat history, notes, etc.) still work

Dev setup is in CLAUDE.md / READMEcd apps/x && pnpm install && npm run dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions