feat(plugins): notifications with command buttons (#1974)

Adds API 1.3 `ui.notify(level, title, body, actions) -> result<_, error>`: up to three buttons, each running one of the plugin's declared commands with an optional argument in the balloon's window and dismissing the balloon. An invalid action or an undeclared command fails the call and shows nothing. The plugin `Notification` event carries the actions; SDK `host::notify_with_actions` and `NotificationAction`. Closes #1955.

Co-authored-by: arnaud-ritti <[email protected]>
Цей коміт міститься в:
Arnaud Ritti authored and GitHub committed 2026-11-07 22:35:36 +08:00
1 джерело f3837e0fe7
коміт 112ed773fb
43 files changed
+419 -39

No files matched your search

+10
Переглянути файл
@@ -1268,3 +1268,13 @@ reused as usual, and the normal trust prompt and unsaved-change guard apply.
The call acknowledges the request; cancellation or opening errors are handled by
the window. Neither API needs a capability. Paths belong to the UI machine,
including when plugin code runs on a remote host.
### Notifications with commands
`host::notify_with_actions(level, title, body, actions)` shows up to three
buttons. Build each with `NotificationAction::new(label, command)` and an
optional `.argument(text)`. Commands must be declared by that plugin; choosing
one dismisses the balloon and runs the command in the receiving window with
its normal editor and project context. No capability is needed. Invalid or
undeclared actions reject the whole notification. Labels are limited to 256
bytes and arguments to 64 KiB. Plain `host::notify` behaves as before.
+1 -1
Переглянути файл
@@ -1 +1 @@
2d93f4f7eb0529528591ac1b7057a02cae7ed978eb21fe2be2f188529560b972
2c583e91b023c13c13f59dc4e332c7c68296485da3d6febc0648811306e6d136
+1 -1
Переглянути файл
@@ -1 +1 @@
af52d666db0224b43e19193d90331d54c9645ebd63c183ede65abc5666c15fd7
ce627cd77f3e27c1f3dcac9ec8c5470a349a937730db3fee4a2cb327cfa399a1
+1 -1
Переглянути файл
@@ -1 +1 @@
a5bcffff3f4bb1c01840bd7b16d5e90908b293ef7676ffd81264a2fa850f91c7
976bb84b7ea7e3c3de84ba51a2e7173334fe7a8b316cd1fb8e3e82b51800bf41
+1 -1
Переглянути файл
@@ -1 +1 @@
d20a458237ecdd0d34de2be8e4df527f2ed647627b784bf5df1206e18beba2b1
89c9e4cc9d455190d33139651388013f127752b196a29715b651f77b4d629ee5
+1 -1
Переглянути файл
@@ -1 +1 @@
d9b33e747442c539541778b2a907fc02226e9af120962d4f384820b76674d40a
b0ce44f054cb3481cede4bf77a57a3254bf67627cbe617c59632185c20fb687c
+1 -1
Переглянути файл
@@ -1 +1 @@
b8c276a0d40a1615a658dc643f81e67683cfea57eb47282ff155c8df148fd771
aafd97ca04b7e946d0d5a1fee7f0348242a49ebc2e31c43fedc090e83081e74c
+1 -1
Переглянути файл
@@ -1 +1 @@
c12eaf6b64a2482c83dab1958a195c939c38574d0bc15af1afcdaf811cf311d5
4616c4a6a7c0bea36ca5ef0e0eae1bee283679edc691671b9911a4adec499210
+1 -1
Переглянути файл
@@ -1 +1 @@
fa12ebc743e31fa57b31c0a623708133a232754d110bd687ef16d1037be62b19
61fd51343e7341b05de2f599ba54e9e6b5de3e8c80bdf91d3dad1604cde772bb
+1 -1
Переглянути файл
@@ -1 +1 @@
53271d32104c682e510b4b5a8edb3467c77b39ee58d9b14c891513a494526180
e33af7d9f19fe5242b389ccbb820ac737e81c5793e37da67bf743ed57972de19
+1 -1
Переглянути файл
@@ -1 +1 @@
2eb51fed9362021834f237f80553979a56ed1d8301d78b551e5911768b6e443c
c571c6a7a4f796631d27faaeaa67b60e0ba9c62e410d4363b5744cac3aa3eda1
+1 -1
Переглянути файл
@@ -1 +1 @@
82547cce827ac884aafed961134e5d54be3dcd937990a3c372dfcdd8102aea23
45764bde01e5475ec2eaf67db4b369f405f92800877c72b9f3dbef2e4b317a28