fix: regressions related to workspace avatars#41485
fix: regressions related to workspace avatars#41485MonilBhavsar merged 13 commits intoExpensify:mainfrom
Conversation
|
@ahmedGaber93 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] |
|
@rushatgabhane this a regression from #39637, I don't think it is needed a new C+. |
src/components/MenuItem.tsx
Outdated
| onFocus?: () => void; | ||
|
|
||
| /** Optional account id if it's user avatar or policy id if it's workspace avatar */ | ||
| accountId?: number | string; |
There was a problem hiding this comment.
| accountId?: number | string; | |
| accountID?: number | string; |
|
we might be doing a revert of original PR - https://expensify.slack.com/archives/C01GTK53T8Q/p1715183132740789 |
|
Thanks for linking this 👍 |
|
Running a test build |
This comment has been minimized.
This comment has been minimized.
Kicu
left a comment
There was a problem hiding this comment.
Hey, I spent a lot of time with avatar code so I wanted to leave a few comments here.
After the previous PR there is also a bug in this line: https://github.com/Expensify/App/blob/main/src/components/MultipleAvatars.tsx#L147
Because we started to pass also policyID as icon id, and it can be string, then this parsing will generate NaN and Nan gets passed as accountID.
Previously only actual account ids were passed to icons so this didn't happen I believe.
It would be nice to handle this somehow.
src/components/MenuItem.tsx
Outdated
| isPaneMenu = false, | ||
| shouldPutLeftPaddingWhenNoIcon = false, | ||
| onFocus, | ||
| accountID = '', |
There was a problem hiding this comment.
Can you point to me where in the code this will actually be used? because in this PR your not passing accountID anywhere to MenuItem and I would like understand the flow of props better.
Also please don't default to '' - accountID makes no sense with empty value.
There was a problem hiding this comment.
Thanks your comment
I missed adding props in MoneyRequestConfirmationList when resolving conflict
| isWorkspaceAvatar | ||
| maybeIcon | ||
| originalFileName={policy?.originalFileName ?? policyName} | ||
| originalFileName={policy?.originalFileName ?? policy?.id} |
There was a problem hiding this comment.
Technically this will work, but the prop name is called originalFileName so passing policy.id will confuse people in future.
There was a problem hiding this comment.
I added a comment to explain, please check again
There was a problem hiding this comment.
Can we add why we need to do this?
There was a problem hiding this comment.
// In the case of the default workspace avatar, we will use the policy id that will be originalFileName prop to get the color of the avatar.
@MonilBhavsar I added a comment.
@nkdengineer please fix the multiple avatars/subscript avatar case |
grgia
left a comment
There was a problem hiding this comment.
LGTM, but we need to fix the case I commented before me merge
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeMacOS: Desktop |
src/components/MenuItem.tsx
Outdated
| /** Optional account id if it's user avatar or policy id if it's workspace avatar */ | ||
| accountID?: number | string; |
There was a problem hiding this comment.
Having a prop with name accountID and holding value of policyID is confusing IMO.
We can either have two props - policyID and accountID and use one that's provided - policyID ?? accountID
Or, we can have a prop avatarID that takes either policyID or accountID.
There was a problem hiding this comment.
I think avatarID is fine.
There was a problem hiding this comment.
@MonilBhavsar I updated with new prop name
| isWorkspaceAvatar | ||
| maybeIcon | ||
| originalFileName={policy?.originalFileName ?? policyName} | ||
| originalFileName={policy?.originalFileName ?? policy?.id} |
There was a problem hiding this comment.
Can we add why we need to do this?
|
@nkdengineer could you merge main? |
|
@grgia please check again |
|
@rushatgabhane could you please re-review |
|
triggering final test build... |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
MonilBhavsar
left a comment
There was a problem hiding this comment.
Minor comment edit to explain it in a better way. Looks good overall!
Co-authored-by: Monil Bhavsar <monilbhavsar25@gmail.com>
|
@MonilBhavsar I updated. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 1.4.75-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.75-1 🚀
|










Details
Fixed Issues
$ #41385
#41387
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov