-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 display name and date alignment #14304
Conversation
@Santhosh-Sellavel @MariaHCD One of you needs to 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] |
@Expensify/design or @shawnborton does it looks as expected? WebDesktopAndroidiOSAndroid mWebiOS mWeb |
@luacmartins PR Screenshots are not loading can you check? |
src/styles/styles.js
Outdated
lineHeight: variables.lineHeightXLarge, | ||
paddingBottom: 4, |
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 want to get rid of the padding bottom. However, for image attachments, if the image attachment is the first thing in the message group (it comes right after the sender name) we should give it some top margin of say 4-8px.
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 just read the Slack thread linked to the issue and it seems like we also want to do some cleanup on the negative margins used for the message text, as well as add some padding for images. I'll add that to this PR.
That being said, I'm having issues aligning the sender name & date at the baseline. alignItems: 'baseline'
is supported in RN and works well on browsers, but the Pressable
component wrapping the sender name text is throwing off the alignment on iOS/android native since it's baseline is different from the text baseline. Here's how they behave:
I've spent some time trying to work around this issue, but no luck so far. Any suggestions?
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.
Take a look at the discussion from this one: #14148
We actually learned that baseline doesn't always work on Android so we might want to avoid that.
There was a proposal that seemed to fix the alignment by always making sure the big text (sender) and small text (timestamp) had the same lineheight and height. So maybe we could try that first?
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.
So after seeing this, it does feel like the sender is too close to the message, but maybe that's because the negative margin is still there. So let me know once you start playing around with that stuff too.
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 proposal that seemed to fix the alignment by always making sure the big text (sender) and small text (timestamp) had the same lineheight and height. So maybe we could try that first?
I tried this and the other solutions in that issue but none of them seem to work. Maybe I'm holding something wrong?
I'd appreciate any other suggestions as I'm struggling to find a solution that doesn't add any padding/margins to the 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.
@shawnborton I updated the branch with the following:
- Added
lineHeight: 20px
to the senders name and removed the bottom padding - Added
lineHeight: 16px
andpaddingTop: 4px
to the timestamp
Now the header + single line message sums up to 40px and both seem to be aligned at the baseline:
In addition, I removed the negative margin from chatItemMessage
and added a conditional 8px top margin to attachments when displayed with the header:
Let me know what you think!
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.
@aneequeahmad let's see what @shawnborton says about my changes above!
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.
That feels pretty great to me! Thanks for pushing through this one and getting to a good solution!
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.
@luacmartins Code changes looks good to me too. That's a pretty neat solution. @shawnborton Thank-you for your suggestion.
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.
Thank you both for the help!
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 the screenshots in the OP :) The padding bottom does look a bit too much in @Santhosh-Sellavel's screenshots but it looks fine when I tested locally on:
Web:
Desktop:
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!
@Santhosh-Sellavel all yours for review! |
Screenshots/VideosThe latest screenshots does it looks good? cc: @shawnborton @luacmartins @MariaHCD |
Reviewer Checklist
|
@luacmartins Can you update the latest screenshots in the PR? |
@Santhosh-Sellavel done! |
@luacmartins have you checked this #14304 (comment)? Seem still something is off to me, is it just to me? |
|
@shawnborton I just checked this branch it seems fine at my end. Strange. |
Hmm @Santhosh-Sellavel any idea what's causing this? It seems like between this issue and the other alignment issue, we're getting a lot of inconsistencies in various platforms/screenshots. |
hmm I'm seeing a small alignment issue on mWeb Chrome and Safari 🤔 Not sure what's causing it yet. |
@luacmartins i just debugged and fixed the issue. Actually there is not need to add Also verified it doesn't cause regression on Web. cc: @shawnborton Code Changes: chatItemMessageHeaderTimestamp: {
flexShrink: 0,
color: themeColors.textSupporting,
fontSize: variables.fontSizeSmall,
- paddingTop: 4,
- lineHeight: variables.lineHeightNormal,
+ paddingTop: 2,
},
|
I find all platforms are off, i.e compare this screenshots with screenshots in the PR description. @MariaHCD Can you post what you see on Web & Desktop? Honestly, I'm confused about what's happening here, before worrying about Inconsistent between platforms, there is an inconsistency between author screenshots & reviewer screenshots 😕 . cc: @shawnborton |
I updated the PR and screenshots using this suggestion. Ready for another review! |
That feels pretty good to me. It might not be perfectly baseline aligned, but I think it's a good improvement and it feels consistent across platforms. |
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.
Here are new screenshots can you confirm this looks @shawnborton @luacmartins |
Yup, this feels pretty good to me! |
@Santhosh-Sellavel seems like this looks good now. Can you complete the checklist please? |
Yes will do! |
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, everyone!
✋ 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/luacmartins in version: 1.2.63-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.63-0 🚀
|
Details
Fix the display name and date alignments
Fixed Issues
$ #14269
Tests
Offline tests
N/A
QA Steps
Same as tests
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.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android