-
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
Make emojis larger when multiple are sent at the same time #8896
Conversation
Updated |
Even if there are spaces in between Emojis should they be small? |
PR Reviewer Checklist
|
Add failure steps i.e which is adding text along with emoji will make them smaller |
Hmm, nice edgecase! I missed that. Part of me thinks that yes a space character could be an exception -- but it's a bit of a rabbit hole as I'm sure we could think of other exceptions too. Ultimately I don't think it matters too much either way |
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.
Tested well for me on all platforms.
CC @tgolen who may want to review, as you have essentially already reviewed |
This could be plausible regressions just checking with you. I could see only whitespaces and a newLine, |
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 left a few edge cases here #8896 (comment).
Otherwise Looks good & test's well for me!
cc: @Julesssss
src/styles/styles.js
Outdated
fontSize: variables.fontSizeSingleEmoji, | ||
lineHeight: variables.fontSizeSingleEmojiHeight, |
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.
NAB! these variables could be renamed 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.
@eVoloshchak Can you handle these cases thanks! #8896 (comment)
Thats a good catch I have a solution for the case with line breaks, but would like your input on it before i push it: Proposed solution:
In practice, it means adding the following before this line: const differByLineBreaksOnly = props.fragment.html.replaceAll('<br />', ' ') === props.fragment.text;
if (differByLineBreaksOnly) {
props.fragment.text = props.fragment.html = props.fragment.html.replaceAll('<br />', '\n');
} What do you think? |
I think I'm OK with that fix for the newlines. Nice that the whitespace idea was suggested. |
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!
all you @Santhosh-Sellavel |
Yeah will check this today. |
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.
Re-approving. Tests well 👍
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.
Just a small change can we clean this up, thanks!
src/libs/EmojiUtils.js
Outdated
|
||
// Emojis are stored as multiple characters, so we're using spread operator | ||
// to iterate over the actual emojis, not just characters that compose them | ||
const messageCodes = _.filter(_.map([...message.replace(/ /g, '').replaceAll('\n', '')], |
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 not DRY, message.replace(/ /g, '').replaceAll('\n', '')
computing this twice.
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 not DRY,
message.replace(/ /g, '').replaceAll('\n', '')
computing this twice.
All done
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.
Looks good to me, tests well!
cc: @tgolen @Julesssss
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.
Thanks all, looks good to me 👍
I think we are good to merge this cc: @tgolen |
✋ 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 production by @AndrewGable in version: 1.1.61-3 🚀
|
Interesting FYI that these changes appear to be breaking mobile web for me on iOS simulator running iOS 13 - my device running iOS 15 is not affected. Pretty sure we are not tracking support for mobile web on all iOS versions so unsure if this counts as a "regression" - but gonna fix it. |
|
@marcaaron, that's a good catch, thank you! |
@marcaaron I think we should capture this somewhere to avoid this happening again. |
Thanks, I'm working on a fix already so feel free to close your PR @eVoloshchak.
One solution I can think of is to...
|
Sounds good to me! |
Just stopping by to say that I saw the same error ( |
Details
Previously emojis in messages were larger than text only if you send message consisting of only one emoji. This PR ensures that if message consists only of emojis, they are displayed larger that text, regardless of the length.
Fixed Issues
#8867
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
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)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
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)QA Steps
Screenshots
Web
Mobile Web
Desktop
I'm unable to launch the desktop app due to this bug. It is not present if you downgrade to certain node and npm versions, but since I use MacinCloud, I'm unable to do so. So if someone with a mac could test it and upload a video, I would highly appreciate it.
iOS
Android