Skip to content

feat: allow editing user avatars#26652

Open
aslilac wants to merge 1 commit into
mainfrom
lilac/edit-user-avatar
Open

feat: allow editing user avatars#26652
aslilac wants to merge 1 commit into
mainfrom
lilac/edit-user-avatar

Conversation

@aslilac

@aslilac aslilac commented Jun 24, 2026

Copy link
Copy Markdown
Member

Adds an avatar URL field to the admin Edit user page, available only for users whose login type is password or none.

For identity-provider login types (github, oidc) the avatar is synced from the IdP on every login, so the field is hidden and the API ignores any submitted avatar to avoid confusing overwrites.

The field reuses the same emoji picker + URL input (IconField) already used for template, group, and organization icons.

A follow-up PR will add the same control to the self-service Account settings page.

Implementation plan & decisions

Goal: Let an admin set/clear a user's avatar from the Edit user page, gated to password/none login types.

Backend

  • Add avatar_url to codersdk.UpdateUserProfileRequest.
  • putUserProfile applies the submitted avatar only for password/none; otherwise it preserves the existing (IdP-synced) value.
  • Regenerated TS types and API docs via make gen.

Frontend

  • EditUserForm renders an IconField ("Avatar URL") when the login type allows it.
  • EditUserPage passes the avatar value and a canEditAvatar flag.
  • AccountPage round-trips avatar_url so the shared request type doesn't wipe avatars on the self-service path.

Gating is enforced in both the UI (field hidden) and the backend (submitted value ignored for IdP login types).

Tests/stories: backend TestUpdateUserProfile covers apply (password) and ignore (SSO); EditUserForm stories cover the shown/hidden states with interaction tests.


Generated by Coder Agents on behalf of @aslilac.

Add an avatar URL field to the admin edit user page for users whose
login type is password or none. Identity-provider avatars are synced
on login, so the field is hidden for those users and the API ignores a
submitted avatar.
@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/reference/api/schemas.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant