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 E/PR #535] [$250] Chat - In mWeb, text is centered but in Android text is dropping down #52827

Open
2 of 8 tasks
IuliiaHerets opened this issue Nov 20, 2024 · 24 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 20, 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: V9. 0.64-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Open both mWeb and app
  2. Open a chat
  3. Enter > # hai

Expected Result:

In mWeb, text is centered but in Android text must not drop down.

Actual Result:

In mWeb, text is centered but in Android text is dropping down.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6670752_1732113789398.az_recorder_20241120_200615_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863815952930925048
  • Upwork Job ID: 1863815952930925048
  • Last Price Increase: 2024-12-10
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 20, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Triggered auto assignment to @alexpensify (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.

@QichenZhu
Copy link
Contributor

Proposal

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

Headings are not vertically centered on Android.

What is the root cause of that problem?

The line height is enlarged on Android to fix overlapping lines.

Screenshot 2024-11-23 at 1 27 58 AM

However, the text is bottom-aligned in MarkdownLineHeightSpan.

Screenshot 2024-11-23 at 1 40 05 AM

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

Fine-tune the fm.ascent, fm.descent, fm.top, fm.bottom properties to vertically center the text. The code below refers to this implementation. It’s not the final version and might need confirmation from the design team.

  @Override
  public void chooseHeight(CharSequence text, int start, int end, int spanstartv, int lineHeight, Paint.FontMetricsInt fm) {
    float leading = mLineHeight - ((-fm.ascent) + fm.descent);
    fm.ascent -= (int)Math.ceil(leading / 2.0);
    fm.descent += (int)Math.floor(leading / 2.0);

    // The top of the first line, and the bottom of the last line, may influence bounds of the
    // paragraph, so we match them to the text ascent/descent. It is otherwise desirable to allow
    // line boxes to overlap (to allow too large glyphs to be drawn outside them), so we do not
    // adjust the top/bottom of interior line-boxes.
    if (start == 0) {
      fm.top = fm.ascent;
    }
    if (end == text.length()) {
      fm.bottom = fm.descent;
    }
  }

Screenshots

Before After
Before After

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
@alexpensify
Copy link
Contributor

I didn't get to test this one before going OOO. This week, I'll try to log in to confirm the next steps.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 25, 2024
Copy link

melvin-bot bot commented Nov 29, 2024

@alexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@alexpensify
Copy link
Contributor

No update

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 29, 2024
@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

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

@melvin-bot melvin-bot bot changed the title Chat - In mWeb, text is centered but in Android text is dropping down [$250] Chat - In mWeb, text is centered but in Android text is dropping down Dec 3, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 3, 2024
@alexpensify
Copy link
Contributor

@alitoshmatov - I was able to replicate the experience. Can you please verify if this proposal will fix the issue? Thanks!

Copy link

melvin-bot bot commented Dec 4, 2024

@alexpensify @alitoshmatov 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!

Copy link

melvin-bot bot commented Dec 6, 2024

@alexpensify, @alitoshmatov Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 6, 2024
@alitoshmatov
Copy link
Contributor

@QichenZhu Are you suggestion that this should be fixed in react-native-live-markdown

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2024
@QichenZhu
Copy link
Contributor

@alitoshmatov That’s correct.

Copy link

melvin-bot bot commented Dec 10, 2024

@alexpensify, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

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

@alitoshmatov
Copy link
Contributor

@tomekzaw Can you check out this issue where heading in android is pushed down noticeably. And we have this proposal which suggests to update height calculation for android.

I suspect this issue is related to Expensify/react-native-live-markdown#522

What do you think

@melvin-bot melvin-bot bot removed the Overdue label Dec 10, 2024
@tomekzaw
Copy link
Contributor

tomekzaw commented Dec 10, 2024

@alitoshmatov Indeed, this should be fixed on Android with Expensify/react-native-live-markdown#535 telling from the screenshots in Expensify/react-native-live-markdown#535 (comment).

Looks like we need to center text vertically on iOS (as per this comment Expensify/react-native-live-markdown#535 (comment)) and we're good to go.

@alitoshmatov
Copy link
Contributor

Great. I guess we can hold this issue then.

@alexpensify Can you update the issue to hold for Expensify/react-native-live-markdown#535

@alexpensify alexpensify added Weekly KSv2 and removed Daily KSv2 labels Dec 12, 2024
@alexpensify alexpensify changed the title [$250] Chat - In mWeb, text is centered but in Android text is dropping down [HOLD E/PR #535] [$250] Chat - In mWeb, text is centered but in Android text is dropping down Dec 12, 2024
@alexpensify
Copy link
Contributor

alexpensify commented Dec 12, 2024

Done - thanks for flagging

@alexpensify
Copy link
Contributor

Heads up, I will be offline until Wednesday, December 18, 2024, and will not actively watch over this GitHub during that period.

If this GitHub requires an urgent update, please ask for help in the #expensify-open-source Slack Room. If the inquiry can wait, I'll review it when I return online.

@alexpensify
Copy link
Contributor

Weekly Update: Expensify/react-native-live-markdown#535 is still under review

@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2024
@alexpensify
Copy link
Contributor

Weekly Update: Expensify/react-native-live-markdown#535 is still under review

@alexpensify
Copy link
Contributor

Weekly Update: Same as last week

@melvin-bot melvin-bot bot removed the Overdue label Dec 30, 2024
@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2025
@alexpensify
Copy link
Contributor

Weekly Update: Waiting on Expensify/react-native-live-markdown#535

@melvin-bot melvin-bot bot removed the Overdue label Jan 9, 2025
@melvin-bot melvin-bot bot added the Overdue label Jan 17, 2025
@alexpensify
Copy link
Contributor

Weekly Update: Expensify/react-native-live-markdown#535 is still under review

@melvin-bot melvin-bot bot removed the Overdue label Jan 17, 2025
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. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
Development

No branches or pull requests

5 participants