Skip to content

feat: improve Windows Toast actions support#48132

Merged
jkleinsc merged 3 commits intomainfrom
toast-actions
Feb 12, 2026
Merged

feat: improve Windows Toast actions support#48132
jkleinsc merged 3 commits intomainfrom
toast-actions

Conversation

@codebytere
Copy link
Copy Markdown
Member

@codebytere codebytere commented Aug 20, 2025

Description of Change

Closes #47722
Closes #24524

Extends actions support for Windows Toasts to include buttons, dropdowns, and replies.

TODO:

  • Allow devs to set toast activator CLSID
  • Test selection action functionality
  • Test button action functionality
  • Test reply functionality
  • Update Documentation
  • Localize reply button

Checklist

Release Notes

Notes: Extended actions support for Windows notifications to include buttons, select dropdowns, and replies.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Aug 20, 2025
@codebytere codebytere force-pushed the toast-actions branch 8 times, most recently from 543fb76 to 5398c73 Compare August 21, 2025 13:36
@codebytere codebytere marked this pull request as ready for review August 21, 2025 13:37
@codebytere codebytere added the semver/minor backwards-compatible functionality label Aug 21, 2025
@codebytere codebytere added target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. and removed api-review/requested 🗳 labels Aug 21, 2025
@codebytere codebytere force-pushed the toast-actions branch 6 times, most recently from 7402311 to a7ed12e Compare August 22, 2025 10:02
@codebytere codebytere requested a review from a team August 22, 2025 12:30
@codebytere codebytere force-pushed the toast-actions branch 2 times, most recently from ac4006f to 23c7db6 Compare August 26, 2025 18:04
@bitdisaster
Copy link
Copy Markdown
Contributor

bitdisaster commented Aug 26, 2025

I'm curious about how this gets around the requirement for COM server to implement reply features.
There is also a better API to implement this. We could get rid of all the XML code and get even more features such Video/Mic preview.
https://github.com/microsoft/WindowsAppSDK/blob/main/specs/AppNotifications/AppNotifications-spec.md
Did you test this with a MSIX container? The activation behavior can be different than regular Win#2 apps.

@@ -0,0 +1,414 @@
// Copyright (c) 2025 Microsoft, GmbH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GmbH

Hihi


namespace {

class NotificationActivatorFactory final : public IClassFactory {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe throw in a giant warning here that you'll be using COM macros liberally (you have to!) just so that people who haven't encountered them know what to google for

I feel like many people will see a IFACEMETHODIMP and go "huh?"

void** ppv) override {
if (outer)
return CLASS_E_NOAGGREGATION;
auto activator = Microsoft::WRL::Make<NotificationActivator>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, nice! They really improved things!

base::win::RegKey key(HKEY_CURRENT_USER, key_path.c_str(), KEY_SET_VALUE);
if (!key.Valid())
return;
key.WriteValue(nullptr, L"Electron Notification Activator");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, just wondering if we want this to be app-configurable. I wouldn't know if that is user-visible anywhere though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely not a problem because the the key path includes the CLSID which is unique. But I'm still wondering if there could be a name collision if multiple Electron Apps register the toast activator. Just being paranoid here.

@bitdisaster
Copy link
Copy Markdown
Contributor

API LGTM ✅
Code LGTM ✅
Manual Tested ✅

@jkleinsc jkleinsc merged commit 74fd104 into main Feb 12, 2026
108 of 110 checks passed
@jkleinsc jkleinsc deleted the toast-actions branch February 12, 2026 22:25
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Feb 12, 2026

Release Notes Persisted

Extended actions support for Windows notifications to include buttons, select dropdowns, and replies.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Feb 12, 2026

I was unable to backport this PR to "38-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Feb 12, 2026

I was unable to backport this PR to "39-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/38-x-y needs-manual-bp/39-x-y and removed target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Feb 12, 2026
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Feb 12, 2026

I have automatically backported this PR to "40-x-y", please check out #49786

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Feb 12, 2026

I have automatically backported this PR to "41-x-y", please check out #49787

@trop trop bot added in-flight/41-x-y merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. and removed target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. in-flight/40-x-y in-flight/41-x-y labels Feb 12, 2026
kycutler pushed a commit to kycutler/electron that referenced this pull request Feb 26, 2026
* feat: improve Windows Toast actions support

* fix: ensure MSIX compatibility

* test: add bad clsid format test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. needs-manual-bp/38-x-y needs-manual-bp/39-x-y semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow desktop notifications with buttons Windows Toast notifications activation issues

8 participants