Add Windows desktop app menu (#28420)

This commit is contained in:
Luke Parker
2026-05-20 14:28:15 +10:00
committed by GitHub
parent 66d409d679
commit 82c5d45601
14 changed files with 554 additions and 134 deletions
+5
View File
@@ -1,6 +1,7 @@
import { execFile } from "node:child_process"
import { BrowserWindow, Notification, app, clipboard, dialog, ipcMain, shell } from "electron"
import type { IpcMainEvent, IpcMainInvokeEvent } from "electron"
import type { DesktopMenuAction } from "@opencode-ai/app/desktop-menu"
import type {
InitStep,
@@ -10,6 +11,7 @@ import type {
WindowConfig,
WslConfig,
} from "../preload/types"
import { runDesktopMenuAction } from "./desktop-menu-actions"
import { getStore } from "./store"
import { setTitlebar, updateTitlebar } from "./windows"
@@ -198,6 +200,9 @@ export function registerIpcHandlers(deps: Deps) {
if (!win) return
setTitlebar(win, theme)
})
ipcMain.handle("run-desktop-menu-action", (event: IpcMainInvokeEvent, action: DesktopMenuAction) => {
runDesktopMenuAction(BrowserWindow.fromWebContents(event.sender), action)
})
}
export function sendSqliteMigrationProgress(win: BrowserWindow, progress: SqliteMigrationProgress) {