-
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
Add support for Latin characters in emoji suggestion #39805
Conversation
@thesahindia Please 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] |
I think we cannot use |
@@ -1680,8 +1680,8 @@ const CONST = { | |||
// Extract attachment's source from the data's html string | |||
ATTACHMENT_DATA: /(data-expensify-source|data-name)="([^"]+)"/g, | |||
|
|||
EMOJI_NAME: /:[\w+-]+:/g, | |||
EMOJI_SUGGESTIONS: /:[a-zA-Z0-9_+-]{1,40}$/, | |||
EMOJI_NAME: /:[\p{L}0-9_+-]+:/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.
This is used when auto-completing the emoji (:emoji_name:
).
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 cannot use localeCompare here given the current implementation of Trie and localeCompare only shows us whether two strings are equal but sometimes we want to search for a substring.
Let's discuss this in the issue
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.
Small nitpick change
Why is 😍 showing before ❤️ ? The former is not an exact match, while the latter is, so I would expect the latter to show up first. @tienifr, can you look into this? |
On it. |
Bump @tienifr |
@thesahindia I'm sorry this got out of my radar for a while. The problem is that we did not add the accent-normalized version when directly adding to the trie: Line 74 in e8ae3c5
We also need to add this logic while updating the trie: Line 41 in e8ae3c5
Line 76 in e8ae3c5
|
src/libs/StringUtils.ts
Outdated
* Remove accents/diacritics | ||
* @param text - The input string | ||
* @returns The string with all accents/diacritics removed | ||
*/ |
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.
Let's keep some description for this @tienifr
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.
bump @tienifr
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.
Updated!
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.
Looks good!
Gonna duck out of this review since @iwiznia is reviewing and participated in the linked issue more than me. |
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.78-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.78-0 🚀
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.78-2 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.78-2 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
Details
Composer does not auto complete or show suggestion and no results found in emoji picker when type emoji name with Latin characters. This PR fixes that.
Fixed Issues
$ #38549
PROPOSAL: #38549 (comment)
Tests
corazón
):emoji_name
(without closing:
) in the main composer to suggest a Latin emoji (e.g.,corazón
):emoji_name
(without closing:
) in the main composer to suggest the above emoji with its base characters (e.g.,corazon
):
(e.g.,:corazón:
)Offline tests
NA
QA Steps
corazón
):emoji_name
(without closing:
) in the main composer to suggest a Latin emoji (e.g.,corazón
):emoji_name
(without closing:
) in the main composer to suggest the above emoji with its base characters (e.g.,corazon
):
(e.g.,:corazón:
)PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Screen.Recording.2024-04-08.at.17.49.40-compressed.mov
Android: mWeb Chrome
Screen.Recording.2024-04-08.at.17.48.05-compressed.mov
iOS: Native
Screen.Recording.2024-04-08.at.17.38.03-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-04-08.at.17.40.21-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-08.at.17.34.44-compressed.mov
MacOS: Desktop
Screen.Recording.2024-04-08.at.17.39.43-compressed.mov