-
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
Issue 6390 - Fixes emoji positioning #6766
Issue 6390 - Fixes emoji positioning #6766
Conversation
export default { | ||
paddingTop: 19, | ||
}; |
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.
From #6390 (comment).
We should try to avoid using styles specific to platforms. Try to generalize the styles so that they look good on each platform.
This change affects only IOS creating inconsistency across platforms. Also, this is a big design decision and thus I will ask someone to review this.
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.
The default padding top is 23, I'll move it to the file for clarity. @parasharrajat
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.
Also, I had to do similar in another issue related to emojis
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.
I agree, I forgot to mention that at that time but there, UI was not affected. The text was vertically aligned on all platforms and here the gap is not equal.
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.
Can you help me understand what this change does, and how it helps us fix the issue that is being addressed 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.
@parasharrajat gotcha
@shawnborton long story short, emojis on iOS display a bit larger ( #6390 (comment) ) and require some extra pixels to display it properly. The input has height: 100%; paddingBottom: 8; paddingTop: 23
, and the parent has height: 50
, so, the usable height for the input is 19
, but as the input has fontSize: 15
, it needs 4 extra pixels to render the emoji properly, that's why changing paddingTop: 23
to paddingTop: 19
address the issue.
We can also use paddingBottom: 6; paddingTop: 21
to try to keep it a bit more at center...
src/styles/styles.js
Outdated
}, | ||
|
||
expensiTextInputAndIconContainer: { | ||
zIndex: -1, | ||
flexDirection: 'row', | ||
height: '100%', |
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 could be breaking Multiline input. Could you test it and share a clip of that with me?
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.
@parasharrajat I tested Web Safari and App iOS and it was alright. I'll run screenshots once we settle the requested changes...
@shawnborton This PR is changing the padding for TextInputs across the app to paddingTop: 19px. Could you please check the screenshots and tell us if this is fine? |
I don't understand why the text input components are being touched when this issue is about fixing how emojis display in the chats list. Can someone help me understand? Thanks! |
@shawnborton This also affects the TextInput and Emojis are cropped on TextInput in IOS too. #6390 (comment). Scope was extended. |
Just to clarify, how did that scope get added here? Seems like that should be a separate project? |
Okay looks like it was discussed to group these together in the issue, cc @roryabraham |
@@ -1111,8 +1114,8 @@ const styles = { | |||
}, | |||
|
|||
optionAlternateText: { | |||
height: 16, | |||
lineHeight: 16, | |||
height: 20, |
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 not sure how I feel about this change. Right now, we have the user name/email set to be 20px tall, then a 4px margin, then the alternate text is 16px. This gives us 20 + 4 + 16 = 40px, which sits perfectly next to the 40px tall avatar. Can you make sure we get this same kind of evenness with these proposed changes?
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 the margin was removed, as discussed in #6390 (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.
@sidferreira could you please expand on Shawn's comment. We want to be sure from a design perspective.
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.
Quoting from the link:
To fix this, we need to tweak optionAlternateText
in 3 places:
Use case 1
App/src/pages/home/HeaderView.js
Lines 151 to 159 in ecce012
<ExpensifyText | |
style={[ | |
styles.sidebarLinkText, | |
styles.optionAlternateText, | |
styles.textLabelSupporting, | |
styles.mt1, | |
]} | |
numberOfLines={1} | |
> |
Use case 2
App/src/pages/home/sidebar/OptionRow.js
Line 95 in 0311b18
: [textStyle, styles.optionAlternateText, styles.textLabelSupporting, styles.mt1]; |
Have a total height 20
as the component height
is 16
and mt1
is 4
.
Use case 3
App/src/pages/ReportDetailsPage.js
Lines 147 to 155 in ecce012
<ExpensifyText | |
style={[ | |
styles.sidebarLinkText, | |
styles.optionAlternateText, | |
styles.textLabelSupporting, | |
styles.mb6, | |
]} | |
numberOfLines={1} | |
> |
Has a
total height 40
as the component height
is 16
and mt6
is 24
So, my suggestion is to:
A) change optionAlternateText
to have lineHeight/height: 20
, behaving kinda like mt1
by default
B) Remove mt1
from use cases 1 and 2
C) Change mb6
to mb5
in use case 3
This change will make sure that all items keep their designed heights but allow space to emoji wherever is needed.
@shawnborton yeah, @parasharrajat and I wondered if we should split it or not, but sounded smaller than turned into... |
I think it's better to split the Textinput issue into a separate one. So I am reporting it on Slack. |
This reverts commit ee5b660.
@parasharrajat @roryabraham @shawnborton revered input changes |
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 all seems fine to me, but let's see what @shawnborton thinks
Awaiting Shawn's input before final review. |
I think this looks good to me, thanks! |
✋ 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 @roryabraham in version: 1.1.21-2 🚀
|
@roryabraham @sidferreira @parasharrajat How can we create default room, with a subtitle? |
@mvtglobally for development purposes I forced those cases, I'm not sure how to create it as well... It seems to require admin rights or something... |
@mvtglobally since:
I think that gives me enough confidence to check this off and run the deploy. |
🚀 Deployed to production by @sketchydroide in version: 1.1.22-0 🚀
|
Details
This issue addresses some positioning issues for emojis in iOS.
Some changes affects other platforms, but minor changes.
Fixed Issues
$ #6390
Tests
QA Steps
To test: App/src/pages/home/HeaderView.js
Needs a default room, with a subtitle.
Look at the room subtitle.
Emoji should be fully visible, no positioning change on other platforms.
Adding/removing the emoji should not change the text position.
To test: App/src/pages/ReportDetailsPage.js
Needs a default room, with a subtitle.
Go to the room details.
Emoji should be fully visible, the component had
height: 16px; paddingBottom: 24px;
now it hasheight: 20px; paddingBottom: 20px;
.The text is basically ~4px lower with this.
Adding/removing the emoji should not change the text position.
To test: App/src/pages/home/sidebar/OptionRow.js
Go to a chat, send an emoji
Go back to chat list
Emoji should be fully visible, the description component had
height: 16px; paddingTop: 4px;
now it hasheight: 20px; paddingTop: 0px;
.The text moves a ~1px up with the change.
Adding/removing the emoji should not change the text position.
Tested On
Screenshots
App/src/pages/home/HeaderView.js
App/src/pages/ReportDetailsPage.js
App/src/pages/home/sidebar/OptionRow.js
Most Recents
App/src/pages/home/sidebar/OptionRow.js
Focus
(avoid regression)