-
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
Fix styled text treated as an emoji #13905
Conversation
@AndrewGable @thesahindia 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] |
src/CONST.js
Outdated
@@ -455,7 +455,7 @@ const CONST = { | |||
|
|||
EMOJI_FREQUENT_ROW_COUNT: 3, | |||
|
|||
EMOJI_INVISIBLE_CODEPOINTS: ['fe0f', '200d'], | |||
EMOJI_INVISIBLE_CODEPOINTS: ['fe0f', '200d', '2066'], |
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.
Now that we are adding LTR unicode here, I think it would be better to rename it to just INVISIBLE_CODEPOINTS
tests/unit/EmojiTest.js
Outdated
@@ -76,6 +76,21 @@ describe('EmojiTest', () => { | |||
|
|||
// Given an input when we check only multiple emojis with additional whitespace, then it should return false | |||
expect(EmojiUtils.containsOnlyEmojis('😄 👋')).toBe(true); | |||
|
|||
// Given an emoji with a LTR unicode, when when we check if it contains only emoji, then it should return true |
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.
// Given an emoji with a LTR unicode, when when we check if it contains only emoji, then it should return true | |
// Given an emoji with a LTR unicode, when we check if it contains only emoji, then it should return true |
tests/unit/EmojiTest.js
Outdated
expect(EmojiUtils.containsOnlyEmojis('\u2066😄')).toBe(true); | ||
}); | ||
|
||
it('don\'t match for non emoji', () => { |
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.
it('don\'t match for non emoji', () => { | |
it('will not match for non emoji', () => { |
My IP has been whitelisted. Added the video for iOS mWeb and added some commits for the suggested changes. |
Reviewer Checklist
Screenshots/Videos |
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.
Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - 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 @AndrewGable in version: 1.2.47-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.2.47-0 🚀
|
Details
(A) When we send a styled text (italic, bold, or any styling) from another website, our current EMOJIS regex matches the text as an emoji, and because we set the font size bigger for emoji only messages, the styled text also gets bigger.
And there is also an additional issue (B) where when we copy emoji only messages by selecting it from the sent message and send it again, the emoji font size is not big (only possible happens on web).
Fixed Issues
$ #13823
PROPOSAL: #13823 (comment)
Tests
(A)
(B-web only)
Offline tests
(A)
(B-web only)
QA Steps
(A)
(B-web only)
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
Screen.Recording.2022-12-28.at.18.37.51.mov
Mobile Web - Chrome
328711.t.mp4
Mobile Web - Safari
Screen.Recording.2022-12-30.at.08.21.11.mp4
Desktop
Screen.Recording.2022-12-29.at.20.19.40.mov
iOS
Screen.Recording.2022-12-29.at.21.33.55.mov
Android
328706.t.mp4