feat(mentions): user groups in @ autocomplete #146

Merged
nrupard merged 1 commit from feat/lc-83-group-mention-popover into main 2026-05-18 21:35:19 +02:00
Owner

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.

What changed:

  • MentionSuggestion::group(name, member_count) constructor mirrors the existing user and broadcast constructors.
  • get_autocomplete looks up the room's enclave (skips DMs and legacy enclave-less public rooms, because the resolver in routes/room.rs cannot 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.html branches on kind == "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 = 8 budget so user rows stay visible. Same logic that puts broadcast tokens first.

Validated: just check clean (server + desktop + clippy both feature sets + fmt). routes_mentions integration suite 15/15. Added autocomplete_includes_enclave_user_groups covering 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. What changed: - `MentionSuggestion::group(name, member_count)` constructor mirrors the existing `user` and `broadcast` constructors. - `get_autocomplete` looks up the room's enclave (skips DMs and legacy enclave-less public rooms, because the resolver in `routes/room.rs` cannot 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.html` branches on `kind == "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 = 8` budget so user rows stay visible. Same logic that puts broadcast tokens first. Validated: `just check` clean (server + desktop + clippy both feature sets + fmt). `routes_mentions` integration suite 15/15. Added `autocomplete_includes_enclave_user_groups` covering the happy path.
feat(mentions): include user groups in @ autocomplete
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 53s
31e2dbab84
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.
nrupard deleted branch feat/lc-83-group-mention-popover 2026-05-18 21:35:19 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!146
No description provided.