Channel typeahead: ~ to link a channel, like @ for people #274
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Typing
@in the composer opens a people picker and inserts@username. Mattermost has the same affordance for channels —~channel-namerenders as a channel link — but we have no typeahead for it, so you have to know and type the exact slug.Feasible, and mostly cheap
Checked while working on #168:
GET /api/mm/targets?account_id=…returns every channel and conversation for the account and is already cached for 30s (useTargets, used by the composer's "Aan" picker). Filtering can be client-side, so no request per keystroke.@and:lists are one consumer-owned component driven by a regex plus a fetcher; a third trigger is a small addition. On the Tiptap engine@tiptap/suggestiontakes acharoption, so~is a second configured instance of whatmentionSuggest.tsalready does.One thing that is not free
~links resolve on the channel slug, not the display name (~town-square, not~Town Square).Targetcurrently carriesdisplay_namebut no slug (backend/waggle/schemas/mm_targets.py:20-36), so the backend has to expose it — probablychannel_name, straight from the MM channel'sname.So: one backend field, one frontend typeahead, per engine.
Depends on the escaping fix
Worth noting these interact: until recently the composer sent
~town-squareas\~town-square, because tiptap-markdown escapes every tilde. Mattermost's channel autolinking then did not resolve it. Fixed in #271 — a~typeahead that inserted a link Mattermost would not resolve would have been worse than none.Scope note
Only channels are linkable this way (
kind === 'channel'); DMs and group conversations have no~form, so they should not appear in the list.