Repository navigation
Fix gray fallback avatars on Workspace Members page - #99589
Conversation
Co-authored-by: Joe Ph <gijoe0295@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
🤖 Ran the PR testing steps on Web (dev NewDot). Result: ✅ pass — after Clear cache and restart, an invited email-login member shows a colored letter avatar (blue "M") on both the Members list and the member details page, matching the fix. Phone/SMS logins keep the illustrated catalog default, unaffected. No gray fallback avatar observed anywhere.
Console errors: none. Environment quirks (not app bugs)
ScreenshotsMembers list after clear cache and restart — colored letter avatar for email-invited member
Member details page showing matching colored letter avatar
Members list with phone-invited member showing illustrated catalog default avatar
Zoomed comparison — phone (illustrated), owner (letter), email-invited (letter)
|
DetailsExplanation of ChangeOn the Workspace Members page, members whose personal details aren't loaded yet (e.g. right after Clear cache and restart) rendered the generic gray fallback avatar. This mirrors how the rest of the app already handles this (see Changes:
Members with an email login now show a letter avatar; phone/SMS logins keep the illustrated catalog default (letter-avatar initials are empty for SMS logins by design); once personal details load, the real avatar takes over. Fixed Issues$ #99381 Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
Offline testsQA StepsSame as tests // TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review", or the issue title must include "[No QA]".
PR Author Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeScreen.Recording.2026-08-27.at.23.17.45.moviOS: NativeiOS: mWeb SafariScreen.Recording.2026-08-27.at.23.14.39.movMacOS: Chrome / SafariScreen.Recording.2026-08-27.at.23.11.15.mov |
|
🤖 Done — I've set the PR description to the content you provided. |
|
@MelvinBot Mark Pull Request ready for review |
|
@gijoe0295 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🤖 Done — I've marked this PR as ready for review. |
| const prevMember = usePrevious(member); | ||
| const details = memberPersonalDetails ?? ({} as PersonalDetails); | ||
| const fallbackIcon = details.fallbackIcon ?? ''; | ||
| const memberAvatarSource = details.avatar ?? (memberLogin ? getDefaultAvatarURL({accountID, accountEmail: addSMSDomainIfPhoneNumber(memberLogin)}) : undefined); |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
This inline computation duplicates the exact seeded-avatar resolution that the same PR is centralizing inside buildUserIcon (personalDetails.avatar ?? getDefaultAvatarURL({accountID, accountEmail: addSMSDomainIfPhoneNumber(login)})). UserAvatarUtils.ts even documents buildUserIcon as the place where "the resolution stays in one place", so replicating the same getDefaultAvatarURL({accountID, accountEmail: addSMSDomainIfPhoneNumber(memberLogin)}) fallback here re-implements shared logic and risks the two copies drifting apart.
Resolve the avatar through the shared path instead of hand-rolling the fallback. For example, derive the icon via buildUserIcon/useAccountIcons (passing accountEmail: memberLogin) and pass its source, or extract a small helper in UserAvatarUtils.ts (e.g. getSeededAvatarSource(accountID, login)) and call it in both places:
// UserAvatarUtils.ts
function getSeededAvatarSource(accountID: number, accountEmail?: string): AvatarSource | undefined {
return accountEmail ? getDefaultAvatarURL({accountID, accountEmail: addSMSDomainIfPhoneNumber(accountEmail)}) : undefined;
}
// WorkspaceMemberDetailsPage.tsx
const memberAvatarSource = details.avatar ?? getSeededAvatarSource(accountID, memberLogin);Reviewed at: 1aafe83 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2026-08-27.at.23.17.45.moviOS: HybridAppiOS: mWeb SafariScreen.Recording.2026-08-27.at.23.14.39.movMacOS: Chrome / SafariScreen.Recording.2026-08-27.at.23.11.15.mov |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
LGTM |
|
🚧 justinpersaud has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/justinpersaud in version: 9.4.65-0 🚀
|
|
No help site changes are required, so I did not create a draft PR. This PR is a rendering regression fix: it makes not-yet-loaded workspace members show a letter avatar instead of the gray fallback. It adds no feature, setting, tab, or button, and it changes no user-facing copy — the only new surface is internal props ( The help site already documents the behavior this PR restores:
— docs/articles/expensify-classic/settings/Add-profile-photo.md:37 That matches the PR exactly, including the phone/SMS carve-out. So the article was already correct; the app was the thing out of step. I also checked the other articles that touch avatars or workspace members and found nothing that this PR makes stale:
One thing worth noting, though it is out of scope for this PR: the automatic letter-avatar explanation exists only in the Expensify Classic article, not the New Expensify one. That is a pre-existing gap, not something this PR created. Tell me if you want a separate docs PR to add it to the New Expensify article. @gijoe0295, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.4.65-3 🚀
Bundle Size Analysis (Sentry): |






Explanation of Change
On the Workspace Members page, members whose personal details aren't loaded yet (e.g. right after Clear cache and restart) rendered the generic gray fallback avatar.
buildUserIconinUserAvatarUtils.tsonly produced a default avatar wheninvitedEmailwas passed, so a not-yet-loaded member fell through todefaultAvatars.FallbackAvatarwith nofallbackIcon, andUserAvatarrendered the gray asset. The list started rendering those members after #98483, which is why the regression became visible.This mirrors how the rest of the app already handles this (see
ReportUtilsandPersonalDetailsUtils) by seedingsourcewithgetDefaultAvatarURL— a locally-drawn letter avatar (first initial + login-hashed color), requiring no network request. It seedssource(notfallbackIcon), becauseparseLetterAvatarURLonly inspects the resolved source; a letter URL infallbackIconwould be fetched as a remote image instead of drawn locally.Changes:
UserAvatarUtils.buildUserIconaccepts an optionalaccountEmailand, when personal details aren't loaded, seedssourcewithgetDefaultAvatarURL({accountID, accountEmail: addSMSDomainIfPhoneNumber(accountEmail)}). Invited rows are unchanged.useAccountIconsaccepts a third optionalaccountEmailsparam (index-aligned withaccountIDs) and forwards it.AccountAvataraccepts an optionalaccountEmailprop and passes it through.WorkspaceMembersTableRowpassesaccountEmail={item.login}(useslogin, not the phone-formattedemail).WorkspaceMemberDetailsPageseeds theUserAvatarsourcefrom the already-recoveredmemberLoginso the details page matches the row.Members with an email login now show a letter avatar; phone/SMS logins keep the illustrated catalog default (letter-avatar initials are empty for SMS logins by design); once personal details load, the real avatar takes over.
MultiAccountAvatar,AccountAvatarWithCardFeed,usePolicyIcons, and invited/pending rows are unchanged because they pass noaccountEmail.Fixed Issues
$ #99381
PROPOSAL:
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
// Suggested steps: Create a workspace and invite a member with an email login. Go to Troubleshoot → Clear cache and restart. Open Workspace → Members and verify the member shows a colored letter avatar (not gray). Open the member's details page and verify the avatar matches the row. Confirm phone/SMS logins keep the illustrated catalog default and that invited/pending rows are unchanged.
Offline tests
QA Steps
Same as tests
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review", or the issue title must include "[No QA]".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
Screen.Recording.2026-08-27.at.23.17.45.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2026-08-27.at.23.14.39.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-27.at.23.11.15.mov