Enable avatar preview for workspace & thread replies#24425
Enable avatar preview for workspace & thread replies#24425PauloGasparSv merged 7 commits intoExpensify:mainfrom spcheema:fix/21073-show-avatar-preview
Conversation
|
@aimane-chnaif Here is a draft PR. Please have a look and leave your feedback. I'll update screenshots later. |
|
@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] |
|
@aimane-chnaif I am currently having issues with Android emulator and haven't found any solution yet. I'll update android testing video later. https://expensify.slack.com/archives/C01GTK53T8Q/p1691972994564499 |
Android testing video attached |
|
Bumping up for code review @aimane-chnaif |
|
@spcheema when user sets custom workspace avatar, I think it should show original size to be consistent with custom user avatar Screen.Recording.2023-08-15.at.10.04.59.AM.mov |
NVM, I confirmed that it's already resized when upload workspace photo. So out of scope |
|
@aimane-chnaif That's the max size for the workspace
Here is the image I have used |
Co-authored-by: Aimane Chnaif <96077027+aimane-chnaif@users.noreply.github.com>
|
This is minor but hover area doesn't cover full workspace avatar Screen.Recording.2023-08-15.at.10.34.06.AM.mov |
61.New.Expensify.-.15.August.2023.mp4You may notice 4px hover cover outside the avatar is also clickable. It's due to the 4px border of the avatar container.
We can't reduce it otherwise avatars overlap won't be visible |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
|
Now workspace avatar preview and user avatar preview look exactly same, no further design confirmation is needed. |
aimane-chnaif
left a comment
There was a problem hiding this comment.
LGTM 🎉
@PauloGasparSv all yours!
PauloGasparSv
left a comment
There was a problem hiding this comment.
LGTM to me too and tests great on Web.
Nice catch on separating that margin style too.
|
✋ 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/PauloGasparSv in version: 1.3.55-0 🚀
|
|
🚀 Deployed to staging by https://github.com/PauloGasparSv in version: 1.3.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
| <AttachmentModal | ||
| headerTitle={props.icons[0].name} | ||
| source={UserUtils.getFullSizeAvatar(props.icons[0].source, props.icons[0].id)} | ||
| isAuthTokenRequired |
There was a problem hiding this comment.
I have a query regarding the isAuthTokenRequired flag set to true for the AttachmentModal component. This flag's setting becomes particularly interesting when compared with the Avatar component's behavior. Both AttachmentModal and Avatar utilize the same image source (props.icons[0].source), yet Avatar manages to load its image without requiring authentication.
This leads me to wonder if there are specific scenarios where authentication is indeed necessary for loading an avatar image. Understanding this is crucial because if authentication is not required in these cases, we might be exposing our authentication tokens to external addresses unnecessarily.
Furthermore, it’s important to consider future updates, particularly regarding the Image component's adaptation to use header-based authentication. Such changes can introduce complexities due to browser security features like CORS (Cross-Origin Resource Sharing). Since avatar sources are not hosted on the same origin, this could potentially lead to CORS errors, disrupting the user experience.
Could you provide insights on the necessity of the isAuthTokenRequired flag in this context? Understanding the rationale behind this decision will help us ensure both secure and efficient handling of image sources across different components.
There was a problem hiding this comment.
I'm also interested - AFAIK the auth tokens were only needed for chat attachments, since these obviously need to be private (only accessible by the participants of a report where the chat attachment was sent). I don't know of / remember a reason we would need any avatars to be private & require auth tokens to fetch



Details
Fixed Issues
$ #21073
PROPOSAL: #21073 (comment)
Tests
Scenario 1:
Scenario 2:
Scenario 3:
Offline tests
QA Steps
Scenario 1:
Scenario 2:
Scenario 3:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
Web.mp4
Mobile Web - Chrome
Mobile.Web.-.Chrome.mp4
Mobile Web - Safari
Mobile.-.Safari.mp4
Desktop
Desktop.mp4
iOS
Re_.iOS.-.13.August.2023.mp4
Android
Android.mp4