-
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 cutoff emojis inside code blocks #20287
Conversation
@@ -1,15 +1,15 @@ | |||
const codeWordWrapper = { | |||
height: 20, | |||
height: 22, |
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.
Isn't 20 enough?
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.
In the case of 20, line-spacing is barely seen. Do you still want to set 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.
Can you please attach two screenshots for 20 and 22
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.
@s77rt
22 looks good IMO. What do 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.
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.
Ah right.
Let's use the value that is closest to mWeb Safari. 22 seems too much difference. Should we keep it 20 or 21? (Just pick the one that match the mWeb Safari the most)
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.
@s77rt
Of course 20 is the closest one, but visually 22 is the most similar. Which do you prefer? Visually 21 isn't good as well.
What about to leave it as is for now?
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.
@s77rt
Do you still want to set height to 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.
No it's okay, not a blocker. We can go ahead with 22
src/CONST.js
Outdated
@@ -1122,6 +1122,10 @@ const CONST = { | |||
// eslint-disable-next-line no-misleading-character-class | |||
/[\n\s,/?"{}[\]()&^%$#<>!*\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, | |||
|
|||
EMOJI_WORD_SPLITTER: |
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.
Change name to SPACE_OR_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.
done
Reviewer Checklist
Screenshots/VideosAndroidNot applicable due to a known bug |
Please update the tests specifying that the emojis should be aligned with the text and not cut and complete the checklist (check Android cases) |
PR updated |
Move the verify part to another step and not in the checkbox (it can be easily missed) |
to
|
PR updated |
@s-alves10 Thank you |
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! 🚀
cc @flodnv
Thanks! In the future please make sure your PR titles are descriptive -- I've updated this one for now 🙇 |
@@ -1122,6 +1122,10 @@ const CONST = { | |||
// eslint-disable-next-line no-misleading-character-class | |||
/[\n\s,/?"{}[\]()&^%$#<>!*\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, | |||
|
|||
SPACE_OR_EMOJI: | |||
// eslint-disable-next-line no-misleading-character-class | |||
/(\s+|(?:[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3)+)/gu, |
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.
\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3
is repeated 4 times in this file, would it make sense to somehow extract it in its own constant?
Or said another way, can we reuse the EMOJIS
constant here instead of copy pasting it?
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.
@flodnv
Yes. In order to extract it, we have to extract it as string and use new RegExp
syntax, but I found that there is no such expression though it has been repeated 3 times already. So I guessed it's intentional.
Do you still want to extract EMOJIS constant as string?
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 doubt this is intentional. Can we extract \p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3
? If yes then let's do it
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.
Got it. Sorry for the noob question -- I understand that we cannot use it in new RegExp
, but why does this matter here?
Asked another way, why can we not have (pseudo code):
EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
SPACE_OR_EMOJI: /(\s+|(?:EMOJIS)+)/gu,
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.
@flodnv
/.../gu
isn't a string, it's a RegExp
object. We can't embed it inside another RegExp object like 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.
Ohhhh 👍 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 https://github.com/flodnv in version: 1.3.26-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.26-4 🚀
|
@@ -1,15 +1,15 @@ | |||
const codeWordWrapper = { | |||
height: 20, | |||
height: 22, |
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 kept it low to match the design requirements. Now the line must be bigger and inconsistent across platforms.
- Also, Are all platforms looking the same?
- Did we take design approval on this?
Details
Fixed Issues
$ #19922
PROPOSAL: #19922 (comment)
Tests
😄Hi👌 You're welcome. This is the unique👍 opportunity. Please take a look 🙂
Offline tests
😄Hi👌 You're welcome. This is the unique👍 opportunity. Please take a look 🙂
QA Steps
😄Hi👌 You're welcome. This is the unique👍 opportunity. Please take a look 🙂
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
19922_mac_chrome.mp4
Mobile Web - Chrome
19922_android_chrome.mp4
Mobile Web - Safari
19922_ios_safari.mp4
Desktop
19922_mac_desktop.mp4
iOS
19922_ios_native.mp4
Android
19922_android_native.mp4
Note:
Inline code blocks has a bug on Android devices as described here. This bug is out of the scope.