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:
@@ -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
|
||||
? []
|
||||
: [
|
||||
|
||||
Reference in New Issue
Block a user