Skip to content

[HOLD for payment 2024-03-26] [$500] [Hold for payment 2024-02-22] Web - Most of the flag icons are replaced by country codes #33653

Closed

Description

@kbecciv

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: 1.4.18.1
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Issue found when executing PR #33603

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Open emoji picker
  3. Click on the "flag" category
  4. Scroll down

Expected Result:

Actual flags should be added. Black ones should be replaced.

Actual Result:

Most of the flag icons are replaced by country codes. Some of them are just black.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6326895_1703696523699.bandicam_2023-12-27_17-41-01-308.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bb535f38757934f7
  • Upwork Job ID: 1760839254159802368
  • Last Price Increase: 2024-02-23

Activity

  1. added
    DeployBlockerCash
    on Dec 27, 2023
  2. github-actions commented on Dec 27, 2023

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  3. melvin-bot commented on Dec 27, 2023

    @melvin-bot

    Triggered auto assignment to @deetergp (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  4. abzokhattab commented on Dec 27, 2023

    @abzokhattab
    Contributor

    I cannot reproduce it:
    image

  5. deetergp commented on Dec 27, 2023

    @deetergp
    Contributor

    I am also not seeing this. Don't think it's a blocker.
    Screenshot 2023-12-27 at 2 28 06 PM

  6. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Dec 27, 2023
  7. dragnoir commented on Dec 28, 2023

    @dragnoir
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Flag icons are not accessible on windows.

    What is the root cause of that problem?

    We are encountering an issue where flag icons are not rendered correctly on Windows platforms within the application. This problem affects the accessibility and visual consistency of the UI.

    To address the root cause, let's delve into the process of how browsers handle fonts, particularly for rendering emojis.
    Consider a simple text element <Text>Hello</Text> styled with a font, say FontBetaX, as follows:
    And we need the app to use FontBetaX (just as an example). We do in styling this line:

    font-family: FontBetaX;

    The browser's rendering process is two-fold:

    1. Font Loading: It checks if FontBetaX is loaded from the server:
    @font-face {
      font-family: ExpensifyNeue-Regular;
      src: url('../assets/fonts/web/FontBetaX.woff') format('woff');
    }
    1. Fallback Fonts: If not loaded from the server, the browser defaults to system-installed fonts.

    In the context of our app, specifically for emojis, the font styling is defined as:

    const  fontFamily:  FontFamilyStyles  = {
      EXP_NEUE: 'ExpensifyNeue-Regular, Segoe UI Emoji, Noto Color Emoji',
    };

    and then we use it in styling of the components

    fontFamily: FontUtils.fontFamily.platform.EXP_NEUE,

    On the browser, this translates to:

    font-family: ExpensifyNeue-Regular, "Windows Segoe UI Emoji", "Noto Color Emoji";

    Here’s the process the browser follows:

    1. The browser will check if the ExpensifyNeue-Regular font is loaded from the app server (Yes it is)
    2. The browser will check if the font ExpensifyNeue-Regular support the emoji (No the font doesn't support the emoji).
    3. The browser will move to the next font, Segoe UI Emoji, and check if it's imported from the server (No, we don't import this font)
    4. The browser will check if the system has this font (Yes, windows has by default the Segoe family font)
    5. The browser then will use this font the render the emoji (This cause the issue because Segoe render flags as characters)

    In contrast, on Ubuntu, none of the fonts are supported by default, resulting in emojis not displaying correctly, as shown in the attached screenshot from Ubuntu.
    image

    The core issue lies in our reliance on default system fonts for emoji rendering, which varies across platforms:

    • Android uses Noto Color Emoji iOS
    • macOS use Apple Color Emoji
    • Windows and use Segoe UI Emoji
      A more robust approach is to serve a consistent emoji font from our server, as we do with ExpensifyNeue-Regular.

    What changes do you think we should make in order to solve the problem?

    To resolve this on Windows, we should serve a universally compatible emoji font from our server. I suggest Noto Color Emoji (already in use on Android devices). The implementation steps are:

    1. Add the font file to the folder /assets/fonts/web
    2. Import the Noto font here
    3. Apply the Noto Color Emoji font on Emojies on Windows and not Windows Segoe UI Emoji by changing the order of the fonts in the style.
    font-family: ExpensifyNeue-Regular, "Noto Color Emoji";

    What alternative solutions did you explore? (Optional)

    We observed that the Expensify app currently renders emojis differently across platforms, as demonstrated in the attached screenshot comparing Windows and Android emojis.

    image

    An alternative approach would be to standardize the emoji style across all platforms, akin to platforms like Slack. This would enhance consistency in our user experience.

  8. dragnoir commented on Dec 28, 2023

    @dragnoir
    Contributor

    @deetergp the issue is only on Windows

    image

  9. mountiny commented on Dec 28, 2023

    @mountiny
    Contributor

    I think this was expected, and its known that on windows the flag emojis are not working perfectly.

    it would be great to avoid any kind of workarounds if we want to fix this

  10. aimane-chnaif commented on Dec 28, 2023

    @aimane-chnaif
    Contributor

    I think this can be closed. If this should be fixed, original contributors in #31717 should handle this as follow-up as they enabled this feature.

  11. 74 remaining items

  12. iwiznia commented on Mar 15, 2024

    @iwiznia
    Contributor

    Yep. I think we should just revert this and leave the "broken" flag emojis on window.

    If people feel passionate that it should work, then we should make it only load for windows users AND reduce the size of the font (maybe by removing all emojis that are not flags?)

  13. dragnoir commented on Mar 15, 2024

    @dragnoir
    Contributor

    @iwiznia another issue to consider is:

    • User A on a non-windows device sends a message to user B, the message use flags
    • User B on Windows, will not be able to see the flags, but some characters like AM
  14. iwiznia commented on Mar 15, 2024

    @iwiznia
    Contributor

    Yes, I know, windows users will use the flag icons that windows has, which apparently is just initials of the place.

  15. added
    Weekly
    Awaiting Payment
    and removed
    Daily
    on Mar 19, 2024
  16. changed the title [-][$500] [Hold for payment 2024-02-22] Web - Most of the flag icons are replaced by country codes[/-] [+][HOLD for payment 2024-03-26] [$500] [Hold for payment 2024-02-22] Web - Most of the flag icons are replaced by country codes[/+] on Mar 19, 2024
  17. melvin-bot commented on Mar 19, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  18. removed
    Reviewing
    on Mar 19, 2024
  19. melvin-bot commented on Mar 19, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.54-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-03-26. 🎊

    For reference, here are some details about the assignees on this issue:

    • @dragnoir requires payment (Needs manual offer from BZ)
    • @aimane-chnaif requires payment (Needs manual offer from BZ)
  20. melvin-bot commented on Mar 19, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
    • [@aimane-chnaif] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • [@aimane-chnaif] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • [@aimane-chnaif] Determine if we should create a regression test for this bug.
    • [@aimane-chnaif] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugEngineeringExternalWeekly

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions