Skip to content

[HOLD E/PR #535] [$250] Chat - In mWeb, text is centered but in Android text is dropping down #52827

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

Open
2 of 8 tasks
IuliiaHerets opened this issue Nov 20, 2024 · 39 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 Monthly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 20, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
Issue OwnerCurrent Issue Owner: @alitoshmatov
@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? 💸

@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
@alexpensify
Copy link
Contributor

Weekly update: same as last week

@alexpensify
Copy link
Contributor

Weekly Update: No movement in the PR

@tomekzaw
Copy link
Contributor

Just FYI, I wasn't actively working on this PR because I was hoping that RN 0.76 upgrade would fix this. Unfortunately this is not the case so I'll need to resume working on this PR once I complete my current tasks.

@melvin-bot melvin-bot bot added the Overdue label Feb 10, 2025
@alexpensify
Copy link
Contributor

Oh no, thank you for the update. Keep us posted when you have a better timeline to get to this one. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Feb 13, 2025
@melvin-bot melvin-bot bot added the Overdue label Feb 21, 2025
@alexpensify
Copy link
Contributor

Weekly Update: Waiting for @tomekzaw to have a free cycle

@melvin-bot melvin-bot bot removed the Overdue label Feb 22, 2025
@alexpensify
Copy link
Contributor

Weekly Update: Same

@alexpensify

This comment has been minimized.

@alexpensify
Copy link
Contributor

Weekly Update: Same update, but I'm back online.

@tomekzaw
Copy link
Contributor

tomekzaw commented Mar 16, 2025

@melvin-bot melvin-bot bot added the Overdue label Mar 24, 2025
@alexpensify
Copy link
Contributor

Thank you, @tomekzaw, for the update!


🚨 Heads up! I'll be offline until Monday, April 7, 2025, and won’t be actively monitoring this GitHub during that time.

If this GitHub requires an urgent update, please reapply the bug label or reach out in the #expensify-open-source Slack room for help. Otherwise, I'll pick things up when I'm back online. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Mar 28, 2025
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Apr 21, 2025
Copy link

melvin-bot bot commented Apr 21, 2025

This issue has not been updated in over 15 days. @alexpensify, @alitoshmatov 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!

@alexpensify
Copy link
Contributor

@tomekzaw is there any update here? Thanks!

@alexpensify alexpensify added the Weekly KSv2 label May 2, 2025
@tomekzaw
Copy link
Contributor

tomekzaw commented May 5, 2025

@alexpensify I've pushed some changes to Expensify/react-native-live-markdown#535 but found out that a proper solution requires some small changes in react-native code. There's also another PR (Expensify/react-native-live-markdown#520) that I'd like to merge prior to this one.

@alexpensify alexpensify removed the Monthly KSv2 label May 8, 2025
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels May 27, 2025
Copy link

melvin-bot bot commented May 27, 2025

This issue has not been updated in over 15 days. @alexpensify, @alitoshmatov 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!

@alexpensify
Copy link
Contributor

Still waiting on Expensify/react-native-live-markdown#535

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 Monthly KSv2
Projects
Status: LOW
Development

No branches or pull requests

5 participants