Skip to content

Commit 3c0b3f9

Browse files
authored
Merge pull request #3387 from Kilo-Org/kevinvandijk/notification-types
Add support for notifications per app
2 parents 98c4d89 + 7dfc96b commit 3c0b3f9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

cli/src/state/atoms/notifications.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface KilocodeNotification {
1111
actionText: string
1212
actionURL: string
1313
}
14+
showIn?: string[]
1415
}
1516

1617
/**

cli/src/utils/notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function fetchKilocodeNotifications({
5252

5353
const { notifications } = (await response.json()) as NotificationsResponse
5454

55-
return notifications
55+
return notifications.filter(({ showIn }) => !showIn || showIn.includes("cli"))
5656
}
5757

5858
/**

src/core/kilocode/webview/webviewMessageHandlerUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ export const fetchKilocodeNotificationsHandler = async (provider: ClineProvider)
111111
(notification: any) =>
112112
!dismissedIds.includes(notification.id) &&
113113
!shownNativeNotificationIds.has(notification.id) &&
114-
notification.showAsNative === true,
114+
(notification.showIn ?? []).includes("extension-native"),
115115
)
116116

117117
provider.postMessageToWebview({
118118
type: "kilocodeNotificationsResponse",
119119
notifications: (response.data?.notifications || []).filter(
120-
(notification: any) => notification.showAsNative !== true,
120+
({ showIn }: { showIn?: string[] }) => !showIn || showIn.includes("extension"),
121121
),
122122
})
123123

0 commit comments

Comments
 (0)