Plugins: document addMessageAction (toolbar buttons)

This commit is contained in:
reverse 2026-06-20 09:05:34 +00:00
parent cf2dec44ed
commit e6ea864ae1
No known key found for this signature in database

View file

@ -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