feat(desktop): rich context menu — copy link, image, spellcheck

Replaces the hardcoded Copy/Paste/Select All menu with one driven by
ContextMenuParams: link items (Open in Browser, Copy Link Address),
image items (Copy Image, Save Image As), spellcheck suggestions, and
proper Cut/Copy/Paste in editable inputs. Both the main window and
the browser webview menus go through the shared helper.

MarkdownLink (web branch) now wraps its Pressable+Text in a real
<a href> with `display: contents` so Electron exposes linkURL on
right-click. Native branch is untouched.
This commit is contained in:
Mohamed Boudra
2026-05-09 12:24:08 +07:00
parent 511580a47e
commit 650d3148e9
3 changed files with 101 additions and 19 deletions
+2 -4
View File
@@ -23,6 +23,7 @@ import {
setupWindowResizeEvents,
setupDefaultContextMenu,
setupDragDropPrevention,
buildStandardContextMenuItems,
} from "./window/window-manager.js";
import { registerDialogHandlers } from "./features/dialogs.js";
import {
@@ -150,10 +151,7 @@ function showBrowserWebviewContextMenu(
params: Electron.ContextMenuParams,
): void {
const menu = Menu.buildFromTemplate([
{ role: "copy", enabled: params.selectionText.length > 0 },
{ role: "paste" },
{ type: "separator" },
{ role: "selectAll" },
...buildStandardContextMenuItems(contents, params),
...(app.isPackaged
? []
: [