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] [$1000] Payment delete modal menu missing margin at the top #18581

Closed
6 tasks
kavimuru opened this issue May 8, 2023 · 37 comments
Closed
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

kavimuru commented May 8, 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!


Action Performed:

  1. Open App
  2. Go to Settings > Payments
  3. If no payment has been added then add any one
  4. Press on the added payment method
  5. It will open the delete modal from the
  6. Press on delete
  7. It will open a confirmation modal
  8. Observe both modal’s top padding

Expected Result:

There should be some padding between the payment option and the delete modal

Actual Result:

There is no padding between the payment option and the delete modal

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.11.2
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
Notes/Photos/Videos: Any additional supporting documentation

delete-modal-no-spacing.mov

delete-modal-no-spacing

Recording.525.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01510361e941b5686d
  • Upwork Job ID: 1656321116447989760
  • Last Price Increase: 2023-05-10
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

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

@melvin-bot
Copy link

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

@jayeshmangwani
Copy link
Contributor

Proposal

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

Delete Payment modal has a missing margin at the top compared to the payment option.

What is the root cause of that problem?

At the time of calculating the top anchor position in setPositionAddPaymentMenu, we are not adding any additional top margin outside the touch area, so when the user press MenuItem(Payment method), we count the top position like this, MenuItem height + Pressed MenuItem component position from top (position.top + position.height)

setPositionAddPaymentMenu(position) {
this.setState({
anchorPositionTop: position.top + position.height,
anchorPositionBottom: this.props.windowHeight - position.top,
// We want the position to be 13px to the right of the left border
anchorPositionRight: (this.props.windowWidth - position.right) + 13,
});
}

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

We can add the top margin many ways, but I would suggest that when calculating the anchorPositionTop, we should add the six margins to the top of position.top + position.height ,

we should add six here in anchorPositionTop: position.top + position.height + 6

anchorPositionTop: position.top + position.height,
anchorPositionBottom: this.props.windowHeight - position.top,
// We want the position to be 13px to the right of the left border
anchorPositionRight: (this.props.windowWidth - position.right) + 13,
});

we can add the top margin to individual PopOver too, like this top: this.state.anchorPositionTop + 6 , but for adding the top margin to all the PopOver on page,

anchorPosition={{
top: this.state.anchorPositionTop,
right: this.state.anchorPositionRight,
}}

Why 6 margin ?
We have the 6 margins on this page between Add Payment button and Add Payment popover for consistency we can add 6 (or we can add a margin by confirming with the design team).

Throughout the app, we added different margins from the top and bottom of the touchable area, but for this page, we can use 6.

I am attaching a video here with 6 pixel space

Result
6px-delete.mov

What alternative solutions did you explore? (Optional)

N/A

@bernhardoj
Copy link
Contributor

@slafortune
Copy link
Contributor

I wasn't able to pick out the green border around the delete button - Sheena helped me see it 🙌
image

@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label May 10, 2023
@melvin-bot melvin-bot bot changed the title Payment delete modal menu missing margin at the top [$1000] Payment delete modal menu missing margin at the top May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01510361e941b5686d

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

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

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

melvin-bot bot commented May 10, 2023

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

@Nikhil-Vats
Copy link
Contributor

Nikhil-Vats commented May 12, 2023

Proposal

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

There is no space between the payment method delete popover and the payment method.

I would also like to highlight two related issues that are quite important I believe -

  1. On the web and desktop app (on large screen size), the Confirm delete payment modal has inconsistent styling with other Confirm Modals like delete workspace and delete comment. The delete payment modal is not centered on the screen like others and it doesn't look good at all.

  2. If we show the MakeDefaultButton then the buttons have little space in between. See the image below.

Very less gap between buttons image

What is the root cause of that problem?

The root cause of this issue is how we calculate the anchorPositionTop of the delete Popover. anchorPositionTop is equal to the top position of the target (PaymentMethod) plus the height of the target which doesn't leave any space between the PaymentMethod and the Popover component.

The root cause of additional similar issues mentioned -

  1. Confirm Delete Modal not centered - The BasePaymentsPage uses the ConfirmContent component with its own styles and anchorPosition rather than using the ConfirmModal which is used everywhere else. This is an inconsistency with all other similar modals and should be fixed.
  2. Very less gap between MakeDefaultButton and DeletePaymentMethodButton - There is no style added for gap in the styles prop of the View wrapper.

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

The add payment button has a vertical padding of 6px so for keeping consistency we can add the same 6px to the anchorPositionTop in setPositionAddPaymentMenu.

To fix other issues -

  1. Use ConfirmModal instead of ConfirmContent to center the delete payment method confirm modal.
  2. Use styles.gap1 in the parent View of MakeDefaultButton and DeletePaymentMethodButton.

What alternative solutions did you explore? (Optional)

In my opinion from a UX perspective clicking on the payment method to reveal a Popover which has a delete button and other buttons like make default method is inconsistent with our other similar menus and also unintuitive.

For example - The delete workspace popover is opened using the ThreeDotsMenu which looks better and is also better for UX.

Screenshot 2023-05-13 at 12 45 21 AM

I think we should use ThreeDotsMenu for showing the delete and make default payment method button. Also, clicking on the delete button should show a centred modal using the ConfirmModal component.

I strongly believe we should do this but I added it as an alternative solution because its scope is bigger than the core issue here.

A rough final look should be something like this -
Please note that the Paypal button also looks selected but that is because I wanted to visualize the UI so didn't clean up that code and wrote a rough version of it -

delete_payment_method

If this is too big of a change then I think we should at least fix the ConfirmModal position and add the gap between MakeDefaultButton and DeletePaymentMethodButton because those are small changes of a few lines of code within BasePaymentsPage.js.

@melvin-bot melvin-bot bot added the Overdue label May 12, 2023
@Nikhil-Vats
Copy link
Contributor

Nikhil-Vats commented May 12, 2023

I wasn't able to pick out the green border around the delete button - Sheena helped me see it 🙌 image

@slafortune It seems like in your screenshot the top border has less width than the other three sides due to which it's difficult to notice but it looks okay here -
image

@PauloGasparSv
Copy link
Contributor

Thks for bringing this up @bernhardoj.

I'm not sure why we did nothing last time since it looks like everyone agreed it wasn't a bug but that we should add the space. I think we should fix it this time.

@melvin-bot melvin-bot bot removed the Overdue label May 13, 2023
@mananjadhav
Copy link
Collaborator

I am not sure either. @shawnborton do you want to chime in here if we are open to fix it now?

@shawnborton
Copy link
Contributor

I'm cool with adding some margin above the menu.

@slafortune
Copy link
Contributor

I actually feel like that green box around the delete button seems odd to have - or doesn't seem to add anything. Are we set on that staying?

Disclaimer not a designer

@mananjadhav
Copy link
Collaborator

thanks for the confirmation @shawnborton. Could you also specify how much margin do we want to keep?

@slafortune I think the green border would be required to show the popup? It is due to no margin we can't identify the border.

That being said, I think @jayeshmangwani's initial proposal is good to go with. @Nikhil-Vats's proposal is also on the similar lines and as they also agree their alternative solutions are not relevant to fix the current PR.

@PauloGasparSv All yours.

@PauloGasparSv
Copy link
Contributor

Thks @mananjadhav, I'm assigning @jayeshmangwani since it was the first proposal here

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

melvin-bot bot commented May 15, 2023

📣 @jayeshmangwani You have been assigned to this job by @PauloGasparSv!
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 📖

@jayeshmangwani
Copy link
Contributor

@PauloGasparSv @mananjadhav PR is ready for review

@shawnborton Added margin 6 between the delete modal and Payment Option and it looks like this
Screenshot 2023-05-16 at 2 51 09 AM

@shawnborton
Copy link
Contributor

We should do everything using blocks of our 4px spacer. We already have some helper classes built in for this too. So you could use something like mt2 which is margin-top-2xSpacer, which will give you a margin top of 8px.

@jayeshmangwani
Copy link
Contributor

@shawnborton We can add 8 directly to the position.top + position.height sum

anchorPositionTop: position.top + position.height,

As we are calculating anchorPositionTop in state value and using it at every PopOver on the page, here we can not use mt2 from styles.
e.g. here we are calculating anchorPositionRight by adding an additional 13 px
// We want the position to be 13px to the right of the left border
anchorPositionRight: this.props.windowWidth - position.right + 13,

@mananjadhav
Copy link
Collaborator

@jayeshmangwani You can add the value to variables.js and use it here.

@jayeshmangwani
Copy link
Contributor

@jayeshmangwani You can add the value to variables.js and use it here.

@mananjadhav Right now there are 4 constants in variables.js, that have an 8px value

  1. componentBorderRadius
  2. componentBorderRadiusNormal
  3. iconSizeXXSmall
  4. sliderBarHeight

IMO we should add a new variable whose name is relevant to Modal/Popover
e.g. popoverTopSpacing

@mananjadhav
Copy link
Collaborator

Yeah that's what I meant when I said add the value instead of hardcoding 8. While we're at it, we should also move 13 to the variables.

@jayeshmangwani
Copy link
Contributor

@mananjadhav Updated code to use variables value and updated desktop and web video with 8 top margins to PR

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

🎯 ⚡️ Woah @mananjadhav / @jayeshmangwani, 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 @jayeshmangwani got assigned: 2023-05-15 20:28:14 Z
  • when the PR got merged: 2023-05-16 18:42:59 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 18, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Payment delete modal menu missing margin at the top [HOLD for payment 2023-05-25] [$1000] Payment delete modal menu missing margin at the top May 18, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.15-12 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-25. 🎊

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

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 24, 2023
@mananjadhav
Copy link
Collaborator

I think the closest PR where we add the margin changes was here. I won't treat this as a bug (more so feature request/UI change) because when the earlier PR was reviewed, we didn't set any requirements for the margin top.

Neither I think we should add a regression test for this one. wdyt @slafortune @PauloGasparSv ?

@PauloGasparSv
Copy link
Contributor

I agree @mananjadhav. IMO we could reference that P.R. as the one that "added the bug" and mark the rest of the checklist as complete but do nothing : )

@mananjadhav
Copy link
Collaborator

@slafortune this one is ready for payout then. thank you.

@slafortune
Copy link
Contributor

@mananjadhav and @jayeshmangwani offers sent!

@mananjadhav
Copy link
Collaborator

Accepted @slafortune

@jayeshmangwani
Copy link
Contributor

@slafortune I am not able to accept the offer, shows offer withdrawal by the client

Screenshot 2023-05-26 at 10 53 14 AM

@slafortune
Copy link
Contributor

slafortune commented May 26, 2023

Shoot! I've run into so many errors with Upworks recently. Resent @jayeshmangwani

@jayeshmangwani
Copy link
Contributor

Thanks @slafortune , Offer accepted

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

8 participants