Fix IOU avatar overlap when sharing manual and scanned expenses#87096
Fix IOU avatar overlap when sharing manual and scanned expenses#87096marufsharifi wants to merge 3 commits intoExpensify:mainfrom
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@aimane-chnaif 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46eb07b5b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const areAllTransactionsCreatedByOneActor = new Set(transactionActorAccountIDs).size < 2; | ||
|
|
||
| if (!areAmountsSignsTheSame) { | ||
| return undefined; | ||
| if (!areAllTransactionsCreatedByOneActor) { | ||
| return undefined; |
There was a problem hiding this comment.
Avoid treating delegate actors as distinct report senders
This new actor-based gate can hide the single-avatar state for valid single-sender previews when requests are submitted by different delegates (or by a delegate plus the owner). In those flows, actorAccountID varies per action even though the preview sender should still resolve to the same childOwnerAccountID/childManagerAccountID, so the early return undefined incorrectly forces multi-avatar rendering. This regression is introduced by using raw actor IDs as the primary sameness check.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I checked this case in the codebase and I don't think this concern applies here.
For IOU actions, delegate/copilot identity is stored separately in delegateAccountID, while the IOU action itself still uses actorAccountID for the main account:
Line 7291 in 46eb07b
App/src/types/onyx/ReportAction.ts
Lines 241 to 242 in 46eb07b
The preview logic in ReportActionItemSingle also already treats delegate separately from the main sender account:
So I don’t see evidence that delegate-created IOU actions would cause different
actorAccountIDs for the same visible sender in this flow.
Explanation of Change
This change makes the report preview avatar logic more cautious for scan expenses.
Before, the app could treat a zero-amount scan expense as if its sender was known, which sometimes caused a 1:1 chat preview to show a single combined avatar incorrectly when one person had sent both a manual expense and a scan expense.
Now we use the most reliable signal first: if the related IOU actions tell us who created each expense, we trust that. If that data is not available, we only fall back to transaction amounts when the direction is actually clear. For zero-value scan expenses that are still unresolved, we stop guessing and keep the preview ambiguous instead of showing the wrong single-avatar state.
Fixed Issues
$ #82488
PROPOSAL: #82488 (comment)
Tests
Other Test Cases:
1. Zero Amount Request
2. Clear Cache /
iouActionsUnavailable3. Two Devices (IOS & MacOS Web)
Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
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))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.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
Screen.Recording.2026-04-03.at.7.55.45.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-04-03.at.7.47.19.PM.mov
iOS: Native
Screen.Recording.2026-04-03.at.7.37.22.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-04-03.at.7.41.11.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-04-03.at.7.16.56.PM.mov