-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable avatar preview for workspace & thread replies #24425
Enable avatar preview for workspace & thread replies #24425
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 <[email protected]>
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
@PauloGasparSv all yours!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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