From e6ea864ae1ed70a0b9af4a110f9cd94bbf70cb8b Mon Sep 17 00:00:00 2001 From: reverse Date: Sat, 20 Jun 2026 09:05:34 +0000 Subject: [PATCH] Plugins: document addMessageAction (toolbar buttons) --- docs/plugins.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 4fc9e58..1633966 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -82,7 +82,8 @@ instead. See **[Compiled plugins](https://orbit.tchatou.fr/docs/compiled-plugins | `orbit.storage.get(key, def)/set(key, val)` | namespaced persistence | | `orbit.addUi(slot, render)` | add UI to a slot (returns a remover) | | `orbit.addSettingsSection({label, icon?, render})` | add a whole Settings section | -| `orbit.addMessageDecorator(m => …)` | append UI to every message; `m` = `{id, nick, text, kind, ts, mine}` | +| `orbit.addMessageDecorator(m => …)` | inline UI after every message's text; `m` = `{id, nick, text, kind, ts, mine}` | +| `orbit.addMessageAction(m => …)` | a button in every message's hover action toolbar (next to reply/react) | | `orbit.h / orbit.html` | render helpers | | `log(…)` | namespaced console logger | @@ -101,10 +102,12 @@ instead. See **[Compiled plugins](https://orbit.tchatou.fr/docs/compiled-plugins | `sidebar_item` | an item in the conversation sidebar header (next to the compose button) | | `settings_section` | a whole section in Settings (own nav entry + pane) — use `orbit.addSettingsSection()` | -Message decorators are added with `orbit.addMessageDecorator(m => …)` rather than -a slot — the callback runs for every rendered message. Every contributed slot and -decorator renders inside its own error boundary, so a crashing plugin renders -nothing instead of taking down the app. +Two per-message hooks run for every rendered message: +`orbit.addMessageDecorator(m => …)` appends inline UI after the text, and +`orbit.addMessageAction(m => …)` adds a button to the hover action toolbar next +to reply/react. Every contributed slot, action and decorator renders inside its +own error boundary, so a crashing plugin renders nothing instead of taking down +the app. ## Trust & security