feat(mentions): user groups in @ autocomplete #146
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-83-group-mention-popover"
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?
Reported: after creating a group
mods, members had to type the full@modstoken by hand because the mention popover did not surface user groups, only users and the@here/@channelbroadcast tokens. The expansion path worked silently, which made the feature feel half-implemented.What changed:
MentionSuggestion::group(name, member_count)constructor mirrors the existinguserandbroadcastconstructors.get_autocompletelooks up the room's enclave (skips DMs and legacy enclave-less public rooms, because the resolver inroutes/room.rscannot expand groups there anyway) and inserts a group row for every group whose name contains the query, between the broadcast tokens and the user rows.partials/mention_popover.htmlbranches onkind == "group": green#glyph (distinct from broadcast's blue@and user's avatar),@{name}token, secondary "N members" label so the picker tells you what you are about to ping.Why between broadcast and users: groups are scoped + named (higher signal than a single user) but still cap at the same
MAX = 8budget so user rows stay visible. Same logic that puts broadcast tokens first.Validated:
just checkclean (server + desktop + clippy both feature sets + fmt).routes_mentionsintegration suite 15/15. Addedautocomplete_includes_enclave_user_groupscovering the happy path.Reported: after creating a group `mods`, members had to type the full `@mods` token by hand because the mention popover did not surface user groups, only users and the `@here` / `@channel` broadcast tokens. The expansion path worked silently, which made the feature feel half-implemented. Adds groups to the popover between broadcast tokens and users. Group rows use a green `#` glyph to distinguish them from broadcast (blue `@`) and user (avatar) rows, render the group name as `@{name}`, and carry a secondary "N members" label so the picker tells you what you are about to ping. Rooms with no enclave (DMs, legacy enclave-less public rooms) skip the lookup because the resolver in `routes/room.rs` cannot expand groups there anyway. New constructor `MentionSuggestion::group(name, member_count)` mirrors the existing `user` and `broadcast` constructors. The template branches on `kind == "group"` alongside the existing `broadcast` / user branches. Validated with `just check` (server + desktop + clippy both feature sets + fmt) and `routes_mentions` integration suite (15/15). Added `autocomplete_includes_enclave_user_groups` covering the happy path.