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 2023-11-17] [$500] No text size change on bold on single backtick code block #30203

Closed
6 tasks done
kbecciv opened this issue Oct 23, 2023 · 50 comments
Closed
6 tasks done
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

@kbecciv
Copy link

kbecciv commented Oct 23, 2023

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: 1.3.89.6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1698062570837299

Action Performed:

  1. Open the app
  2. Open any report
  3. Send normal message, observe font-size for sent message
  4. Send bold message (add # in beginning) and observe font-size for sent message, it will be bigger then normal message
  5. Send normal single backtick code block eg: Hello and observe its font size
  6. Send bold single backtick code block eg: # Hello and observe its font size, it is bold but font size is same as normal single backtick text

Expected Result:

App should increase text size on bold (using #) of single backtick code block as it does for normal text

Actual Result:

App keeps same text size on bold (using #) of single backtick code block as normal text size of single backtick code block

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

Android: Native

android native no bold text issue

Android: mWeb Chrome

android chrome no bold text issue

iOS: Native

ios native text size issue

iOS: mWeb Safari

ios safari text size issue

MacOS: Chrome / Safari

mac chrome text size issue

windows.chrome.no.bold.text.single.backtick.mp4
MacOS: Desktop

mac desktop text size issue

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015b5dbaab7f1156a1
  • Upwork Job ID: 1716547328191115264
  • Last Price Increase: 2023-10-23
  • Automatic offers:
    • s77rt | Reviewer | 27506802
    • dhanashree-sawant | Reporter | 27506803
Issue OwnerCurrent Issue Owner: @laurenreidexpensify
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title No text size change on bold on single backtick code block [$500] No text size change on bold on single backtick code block Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

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

melvin-bot bot commented Oct 23, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

@yakupafsin
Copy link
Contributor

yakupafsin commented Oct 23, 2023

Proposal

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



The issue we're addressing is that when a user sends a message with a code block in bold text, the app still displays it with the normal font size.

What is the root cause of that problem?

This problem stems from how bold messages are saved as HTML code with an <h1> tag, which has a specific font size defined in the style file. However, when a code block is added with bold text, it uses a <code> tag as a child element of <h1>, and the code block's font size takes precedence over the <h1> tag's font size, causing the issue.

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

To solve this problem, we need to modify the code rendering logic (CodeRenderer.js). We should check if the <code> element is a child of an <h1> tag. If it is, we should change <code> tag font-size with 14.5px . Here's an example of the code to achieve this:

//if code is child of h1, change font-size with 14.5, if not use default font size for code

const fontSize = props.tnode.parent.tagName === 'h1' ?
14.5 : textStyle.fontSize;


const textStyleOverride = {
    fontFamily: font,
    fontWeight: undefined,
    fontStyle: undefined,
    fontSize: fontSize,
};

What alternative solutions did you explore? (Optional)

N/A

MacOS: Chrome / Safari
eee6b3b3-ca5b-48a2-a051-286214db386e.mp4

@s77rt
Copy link
Contributor

s77rt commented Oct 24, 2023

@yakupafsin Thanks for the proposal. But you are fixing the wrong bug here. What we are looking is to have the heading message always rendered with fontSizeLarge. i.e.

# msg

should be rendered with fontSizeLarge (already working)

# `msg`

should be rendered with fontSizeLarge as well but it's not (bug is here)

@yakupafsin
Copy link
Contributor

@yakupafsin Thanks for the proposal. But you are fixing the wrong bug here. What we are looking is to have the heading message always rendered with fontSizeLarge. i.e.

# msg

should be rendered with fontSizeLarge (already working)

# `msg`

should be rendered with fontSizeLarge as well but it's not (bug is here)

Hi, sorry. I guess it was too late I made a mistake. But I've edited my proposal and it's aiming the right problem now.

@yakupafsin
Copy link
Contributor

@yakupafsin Thanks for the proposal. But you are fixing the wrong bug here. What we are looking is to have the heading message always rendered with fontSizeLarge. i.e.

# msg

should be rendered with fontSizeLarge (already working)

# `msg`

should be rendered with fontSizeLarge as well but it's not (bug is here)

Do I have to send it again, or just editing enough?

@s77rt
Copy link
Contributor

s77rt commented Oct 24, 2023

@yakupafsin Thanks for the update. I don't think we can just omit the font size. This will make code tag text render at size 15px which does not seem intended.

Do I have to send it again, or just editing enough?

Editing is enough

@yakupafsin
Copy link
Contributor

@s77rt, I have revised my solution. This time, it only changes the font size if the element is a child of an <h1> tag. However, I would still recommend not keeping the font size as 13 for code blocks. We can change it to use variable.fontSizeNormal. I didn't include this in the proposal because it's not part of this specific issue, but in the future, it could potentially cause problems with other devices if we leave it at 13.

@s77rt
Copy link
Contributor

s77rt commented Oct 25, 2023

@yakupafsin Thanks for update. The use of size 13px for code tags is intended to keep the outer height consist with the rest of the text. Similarly for code tags under h1, we don't want to apply 17px but 14.5px. Can you please update your proposal based on that?


cc @shawnborton To 👀 the below changes (changed font size of code tag if it's inside a heading message from 13px to 14.5px)

Before:
Screenshot 2023-10-25 at 2 15 06 AM

After:
Screenshot 2023-10-25 at 2 14 49 AM

@yakupafsin
Copy link
Contributor

yakupafsin commented Oct 25, 2023

@s77rt
Thank you for reviewing
I've applied the changes. It's 14.5px now.

Because on previous comment you mentioned that

What we are looking is to have the heading message always rendered with fontSizeLarge.

That's why I've used that. But we can change values accordingly.

@shawnborton
Copy link
Contributor

How did we arrive at 14.5? I am not a fan of using a half-pixel font size here. If anything, can we use 15px since we use that font size elsewhere? cc @Expensify/design for visibility here

@yakupafsin
Copy link
Contributor

@shawnborton yes I can change it with 15. Or I can just use the one of the values from style page. Whatever best for the app.

@shawnborton
Copy link
Contributor

15 should be the default font size of the app, so I like just grabbing that for the size var.

@abeebridwan
Copy link

abeebridwan commented Oct 25, 2023

it is shouldn't be fixed with hard coding directly using 15px though it could be actually used
been working on it two days
submitting a proposal

@s77rt
Copy link
Contributor

s77rt commented Oct 25, 2023

@shawnborton 14.5px is 85% of 17px (from h1). Based on the use of 13px, 85% of 15px (in normal text). I think we also need to adjust the line height for h1. The code tags are very close to each other.

Screenshot 2023-10-25 at 3 20 49 PM

@yakupafsin
Copy link
Contributor

@s77rt In the same proposal, we can include this change and handle it with a single pull request (PR). I suggest taking the font size of the h1 element and applying 85% of that size to the code tag, as shown in the code snippet below:

'fontSize = h1FontSize/100*85'

Please note that this is just an example, and the actual code may differ.

@shawnborton
Copy link
Contributor

Understood, but I still would prefer 15 so we don't need to manage another font size.

@s77rt
Copy link
Contributor

s77rt commented Oct 25, 2023

Got it. Thanks!

@yakupafsin Let's get this fixed 🚀

🎀 👀 🎀 C+ reviewed
Link to proposal

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@abeebridwan
Copy link

abeebridwan commented Oct 25, 2023

I know I am late
just about to submit it...

Not taking the proposal
I want you to look it from here
Here is what I found

textStyle applied to both are the same ... which came from the backend
the sending and receiving of the text are all good except the styles

image

the merging and overring of the styles happens here
image

image

@yakupafsin
Copy link
Contributor

@roryabraham Thank you for reviewing the proposal. I've sent my proposal on UpWork. Do I have to wait until I've been hired for the project, or can I send my PR straight away?

@s77rt
Copy link
Contributor

s77rt commented Nov 3, 2023

@yakupafsin You can raise the PR now. You will be hired on Upwork only for the payment (everything else is done in Github / Slack)

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 3, 2023
@roryabraham
Copy link
Contributor

PR merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 8, 2023
@melvin-bot melvin-bot bot changed the title [$500] No text size change on bold on single backtick code block [HOLD for payment 2023-11-17] [$500] No text size change on bold on single backtick code block Nov 10, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 10, 2023
Copy link

melvin-bot bot commented Nov 10, 2023

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

Copy link

melvin-bot bot commented Nov 10, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Nov 10, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@s77rt] The PR that introduced the bug has been identified. Link to the PR:
  • [@s77rt] 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:
  • [@s77rt] A discussion in #expensify-bugs 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:
  • [@s77rt] Determine if we should create a regression test for this bug.
  • [@s77rt] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@s77rt
Copy link
Contributor

s77rt commented Nov 11, 2023


Regression Test Proposal

  1. Open any report
  2. Send a normal message e.g. Hello Expensifiers
  3. Send a heading message (add # in beginning) e.g. # Hello Expensifiers
  4. Verify that the font size of the heading message is bigger than that of the normal message
  5. Send a normal single backtick code block e.g. Hello Expensifiers
  6. Send a heading single backtick code block e.g. # Hello Expensifiers
  7. Verify that the font size of the heading message is bigger than that of the normal message

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
@laurenreidexpensify
Copy link
Contributor

Automation failed here - issuing payments now

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2023
@laurenreidexpensify laurenreidexpensify added Daily KSv2 and removed Weekly KSv2 labels Nov 20, 2023
@laurenreidexpensify
Copy link
Contributor

laurenreidexpensify commented Nov 20, 2023

Payment Summary:

  • C+ - @s77rt $500 - payment issued in Upwork
  • Contributor - $500 - @yakupafsin requires payment in Upwork - please accept job
  • Bug Report - $50 @dhanashree-sawant payment issued in Upwork

@laurenreidexpensify
Copy link
Contributor

Final Step: Issue payment to @yakupafsin in Upwork once they accept request

@yakupafsin
Copy link
Contributor

@laurenreidexpensify offer accepted, Thank you.

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

C+ - @s77rt $500 - payment issued in Upwork
Contributor - $500 - @yakupafsin requires payment issued in Upwork
Bug Report - $50 @dhanashree-sawant payment issued in Upwork

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

7 participants