Skip to content

[$500] Web - Chat - Composer with emoji is expanded with an empty line after expanding the composer #39361

Closed

Description

@lanitochka17

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-4
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to any chat
  3. Enter an emoji with a multi-line message
  4. Expand the composer

Expected Result:

No new line should be added at the end of the message

Actual Result:

A new empty line is added at the end of the message

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

Screen.Recording.2024-04-02.at.11.12.12.a.m.mov
Bug6434258_1711977454174.bandicam_2024-04-01_21-10-50-729.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016de42cbd35e27ee2
  • Upwork Job ID: 1775310993834332160
  • Last Price Increase: 2024-04-16

Activity

  1. melvin-bot commented on Apr 1, 2024

    @melvin-bot

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

  2. github-actions commented on Apr 1, 2024

    @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. lanitochka17 commented on Apr 1, 2024

    @lanitochka17
    Author

    @marcochavezf 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

  4. lanitochka17 commented on Apr 1, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp

  5. shahinyan11 commented on Apr 1, 2024

    @shahinyan11

    Proposal

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

    Web - Chat - Composer with emoji is expanded with an empty line after returning from Settings

    What is the root cause of that problem?

    Here we calculate number of lines . When we add an emoji to the text, the calculation does not work correctly and returns 1 line more. This is because the calculation is based on the following variables lineHeight, paddingTopAndBottom,textInput.current.scrollHeight, maxLines where lineHeight always belongs to the text. But currently the fontSize of the emojis is larger than the fontSize of the text. And when we add emojis, the paddingTopAndBottom and textInput.current.scrollHeight values decrease and calculation will not work correctly

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

    Set the same font size for emojis and text. To do that we can add emoji: {fontSize: variables.fontSizeNormal} in markdownStyle object

    What alternative solutions did you explore? (Optional)

    Add below code on this line

    if(extractEmojis(value ?? '').length > 0 && generalNumberOfLines > 1){
        generalNumberOfLines--
    }
    

    What alternative solutions did you explore? (Optional)

    Add ability for getNumberOfLines function to receive one more param ( containsEmoji ) and update calculation logic there

  6. marcochavezf commented on Apr 1, 2024

    @marcochavezf
    Contributor

    I found out this is introduced by #38955, reverting the offending PR here

  7. ishpaul777 commented on Apr 1, 2024

    @ishpaul777
    Contributor

    @marcochavezf I can raise a fix as offending PR author. it was pointed out here on weekend #38955 (comment) but slipped of mind

  8. ishpaul777 commented on Apr 1, 2024

    @ishpaul777
    Contributor

    Can we wait for fixing PR instead of full revert please

  9. marcochavezf commented on Apr 1, 2024

    @marcochavezf
    Contributor

    Sure, we can wait

  10. marcaaron commented on Apr 1, 2024

    @marcaaron
    Contributor

    @ishpaul777 @marcochavezf can you give an ETA on when this will be ready?

  11. 40 remaining items

  12. shahinyan11 commented on Apr 15, 2024

    @shahinyan11

    One question that comes to my mind is, why do we have a different size for emojis and text?

    This is also a question for me. But it is a fact that line calculation does not work correctly when adding emoji.

    @allroundexperts @marcochavezf The problem is in MarkdownTextInput component. It has numberOfLines prop.
    It is logical that when the numberOfLines changes, the input should react to this and update count of lines according to the numberOfLines prop. But now it works little strange. For example, when numberOfLines is updated with the following sequence 1 -> 2, the input lines are not updated, But when numberOfLines is updated with the following sequence 1 -> undefined -> 2 the input lines are updated.
    And here we have a case where currentNumberOfLines can be set to undefined if isComposerFullSize is true. And isComposerFullSize, in turn, at some point had the value true when using return String(route.params?.reportID || '') but never had the value true when using return String(route.params?.reportID || 0)

  13. melvin-bot commented on Apr 16, 2024

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  14. marcochavezf commented on Apr 16, 2024

    @marcochavezf
    Contributor

    And here we have a case where currentNumberOfLines can be set to undefined if isComposerFullSize is true

    Oh interesting, I don't know why it's undefined, seems the numberOfLines is a flawed design because I think the value can be relative to the size of the composer or the screen

  15. shahinyan11 commented on Apr 18, 2024

    @shahinyan11

    @marcochavezf What's interesting is that the input reacts to lines count updates and displays the lines corresponding to the numberOfLines value only when the previous NumberOfLines value was undefined and the new value is any number.

    And I also want to tag @allroundexperts. I am sorry but In my option he is very passive as C+ contributor.

  16. allroundexperts commented on Apr 18, 2024

    @allroundexperts
    Contributor

    @shahinyan11 Sorry, I'm not sure what you're expecting from me here. I think I should be reviewing the proposals rather than correcting the already made proposals. That'd be unfair to other contributors.

  17. mvtglobally commented on Apr 18, 2024

    @mvtglobally

    Issue not reproducible during KI retests. (First week)

  18. shahinyan11 commented on Apr 18, 2024

    @shahinyan11

    @allroundexperts for your information the change I suggested was implemented here what led to the problem being solved.

  19. shahinyan11 commented on Apr 18, 2024

    @shahinyan11

    @marcochavezf @allroundexperts @bfitzexpensify It's just a shame how my efforts on this issue were appreciated

  20. allroundexperts commented on Apr 18, 2024

    @allroundexperts
    Contributor

    @shahinyan11 I see that the solution you proposed in-fact got applied by Software mansion. I think you should get a partial compensation here. @marcochavezf Would you agree?

  21. marcochavezf commented on Apr 18, 2024

    @marcochavezf
    Contributor

    @allroundexperts for your information the change I suggested was implemented here what led to the problem being solved.

    Oh thanks for pointing it out @shahinyan11, and yeah I agree that in this case we should make a partial payment. @bfitzexpensify could you handle that?

  22. bfitzexpensify commented on Apr 19, 2024

    @bfitzexpensify
    Contributor

    Agreed, I think a $250 payment is correct here. @shahinyan11 can you please apply to this Upwork job?

  23. shahinyan11 commented on Apr 19, 2024

    @shahinyan11

    @bfitzexpensify I have applied

  24. bfitzexpensify commented on Apr 19, 2024

    @bfitzexpensify
    Contributor

    Payment complete, closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions