[Feat] Add native OS notifications for background task events#157
Merged
[Feat] Add native OS notifications for background task events#157
Conversation
Contributor
|
Hi @samzong, DetailsInstructions for interacting with me using comments are available here. |
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add native OS notifications via Electron
NotificationAPI so users don't miss task completions and approval requests when the app is backgrounded or minimized.Type of change
[Feat]new featureWhy is this needed?
When ClawWork is minimized or unfocused, users have no way to know a task finished or an approval is pending. The existing in-app
sonnertoasts are invisible when the window isn't visible. The tray icon updates status but never pushes OS-level alerts.What changed?
notifications.tsservice in main process wrapping ElectronNotificationwithisDestroyed/isMinimizedguards matching the tray patternnotification-handlers.tsIPC handler (notification:send) registered alongside existing handlerssendNotification(invoke) +onNotificationNavigateTask(event listener)maybeNotify()helper inuseGatewayDispatcher— async settings check with.catch(), called at three event points: task completion (state === 'final'), approval request (exec.approval.requested), gateway disconnectnavigateToTaskcallback inApp.tsxfor both tray and notification click-to-navigateNotificationConfigadded toAppConfigandAppSettingswith three boolean toggles (all default to enabled via!== false)GeneralSectionusing existingToggle+SettingRowcomponentsen.jsonandzh.jsonArchitecture impact
notification:send(invoke) andnotification:navigate-task(event from main to renderer). Follows the same pattern as existing tray IPC channels.docs/architecture-invariants.md: none. Message persistence is not affected — notifications are fire-and-forget side effects triggered afterfinalizeStream, not part of the write path.Linked issues
N/A
Validation
pnpm lintpnpm testpnpm buildCommands, screenshots, or notes:
Screenshots or recordings
Settings UI adds a "Notifications" card below "General" with three toggles:
Release note
NONE.Checklist
[Feat],[Fix],[UI],[Docs],[Refactor],[Build], or[Chore]