Skip to content

fix(issues): render custom avatars in issue stream assignee column#115541

Open
sentry-junior[bot] wants to merge 2 commits into
masterfrom
fix/assignee-custom-avatar-rendering
Open

fix(issues): render custom avatars in issue stream assignee column#115541
sentry-junior[bot] wants to merge 2 commits into
masterfrom
fix/assignee-custom-avatar-rendering

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented May 14, 2026

Problem

Custom avatars (uploaded / gravatar) never render in the assignee column of the issue feed — every assignee shows a letter avatar. Meanwhile, the People context pane on the issue details page renders them correctly.

Root Cause

Two compounding issues:

  1. Backend: ActorSerializer returns a sparse {id, name, type, email?} object for group.assignedTo — no avatar data.
  2. Frontend: AssigneeBadgeActorAvatarAsyncMemberAvatar checks canRenderActor = Boolean(actor.name) → always true → skips user fetch → falls back to letter_avatar. Even UserAvatar.isActor() treats any Actor-shaped object as letter-avatar-only.

The key insight: the full User[] member list with avatar data is already fetched in overview.tsx and threaded all the way down to AssigneeSelector — it was just never used for the avatar render.

Fix

assigneeSelector.tsx: Builds a memoized Map<id, User> from the already-available currentMemberList and resolves the assigned user when assignedTo.type === 'user'.

assigneeBadge.tsx: New optional assignedUser?: AvatarUser prop. When provided and actor type is 'user', renders UserAvatar (which respects avatar.avatarType for uploaded/gravatar) instead of ActorAvatar.

What This Covers

  • ✅ Uploaded avatars render in issue stream
  • ✅ Gravatar avatars render in issue stream
  • ✅ Teams still render team avatars (unchanged path)
  • ✅ Users not in memberList (deleted, external) gracefully fall back to letter avatar
  • ✅ Unassigned state unchanged
  • ✅ Loading state unchanged
  • ✅ Zero new API calls — uses data already in memory

The assignee column in the issue feed always rendered letter avatars
because AssigneeBadge used ActorAvatar with the sparse Actor object
(id, name, type) which lacks avatar data. Meanwhile, the People
section on issue details rendered real avatars because it had full
User objects.

The member list with full User objects (including avatar info) was
already fetched and passed to AssigneeSelector but never used for
avatar rendering. This change:

- Resolves the assigned user from the existing memberList in
  AssigneeSelector via a memoized Map lookup
- Passes the resolved user to AssigneeBadge as an optional
  assignedUser prop
- Renders UserAvatar (which supports uploaded/gravatar) when a full
  user is available, falling back to ActorAvatar for teams and
  users not in the member list

No new API calls or serializer changes required.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.51%

@souredoutlook souredoutlook marked this pull request as ready for review May 14, 2026 02:08
@souredoutlook souredoutlook requested review from a team as code owners May 14, 2026 02:08
@souredoutlook souredoutlook added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant