Windows toast activation support#229
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Windows toast activation support for the notifications plugin by registering an out-of-proc COM toast activator (for Action Center / cold-start activation) and wiring it into the existing listener/event system, with configuration provided via tauri.conf.json.
Changes:
- Introduces a Windows COM activator (
INotificationActivationCallback) + class factory registration and a buffer for cold-start click events. - Adds typed plugin configuration (
PluginConfig/WindowsConfig) to carry the toast activator CLSID into Windows initialization. - Updates the demo app to include Windows bundle/manifest configuration and a build helper for generating MSIX-related artifacts.
Reviewed changes
Copilot reviewed 9 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/windows.rs | Registers COM toast activator and buffers/drains cold-start click payloads. |
| src/listeners.rs | Drains buffered Windows click payloads when notificationClicked listener registers. |
| src/lib.rs | Adds typed plugin config and passes Windows config into Windows init. |
| examples/notifications-demo/src-tauri/tauri.conf.json | Adds plugin config for the toast activator CLSID in the demo. |
| examples/notifications-demo/src-tauri/gen/windows/bundle.config.json | Adds Windows bundle/extension config for toast activation in the demo. |
| examples/notifications-demo/src-tauri/gen/windows/AppxManifest.xml.template | Adds a manifest template used by the demo’s Windows bundling flow. |
| examples/notifications-demo/src-tauri/gen/windows/.gitignore | Adds a gitignore placeholder for the demo’s generated Windows files. |
| examples/notifications-demo/pnpm-lock.yaml | Locks new demo dependency used for Windows bundling. |
| examples/notifications-demo/package.json | Adds a Windows bundling build script + dependency for the demo. |
| Cargo.toml | Enables required Windows Win32 APIs and adds windows-core + uuid for COM activator support. |
Files not reviewed (1)
- examples/notifications-demo/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+126
to
+129
| /// Build the activation payload JSON consumed by both the in-process | ||
| /// `ToastNotification.Activated` handler and the COM activator. Kept here so | ||
| /// warm and cold paths emit byte-identical event shapes — the JS side can't | ||
| /// distinguish them. |
Comment on lines
+179
to
+183
| if let Some(plugin) = self.plugin.upgrade() { | ||
| if let Ok(mut buf) = plugin.pending_clicks.write() { | ||
| buf.push(click_payload); | ||
| } | ||
| } |
Comment on lines
+172
to
+173
| if invoked.is_empty() { | ||
| let click_payload = serde_json::json!({ "id": serde_json::Value::Null, "data": {} }); |
Comment on lines
+1
to
+2
| # Generated files | ||
| # Keep bundle.config.json and templates in git |
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.
No description provided.