[Avatars - Reports] Use centralized logic for report actions avatars everywhere in the app#65740
Merged
grgia merged 51 commits intoExpensify:mainfrom Aug 4, 2025
Merged
Conversation
Closed
1 task
bf6325e to
ffaeaed
Compare
ffaeaed to
f3f2dba
Compare
Contributor
|
Assigning as a reviewer so I don't lose track :) |
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Contributor
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.1.89-1 🚀
|
48 tasks
Closed
8 tasks
This was referenced Aug 5, 2025
48 tasks
16 tasks
8 tasks
|
@JakubKorytko @shawnborton |
Contributor
Author
|
Yeah, fair point. To simulate that behavior, you can simply create an expense without having any unsettled expenses before. |
This was referenced Aug 5, 2025
8 tasks
16 tasks
48 tasks
Contributor
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.89-21 🚀
|
8 tasks
QichenZhu
reviewed
Oct 22, 2025
Comment on lines
+109
to
+110
| const isAInvoiceReport = isInvoiceReport(iouReport ?? null); | ||
| const isWorkspaceActor = isAInvoiceReport || (isAWorkspaceChat && (!actorAccountID || displayAllActors)); |
Contributor
hoangzinh
reviewed
Dec 4, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation of Change
If the report is of the IOU type and contains only one person's expenses, we want to display only the sender's avatar. If there is more than one expense, we want to display diagonal avatars of both users.
The PR #64802 takes care of that in terms of IOU report previews and report headers.
This PR will address the rest of the app, meaning that with an exception for simple single avatars & avatars with image picker we will use a single component
ReportAvatarfor every report-related avatar.I've removed
MultipleAvatars,SingleReportAvatarandSubscriptAvatar— it's now justReportActionAvatarswith the whole logic encapsulated. The new component has one mandatory prop, which can be either a report ID, an action or account IDs (the other two are for specific cases where a report ID is unavailable, not really used 90% of the time). Also removed some functions related to report avatars that was used in a few places in the code to keep it centralized.The
ReportActionAvatarscomponent uses theReportActionAvatarcompound component to display the correct UI based on the avatar type. The avatar type can be one of the following:Single Avatar (
CONST.REPORT_ACTION_AVATARS.TYPE.SINGLE)Multiple Avatar (
CONST.REPORT_ACTION_AVATARS.TYPE.MULTIPLE)Multiple Diagonal Avatar (
CONST.REPORT_ACTION_AVATARS.TYPE.MULTIPLE_DIAGONAL)Multiple Horizontal Avatar (
CONST.REPORT_ACTION_AVATARS.TYPE.MULTIPLE_HORIZONTAL)Subscript Avatar (
CONST.REPORT_ACTION_AVATARS.TYPE.SUBSCRIPT)Since there is a lot to test here, automated testing is necessary and is included in this PR. We also need to ensure that, if the data is still loading, the app displays a single avatar and then changes to a diagonal one, if applicable - not the other way around.
Optimization
This PR is already huge, but the next step is to optimize the
ReportActionAvatarscomponent as much as possible, since it is currently used in many places. This may be easier once the report actions BE issue is resolved, we could also add a new Onyx derived value, but I would prefer to do so in a follow-up PR with a little refractor as a bonus.Testing
I'm aware that the test steps are extensive, but since we have automated UI tests, I suggest focusing on the report previews, the details page, the LHN, the report and chat headers, and the search page.
Fixed Issues
$ #65559
$ #65741
$ #65813
$ #65814
PROPOSAL: N/A
Tests
[
Subtest: Go through these steps to see if the avatar is displayed correctly.]This must be done for both User A and User B, and the same avatar/s must be displayed for both.
Inbox.Reportstab and selectChats.[Tests]
Subtestyou see only user's A avatar.Subtestyou see both users avatars.Subtestyou see only user's B avatar.Subtestyou see only user's A avatar.Subtestyou see only user's B avatar.Subteststeps to verify that.Offline tests
Same as tests, but the connection must be restored and then dropped after each step in order to receive updated Onyx data.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Web.mov
MacOS: Desktop