I like using Kagi Assistant for lite research and asking questions. I even installed the PWA (btw there are some warnings about errors in the manifest). But sometimes it takes awhile and I want to switch away to another application.
I would like to see a desktop notification pop up when a Kagi Assistant response finishes and the Kagi Assistant tab is not visible.
I usually have Kagi Assistant in a PWA on my desktop. I see myself switching to another browser window or even another application when I don't feel like waiting for Kagi Assistant and switching back when I see the desktop notification. Likewise I can see other users with Kagi Assistant in a browser tab switching tabs to do something else and then returning when they see the desktop notification.
This is most useful when asking questions that Kagi ends up needing to do a lot of research on. But it's also just nice to be able to do something else while a quick reply is being written and know you can go back right when it's ready.
VSCode Chat does this but I couldn't find any screenshots to share.
For development reference:
- It should be fine if this is just scoped to open tabs. Do not need to go all the way to push notifications and service workers to send notifications in the background. This is just for quick window switching on desktop. If the user cares about a tab on desktop, they leave it open; if it is closed they probably don't care about about when Kagi Assistant replies.
- The Page Visibility API lets you know when the user has switched to another tab or another desktop window is covering up the browser. Use that to only send notifications when people are not already looking at Kagi Assistant.
- The Notifications API lets webpages send native desktop notifications. No clue why MDN says Chrome doesn't support it cause when I try out the demo it works fine in Chrome, Firefox, and Edge and caniuse says its fine. Maybe that's because of mobile Chrome, but that is covered by the app.
It would be best if this was non-intrusive. i.e. Don't spam every user the permissions popup to allow the Notification permission, that's the quickest way to get a permissions block. Here's my recommendation:
- Add a Notification section to the settings panel and on that page explain the use of desktop notifications to the user and give them a big button to opt-in so that users who know they want this can very easily find it and enable it.
- Watch the Page Visibility API and pending status of the assistant locally. If you see a user leave the page while a response is pending and then return (whether it's still pending or finished), THAT is someone who could have use for the desktop notification. So that is when you want to display a popup telling the user Kagi Assistant can send a desktop notification when a reply is finished and give them "enable" / x (a temporary close button) / "don't bother me" options.
- Kagi Assistant does have a bit of UI displayed while a response is pending. If it fits there might be a spot there where an enable notifications button can be put.