You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Web - Chat - Composer with emoji is expanded with an empty line after expanding the composer #39361
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:
Go to staging.new.expensify.com
Go to any chat
Enter an emoji with a multi-line message
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?
👋 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:
Identify the pull request that introduced this issue and revert it.
@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
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)
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)
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
@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.
@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.
@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?
@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?
Activity
melvin-bot commentedon Apr 1, 2024
Triggered auto assignment to @marcochavezf (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Apr 1, 2024
👋 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:
lanitochka17 commentedon Apr 1, 2024
@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
lanitochka17 commentedon Apr 1, 2024
We think that this bug might be related to #vip-vsp
shahinyan11 commentedon Apr 1, 2024
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
1line more. This is because the calculation is based on the following variableslineHeight,paddingTopAndBottom,textInput.current.scrollHeight,maxLineswherelineHeightalways belongs to the text. But currently thefontSizeof the emojis is larger than thefontSizeof the text. And when we add emojis, the paddingTopAndBottom and textInput.current.scrollHeight values decrease and calculation will not work correctlyWhat 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 objectWhat alternative solutions did you explore? (Optional)
Add below code on this line
What alternative solutions did you explore? (Optional)
Add ability for getNumberOfLines function to receive one more param (
containsEmoji) and update calculation logic theremarcochavezf commentedon Apr 1, 2024
I found out this is introduced by #38955, reverting the offending PR here
ishpaul777 commentedon Apr 1, 2024
@marcochavezf I can raise a fix as offending PR author. it was pointed out here on weekend #38955 (comment) but slipped of mind
ishpaul777 commentedon Apr 1, 2024
Can we wait for fixing PR instead of full revert please
marcochavezf commentedon Apr 1, 2024
Sure, we can wait
marcaaron commentedon Apr 1, 2024
@ishpaul777 @marcochavezf can you give an ETA on when this will be ready?
40 remaining items
shahinyan11 commentedon Apr 15, 2024
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
MarkdownTextInputcomponent. It hasnumberOfLinesprop.It is logical that when the
numberOfLineschanges, the input should react to this and update count of lines according to thenumberOfLinesprop. But now it works little strange. For example, whennumberOfLinesis updated with the following sequence1 -> 2, the input lines are not updated, But whennumberOfLinesis updated with the following sequence1 -> undefined -> 2the input lines are updated.And here we have a case where
currentNumberOfLinescan be set toundefinedifisComposerFullSizeistrue. AndisComposerFullSize, in turn, at some point had the valuetruewhen usingreturn String(route.params?.reportID || '')but never had the valuetruewhen using returnString(route.params?.reportID || 0)melvin-bot commentedon Apr 16, 2024
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
marcochavezf commentedon Apr 16, 2024
Oh interesting, I don't know why it's undefined, seems the
numberOfLinesis a flawed design because I think the value can be relative to the size of the composer or the screenshahinyan11 commentedon Apr 18, 2024
@marcochavezf What's interesting is that the input reacts to lines count updates and displays the lines corresponding to the
numberOfLinesvalue only when the previousNumberOfLinesvalue wasundefinedand 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.
allroundexperts commentedon Apr 18, 2024
@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.
mvtglobally commentedon Apr 18, 2024
Issue not reproducible during KI retests. (First week)
shahinyan11 commentedon Apr 18, 2024
@allroundexperts for your information the change I suggested was implemented here what led to the problem being solved.
shahinyan11 commentedon Apr 18, 2024
@marcochavezf @allroundexperts @bfitzexpensify It's just a shame how my efforts on this issue were appreciated
allroundexperts commentedon Apr 18, 2024
@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?
marcochavezf commentedon Apr 18, 2024
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?
bfitzexpensify commentedon Apr 19, 2024
Agreed, I think a $250 payment is correct here. @shahinyan11 can you please apply to this Upwork job?
shahinyan11 commentedon Apr 19, 2024
@bfitzexpensify I have applied
bfitzexpensify commentedon Apr 19, 2024
Payment complete, closing this out.