Repository navigation
Closed
Closed
Copy link
Labels
enhancementNew feature or request
Description
Summary
Add OS-level notifications so users are alerted when a chat response finishes while Askimo is not the focused/foreground application. This should be an opt-in, user-configurable feature (default off), consistent with how other optional features (e.g. voice) are handled in AppConfig.
Motivation
Users often switch away from Askimo while waiting on a long-running chat/agent response (e.g. multi-step agent runs, slow models, RAG queries). Today there's no way to know a response finished without switching back to check - an OS notification would close that gap, similar to Slack/Discord/ChatGPT desktop behavior.
Current behavior
desktop-shared/src/main/kotlin/io/askimo/ui/shell/NotificationComponents.ktonly implements an in-app notification bell/popup — nothing surfaces at the OS level.desktop/src/main/kotlin/io/askimo/desktop/Main.ktowns theWindowState(rememberPersistedWindowState()) but there's no tracking of whether the window currently has OS focus.ChatViewModeldrivesisLoading/isThinkingbut there's noEventBusevent fired specifically on "response completed" that other parts of the app can react to.- There is no existing
expect/actualabstraction in the codebase (checked — none found), so this would be the first cross-platform (desktop/Android) native integration point.
Proposed solution
-
Cross-platform notifier abstraction
- Add
expect object AppNotifier { fun notify(title: String, message: String) }in a shared module. actualimplementation for desktop: Compose DesktopTray/NotificationAPI (orjava.awt.SystemTray/TrayIconas fallback).actualimplementation for android (askimo-app/android):NotificationManagerCompatwith a dedicatedNotificationChannel.
- Add
-
Window focus tracking (desktop)
- Track whether the app window currently has OS focus (e.g. via
WindowFocusListeneron the underlying AWT window, or Compose Desktop's focus APIs) and expose it as state (e.g.isWindowFocused: Boolean) fromapp()inMain.kt.
- Track whether the app window currently has OS focus (e.g. via
-
"Response completed" event
- Emit a new
EventBusevent (e.g.ChatResponseCompletedEvent(sessionId, preview)) fromChatViewModelwhen a chat/agent run finishes, following the existing pattern used forInvalidateCacheEvent,RunCodeEvent, etc.
- Emit a new
-
Wiring
- Add a
LaunchedEffectinapp()that collectsChatResponseCompletedEventand callsAppNotifier.notify(...)only when the window is unfocused and the feature is enabled in settings.
- Add a
-
User-configurable setting
- Add a
notificationsconfig section toAppConfig(shared/src/main/kotlin/io/askimo/core/config/AppConfig.kt), mirroring the existingvoiceconfig block:data class NotificationsConfig( val enabled: Boolean = false, // opt-in, default off val onlyWhenUnfocused: Boolean = true, )
- Surface a toggle in Settings UI (new or existing
SettingsSection), following the same pattern as other feature toggles (e.g.ApplicationPreferences.getShowTokenUsageCard()). - Default to enabled
- Add a
Out of scope (future considerations)
- Notification click-to-focus / deep-linking back to the specific session.
- Per-session or per-agent-run granular notification preferences.
- Notification sound customization.
References
desktop-shared/src/main/kotlin/io/askimo/ui/shell/NotificationComponents.kt(existing in-app notification bell)desktop/src/main/kotlin/io/askimo/desktop/Main.kt(WindowState,app()composable,EventBuscollectors pattern)shared/src/main/kotlin/io/askimo/core/config/AppConfig.kt(voiceconfig block as a reference pattern for opt-in features)io.askimo.core.event.EventBus
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
[-]dd OS-level notifications when a long chat response finishes while app is unfocused[/-][+]Add OS-level notifications when a long chat response finishes while app is unfocused[/+]