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-06-07] does not bold the mention in heading style #18892

Closed
1 of 6 tasks
kavimuru opened this issue May 13, 2023 · 46 comments
Closed
1 of 6 tasks
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

@kavimuru
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. open a chat
  2. send a mention
  3. send a mention in heading style (# @ddddd)

Expected results:

should bold the mention

Actual results:

padding is added but same font-weight in heading

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.13.4
Reproducible in staging?: y
Reproducible in production?:
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
Notes/Photos/Videos: Any additional supporting documentation

bandicam.2023-05-13.02-13-21-094.mp4
Recording.601.mp4

Expensify/Expensify Issue URL:
Issue reported by: @chiragxarora
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683924161722189

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 13, 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

@huzaifa-99
Copy link
Contributor

Not reproducible on main branch
image

@chiragxarora
Copy link
Contributor

It's about the new mention style present in staging where it adds background to email

@bernhardoj
Copy link
Contributor

Proposal

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

Heading style (bold, bigger font size) is not applied to mention text. Also, other markdown style (bold, italic) is not applied to the mention on native.

What is the root cause of that problem?

We have a custom renderer for mention, MentionUserRenderer and MentionUserRenderer. In web, when we wrap the mention with bold markdown for example, the style will be inherited to the mention text. However, with heading text, we will have multiple nested element as you can see below.
image

If you look at the css style, you can see the font style is set to inherited, which means it will inherit the style from it's parent, which is a div, not the h1. I found we have the extra div because of the outer Text here.

<Text>
<Tooltip
absolute
text={loginWhithoutLeadingAt}
>
<Text
// eslint-disable-next-line react/jsx-props-no-spreading
{...defaultRendererProps}
color={StyleUtils.getMentionTextColor(isOurMention)}
style={StyleUtils.getMentionStyle(isOurMention)}
onPress={() => showUserDetails(loginWhithoutLeadingAt)}
>
<TNodeChildrenRenderer tnode={props.tnode} />
</Text>
</Tooltip>
</Text>

But, even though we remove the outer Text, the font style will have font-weight set to normal which will override the style from h1. All of these styles is handled by react-native-render-html.

In native, style is not inherited (except for nested text).

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

We should append the mention style with the style from the props.

<Text
// eslint-disable-next-line react/jsx-props-no-spreading
{...defaultRendererProps}
color={StyleUtils.getMentionTextColor(isOurMention)}
style={StyleUtils.getMentionStyle(isOurMention)}

So, the new style will be

style={[props.style, StyleUtils.getMentionStyle(isOurMention)]}

We need to do the same in MentionHereRenderer.

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue. cc @thienlnam

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

Current assignee @zanyrenney is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

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

thanks @bernhardoj lets get this reviewed by our team.

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

@melvin-bot melvin-bot bot removed the Overdue label May 16, 2023
@s-alves10
Copy link
Contributor

s-alves10 commented May 16, 2023

Proposal

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

Mention in heading style doesn't bold.

What is the root cause of that problem?

When we use @ symbol to mention user in the comment, HTMLRenderer uses MentionUserRenderer to render the element. Here is the component
https://github.com/Expensify/App/blob/51dff315ab65bc5266425de0b43d4fe1cd0cdbe7/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js

This component uses Text component defined here
https://github.com/Expensify/App/blob/51dff315ab65bc5266425de0b43d4fe1cd0cdbe7/src/components/Text.js

The root cause of this issue is in Text component. Please check the below code

return (
<RNText
allowFontScaling={false}
ref={ref}
style={[componentStyle]}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{children}
</RNText>
);

RNText component has its own font style and this overrides the font-weight of h1 parent element.
image

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

We need to override the default font style of RNText component by adding the following line

    font: 'inherit',

to the component style.

const componentStyle = {
color,
fontSize,
textAlign,
fontFamily: fontFamily[family],
...mergedStyles,
};

MentionHereRender uses the same Text component and this fix works for MentionHereRender as well.

Result
mac_chrome_18892.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label May 18, 2023
@zanyrenney
Copy link
Contributor

hey @madmax330 let me know which proposal you think looks best.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 19, 2023
@zanyrenney
Copy link
Contributor

bump @madmax330 curious who you think we should hire for this job please!

@melvin-bot melvin-bot bot removed the Overdue label May 22, 2023
@madmax330
Copy link
Contributor

@aimane-chnaif can you review the proposals?

@aimane-chnaif
Copy link
Contributor

@bernhardoj's proposal looks good to me. The root cause is well explained and solution is simple.
It would be good to find out and fix any other renderers (if exist) which have similar issue in heading style.

cc: @madmax330
🎀 👀 🎀 C+ reviewed

@s-alves10
Copy link
Contributor

@aimane-chnaif
I think my solution is the simplest one and let the Text component work as expected because it makes the parent font inherited.
Will you point out the drawbacks of my proposal?

@aimane-chnaif
Copy link
Contributor

@s-alves10 can you please focus first issue you assigned? As per contributing guideline, new contributors won't get assigned before first PR merged

@aimane-chnaif
Copy link
Contributor

can we keep that for now? I don't want refund.
And when payment time, we can wrap up, either 50% bonus or refund if penalty

@zanyrenney
Copy link
Contributor

2023-05-25_15-43-21

@aimane-chnaif
Copy link
Contributor

@zanyrenney if you want refund, let's use that job for the compensation in #18872

@zanyrenney
Copy link
Contributor

Just chatting internally about the best thing to do here.

@zanyrenney
Copy link
Contributor

Okay @bernhardoj and @aimane-chnaif - yep, we won't go the refund route, instead we will leave this with the payment done ahead of the PR being merged. I appreciate this is the incorrect order of things, so apologies.

When the PR is merged we can handle penalty or bonus.

Assigning @laurenreidexpensify who will watch over this whilst I am out of office.

the upwork issue is here

C+ and contributor have been paid.
Reporting bonus has not yet been paid.

Thanks!

@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

🎯 ⚡️ Woah @aimane-chnaif / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-05-25 13:42:39 Z
  • when the PR got merged: 2023-05-29 07:58:12 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 31, 2023
@melvin-bot melvin-bot bot changed the title does not bold the mention in heading style [HOLD for payment 2023-06-07] does not bold the mention in heading style May 31, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.20-5 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-06-07. 🎊

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 31, 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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] 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.
  • [@zanyrenney / @laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@laurenreidexpensify
Copy link
Contributor

@aimane-chnaif can you advise on the regression steps above? Thanks!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 6, 2023
@laurenreidexpensify
Copy link
Contributor

Bonus payments issued to @aimane-chnaif @bernhardoj ✔️

Remaining Steps:

  • Waiting for @chiragxarora to accept offer in Upwork for reporting bonus so we can issue payment
  • Waiting for @aimane-chnaif to confirm regression steps above

@zanyrenney I am OOO from tomorrow til 19 June so am going to unassign myself for you to cover those last 2 steps thanks

@chiragxarora
Copy link
Contributor

Accepted

@zanyrenney
Copy link
Contributor

Thanks @laurenreidexpensify

@zanyrenney
Copy link
Contributor

@aimane-chnaif bump on the regression steps please so we can close this out.

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Jun 9, 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:

This bug was introduced while implementing new feature of mentions renderer.
As mentioning user in heading1 text is very rare case and that style doesn't affect user experience, I don't think regression test step is needed.

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@madmax330
Copy link
Contributor

Agreed I don't think we need regression steps for this

@melvin-bot melvin-bot bot removed the Overdue label Jun 12, 2023
@chiragxarora
Copy link
Contributor

@zanyrenney pls complete the upwork contract

@zanyrenney
Copy link
Contributor

remaining payout is complete for @chiragxarora and the reporting bonus. Closing this out now as all have been paid and no regression steps needed.

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

9 participants