Skip to content

[HOLD for payment 2023-08-16] [$1000] On request money report clicking the down arrow on options to pay with expensify hides the entire button #23140

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

Closed
2 of 6 tasks
kavimuru opened this issue Jul 18, 2023 · 34 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

@kavimuru
Copy link

kavimuru commented Jul 18, 2023

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. Login to ND (account should have permission to pay with Expensify)
  2. Navigate to any request money report (if there is non then on user A request money to user B then login to user B to access request money report)
  3. On request money report there should be a drop down button -> click on down arrow
  4. Notice the dropdown option hides the pay with expensify button

Expected Result:

On opening the drop menu should not hide the button

Actual Result:

On opening the drop menu it hides the entire button

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.41-2
Reproducible in staging?: Needs reproducion (Pay with expensify only for USD)
Reproducible in production?: Needs reproduction
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

Screen.Recording.2023-07-17.at.5.37.39.PM.mov

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f871dc05dbdb8459
  • Upwork Job ID: 1682166781314084864
  • 2023-07-27
  • Automatic offers:
    • situchan | Reviewer | 25854538
    • Nikhil-Vats | Contributor | 25854540
    • dhairyasenjaliya | Reporter | 25854542
@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

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

@kavimuru
Copy link
Author

Proposal

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

On request money report clicking the down arrow on options to pay with expensify hides the entire button

What is the root cause of that problem?

The root cause is we are passing wrong vertical anchorAlignment on ButtonWithDropdownMenu that makes menu to over laps with button and hide under it

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

We need to pass correct vertical``anchorAlignment that shows menu on bottom of the button without hiding that
Currently we are passing ANCHOR_ORIGIN_VERTICAL.BOTTOM instead of that ew just need to pass ANCHOR_ORIGIN_VERTICAL.TOP on below line

vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 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

@sakluger
Copy link
Contributor

Asking in the Slack threadabout reproduction.

@Nikhil-Vats
Copy link
Contributor

Nikhil-Vats commented Jul 19, 2023

Proposal

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

In IOU Report, when caret/arrow/dropdown button is clicked in settlement button in header, the main button gets hidden behind the popover menu.

What is the root cause of that problem?

We are using a fixed BOTTOM vertical alignment for the popover menu here. It should be passed via props based on where the position of button is -

  1. If button is in header like in case of MoneyReportHeader, menu should open below it.
  2. If button is at the bottom of page like in case of MoneyRequestConfirmationList, menu should open above it.
    vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,

Also, we always add the height h to the vertical position but we only need to do this when we need to show the menu below button (MoneyReportHeader) not when we show the menu above the button MoneyRequestConfirmationList.

setPopoverAnchorPosition({
horizontal: x + w,
vertical: y + h,
});

Lastly, there is no padding here which we are using on other pages -

anchorPositionVertical: domRect.top - 8,

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

We need to introduce a new prop anchorAlignment in ButtonWithDropdownMenu and SettlementButton -

// type -
anchorAlignment: PropTypes.shape({
    horizontal: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL)),
    vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)),
}) 

// default value -
anchorAlignment: {
    horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
    vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, // we can keep it as bottom also
}

Also, we need to calculate the vertical position based on the vertical anchorAlignment and add the consistent padding of 8px -

setPopoverAnchorPosition({
    horizontal: x + w,
    vertical: props.anchorAlignment.vertical === CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP
        ? y + h + 8 // if anchorPosition is top, menu will open below the button and we need to add the height of button
        : y - 8 // if anchorPosition is bottom, menu will open above the button so no need to add height to vertical position
});

We should make a constant for this 8px in CONST.js and then use it here and in other files.
Design team provided there approval on this 8px padding here.

Finally, we should pass the new prop from following components -

  1. In SettlementButton we just need to pass the prop received from parent to ButtonWithDropdownMenu like - anchorAlignment={this.props.anchorAlignment}.
  2. In MoneyReportHeader, the dropdown should open below button so vertical anchor position should be TOP -
anchorAlignment={{
    horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
    vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
  1. In MoneyRequestConfirmationList, the dropdown should open above button so vertical anchor position should be BOTTOM -
anchorAlignment={{
    horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
    vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
}}
Other inconsistencies

We are using 10px gap here so we can change this to 8px too. This is the add payment method menu in settings.

vertical: this.state.anchorPositionVertical - 10,

What alternative solutions did you explore? (Optional)

Instead of introducing the anchorAlignment prop, we can make a simpler prop for just the vertical anchor alignment like -

  1. topVerticalAnchorAlignment - a boolean prop which when true will set vertical anchor alignment to TOP otherwise BOTTOM.
  2. verticalAnchorAlignment - a prop of type PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), we can either pass CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP or BOTTOM.
Videos

Screen.Recording.2023-07-25.at.5.10.29.PM.mov
Screen.Recording.2023-07-25.at.5.11.08.PM.mov

@sakluger sakluger removed the Needs Reproduction Reproducible steps needed label Jul 20, 2023
@sakluger
Copy link
Contributor

I was able to reproduce this and it's definitely a bug!

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Jul 20, 2023
@melvin-bot melvin-bot bot changed the title On request money report clicking the down arrow on options to pay with expensify hides the entire button [$1000] On request money report clicking the down arrow on options to pay with expensify hides the entire button Jul 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

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

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

melvin-bot bot commented Jul 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

@situchan
Copy link
Contributor

There are cases where BOTTOM is needed. i.e. ReportPreview.
So no satisfactory proposals yet.

@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2023
@Nikhil-Vats
Copy link
Contributor

Hey @situchan, we don't show the dropdown options on ReportPreview -

<SettlementButton
currency={props.iouReport.currency}
policyID={props.iouReport.policyID}
chatReportID={props.chatReportID}
iouReport={props.iouReport}
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.iouReport)}
enablePaymentsRoute={ROUTES.BANK_ACCOUNT_NEW}
addBankAccountRoute={bankAccountRoute}
style={[styles.requestPreviewBox]}
/>

Notice that shouldShowPaymentOptions is not passed which is required to show the options. If you are able to see the dropdown button, can you maybe post a screenshot, please?

@situchan
Copy link
Contributor

ok, that's just an example. What about MoneyRequestConfirmationList?
It shows button at the footer so dropdown menu might be overlapped with window bottom edge

@Nikhil-Vats
Copy link
Contributor

You are right @situchan. Although we show the dropdown button only for send money requests which are disabled at the moment, we should still fix it, I will update my proposal.

const shouldShowSettlementButton = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND;
const shouldDisableButton = selectedParticipants.length === 0;
const recipient = props.selectedParticipants[0] || {};
return shouldShowSettlementButton ? (
<SettlementButton
isDisabled={shouldDisableButton}
onPress={confirm}
shouldShowPaypal={Boolean(recipient && recipient.payPalMeAddress)}
enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS}
addBankAccountRoute={props.bankAccountRoute}
addDebitCardRoute={ROUTES.IOU_SEND_ADD_DEBIT_CARD}
currency={props.iouCurrencyCode}
policyID={props.policyID}
shouldShowPaymentOptions
/>

But I have a follow-up in that case, the dropdown icon points to the bottom in MoneyRequestConfirmationList but the dropdown will open in the upwards direction -

Screen.Recording.2023-07-25.at.3.50.57.AM.mov

I see @Julesssss worked on this before. Hey @Julesssss can you confirm what should be the behaviour here? It is for send money flow which is disabled at the moment but still is it okay if dropdown icon points downward but menu open upwards?

@Julesssss
Copy link
Contributor

Julesssss commented Jul 25, 2023

Yeah, I think it's fine because it's still a dropdown menu, we just happen to show the menu above the button instead of on-top or below.

@Julesssss Julesssss self-assigned this Jul 25, 2023
@Nikhil-Vats
Copy link
Contributor

Hey @situchan, I have updated my proposal.

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

Current assignee @Julesssss is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

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

melvin-bot bot commented Jul 31, 2023

📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

📣 @Nikhil-Vats 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

📣 @dhairyasenjaliya 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@Nikhil-Vats
Copy link
Contributor

I have started working on this and will have the PR ready for review today.

@greg-schroeder
Copy link
Contributor

FYI: We've closed #22505 as a dupe of this issue. Let's make sure the solution extends to the ThreeDotsMenu as well

@Nikhil-Vats
Copy link
Contributor

PR is ready for review.

@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @Nikhil-Vats got assigned: 2023-07-31 10:20:23 Z
  • when the PR got merged: 2023-08-07 13:16:51 UTC
  • days elapsed: 5

On to the next one 🚀

@Julesssss
Copy link
Contributor

Screenshot 2023-08-07 at 15 19 30

The PR was ready to merge within 3 days, but I was OOO. Bonus should apply.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 9, 2023
@melvin-bot melvin-bot bot changed the title [$1000] On request money report clicking the down arrow on options to pay with expensify hides the entire button [HOLD for payment 2023-08-16] [$1000] On request money report clicking the down arrow on options to pay with expensify hides the entire button Aug 9, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.51-2 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-08-16. 🎊

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:

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 Aug 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:

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

@sakluger sakluger added Daily KSv2 and removed Weekly KSv2 labels Aug 17, 2023
@sakluger
Copy link
Contributor

sakluger commented Aug 17, 2023

@situchan as soon as you finish the BugZero checklist I can complete your payment as well. Thanks!

@situchan
Copy link
Contributor

No PR caused regression. I'd say this is minor UI improvement than bug so no regression test is needed

@sakluger
Copy link
Contributor

Thanks @situchan! I completed payment via 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

6 participants