Add opt-in desktop notifications for finished and waiting sessions - #62
Open
emircan-sahin wants to merge 5 commits into
Open
Add opt-in desktop notifications for finished and waiting sessions#62emircan-sahin wants to merge 5 commits into
emircan-sahin wants to merge 5 commits into
Conversation
Contributor
Author
|
I think everyone's going to love this feature. I was using cmux purely for the notifications, now MonoCode will have that too 🙈 |
Owner
|
Thanks for the PR @emircan-sahin. Before merging, could you address these issues:
|
Contributor
Author
|
Thanks for the review, all four addressed in 93604cf:
|
The linker's ad-hoc signature carries a monocode-<hash> identifier while Info.plist says com.monocode.desktop. UNUserNotificationCenter refuses authorization without prompting when the two disagree, so tauri dev could never show a notification. Copy the binary instead of hard-linking it, since re-signing rewrites the file the running process was linked to.
Off by default. When on, a system notification appears when a turn ends or an agent waits on an approval or question in a session that is not on screen, whether MonoCode is in the background or another session is open. Clicking it, or its Show button, focuses the window and opens the session. macOS goes through UNUserNotificationCenter directly: the app already links it for the Dock badge, it reports the real authorization state, and the Settings row offers a System Settings link when alerts are blocked. Linux uses notify-rust over the freedesktop bus. The Sounds setting decides whether the notification carries a sound; the in-app cue is skipped when a banner fires so nothing chimes twice.
…, keep cue on failed dispatch - macOS no longer requests badge-only authorization at startup while the prompt is undecided; the Notifications toggle owns the one-time dialog. - Linux registers the "default" action so servers report the click, and escapes notification bodies since agent output is rendered as markup. - The in-app turn-finished cue is skipped only after the OS accepted the notification, not on dispatch.
emircan-sahin
force-pushed
the
feat/desktop-notifications
branch
from
September 4, 2026 16:32
93604cf to
aa20395
Compare
Clippy's items_after_test_module lint fails CI on Linux with -D warnings.
Owner
|
Thanks @emircan-sahin, the permission flow and Linux issues look fixed. One remaining issue: macOS show_notification returns success before its authorization and scheduling callbacks complete, so the frontend can still suppress the completion cue when no notification was delivered. Could the command await the actual scheduling result before returning success? |
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.
What changed
A Notifications toggle in Settings, off by default. When on, a system notification appears when a turn finishes or an agent waits on an approval or question in a session that is not on screen, whether MonoCode is in the background or another session is open. Clicking the banner or its Show button focuses the window and opens that session.
UNUserNotificationCenterdirectly (already linked for the Dock badge): real permission state, aShowaction category, and a delegate that presents banners while the app is frontmost and routes clicks back to the session. When alerts are blocked, the Settings row shows "Permission needed" with an Open System Settings button that deep-links to MonoCode's notification page.notify-rustover the freedesktop bus; no permission model there. Other platforms reportunsupportedand the toggle says so.MonoCode, subtitle is the session title, body is the first paragraph of the reply (or the pending approval / question).Also fixes
tauri devon macOS: the dev bundle is now ad-hoc signed withcom.monocode.desktop. The linker's signature carried amonocode-<hash>identifier, andUNUserNotificationCenterrefuses authorization without prompting when that disagrees withCFBundleIdentifier. The binary is copied instead of hard-linked because re-signing rewrites the file the running process was linked to.Why
Sessions often finish or stall while you are in another app or another tab. Sounds already cover the first case; a clickable banner covers the second and gets you back to the right session in one click.
UI
New Settings row under Sounds: "Notifications" toggle, with "Permission needed · Open System Settings" beside it when macOS has alerts blocked.
Checklist
npm run check(the twogit_stash_*Rust tests fail onmainfor me too, unrelated)