From d38f422beea3ce75bd85df7c9b7d9e3fcdc88978 Mon Sep 17 00:00:00 2001 From: Amy Date: Tue, 3 Mar 2026 15:29:25 -0400 Subject: [PATCH] feat: allow copying images from native context menu closes stoatchat/for-web#738 Signed-off-by: Amy --- src/native/window.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/native/window.ts b/src/native/window.ts index 3cc68c8..0813e13 100644 --- a/src/native/window.ts +++ b/src/native/window.ts @@ -147,7 +147,7 @@ export function createMainWindow() { // configure spellchecker context menu mainWindow.webContents.on("context-menu", (_, params) => { const menu = new Menu(); - + if (params.isEditable) { // add all suggestions for (const suggestion of params.dictionarySuggestions) { menu.append( @@ -178,6 +178,15 @@ export function createMainWindow() { click() { config.spellchecker = !config.spellchecker; }, + }), + ); + } + + menu.append( + new MenuItem({ + label: "Copy Image", + visible: params.hasImageContents, + click: () => mainWindow.webContents.copyImageAt(params.x, params.y), }), );