дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
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]>
Цей коміт міститься в:
1 джерело
f3837e0fe7
коміт
112ed773fb
43 files changed
+419
-39
No files matched your search
@@ -540,7 +540,14 @@ export function createMemoryPluginsBackend(
|
||||
if (commandId === "word-count") {
|
||||
if (!activeFile) throw new IpcError({ kind: "internal", message: "no file is open in the editor" });
|
||||
const name = activeFile.split("/").pop() ?? activeFile;
|
||||
emit({ type: "notification", pluginId, level: "info", title: `Word count: ${name}`, body: "(simulated)" });
|
||||
emit({
|
||||
type: "notification",
|
||||
pluginId,
|
||||
level: "info",
|
||||
title: `Word count: ${name}`,
|
||||
body: "(simulated)",
|
||||
actions: [],
|
||||
});
|
||||
return null;
|
||||
}
|
||||
throw new IpcError({ kind: "internal", message: `unknown command: ${commandId}` });
|
||||
|
||||
Reference in new issue
Заблокувати користувача