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-11-21] [$250] Android - Compose Box - Composer not expanded when adding emojis until reaching second line #51287

Closed
1 of 8 tasks
lanitochka17 opened this issue Oct 22, 2024 · 27 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 22, 2024

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: 9.0.52-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5113856&group_by=cases:section_id&group_order=asc&group_id=306201
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the Expensify app
  2. Open any chat
  3. On compose box, add several emojis until reaching a second line
  4. Verify the compose box is expanded and all the message is visible

Expected Result:

When the message with emojis reaches a second line, the compose box should expand to make all the message visible

Actual Result:

When adding several emojis and reaching a second line, the compose box is not expanded and only the second line is visible

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6642449_1729622425031.Expand.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021851362613036850059
  • Upwork Job ID: 1851362613036850059
  • Last Price Increase: 2024-10-29
  • Automatic offers:
    • DylanDylann | Reviewer | 104755710
    • QichenZhu | Contributor | 104755712
Issue OwnerCurrent Issue Owner: @twisterdotcom
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

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

@melvin-bot melvin-bot bot added the Overdue label Oct 24, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

@anmurali Huh... This is 4 days overdue. Who can take care of this?

@anmurali anmurali added the External Added to denote the issue can be worked on by a contributor label Oct 29, 2024
@melvin-bot melvin-bot bot changed the title Android - Compose Box - Composer not expanded when adding emojis until reaching second line [$250] Android - Compose Box - Composer not expanded when adding emojis until reaching second line Oct 29, 2024
Copy link

melvin-bot bot commented Oct 29, 2024

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

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

melvin-bot bot commented Oct 29, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (External)

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
@shahinyan11
Copy link

shahinyan11 commented Oct 30, 2024

Proposal

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

Android - Compose Box - Composer not expanded when adding emojis until reaching second line

What is the root cause of that problem?

We have set height: 0 here but currently the input height does not increase when adding emoji and reaching the second line. It is android's behavior

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

  1. Add new state in Composer component
const [inputContentHeight, setInputContentHeight] = useState<number | undefined>();
  1. Update above state in onContentSizeChange
onContentSizeChange={(e) => {
    setInputContentHeight(e?.nativeEvent?.contentSize?.height)
    ....
}
  1. Update composerStyle to bellow
const isAndroidNative = getPlatform() === CONST.PLATFORM.ANDROID
const composerStyle = useMemo(() => StyleSheet.flatten([
    style, textContainsOnlyEmojis ? styles.onlyEmojisTextLineHeight : {},
    isAndroidNative ? {height: inputContentHeight} : undefined
]), [style, textContainsOnlyEmojis, styles, inputContentHeight]);

What alternative solutions did you explore? (Optional)

@QichenZhu
Copy link
Contributor

Proposal

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

The height of live markdown input doesn't fit its content on Android if it contains emojis.

What is the root cause of that problem?

MarkdownEmojiSpan uses font size in DIP units.

Screenshot 2024-11-02 at 11 52 28 PM

AbsoluteSizeSpan(int size, boolean dip)
Set the text size to size physical pixels, or to size device-independent pixels if dip is true.

However, the text height measurement treats the font size as if it’s in pixels, so the measured height doesn't match the actual height.

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

Use pixels in MarkdownEmojiSpan, just like in MarkdownFontSizeSpan below.

Screenshot 2024-11-03 at 12 02 26 AM

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Nov 2, 2024
@DylanDylann
Copy link
Contributor

Reviewing on Monday

@melvin-bot melvin-bot bot removed the Overdue label Nov 3, 2024
@DylanDylann
Copy link
Contributor

@QichenZhu Your proposal doesn't work for me

Screenshot 2024-11-04 at 16 37 39

@DylanDylann
Copy link
Contributor

@shahinyan11 Could you please provide a test branch?

@QichenZhu
Copy link
Contributor

@DylanDylann Sorry I didn’t clearly mention that both arguments in the constructor need to change. Here’s the code I tested with. Could you double check?

node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/spans/MarkdownEmojiSpan.java

package com.expensify.livemarkdown.spans;

import android.text.style.AbsoluteSizeSpan;

import com.facebook.react.uimanager.PixelUtil;

public class MarkdownEmojiSpan extends AbsoluteSizeSpan implements MarkdownSpan {
  public MarkdownEmojiSpan(float fontSize) {
    super((int) PixelUtil.toPixelFromDIP(fontSize), false);
  }
}

Before:

1000000825-2024-11-04 10_12_30 900

After:

1000000827-2024-11-04 10_12_33 389

@DylanDylann
Copy link
Contributor

@QichenZhu Thanks for your update

@QichenZhu's proposal looks good to me

🎀 👀 🎀 C+ Reviewed

Copy link

melvin-bot bot commented Nov 4, 2024

Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Nov 5, 2024

@francoisl @anmurali @DylanDylann this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 5, 2024
Copy link

melvin-bot bot commented Nov 5, 2024

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 5, 2024

📣 @QichenZhu 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@DylanDylann
Copy link
Contributor

@QichenZhu Let's create a PR on App repo to upgrade https://github.com/Expensify/react-native-live-markdown version

@QichenZhu
Copy link
Contributor

@DylanDylann The PR to bump the library to an earlier version has already been reviewed, so how about waiting until it's merged as jumping versions tends to cause issues?

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@QichenZhu
Copy link
Contributor

Still reproducible. I'll open a PR in hours.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 9, 2024
@anmurali anmurali removed their assignment Nov 12, 2024
@anmurali anmurali added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 12, 2024
@anmurali
Copy link

Rotating to get another BZ assigned while OOO

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Nov 14, 2024
@melvin-bot melvin-bot bot changed the title [$250] Android - Compose Box - Composer not expanded when adding emojis until reaching second line [HOLD for payment 2024-11-21] [$250] Android - Compose Box - Composer not expanded when adding emojis until reaching second line Nov 14, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

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

Copy link

melvin-bot bot commented Nov 14, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.61-3 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-11-21. 🎊

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

Copy link

melvin-bot bot commented Nov 14, 2024

@DylanDylann @twisterdotcom @DylanDylann The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@DylanDylann
Copy link
Contributor

DylanDylann commented Nov 20, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: Bug on the lib, also requires a reviewing from the author of lib: Fix emoji font size measurement on Android react-native-live-markdown#538 (review)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Test:

Platform: Android

  1. Open any chat.
  2. In the Composer, add several emojis until it wraps to the next line.
  3. Verify that the Composer expands and the full message is visible.

Do we agree 👍 or 👎

@twisterdotcom
Copy link
Contributor

Payment Summary:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 20, 2024
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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants