From 020aaab1c677b8bdea2de81e2464f77a787f5d67 Mon Sep 17 00:00:00 2001 From: iliya Date: Sat, 21 Mar 2026 13:44:50 +0200 Subject: [PATCH] feat: enable notification action buttons on Windows (not just macOS) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Electron's 'action' event fires on both macOS and Windows per docs. Removed isMac guard — now Allow/Deny buttons appear on Windows too. Linux excluded (libnotify doesn't fire the 'action' event). --- src/main/services/team/TeamProvisioningService.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index 39bc557f..1f374c75 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -5380,16 +5380,21 @@ export class TeamProvisioningService { if (!ElectronNotification.isSupported()) return; const isMac = process.platform === 'darwin'; + const isLinux = process.platform === 'linux'; const iconPath = isMac ? undefined : getAppIconPath(); const teamLabel = run.request.displayName ?? run.teamName; const body = this.formatToolApprovalBody(approval.toolName, approval.toolInput); + // Actions (Allow/Deny buttons) supported on macOS and Windows. + // Linux libnotify doesn't fire the 'action' event — users get click-to-focus. + const supportsActions = !isLinux; + const notification = new ElectronNotification({ title: `Tool Approval — ${teamLabel}`, body, sound: config.notifications.soundEnabled ? 'default' : undefined, ...(iconPath ? { icon: iconPath } : {}), - ...(isMac + ...(supportsActions ? { actions: [ { type: 'button' as const, text: 'Allow' }, @@ -5417,8 +5422,9 @@ export class TeamProvisioningService { notification.on('close', cleanup); - // macOS action buttons: Allow (index 0) / Deny (index 1) - if (isMac) { + // Action buttons: Allow (index 0) / Deny (index 1) + // 'action' event fires on macOS and Windows (not Linux) + if (supportsActions) { notification.on('action', (_event, index) => { cleanup(); const allow = index === 0;