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

Web - Chat - Top of the highlight is not even when highlight emojis #39261

Closed
1 of 6 tasks
m-natarajan opened this issue Mar 29, 2024 · 24 comments
Closed
1 of 6 tasks

Web - Chat - Top of the highlight is not even when highlight emojis #39261

m-natarajan opened this issue Mar 29, 2024 · 24 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review

Comments

@m-natarajan
Copy link

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.58.0
Reproducible in staging?: Yes
Reproducible in production?: No
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:

Action Performed:

1.Go to staging.new.expensify.com/

2.Go to any chat

3.Inset multiple emojis

4.Highlight all the emojis

Expected Result:

The top of the highlight will be even

Actual Result:

The top of the highlight is not even

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

317920620-f03fe9dc-8116-4fa1-9e66-86303a56d401

20240329_233415.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

Triggered auto assignment to @marcochavezf (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Mar 29, 2024

Triggered auto assignment to @kevinksullivan (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Mar 29, 2024
@melvin-bot melvin-bot bot added the Daily KSv2 label Mar 29, 2024
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.

@m-natarajan
Copy link
Author

We think this bug might be related to #vip-vsb

@m-natarajan
Copy link
Author

@kevinksullivan 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.

@MahmudjonToraqulov
Copy link
Contributor

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

Web - Chat - Top of the highlight is not even when highlight emojis

What is the root cause of that problem?

ExtrafontSize: 20px is added for emoji so we're getting this issue.

14

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

We should remove thisfontSize: 20px and it's solved.

11

What alternative solutions did you explore? (Optional)

N/A

Result

13

@thienlnam thienlnam removed the DeployBlockerCash This issue or pull request should block deployment label Mar 29, 2024
@thienlnam thienlnam assigned thienlnam and unassigned marcochavezf Mar 29, 2024
@thienlnam
Copy link
Contributor

Not a blocker - added to the main tracking issue

@tomekzaw
Copy link
Contributor

tomekzaw commented Mar 29, 2024

I think this might be actually the correct behavior as there is a space character between each pair of emojis.

Also, emojis have larger font size than the text.

Here's how it looks on Firefox with some text added in between:

Screenshot 2024-03-29 at 22 37 24

cc @thienlnam

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

@kevinksullivan, @thienlnam Still overdue 6 days?! Let's take care of this!

@kevinksullivan
Copy link
Contributor

@thienlnam think tis fits into VSB as a very, very low bug?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 5, 2024
@thienlnam
Copy link
Contributor

thienlnam commented Apr 8, 2024

Ah okay, so tested it and I think the problem here is with the emoji size in the composer. Emojis when sent without text are larger than if you send them with text
Screenshot 2024-04-08 at 9 55 59 AM

But the size of the emoji with text in the composer is larger than the text, so it ends up creating the odd highlighting. But when you highlight the sent text, it doesn't have a problem because the emojis are smaller
Screenshot 2024-04-08 at 9 57 33 AM

Screenshot 2024-04-08 at 9 52 59 AM

@kevinksullivan Yeah I'd place this as a very very low bug in vip-vsb

@melvin-bot melvin-bot bot removed the Overdue label Apr 8, 2024
@thienlnam thienlnam added Weekly KSv2 and removed Daily KSv2 labels Apr 8, 2024
@tomekzaw
Copy link
Contributor

tomekzaw commented Apr 8, 2024

I think the problem here is with the emoji size in the composer.

Here's the full story:

  1. Currently (both on main and prod), the font size of any emoji in the composer is always set to 20pt. That's because 20pt is the default value of emoji.fontSize in Live Markdown library and I forgot to override it in E/App.

  2. There's already a PR from @Skalakid that sets the correct font size from variables.emojiSize:

  1. Once the above PR gets merged, the font size of any emoji in the composer will be always set to variables.emojiSize. Is this the expected behavior? Correct me if I'm wrong but based on this discussion, I assume that the emoji.fontSize should depend on the current message – if it contains only emojis, the font size should be larger.

cc @thienlnam

@thienlnam
Copy link
Contributor

Ah yup that's correct - okay sweet in that case this should be "fixed" when that PR is merged so I'll go ahead and close

@tomekzaw
Copy link
Contributor

tomekzaw commented Apr 8, 2024

@thienlnam What about point 3? Do we want to increase/decrease the font size of emojis in the composer depending on whether the current message contains any text or only emojis?

@thienlnam
Copy link
Contributor

Oh my bad, but emoji.fontSize should depend on the current message
Screenshot 2024-04-08 at 2 27 53 PM

For example the first size is larger since there are only emojis, and then the second message with text is smaller

@thienlnam thienlnam reopened this Apr 8, 2024
@tomekzaw
Copy link
Contributor

tomekzaw commented Apr 8, 2024

No problem, I think we can easily achieve that. We can set emoji.fontSize in markdownStyle based on the current message directly in React code.

Currently, we have a useMarkdownStyle hook that returns the markdownStyle object – we can pass the current text as an argument and calculate emoji.fontSize based on whether it contains only emojis or not.

The only problem is that the font size will be calculated on the JS thread but the formatting needs to be applied on the UI thread while typing – there's a possibility of a "font size jump" when the result of the predicate changes. I believe this is not a huge problem for now (please let me know what you think @thienlnam).

There are two options how we can improve that in the future:

  1. We can extend Live Markdown so that we can pass two different fontSize values and MarkdownTextInput will use the appropriate value based on its contents. (I don't like this option as it introduces some confusion)
  2. We can extend the JS parser so that it does not apply emoji style to the emojis if the current text includes characters (glyphs?) other than emojis. This way, we can set emoji.fontSize once and this setting will be used only for emoji-only messages.

@thienlnam
Copy link
Contributor

Yeah that sounds good, the font size jump doesn't sound like a problem right now - so let's just try that first and improve it later if there are any concerns

@tomekzaw
Copy link
Contributor

tomekzaw commented Apr 8, 2024

Do you want to merge #39597 first and then come up with another PR or should we implement this directly in #39597?

@thienlnam
Copy link
Contributor

If we could implement it directly that would be great

@tomekzaw
Copy link
Contributor

tomekzaw commented Apr 8, 2024

Sure thing, I'll leave it up for @Skalakid since he's the author of the PR.

Copy link

melvin-bot bot commented Apr 12, 2024

@kevinksullivan @thienlnam this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@tomekzaw
Copy link
Contributor

tomekzaw commented Apr 12, 2024

fyi #39597 has been merged.

@thienlnam thienlnam added the Reviewing Has a PR in review label Apr 12, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

This issue has not been updated in over 15 days. @kevinksullivan, @thienlnam eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@kevinksullivan
Copy link
Contributor

Think this is all set @thienlnam ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants