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-04-27] [$1000] Back button in split bill page is 20px padding left inconsistent with other pages of the app #17366

Closed
6 tasks done
kavimuru opened this issue Apr 13, 2023 · 28 comments
Assignees
Labels
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 Apr 13, 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 the app
  2. Click on plus
  3. Click on split bill
  4. Enter any amount and click next
  5. Check padding in the top before back button
  6. Select any user, click next and again check paddin in the top before back button

Expected Result:

Split bill pages should have 8px padding-left as we have used in page navigation before back button throughout the app

Actual Result:

Split bill pages have 20px padding-left instead of standard 8px

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: v1.2.99-4
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

inconsistent.padding.before.back.button.mp4
Recording.217.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681289696995609

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010c9460f2554a482b
  • Upwork Job ID: 1646545267189272576
  • Last Price Increase: 2023-04-13
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 13, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 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

@kavimuru kavimuru changed the title Split bill pages have 20px padding-left before back button instead of 8px padding-left present throughout the app in the navigation before back button Back button in split bill page is 20px padding left inconsistent with other pages of the app Apr 13, 2023
@Victor-Nyagudi
Copy link
Contributor

Proposal

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

Back button in split bill page is 20px padding left inconsistent with other pages of the app

What is the root cause of that problem?

WorkspacesListPage.js uses a HeaderWithCloseButton.js element which, when shouldShowBackButton is set to true, adds styles.pl2 to HeaderWithCloseButton's style prop adjusting its paddingLeft once more.

<HeaderWithCloseButton
title={this.props.translate('common.workspaces')}
shouldShowBackButton
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>

Left padding is first adjusted by styles.headerBar to 20 then overwritten by styles.pl2 to 8.

<View style={[styles.headerBar, this.props.shouldShowBorderBottom && styles.borderBottom, this.props.shouldShowBackButton && styles.pl2]}>

App/src/styles/styles.js

Lines 1874 to 1881 in 42bea4b

headerBar: {
overflow: 'hidden',
justifyContent: 'center',
display: 'flex',
paddingLeft: 20,
height: variables.contentHeaderHeight,
width: '100%',
},

pl2: {
paddingLeft: 8,
},

However, the IOUBillPage.js page component renders a <MoneyRequestModal /> component which in turn renders a <ModalHeader /> rather than a <HeaderWithCloseButton />.

This <ModalHeader /> only has the styles.headerBar style prop applied, so padddingLeft ends up being 20.

<View style={[styles.headerBar]}>

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

Since the <ModalHeader /> and <HeaderWithCloseButton /> have an identical component hierarchy and similar prop types, adding an optional styles.pl2 to <ModalHeader /> will give it a paddingLeft of 8 like its <HeaderWithCloseButton /> counterpart resulting in a more consistent look.

<View style={[styles.headerBar, props.shouldShowBackButton && styles.pl2]}>

I have videos showing the final result, but they're slightly too big to add to this comment. I can upload them to Slack if you'd like to take a look.

@laurenreidexpensify laurenreidexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 13, 2023
@melvin-bot melvin-bot bot changed the title Back button in split bill page is 20px padding left inconsistent with other pages of the app [$1000] Back button in split bill page is 20px padding left inconsistent with other pages of the app Apr 13, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~010c9460f2554a482b

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 13, 2023
@Prince-Mendiratta
Copy link
Contributor

Proposal

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

In this issue, we can notice that the left padding for the Modal header is of 20px, which is inconsistent with the rest of the app, where the left padding for the back button / header is 8px.

What is the root cause of that problem?

This looks like a regression / missed case from #16679.

This issue is present in not just Split Bill flow, but also on the Request Money and Send Money flow.

This is because all of the above mentioned flows make use of the MoneyRequestModal, which uses the ModalHeader to set the header message as well as the left padding of the header. It uses the style styles.headerBar, which has a padding of 20px. This is because by default, the modal header also shows the titles such as 'Request Money', 'Split Bill' which require the padding to be of 20px. When the back button is displayed however, the padding should be reduced to 8px, as is done in the HeaderWithCloseButton. However, we do not do this in the ModalHeader, leading to the inconsistent pattern.

<View style={[styles.headerBar]}>

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

We need to selectively set the padding to 8px if the back button is visible. This needs to be done here:

<View style={[styles.headerBar]}>

This can be done by using the conditional statement to the View style such that when the prop shouldShowBackButton is true, the padding should be set to styles.pl2, i.e 8px.

What alternative solutions did you explore? (Optional)

None

@dukenv0307
Copy link
Contributor

Proposal

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

Back button in split bill page is 20px padding left inconsistent with other pages of the app

What is the root cause of that problem?

Split bill page use ModalHeader component that has the wrapper View with style is styles.headerBar. So that it has padding left 20px

<View style={[styles.headerBar]}>

While other pages use HeaderWithCloseButton component, if have back button it has padding left 8px with style styles.pl2
<View style={[styles.headerBar, this.props.shouldShowBorderBottom && styles.borderBottom, this.props.shouldShowBackButton && styles.pl2]}>

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

Add style styles.pl2 for wrapper View of ModalHeader component when has back button same as HeaderWithCloseButton component: <View style={[styles.headerBar, props.shouldShowBackButton && styles.pl2]}>

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.13-04-2023.22.16.43.webm

@MelvinBot
Copy link

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

@dianaferreira1
Copy link

Proposal

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

the left padding of the Modal header is 20px, which doesn't match the 8px left padding used in other parts of the app for the back button/header

What is the root cause of that problem?

The issue causing the Back button in split bill page to have inconsistent padding of 20px on the left compared to other pages of the app is likely due to the "mr2" style applied to the containing View element.

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

To fix this issue, modify the styles applied to the containing View element by removing the "mr2" style. For example:

const ModalHeader = props => (

<View style={[
styles.dFlex,
styles.flexRow,
styles.alignItemsCenter,
styles.flexGrow1,
styles.justifyContentBetween,
styles.overflowHidden,
]}
>
{props.shouldShowBackButton
&& (

<Tooltip text={props.translate('common.back')}>





)}


<View style={[styles.reportOptions, styles.flexRow, styles.pr5]}>
<Tooltip text={props.translate('common.close')}>
<TouchableOpacity
onPress={() => Navigation.dismissModal()}
style={[styles.touchableButtonImage]}
accessibilityRole="button"
accessibilityLabel={props.translate('common.close')}
>






);

@MelvinBot
Copy link

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@sobitneupane
Copy link
Contributor

Thanks for the proposal everyone.

Proposal from @Prince-Mendiratta looks good to me.

🎀👀🎀 C+ reviewed
cc: @flodnv

@Victor-Nyagudi
Copy link
Contributor

@sobitneupane Just so I can get some clarity, the accepted proposal looks very identical to mine including the solution, however, mine wasn't selected even though it came first.

Is there a different selection process for identical proposals, or is there a small detail in the identical accepted proposal that mine doesn't have that I should include in future proposals?

@sobitneupane
Copy link
Contributor

@Victor-Nyagudi You are not supposed to propose solution before Help Wanted label is applied and any proposals submitted when that label is not present will not be reviewed.

https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#propose-a-solution-for-the-job

@Victor-Nyagudi
Copy link
Contributor

Noted.

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

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

@flodnv
Copy link
Contributor

flodnv commented Apr 17, 2023

Thanks, go ahead @Prince-Mendiratta

@Prince-Mendiratta
Copy link
Contributor

PR is up for review!

Applied to Upwork

Thanks all!

cc @sobitneupane @flodnv @laurenreidexpensify

@laurenreidexpensify
Copy link
Contributor

Bug reporter, Contributor and C+ all hired in Upwork

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 20, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Back button in split bill page is 20px padding left inconsistent with other pages of the app [HOLD for payment 2023-04-27] [$1000] Back button in split bill page is 20px padding left inconsistent with other pages of the app Apr 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 20, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.2-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-04-27. 🎊

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

@MelvinBot
Copy link

MelvinBot commented Apr 20, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane] 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:
  • [@sobitneupane] 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:
  • [@laurenreidexpensify] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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:

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

@sobitneupane pls complete your steps above, thanks!

@laurenreidexpensify laurenreidexpensify removed the Awaiting Payment Auto-added when associated PR is deployed to production label Apr 27, 2023
@laurenreidexpensify
Copy link
Contributor

I don't think we need a regression test for this as it's a stylistic consistency issue rather than a UI bug

@laurenreidexpensify
Copy link
Contributor

Everyone has been paid, including 50% 3 day bonus, just waiting for Sobit to finish last steps before closing.

@sobitneupane
Copy link
Contributor

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#16679

  • [@sobitneupane] 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:

#16679 (comment)

  • [@sobitneupane] 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:

https://expensify.slack.com/archives/C049HHMV9SM/p1682597327733349

@flodnv
Copy link
Contributor

flodnv commented Apr 27, 2023

I don't think we need a regression test for this as it's a stylistic consistency issue rather than a UI bug

Agreed

@laurenreidexpensify
Copy link
Contributor

Nice work everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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