feat(mentions): per-enclave user groups @group-name (LC-83) #143
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-83-user-groups"
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?
Summary
LC-83: per-enclave user groups for
@group-namementions. A token that doesn't match a username falls through to a per-enclave group lookup; on match, the existing@usernamecodepath gets oneMentionRefper member, so each member gets a realmentionsrow + notification + activity entry through the existing per-user pipeline.Schema (chat 0027)
user_groups (id, enclave_id, name, description, created_by, created_at)withUNIQUE (enclave_id, name)andON DELETE CASCADEfrom enclaves.user_group_members (group_id, user_id, added_at, PK(group_id, user_id))withON DELETE CASCADEfrom user_groups.Admin API (gated by
enclave_can_manage)POST /enclave/{id}/groups(form:name, optionaldescription).PATCH /enclave/{id}/groups/{group_id}(rename).DELETE /enclave/{id}/groups/{group_id}.POST /enclave/{id}/groups/{group_id}/members(form:user_id).DELETE /enclave/{id}/groups/{group_id}/members/{user_id}.Add-member refuses non-enclave-members so a group can only hold users who actually have access.
Acceptance criteria
@group-nameresolves to each member through the existing per-user mention pipeline.@group-nameas literal text (parser fails to find the group; existing mention rows stay valid).Out of scope (open questions)
Test plan
just check(fmt + clippy across standalone + saas)../dev/cargo test -p lets-chat-server --test routes_user_groups- 3/3 pass (admin creates + adds member; member is 403'd;@designersmention writes a mentions row for the member).@team-fooin #general - verify both get notifications + activity entries.Drift
Chat migration 0027 added to all 6 hand-rolled test files (CLAUDE.md test-maintenance section 2).