[CP Staging][Avatars] Display subscript for single expenses & invoices in Workspace#67993
Conversation
|
@QichenZhu 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] |
|
Unused styles check failing unrelated, it is failing on main as well. |
| const shouldShowAllActors = displayAllActors && !reportPreviewSenderID; | ||
| const isChatThreadOutsideTripRoom = isChatThread(chatReport) && !isATripRoom; | ||
| const shouldShowSubscriptAvatar = shouldReportShowSubscript(iouReport ?? chatReport, isReportArchived) && policy?.type !== CONST.POLICY.TYPE.PERSONAL; | ||
| const shouldShowSubscriptAvatar = shouldReportShowSubscript(iouReport ?? chatReport, isReportArchived) && isWorkspacePolicy; |
There was a problem hiding this comment.
shouldReportShowSubscript
Instead of add the case outside of it, could we update this function?
There was a problem hiding this comment.
Well, it's not that easy. It's more a matter of which report to pass and which report to pass to the icons function. For example, the invoice single expense view has no IOU report, and the invoice report is actually a parent of its chat report. The whole logic revolves around that. The function itself performs checks such as isExpenseRequest so it is correct.
But I agree that there are sooo many checks that it needs a refractor and some utils functions and I am willing to do such as well as the optimization but I think we should focus to cover everything and do refractor as a last PR, same as we did with Better Expense Report View and it worked well.
What do you think?
| if (shouldUseInvoiceExpenseIcons) { | ||
| avatars = getIconsWithDefaults(invoiceReport); | ||
| } else if (shouldUseMappedAccountIDs) { | ||
| avatars = avatarsForAccountIDs; |
There was a problem hiding this comment.
Is this the centralized place where these checks are made?
There was a problem hiding this comment.
Yes, this hook is used inside a component that is used for every report or report action avatar in the app.
|
🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
@JakubKorytko, I think the reviewers of #65740 will take care of this since it's a follow-up PR. If it's time-sensitive or you'd like my input, I'm happy to help. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
@QichenZhu yes no need for review, I will be testing! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…le-expense-no-subscript [CP Staging][Avatars] Display subscript for single expenses & invoices in Workspace (cherry picked from commit 9f165e6) (cherry-picked to staging by mountiny)
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.1.89-19 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.89-21 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.1.90-0 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.90-11 🚀
|
| const defaultDisplayName = getDisplayNameForParticipant({accountID, personalDetailsData: personalDetails}) ?? ''; | ||
| const isAInvoiceReport = isInvoiceReport(iouReport ?? null); | ||
| const invoiceReport = [iouReport, chatReport, reportChatReport].find(isInvoiceReport); | ||
| const isNestedInInvoiceReport = !!invoiceReport; |
There was a problem hiding this comment.
Coming from #69343, we should add the check for the chat thread as well

Explanation of Change
Fix for workspace's single expenses & invoices in
Reports->Chats, header & details page not being displayed as a subscript.Fixed Issues
$ #67975
$ #67750
PROPOSAL: N/A
Tests
Reports->ChatsOffline tests
N/A
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