From e3358840c3333e090540ded30a4e0e249017c066 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 16 Jun 2025 16:58:05 -0500 Subject: [PATCH] Opopadich/issue 1625 (#2904) --- .../settings/app/AppSettingsSection.tsx | 117 ++++++++++++++++++ .../ToolSelectionStrategySection.tsx | 7 +- ui/desktop/src/main.ts | 56 +++++++++ ui/desktop/src/preload.ts | 2 + 4 files changed, 178 insertions(+), 4 deletions(-) diff --git a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx index 8f81fac7..0940aab0 100644 --- a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx +++ b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx @@ -1,5 +1,8 @@ import { useState, useEffect, useRef } from 'react'; import { Switch } from '../../ui/switch'; +import { Button } from '../../ui/button'; +import { Settings } from 'lucide-react'; +import Modal from '../../Modal'; import UpdateSection from './UpdateSection'; import { UPDATES_ENABLED } from '../../../updates'; @@ -12,6 +15,7 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti const [dockIconEnabled, setDockIconEnabled] = useState(true); const [isMacOS, setIsMacOS] = useState(false); const [isDockSwitchDisabled, setIsDockSwitchDisabled] = useState(false); + const [showNotificationModal, setShowNotificationModal] = useState(false); const updateSectionRef = useRef(null); // Check if running on macOS @@ -90,6 +94,38 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti

Configure Goose app

+ {/* Task Notifications */} +
+
+

Notifications

+

+ Notifications are managed by your OS{' - '} + setShowNotificationModal(true)} + > + Configuration guide + +

+
+
+ +
+
+ + {/* Menu Bar */}

Menu Bar Icon

@@ -106,6 +142,7 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
+ {/* Dock Icon */} {isMacOS && (
@@ -157,6 +194,86 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
)}
+ + {/* Notification Instructions Modal */} + {showNotificationModal && ( + setShowNotificationModal(false)} + footer={ + + } + > + {/* Title and Icon */} +
+
+ +
+
+

+ How to Enable Notifications +

+
+
+ + {/* Content */} +
+ {isMacOS ? ( +
+

To enable notifications for Goose on macOS:

+
    +
  1. Click the "Open Settings" button
  2. +
  3. Find "Goose" in the list of applications
  4. +
  5. Click on "Goose" to open its notification settings
  6. +
  7. Toggle "Allow Notifications" to ON
  8. +
  9. Choose your preferred notification style
  10. +
+
+ ) : window.electron.platform === 'win32' ? ( +
+

To enable notifications for Goose on Windows:

+
    +
  1. Click the "Open Settings" button
  2. +
  3. + In the Notifications & actions settings, scroll down to "Get notifications from + these senders" +
  4. +
  5. Find "Goose" in the list of applications
  6. +
  7. Click on "Goose" to expand its notification settings
  8. +
  9. Toggle the main switch to ON to enable notifications
  10. +
  11. Customize notification banners, sounds, and other preferences as desired
  12. +
+
+ ) : ( +
+

To enable notifications for Goose on Linux:

+
    +
  1. Click the "Open Settings" button
  2. +
  3. + In the notification settings panel, look for application-specific settings +
  4. +
  5. Find "Goose" or "Electron" in the list of applications
  6. +
  7. Enable notifications for the application
  8. +
  9. Configure notification preferences such as sound and display options
  10. +
+
+

+ Note: The exact steps may vary depending on your desktop + environment (GNOME, KDE, XFCE, etc.). If the "Open Settings" button doesn't + work, you can manually access notification settings through your system's + settings application. +

+
+
+ )} +
+
+ )} ); } diff --git a/ui/desktop/src/components/settings/tool_selection_strategy/ToolSelectionStrategySection.tsx b/ui/desktop/src/components/settings/tool_selection_strategy/ToolSelectionStrategySection.tsx index c3535dbf..3851805a 100644 --- a/ui/desktop/src/components/settings/tool_selection_strategy/ToolSelectionStrategySection.tsx +++ b/ui/desktop/src/components/settings/tool_selection_strategy/ToolSelectionStrategySection.tsx @@ -15,8 +15,7 @@ export const all_tool_selection_strategies = [ { key: 'vector', label: 'Vector', - description: - 'Filter tools based on vector similarity.', + description: 'Filter tools based on vector similarity.', }, { key: 'llm', @@ -64,8 +63,8 @@ export const ToolSelectionStrategySection = ({

- Configure how Goose selects tools for your requests. Recommended when many extensions are enabled. - Available only with Claude models served on Databricks for now. + Configure how Goose selects tools for your requests. Recommended when many extensions are + enabled. Available only with Claude models served on Databricks for now.

{all_tool_selection_strategies.map((strategy) => ( diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index 630f208b..70666c33 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -796,6 +796,62 @@ ipcMain.handle('get-dock-icon-state', () => { } }); +// Handle opening system notifications preferences +ipcMain.handle('open-notifications-settings', async () => { + try { + if (process.platform === 'darwin') { + spawn('open', ['x-apple.systempreferences:com.apple.preference.notifications']); + return true; + } else if (process.platform === 'win32') { + // Windows: Open notification settings in Settings app + spawn('ms-settings:notifications', { shell: true }); + return true; + } else if (process.platform === 'linux') { + // Linux: Try different desktop environments + // GNOME + try { + spawn('gnome-control-center', ['notifications']); + return true; + } catch (gnomeError) { + console.log('GNOME control center not found, trying other options'); + } + + // KDE Plasma + try { + spawn('systemsettings5', ['kcm_notifications']); + return true; + } catch (kdeError) { + console.log('KDE systemsettings5 not found, trying other options'); + } + + // XFCE + try { + spawn('xfce4-settings-manager', ['--socket-id=notifications']); + return true; + } catch (xfceError) { + console.log('XFCE settings manager not found, trying other options'); + } + + // Fallback: Try to open general settings + try { + spawn('gnome-control-center'); + return true; + } catch (fallbackError) { + console.warn('Could not find a suitable settings application for Linux'); + return false; + } + } else { + console.warn( + `Opening notification settings is not supported on platform: ${process.platform}` + ); + return false; + } + } catch (error) { + console.error('Error opening notification settings:', error); + return false; + } +}); + // Add file/directory selection handler ipcMain.handle('select-file-or-directory', async () => { const result = (await dialog.showOpenDialog({ diff --git a/ui/desktop/src/preload.ts b/ui/desktop/src/preload.ts index d79f68a5..a9321c2b 100644 --- a/ui/desktop/src/preload.ts +++ b/ui/desktop/src/preload.ts @@ -67,6 +67,7 @@ type ElectronAPI = { getMenuBarIconState: () => Promise; setDockIcon: (show: boolean) => Promise; getDockIconState: () => Promise; + openNotificationsSettings: () => Promise; on: ( channel: string, callback: (event: Electron.IpcRendererEvent, ...args: unknown[]) => void @@ -138,6 +139,7 @@ const electronAPI: ElectronAPI = { getMenuBarIconState: () => ipcRenderer.invoke('get-menu-bar-icon-state'), setDockIcon: (show: boolean) => ipcRenderer.invoke('set-dock-icon', show), getDockIconState: () => ipcRenderer.invoke('get-dock-icon-state'), + openNotificationsSettings: () => ipcRenderer.invoke('open-notifications-settings'), on: ( channel: string, callback: (event: Electron.IpcRendererEvent, ...args: unknown[]) => void