#226 Space member picker: candidate autocomplete (v0.6.19) #230

Merged
Cordy merged 2 commits from feat/226-member-picker into main 2026-08-13 23:30:52 +00:00
Owner

Closes #226 and the picker half of #210.

Adds a candidate dropdown / type-ahead to the space add-member field.

Backend

  • GET /api/v1/spaces/{name}/candidates (owner-or-admin gated) returns the usernames the instance can enumerate, minus the owner and current members (server-filtered), sorted, deduped.
  • Source resolution: an injected SpacesAPI.Candidates enumerator (local users / read client) if set; otherwise Manager.Users on IdP-managed instances; otherwise empty. Manager.Users lists realm users via GET /users?max=500&briefRepresentation=true.
  • Empty (not an error) when no source is enumerable — no main.go wiring required for the IdP path; the seam is there for local/read-client sources.

Frontend

  • <datalist> attached to the add-member input, populated on dialog open from the candidates endpoint. Degrades to the validated free-text picker (#217) when the list is empty.

Tests

  • internal/api/spaces_candidates_test.go: owner/member exclusion + sort; non-owner 403; empty-when-no-source.
  • internal/spaces: TestUsers (enumeration via the fake Keycloak, extended to list all users).

No main.go changes; existing IdP-managed instances get autocomplete, app-owned/OIDC-without-a-client instances degrade cleanly.

Closes #226 and the picker half of #210. Adds a candidate dropdown / type-ahead to the space add-member field. **Backend** - `GET /api/v1/spaces/{name}/candidates` (owner-or-admin gated) returns the usernames the instance can enumerate, minus the owner and current members (server-filtered), sorted, deduped. - Source resolution: an injected `SpacesAPI.Candidates` enumerator (local users / read client) if set; otherwise `Manager.Users` on IdP-managed instances; otherwise empty. `Manager.Users` lists realm users via `GET /users?max=500&briefRepresentation=true`. - Empty (not an error) when no source is enumerable — no `main.go` wiring required for the IdP path; the seam is there for local/read-client sources. **Frontend** - `<datalist>` attached to the add-member input, populated on dialog open from the candidates endpoint. Degrades to the validated free-text picker (#217) when the list is empty. **Tests** - `internal/api/spaces_candidates_test.go`: owner/member exclusion + sort; non-owner 403; empty-when-no-source. - `internal/spaces`: `TestUsers` (enumeration via the fake Keycloak, extended to list all users). No `main.go` changes; existing IdP-managed instances get autocomplete, app-owned/OIDC-without-a-client instances degrade cleanly.
Cordy merged commit 104f1f8775 into main 2026-08-13 23:30:52 +00:00
Cordy deleted branch feat/226-member-picker 2026-08-13 23:30:55 +00: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: Cordy/Cairn#230
No description provided.