mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-25 19:13:49 +00:00
Newcomers to a multi-user pad regularly fail to discover the chat
panel and the @-mention convention. Make the user list itself the
discovery affordance: clicking another user's row opens chat (if
hidden) and prefills the input with "@<their_name> ", ready to send.
The skin gets a small visual cue — pointer cursor on .usertdname and
an underline on hover — so the affordance is visible without
requiring a redesign. The color swatch keeps its own click semantics
(color picker), so the swatch cell is excluded from the new handler.
To let bot/AI plugins substitute their trigger string for an
otherwise-useless @-mention of the bot's display name (e.g.
"@AI Assistant" → "@ai"), this adds a new client-side hook,
chatPrefillFromUser, that takes {authorId, name, prefill} and lets
the first plugin to return a non-empty string override the default
prefill. Documented in doc/api/hooks_client-side.md alongside
chatSendMessage.
Plugin errors in the hook are caught — a misbehaving plugin can't
break the click. If chat is hidden by pad settings, chat.show() is
a no-op and the click effectively does nothing, which matches the
existing behavior of "no chat means no chat-related affordances".
The new prefill never clobbers a real partial message in the input;
if the user was mid-typing something, the @-mention is appended
rather than replacing.
|
||
|---|---|---|
| .. | ||
| api.adoc | ||
| changeset_library.adoc | ||
| changeset_library.md | ||
| editbar.adoc | ||
| editbar.md | ||
| editorInfo.adoc | ||
| editorInfo.md | ||
| embed_parameters.adoc | ||
| embed_parameters.md | ||
| hooks_client-side.adoc | ||
| hooks_client-side.md | ||
| hooks_overview.adoc | ||
| hooks_overview.md | ||
| hooks_server-side.adoc | ||
| hooks_server-side.md | ||
| http_api.adoc | ||
| http_api.md | ||
| index.md | ||
| pluginfw.adoc | ||
| pluginfw.md | ||
| toolbar.adoc | ||
| toolbar.md | ||