-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix: tweak the anonymous footer component design #20884
Conversation
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Sign in" button is cut or hidden when room name is too long
Screen.Recording.2023-06-16.at.1.26.29.PM.mov
return ( | ||
<View style={styles.anonymousRoomFooter}> | ||
<View | ||
onLayout={onLayout} |
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.
Why changed withWindowDimensions to onLayout? This callback seems slower.
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.
This is needed because we need to change the layout of this component based on the component width rather than the screen size.
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 think we can calculate width enough from windowWidth. LHN width is fixed as 375.
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.
We can, but the component won't be fully responsive. Like it will fail inside storybook where there is no left side bar.
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.
My concern is when resize window, layout flickers as you see my video.
I think storybook is less important than that.
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.
@marcochavezf Can you share your thoughts here?
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.
Bump @marcochavezf!
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.
Oh this is an interesting issue, yeah my initial thought was that the flickering was almost unnoticeable in the video and I agree that an end-user resizing the window would be a rare case. But after seeing the video that @aimane-chnaif posted here, I think the problem is more noticeable when the room is loading on a small screen. It seems that we're not loading the sign-in button for a moment, not sure if it's related to the resizing logic, but agree with @aimane-chnaif we should fix that (at least the sign-in button which causes the report footer to be displayed incorrectly for a moment).
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.
This is clearly noticeable when app becomes heavy (i.e. HT account, old device). View onLayout
is called a few seconds after mount.
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.
@aimane-chnaif Removed onLayout
. Please check.
<View style={[props.isSmallScreenWidth ? styles.alignItemsStart : styles.alignItemsEnd]}> | ||
<View style={styles.anonymousRoomFooterWordmarkAndLogoContainer(isSmallSizeLayout)}> | ||
<View style={[styles.mr4, styles.flexShrink1]}> | ||
<View style={[isSmallSizeLayout ? styles.alignItemsStart : styles.alignItemsEnd]}> | ||
<ExpensifyWordmark style={styles.anonymousRoomFooterLogo} /> | ||
</View> | ||
<Text style={[styles.textNormal, styles.textWhite]}>{props.translate('anonymousReportFooter.logoTagline')}</Text> |
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.
No font family is added here. #20494 (comment)
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.
Handled.
@aimane-chnaif This was meant to be handled here. No? |
you mean loooong room name case is out of scope for this PR? |
That is my understanding. Correct me if I'm wrong @marcochavezf. |
I think the main purpose of this PR is to fix wrong designs different from design doc.
|
Yes, @aimane-chnaif is right. Only the long name is out of scope here since it would be fixed in the other issue. We're aiming to fix all the style inconsistencies here 🙇🏽♂️ |
"Join in on the discussion" still doesn't feel like it's the right font - can you double check that? An easy way to tell is to use a lowercase "g" and see if it is double story or not. Then for the background color, it looks incorrect as well - it should be the same background color as a preview card or the LHN or an IOU for example. |
@shawnborton I'm using I've updated the background colour FYI. |
That's the right font, but it doesn't look like it's working. Can you add a lowercase g to the sentence so I can check? |
@shawnborton Here's how it looks. |
Okay great, thanks for confirming! That looks good to me. |
Still waiting for @marcochavezf's thoughts on this thread. This is my concern: Screen.Recording.2023-06-23.at.1.59.57.PM.mov |
@allroundexperts please pull main |
const hideComposer = isArchivedRoom || !_.isEmpty(props.errors) || !isAllowedToComment; | ||
|
||
const isSmallSizeLayout = props.windowWidth - (props.isSmallScreenWidth ? 0 : 375) < variables.anonymousReportFooterBreakpoint; |
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.
const isSmallSizeLayout = props.windowWidth - (props.isSmallScreenWidth ? 0 : 375) < variables.anonymousReportFooterBreakpoint; | |
const isSmallSizeLayout = props.windowWidth - (props.isSmallScreenWidth ? 0 : variables.sideBarWidth) < variables.anonymousReportFooterBreakpoint; |
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.
Fixed.
src/styles/styles.js
Outdated
flexDirection: 'row', | ||
alignItems: 'center', | ||
...(isSmallSizeLayout && { | ||
// flex: 1, |
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.
// flex: 1, |
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.
Fixed.
<View style={styles.mr4}> | ||
<View style={[props.isSmallScreenWidth ? styles.alignItemsStart : styles.alignItemsEnd]}> | ||
<View style={styles.anonymousRoomFooterWordmarkAndLogoContainer(props.isSmallSizeLayout)}> | ||
<View style={[styles.mr4, styles.flexShrink1]}> |
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.
<View style={[styles.mr4, styles.flexShrink1]}> | |
<View style={[props.isSmallSizeLayout ? styles.mr1 : styles.mr4, styles.flexShrink1]}> |
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.
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.
Fixed.
Reviewer Checklist
Screenshots/VideosWebweb.mov |
Cool, Fixed @aimane-chnaif! |
@allroundexperts please test again all possible cases on latest codebase: normal/archived rooms, web/resized web/native, online/offline |
You can test by updating Session.isAnonymousUser() condition manually. This condition should not affect styles made in this PR. |
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.
@marcochavezf 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, thanks guys! Also I won't merge it after SNH
Could we make the Sign In button just slightly less wide? Maybe take like 12-16px off of it. This way we have better space available for small viewports. |
Otherwise this feels good to me! |
@allroundexperts ^
SNH is over? |
@shawnborton Here is how it looks after removing 15px. |
Bump @shawnborton! |
Cool, that works for me, thanks! |
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.
Perfect, thank you guys, the code LGTM!
✋ 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/marcochavezf in version: 1.3.38-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.38-7 🚀
|
Details
This PR changes the design of the
AnonymouseFooter
component such that it matches the specs defined here.Fixed Issues
$ #20699
PROPOSAL: #20699 (comment)
Tests
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android