feat: add OS notifications for completed/failed tasks#976
feat: add OS notifications for completed/failed tasks#976yehyal wants to merge 10 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
apps/web/src/routes/__root.tsx
Outdated
| const previous = lastSessionByThreadRef.current.get(thread.id); | ||
|
|
||
| // A completed/failed turn transitions from running with an activeTurnId | ||
| // to a session with no active turn and status ready/error. |
There was a problem hiding this comment.
should also notify on input/approval requested?
also maybe have the setting be more configurable than a boolean flag so users can set more granular levels of when they wanna be notified
There was a problem hiding this comment.
I wanted to push out a mvp first for just task status notification, but I can definitely work on adding it for input/approval
can you give me a bit more info regarding fine tuning the notifications? some example scenarios / levels that you want to add
There was a problem hiding this comment.
I will proceed with the first style, to match the current option styling like with the theme



Summary
Adds OS notifications when a task completes or fails, with a user-facing toggle and a settings test button.
Why
Addresses issue
Notifications are important for backgrounded work. This keeps users in the loop without requiring the app to stay focused.
What Changed
off,important,normal,verbose) to control when OS alerts fire.task.started,task.progress)Levels are easy to extend by adding new activity kinds or mapping logic in
nativeNotifications.ts.Screenshots / Video
t3code-preview-notification.mp4
Notes
Note
Add OS notifications for completed and failed tasks
notificationLevelsetting (Off,Important,Normal,Verbose) toAppSettingsSchema, defaulting toNormal.nativeNotifications.tsto detect background state, check/request permission, show notifications, and resolve notification payloads for turn completions and attention-requiring activities.__root.tsx: when the app is backgrounded, each thread snapshot triggers completion/failure and attention notifications per the user's level, with per-thread deduplication._chat.settings.tsxwhere users can set verbosity, request browser permission, and send a test notification.desktopBridge/nativeApi), notifications are shown regardless of browser permission state.Macroscope summarized a6d5943.