Open IuliiaHerets opened 1 week ago
Triggered auto assignment to @strepanier03 (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@strepanier03 FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Edited by proposal-police: This proposal was edited at 2024-10-08 15:41:39 UTC.
Android - Profile - Some emojis are displayed as ellipsis in status
This problem arises due to variations in font rendering and text layout across different Android devices. Especially in devices that has low resolution which causes the emoji bigger => it's cut off => we saw this issue.
Adjust Alignment and Text Layout Properties Set alignment and text layout properties to ensure proper text rendering in here: https://github.com/Expensify/App/blob/bdc3a157b5504f05ae2c0a56555de2c8839c21cf/src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx#L77
By adding:
alignSelf: 'stretch',
textAlign: 'center',
lineHeight: 30, // optional
to styles.emojiPickerButtonDropdownIcon
.
Add flex: 1
to styles.emojiPickerButtonDropdownIcon
so it can fill up the space.
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
I need to test this still and it's on my todo for tomorrow.
Can't repro via Browserstack and I don't have a Samsung so asking for help in Slack for testing.
Job added to Upwork: https://www.upwork.com/jobs/~021845940732835928891
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (External
)
Upwork job price has been updated to $50
In light of this type of bug, we have lowered the price to $50.
We would be willing to increase that if the contributor selected to fix this wants to review all emoji on the various devices to find other bugs to lump into this one.
Please let us know if that is the case.
Proposal
On some Samsung devices, specific emojis are being displayed as ellipsis (...) rather than as the intended emoji icons.
Root Cause: This issue often occurs due to compatibility problems with certain emojis on specific Samsung device models, especially if the emoji characters are not supported natively by the device’s font. Samsung devices may also have older emoji support, which might not fully recognize newer or less common emojis, resulting in these emojis rendering as ellipsis. Additionally, the React Native Text component can sometimes have trouble rendering emojis if the font is incompatible with the emoji set.
Font Compatibility Check: Ensure that the font used for the Text component supports a wide range of emojis. Samsung devices, in particular, may not support all emojis if using a custom font. You could use a platform-specific font or the default system font on Android for maximum compatibility with emojis. Update your Text component as follows:
<Text
style={[styles.emojiPickerButtonDropdownIcon, { fontFamily: Platform.OS === 'android' ? 'sans-serif' : undefined }]}
numberOfLines={1}
>
Fallback Mechanism: Add a fallback option where you detect whether the emoji has rendered correctly, and if not, display a generic emoji or icon as a fallback. You can do this by checking the emoji’s width and height, or by using a library such as react-native-unicode-emoji.
Use SVGs for Specific Emojis: Consider using an SVG or PNG icon for certain emojis instead of Unicode emojis, especially for Samsung devices. This avoids issues with the device’s native emoji font. You can implement this by conditionally rendering an SVG icon if you detect a Samsung device.
Cross-Platform Emoji Libraries: Libraries like emoji-mart or react-native-emoji-picker allow for a consistent emoji experience across devices, as they rely on images or SVGs instead of the device's font. However, this increases the app's bundle size.
Custom Emoji Font: You could include a custom emoji font within the app to ensure consistent emoji rendering. This solution might be overkill unless your app heavily relies on emoji display.
📣 @Ariqkip! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Problem On some Samsung devices, specific emojis are being displayed as ellipsis (...) rather than as the intended emoji icons.
This issue often occurs due to compatibility problems with certain emojis on specific Samsung device models, especially if the emoji characters are not supported natively by the device’s font. Samsung devices may also have older emoji support, which might not fully recognize newer or less common emojis, resulting in these emojis rendering as ellipsis. Additionally, the React Native Text component can sometimes have trouble rendering emojis if the font is incompatible with the emoji set.
Ensure that the font used for the Text component supports a wide range of emojis. Samsung devices, in particular, may not support all emojis if using a custom font. You could use a platform-specific font or the default system font on Android for maximum compatibility with emojis. Update your Text component as follows:
<Text
style={[styles.emojiPickerButtonDropdownIcon, { fontFamily: Platform.OS === 'android' ? 'sans-serif' : undefined }]}
numberOfLines={1}
>
Add a fallback option where you detect whether the emoji has rendered correctly, and if not, display a generic emoji or icon as a fallback. You can do this by checking the emoji’s width and height, or by using a library such as react-native-unicode-emoji.
Consider using an SVG or PNG icon for certain emojis instead of Unicode emojis, especially for Samsung devices. This avoids issues with the device’s native emoji font. You can implement this by conditionally rendering an SVG icon if you detect a Samsung device.
Libraries like emoji-mart or react-native-emoji-picker allow for a consistent emoji experience across devices, as they rely on images or SVGs instead of the device's font. However, this increases the app's bundle size.
You could include a custom emoji font within the app to ensure consistent emoji rendering. This solution might be overkill unless your app heavily relies on emoji display.
Contributor details Your Expensify account email: ericokip402@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01e8fca580ad3567b3
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Problem On some Samsung devices, specific emojis are being displayed as ellipsis (...) rather than as the intended emoji icons.
This issue often occurs due to compatibility problems with certain emojis on specific Samsung device models, especially if the emoji characters are not supported natively by the device’s font. Samsung devices may also have older emoji support, which might not fully recognize newer or less common emojis, resulting in these emojis rendering as ellipsis. Additionally, the React Native Text component can sometimes have trouble rendering emojis if the font is incompatible with the emoji set.
Ensure that the font used for the Text component supports a wide range of emojis. Samsung devices, in particular, may not support all emojis if using a custom font. You could use a platform-specific font or the default system font on Android for maximum compatibility with emojis. Update your Text component as follows:
<Text
style={[styles.emojiPickerButtonDropdownIcon, { fontFamily: Platform.OS === 'android' ? 'sans-serif' : undefined }]}
numberOfLines={1}
>
Add a fallback option where you detect whether the emoji has rendered correctly, and if not, display a generic emoji or icon as a fallback. You can do this by checking the emoji’s width and height, or by using a library such as react-native-unicode-emoji.
Consider using an SVG or PNG icon for certain emojis instead of Unicode emojis, especially for Samsung devices. This avoids issues with the device’s native emoji font. You can implement this by conditionally rendering an SVG icon if you detect a Samsung device.
Libraries like emoji-mart or react-native-emoji-picker allow for a consistent emoji experience across devices, as they rely on images or SVGs instead of the device's font. However, this increases the app's bundle size.
You could include a custom emoji font within the app to ensure consistent emoji rendering. This solution might be overkill unless your app heavily relies on emoji display.
@Ariqkip @layacat Could you guys provide videos to see how your solutions work? (Include video before applying change and video after applying change)
Which device you use to reproduce this issue?
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.0.46-1 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Some emojis must not be displayed as ellipsis samsung device.
Actual Result:
Some emojis are displayed as ellipsis in samsung device.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/0a65bc84-f350-4523-9ef9-0963e91df2aa
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @DylanDylann