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-05-25] [HOLD for payment 2023-05-23] [$1000] mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long #18882

Closed
1 of 6 tasks
kbecciv opened this issue May 12, 2023 · 37 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

@kbecciv
Copy link

kbecciv commented May 12, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing PR #18486

Action Performed:

Preconditional: name of Account B is a long name, or it's a long email address

  1. Go to URL https://staging.new.expensify.com/
  2. Login with any account (it is account B)
  3. Create Request from account A to account B

Expected Result:

Description 'UserB owes £1.23' beneath the IOUPreview NOT extends beyond the page

Actual Result:

Description 'UserB owes £1.23' beneath the IOUPreview extends beyond the page

Workaround:

Unknown

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.2

Reproducible in staging?: yes

Reproducible in production?: no

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

Bug6053174_18486_mWeb.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010348cc7d06d68be5
  • Upwork Job ID: 1657761642065977344
  • Last Price Increase: 2023-05-14
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

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

@melvin-bot
Copy link

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

@PrashantMangukiya
Copy link
Contributor

Proposal

Posting proposal early as per new guidelines

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

mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long

What is the root cause of that problem?

IOU description text render via this code block

<View>
{props.iouReport.hasOutstandingIOU ? (
<Text style={[styles.chatItemMessage, styles.cursorPointer]}>{props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})}</Text>
) : (
<View style={[styles.flexRow]}>
<Text style={[styles.chatItemMessage, styles.cursorPointer]}>{props.translate('iou.payerSettled', {amount: reportAmount})}</Text>
{!props.iouReport.hasOutstandingIOU && (
<Icon
style={[styles.ml10]}
src={Expensicons.Checkmark}
fill={themeColors.iconSuccessFill}
/>
)}
</View>
)}
</View>

We can see there is a parent <View> at line 106 and IOU description rendered by its child at line 108 and 110. So here parent view does not have any style (line 106) so it will not shrink when screen is small. So text will goes outside. This is the root cause of the problem.

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

We have to add style styles.flexShrink1 to <View> at line 106 as shown code below:

       <View style={[styles.flexShrink1]}>
          {props.iouReport.hasOutstandingIOU ? (
              ...
          ) : (
              <View style={[styles.flexRow]}>
                 ...
              </View>
          )}
      </View>

So this will solve the issue and long text will goes to second line as shown in results.

What alternative solutions did you explore? (Optional)

If we have to truncate long text then we have to limit numberOfLines to 1 and need to add styles.noWrap to child <text> component at line 108 and 111, so updated code looks as shown below:

<View style={[styles.flexShrink1]}>
    {props.iouReport.hasOutstandingIOU ? (
        <Text
            numberOfLines={1}
            style={[styles.chatItemMessage, styles.cursorPointer, styles.noWrap]}
        >
         ...
        </Text>
    ) : (
        <View style={[styles.flexRow]}>
            <Text
                numberOfLines={1}
                style={[styles.chatItemMessage, styles.cursorPointer, styles.noWrap]}
            >
              ...
            </Text>
            ...
        </View>
    )}
</View>

This will also solve the issue and truncate text in single line as shown in results

Results

Main Solution:

Mweb Safari Mweb Chrome
iOS Android

Alternate Solution (Truncate text with ...)

Mweb Safari Mweb Chrome
Mweb-Safari2 Mweb-Chrome2

@hoangzinh
Copy link
Contributor

hoangzinh commented May 13, 2023

Proposal

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

mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long

What is the root cause of that problem?

We already set work-break to a chatItemMessage here:
https://github.com/Expensify/App/blob/main/src/styles/styles.js#L1470 and applied to ReportReview. But it doesn't work because its View wrapper doesn't set the width with its higher parent.

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

Take a look at this LOC

<Pressable
key={`ReportPreview-${props.action.reportActionID}-${index}`}
onPress={props.onViewDetailsPressed}
onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
onPressOut={() => ControlSelection.unblock()}
onLongPress={(event) => showContextMenuForReport(event, props.contextMenuAnchor, props.chatReportID, props.action, props.checkIfContextMenuActive)}
style={[styles.flexRow, styles.justifyContentBetween]}
focusable
>
<View>
{props.iouReport.hasOutstandingIOU ? (
<Text style={[styles.chatItemMessage, styles.cursorPointer]}>{props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})}</Text>
) : (
<View style={[styles.flexRow]}>
<Text style={[styles.chatItemMessage, styles.cursorPointer]}>{props.translate('iou.payerSettled', {amount: reportAmount})}</Text>
{!props.iouReport.hasOutstandingIOU && (
<Icon
style={[styles.ml10]}
src={Expensicons.Checkmark}
fill={themeColors.iconSuccessFill}
/>
)}
</View>
)}
</View>
<Icon
src={Expensicons.ArrowRight}
fill={StyleUtils.getIconFillColor(getButtonState(props.isHovered))}
/>
</Pressable>

Basically the Pressable component has 2 children, one is arrow icon in the right, and main View component in the left. Currently View component haven't had any style yet. So we need to set styles.flex1 to this View component like we did other places. By set styles.flex1, it will automatically set flex-grow and flex-shrink to 1, it will grow/shrink to take remaining width of parent component.

Result:
Screenshot 2023-05-13 at 22 54 16

@mountiny mountiny self-assigned this May 14, 2023
@mountiny
Copy link
Contributor

I think we prefer not truncating. Asking which c+ can review these today

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label May 14, 2023
@melvin-bot melvin-bot bot changed the title mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long [$1000] mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long May 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 14, 2023

Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.

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

melvin-bot bot commented May 14, 2023

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

@aimane-chnaif
Copy link
Contributor

I prefer flex1
@PrashantMangukiya any reason you suggest flexShrink1?

@PrashantMangukiya
Copy link
Contributor

@aimane-chnaif Thanks for asking.

At present there is not any problem with flex1 but in future if we decide to limit height of parent container and this content is not enough to fit within that height then it will overflow and grow beyond the parent boundary. Not sure exact use case at present, but this can happen.

Also another reason is, we can see at present element already grows and goes beyond the parent limit, so to prevent it I thought just flexShrink1 is enough for this situation, so suggested this solution.

@aimane-chnaif
Copy link
Contributor

I am fine either way as it solves current issue.
As @PrashantMangukiya is the first responder, we can assign @PrashantMangukiya

cc: @mountiny
🎀 👀 🎀 C+ reviewed

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

melvin-bot bot commented May 14, 2023

📣 @PrashantMangukiya You have been assigned to this job by @mountiny!
Please apply to this job in Upwork 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 📖

@mountiny
Copy link
Contributor

Thanks @PrashantMangukiya can you please raise a PR for this

@PrashantMangukiya
Copy link
Contributor

@mountiny @aimane-chnaif Thanks. I will prepare and submit pr within few hours asap.

@PrashantMangukiya
Copy link
Contributor

@aimane-chnaif @mountiny PR is ready for review.

@mountiny
Copy link
Contributor

thanks

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

🎯 ⚡️ Woah @aimane-chnaif / @PrashantMangukiya, 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 @PrashantMangukiya got assigned: 2023-05-14 21:54:26 Z
  • when the PR got merged: 2023-05-16 13:31:30 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 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long [HOLD for payment 2023-05-23] [$1000] mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.14-14 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-05-23. 🎊

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 16, 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:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels May 18, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-05-23] [$1000] mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long [HOLD for payment 2023-05-25] [HOLD for payment 2023-05-23] [$1000] mWeb/Chrome - IOU - Description extends beyond the page if the recipient's name is long May 18, 2023
@melvin-bot

This comment was marked as duplicate.

@melvin-bot

This comment was marked as duplicate.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 23, 2023
@joekaufmanexpensify
Copy link
Contributor

Not sure why the 23rd and the 25th is also in the header here. The PR was deployed to prod on the 16th so we hit 7 days regression reporting period today.

@joekaufmanexpensify
Copy link
Contributor

@PrashantMangukiya was assigned to this issue on May, 14th at 9:54pm UTC. The PR was merged on May 16th at 1:31 pm UTC on May 16th. This is less than 3 business days so this qualifies for a speed bonus. Great job!

@joekaufmanexpensify
Copy link
Contributor

We need to make the following payments:

@joekaufmanexpensify
Copy link
Contributor

@aimane-chnaif offer sent!

@joekaufmanexpensify
Copy link
Contributor

@PrashantMangukiya offer sent!

@PrashantMangukiya
Copy link
Contributor

@joekaufmanexpensify Offer Accepted.

@aimane-chnaif
Copy link
Contributor

This bug was caught by QA team and I think no need further regression test step here.

@joekaufmanexpensify
Copy link
Contributor

TY! BZ checklist complete.

@joekaufmanexpensify
Copy link
Contributor

All set to issue payment here!

@joekaufmanexpensify
Copy link
Contributor

@PrashantMangukiya $1,500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@aimane-chnaif once you accept our offer here, we'll issue payment and close this out!

@joekaufmanexpensify
Copy link
Contributor

@aimane-chnaif $1,500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job removed.

@joekaufmanexpensify
Copy link
Contributor

Bug is fixed, BZ checklist complete, and all payment issued. Closing as this is all set. Thanks everyone!

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

6 participants