Repository navigation
feat(desktop-notification): forward mod toasts to native notifications - #10658
Conversation
…s (WIP) Adds a hooks module that hooks ui.toast, raises $.ui.notify with the title desktop-notification, then calls next so the toast still shows. Adds the desktop_notification_forward_toasts_enabled option and widens the Notification matcher to plugin_notification. Not done: the script branch for plugin_notification, README, generated options docs, changelog fragment, check-affected run. Refs: #9703 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…annels The Notification hook now handles plugin_notification when its title is desktop-notification, so a forwarded toast reaches the bell, OSC 9 and OS toast channels; another mod's notification is left alone. Adds the hook test cases, the README section with the probe result, the regenerated options table and a changelog fragment. Refs: #9703 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-review reviewed Incremental review of the changes since 9261dba (5 files). I found nothing to flag.
|
|
claude-security-review reviewed Security review (incremental, since 9261dba): no security findings. critical-findings: 0 What changed and what I read:
manifest description (userConfig No trust control, token scope, kill switch or merge hold is touched. Nothing in the five files matches the trusted-path list. Nothing in this change spends beyond prepaid credit or subscription usage, and nothing starts a billed resource, so no hold is set. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9261dba848
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ff, and state the 2.1.295 floor With all three plugin channels off the settings hook sends nothing, so $.ui.notify was the only alert; the forwarder now returns early. The README notes the preferredNotifChannel alert $.ui.notify also sends. Forwarding needs 2.1.295, the first release with $.ui.notify. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #9703
Summary
Adds a hooks module to
desktop-notification. It hooksui.toastand forwards each toast any mod shows as a native notification, then callsnextso the toast still shows. The optiondesktop_notification_forward_toasts_enabled(on by default) turns forwarding off.A probe ran first (Claude Code 2.1.312, a two-plugin mod test under
claude plugin test). A user-tier mod'sui.toasthook heard toasts from mods at theprepend,userandappendtiers, and its own. The hooks ran in tier order, and toasts from two senders arrived in the order fired. Not probed: toasts Claude Code raises itself, and a live session.Fix
hooks/register.tshooksui.toast. It calls$.ui.notify(text, { title: 'desktop-notification' })without awaiting it and ignores a rejection, then returnsnext(e).hooks.jsonloads the module and widens the Notification matcher toplugin_notification.desktop-notification.shhandles aplugin_notificationonly when its title isdesktop-notification, and sends it through the bell, OSC 9 and OS toast channels. A notification any other mod raises is left alone.plugin.jsongets the new option. The README covers forwarding, the probe result and the 2.1.287 floor, and its options table is regenerated.Verification
claude plugin test plugins/desktop-notification: 5 of 5 pass. One test shows a second plugin's toast reaching the forwarder, which notifies and callsnext. Others show a refused notify still lets the toast show, a mod that echoes notifications as toasts does not loop, and either off switch suppresses forwarding while the toast still shows.hooks/desktop-notification.test.sh: 49 of 49 pass. That includes two new cases: a forwarded toast gets OSC 9, and another mod'splugin_notificationstays silent.scripts/check-affected.sh --uncommitted: 13 passed, 5 skipped.scripts/check-affected.sh --testsover the branch: 14 passed, 2 skipped.Related
Part of #6228.
🤖 Generated with Claude Code