feat: allow editing user avatars - #26652
Merged
Merged
Conversation
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.
Contributor
Docs preview📖 View docs preview for |
getExternalImageStylesFromUrl threw "Invalid URL" while a user typed an avatar URL (e.g. once the value reached "https:"), crashing the edit user page preview. Treat unparseable URLs as having no special styles.
aslilac
commented
Jun 25, 2026
DanielleMaywood
approved these changes
Jun 26, 2026
Comment on lines
+10
to
+11
| // The avatar is not edited by the form here, so it round-trips the value | ||
| // from the authenticated user. |
Contributor
There was a problem hiding this comment.
Do we need this comment
| error?: unknown; | ||
| isLoading: boolean; | ||
| initialValues: UpdateUserProfileRequest; | ||
| /** Allows hiding the avatar setting when it would be overwritten later by the user's identity provider. */ |
Contributor
There was a problem hiding this comment.
Do we need this one?
aslilac
commented
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an avatar URL field to the admin Edit user page, available only for users whose login type is
passwordornone.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/nonelogin types.Backend
avatar_urltocodersdk.UpdateUserProfileRequest.putUserProfileapplies the submitted avatar only forpassword/none; otherwise it preserves the existing (IdP-synced) value.make gen.Frontend
EditUserFormrenders anIconField("Avatar URL") when the login type allows it.EditUserPagepasses the avatar value and acanEditAvatarflag.AccountPageround-tripsavatar_urlso 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
TestUpdateUserProfilecovers apply (password) and ignore (SSO);EditUserFormstories cover the shown/hidden states with interaction tests.