fix: code block not displayed for ASCII characters#81018
fix: code block not displayed for ASCII characters#81018inimaga merged 11 commits intoExpensify:mainfrom
Conversation
|
@ShridharGoel 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] |
- Use .at() method for array element access per linting rules - Hoist englishTrie lookup outside loop to avoid O(n) overhead
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edf095607e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33b1c9bb44
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Can you fix this line in the testing steps by mentioning an example like |
| // If the user has selected a language other than English, and the emoji doesn't exist in that language, | ||
| // we will check if the emoji exists in English. | ||
| if (normalizedLocale !== CONST.LOCALES.DEFAULT && !checkEmoji?.metaData?.code) { | ||
| const englishTrie = emojisTrie[CONST.LOCALES.DEFAULT]; | ||
| if (englishTrie) { | ||
| checkEmoji = englishTrie.search(name); | ||
| } | ||
| if (!checkEmoji?.metaData?.code && englishTrie) { | ||
| checkEmoji = englishTrie.search(name); | ||
| } |
There was a problem hiding this comment.
Why this change? Is it just to improve the code?
There was a problem hiding this comment.
This refactors the englishTrie lookup outside the loop for efficiency - instead of checking normalizedLocale !== CONST.LOCALES.DEFAULT and looking up emojisTrie[CONST.LOCALES.DEFAULT] on every emoji iteration, we now pre-compute it once before the loop. The behavior is identical - if locale is not default and emoji isn't found in the localized trie, try English.
…ock-not-displayed-for-ASCII-characters
Done. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2026-02-06.at.10.17.30.PM.moviOS: HybridAppScreen.Recording.2026-02-06.at.10.15.53.PM.moviOS: mWeb SafariScreen.Recording.2026-02-06.at.10.14.46.PM.movMacOS: Chrome / SafariScreen.Recording.2026-02-06.at.10.19.06.PM.mov |
…ock-not-displayed-for-ASCII-characters
…ock-not-displayed-for-ASCII-characters
|
🚧 @inimaga has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/inimaga in version: 9.3.17-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.17-9 🚀
|
Explanation of Change
Emoji shortcodes like 😂 were being converted to emoji characters even inside code blocks (
:joy:). This fix adds code block awareness to emoji replacement.Fixed Issues
$ #62710
PROPOSAL: #62710 (comment)
Tests
`to start a code block:joy:(the emoji shortcode)`to close the code block:joy:inside the code blockOffline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-01-30.at.6.50.20.in.the.evening.mov
Android: mWeb Chrome
Screen.Recording.2026-01-30.at.6.56.34.in.the.evening.mov
iOS: Native
Screen.Recording.2026-01-30.at.6.41.03.in.the.evening.mov
iOS: mWeb Safari
Screen.Recording.2026-01-30.at.6.41.53.in.the.evening.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-30.at.6.37.53.in.the.evening.mov