File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
integrations/notifications
webview-ui/src/components/settings Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 11import { execa } from "execa"
22import { platform } from "os"
3+ import * as vscode from "vscode"
34
45interface NotificationOptions {
56 title ?: string
67 subtitle ?: string
78 message : string
9+ force ?: boolean // Force notification even if the window is focused
810}
911
1012async function showMacOSNotification ( options : NotificationOptions ) : Promise < void > {
@@ -65,6 +67,11 @@ async function showLinuxNotification(options: NotificationOptions): Promise<void
6567
6668export async function showSystemNotification ( options : NotificationOptions ) : Promise < void > {
6769 try {
70+ if ( vscode . window . state . focused && ! options . force ) {
71+ // If the window is focused, do not show a notification
72+ return
73+ }
74+
6875 const { title = "Roo Code" , message } = options
6976
7077 if ( ! message ) {
Original file line number Diff line number Diff line change @@ -280,6 +280,7 @@ export interface WebviewMessage {
280280 title ?: string
281281 subtitle ?: string
282282 message : string
283+ force ?: boolean // Force notification even if the window is focused
283284 }
284285}
285286
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export const NotificationSettings = ({
3939 notificationOptions : {
4040 title : t ( "settings.notifications.system.testTitle" ) ,
4141 message : t ( "settings.notifications.system.testMessage" ) ,
42+ force : true ,
4243 } ,
4344 } )
4445 }
You can’t perform that action at this time.
0 commit comments