feat(enclave): typeahead UX for group Add member #145
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-83-add-member-typeahead"
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?
Follow-up to PR #144. The first cut at the group-member UI took a raw user id in a text input, which is unusable - nobody knows their own UUID, let alone someone else's. This rewires it to use the same typeahead UX the enclave invite flow and DM start use.
UX:
Add membercollapsible now contains a search input ("Search by username or display name...") and a popover that fills viahx-get.@username. State is computed server-side:Addbutton (addable),In grouppill (already a member of the group),Not in enclavepill (must be invited to the enclave first).AddPOSTs the row, swapping it in-place with anAddedconfirmation. The bad-input branch (race: user left the enclave between fetch and click) returns an inline red row.Wire:
GET /enclave/{id}/groups/{gid}/members/search?q=reusesdb::auth::search_users+ a per-group id set to compute row state. ReturnsGroupMemberSearchFragment.POST /enclave/{id}/groups/{gid}/membersnow returnsGroupMemberRowResult(HTML row) instead of a redirect; mirrorsPOST /enclave/{id}/invite.GroupMemberCandidate,GroupMemberCandidateState, and the two template structs live inviews/enclave.rsnext to their invite counterparts.enclave/group_member_search.html,enclave/group_member_row_result.html. Both follow the existingenclave/invite_search.html/enclave/invite_row_result.htmlshape so the avatar partial is reused unchanged.Validated:
just checkclean (server + desktop + clippy both feature sets + fmt).routes_user_groupsintegration suite 3/3 passing. Existing test updated fromSEE_OTHERtoOKbecause the add response shape moved from redirect to row fragment.