Skip to content
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

[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
1 of 6 tasks
kbecciv opened this issue Dec 27, 2023 · 58 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Dec 27, 2023

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
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Dec 27, 2023
Copy link
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.

Copy link

melvin-bot bot commented Dec 27, 2023

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

@abzokhattab
Copy link
Contributor

I cannot reproduce it:
image

@deetergp
Copy link
Contributor

deetergp commented Dec 27, 2023

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

@deetergp deetergp added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 27, 2023
@dragnoir
Copy link
Contributor

dragnoir commented Dec 28, 2023

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.

@dragnoir
Copy link
Contributor

dragnoir commented Dec 28, 2023

@deetergp the issue is only on Windows

image

@mountiny
Copy link
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

@aimane-chnaif
Copy link
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.

@mountiny
Copy link
Contributor

its pass the regression period but I think they knew about it so maybe we can just tag @puneetlath @c3024 @s-alves10

@puneetlath
Copy link
Contributor

Yes, my understanding is that the two letter codes is what windows renders for these emojis. It's not a workaround on our part. It's just what the system is doing and it's not a bug. Feel free to reopen/comment if you disagree.

@dragnoir
Copy link
Contributor

Below a screenshot from Slack web app (flags) and same for other web apps on windows.

image

I think it's not good for UX and for the app to allow using emoji unicode with a font that does not support it.
The issue is not from Windows. The issue is that we are asking "Segoe UI Emoji" to dispplay unsupported emoji.

@mountiny
Copy link
Contributor

mountiny commented Jan 4, 2024

@dragnoir Can you give more details about the implementation, we are trying to avoid platform specific code, even more so operating system specific one

@mountiny mountiny reopened this Jan 4, 2024
@melvin-bot melvin-bot bot added the Overdue label Jan 4, 2024
@mountiny
Copy link
Contributor

mountiny commented Jan 4, 2024

@deetergp Discussed this here btw

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Jan 4, 2024

@dragnoir can you share Noto Color Emoji font file? or share test branch

@dragnoir
Copy link
Contributor

dragnoir commented Jan 4, 2024

@aimane-chnaif link for the font: https://fonts.google.com/noto/specimen/Noto+Color+Emoji
@mountiny I will update my proposal for more details

@s-alves10
Copy link
Contributor

@mountiny @aimane-chnaif

This was done by intention in #31717. We added supports for flags emojis on Windows and those are flag emojis(not country code) by the font
I don't think this is a bug

@aimane-chnaif
Copy link
Contributor

@s-alves10
Copy link
Contributor

Okay, if we need to fix this, yeah, the use of proper font is the right way, I think.
We should check if the new font has other side effects anyway

@deetergp
Copy link
Contributor

deetergp commented Jan 4, 2024

The consensus is that nobody feels super passionate about it, but if it's an easy fix, then we should go ahead and fix it.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Feb 19, 2024
@deetergp
Copy link
Contributor

Hi @kadiealexander 👋 welcome to this GH, already in progress. The PR has been made and deployed to production, we just need to pay out once we're past the regression window.

@kadiealexander
Copy link
Contributor

Roger! Thanks for the rundown Scott!

@kadiealexander kadiealexander changed the title Web - Most of the flag icons are replaced by country codes [Hold for payment 2024-02-22] Web - Most of the flag icons are replaced by country codes Feb 20, 2024
@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Feb 23, 2024
@melvin-bot melvin-bot bot changed the title [Hold for payment 2024-02-22] Web - Most of the flag icons are replaced by country codes [$500] [Hold for payment 2024-02-22] Web - Most of the flag icons are replaced by country codes Feb 23, 2024
Copy link

melvin-bot bot commented Feb 23, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01bb535f38757934f7

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 23, 2024
Copy link

melvin-bot bot commented Feb 23, 2024

Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.

@kadiealexander kadiealexander removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 23, 2024
@kadiealexander
Copy link
Contributor

kadiealexander commented Feb 23, 2024

Payouts due:

Upwork job is here.

@kadiealexander
Copy link
Contributor

Contracts sent!

@iwiznia
Copy link
Contributor

iwiznia commented Mar 15, 2024

Sorry but I just realized we did this and correct me if I am wrong but:

  • We added a new font that's 5.4MB
  • This is only so that windows, which does not have flag emojis, can display the flag emojis
  • We are loading this file for every user, even people that are not on windows

Is that all correct?

@iwiznia iwiznia reopened this Mar 15, 2024
@shawnborton
Copy link
Contributor

Yeah, just seeing this now and echoing the same concern as Ionatan above - I think we picked a bad solution for this and we should revert what was implemented.

@iwiznia
Copy link
Contributor

iwiznia commented Mar 15, 2024

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?)

@dragnoir
Copy link
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

@iwiznia
Copy link
Contributor

iwiznia commented Mar 15, 2024

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

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 19, 2024
@melvin-bot melvin-bot bot 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 Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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)

Copy link

melvin-bot bot commented Mar 19, 2024

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
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Archived in project
Development

No branches or pull requests