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 2024-08-05] [$250] Bottom docked button views does not use correct SafeSpace in mobile #44056

Closed
1 of 6 tasks
m-natarajan opened this issue Jun 20, 2024 · 41 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

@m-natarajan
Copy link

m-natarajan commented Jun 20, 2024

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


Version Number: 1.4.86-0
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
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1718816465053499

Action Performed:

  1. Open app
  2. Tap avatar
  3. Tap display name
  4. Observe the space at the bottom of docked button

Expected Result:

There should be proper bottom SafeSpace below the button

Actual Result:

Bottom button is very close to the home bar

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cab23d89474f1097
  • Upwork Job ID: 1804290933858433766
  • Last Price Increase: 2024-06-28
  • Automatic offers:
    • allgandalf | Reviewer | 102958436
    • truph01 | Contributor | 102958440
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @sakluger / @sakluger
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 20, 2024
Copy link

melvin-bot bot commented Jun 20, 2024

Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@truph01
Copy link
Contributor

truph01 commented Jun 20, 2024

Proposal

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

  • Bottom button is very close to the home bar

What is the root cause of that problem?

  • We do not use includeSafeAreaPaddingBottom:

    includeSafeAreaPaddingBottom={false}

    so there is no safe area padding bottom is applied.

  • Also, currently, the "Save" button has style:

    containerStyles={[styles.mh0, styles.mt5, submitFlexEnabled ? styles.flex1 : {}, submitButtonStyles]}

  • As we can see, the "Save" button is always at the bottom of the screen without any safe area on its bottom side.

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

  • We should add an addtional style safeAreaPaddingBottomStyle.paddingBottom && styles.pb5 to the containerStyles:
    containerStyles={[styles.mh0, styles.mt5, submitFlexEnabled ? styles.flex1 : {}, submitButtonStyles]}
                        containerStyles={[styles.mh0, styles.mt5, submitFlexEnabled ? styles.flex1 : {}, submitButtonStyles, safeAreaPaddingBottomStyle.paddingBottom && styles.pb5]}
  • With the above change: In the device where there is no safe area padding-bottom (web, desktop), we do not need to add the additional padding-bottom value 20px, in other words, keep it as it is. In the devices that have safe area padding-bottom (native), add the addtional padding-bottom value as mentioned in here.

What alternative solutions did you explore? (Optional)

  • We have two positions that add the padding-bottom to the screen:

  • One in ScreenWrapper:

    // We always need the safe area padding bottom if we're showing the offline indicator since it is bottom-docked.
    if (includeSafeAreaPaddingBottom || (isOffline && shouldShowOfflineIndicator)) {
    paddingStyle.paddingBottom = paddingBottom;
    }

    and one in FormWrapper:
    style={[style, safeAreaPaddingBottomStyle.paddingBottom ? safeAreaPaddingBottomStyle : styles.pb5]}

  • Let say the safeAreaPaddingBottomStyle.paddingBottom is 20. If we use includeSafeAreaPaddingBottom={true} in ScreenWrapper, both of these above padding styles are applied, the real padding-bottom will be 20*2 = 40. If we use includeSafeAreaPaddingBottom={false}, the real padding-bottom will be 20.

  • In case of this bug, we already applied the safe area padding-bottom, 20, but the design team think it is not enough. And if we need to add more padding-bottom value in case applying safe area padding-bottom is not enough, we can update this:

    style={[style, safeAreaPaddingBottomStyle.paddingBottom ? safeAreaPaddingBottomStyle : styles.pb5]}

    to:

                style={[style, safeAreaPaddingBottomStyle.paddingBottom ? {paddingBottom: safeAreaPaddingBottomStyle + 15} : styles.pb5]}

In there, 15 is just the example, we can modify in the future.

@shawnborton
Copy link
Contributor

@truph01 I think you have the right solution but I think we need to make sure we implement this on all pages that use the bottom-docked green button, not just the display name page.

@truph01
Copy link
Contributor

truph01 commented Jun 20, 2024

@shawnborton We can do it by remove includeSafeAreaPaddingBottom={false} in all screen as I mentioned.

@neonbhai
Copy link
Contributor

Proposal

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

Onboarding modal uses incorrect row hover style when hovering over the options

What is the root cause of that problem?

We disable safeAreaPadding for screens with forms as because it is already accounted for in Form Provider here

This is also mentioned in docs here:

Any `FormProvider.js` that has a button will also add safe area padding by default. If the `<FormProvider>` is inside a `<ScreenWrapper>`, we will want to disable the default safe area padding applied there e.g.
```jsx
<ScreenWrapper includeSafeAreaPaddingBottom={false}>
<FormProvider>
{...}
</FormProvider>
</ScreenWrapper>
```

We still seem to be missing the extra padding below the Form Submit button as we have not configured the styles correctly

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

We will remove the bottom padding style.pb5 added here in #40473:

style={[style, safeAreaPaddingBottomStyle.paddingBottom ? safeAreaPaddingBottomStyle : styles.pb5]}


and apply it here:
containerStyles={[styles.mh0, styles.mt5, submitFlexEnabled ? styles.flex1 : {}, submitButtonStyles]}

@shawnborton
Copy link
Contributor

Cool, I agree that removing includeSafeAreaPaddingBottom={false} is the way to go for native devices. cc @sakluger I think we are ready to open this one up.

@allgandalf
Copy link
Contributor

allgandalf commented Jun 20, 2024

@sakluger , can i be the C+ here? As i have context about this bug and it was found during the PR:

Screenshot 2024-06-21 at 2 08 37 AM

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

@melvin-bot melvin-bot bot changed the title Bottom docked button views does not use correct SafeSpace in mobile [$250] Bottom docked button views does not use correct SafeSpace in mobile Jun 21, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

@sakluger
Copy link
Contributor

@allgandalf sure thing!

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@allgandalf
Copy link
Contributor

allgandalf commented Jun 24, 2024

Will review this today/tomorrow, reviewing an urgent deploy blocker today

@melvin-bot melvin-bot bot removed the Overdue label Jun 24, 2024
@allgandalf

This comment was marked as outdated.

@allgandalf
Copy link
Contributor

I feel both of the proposals don't solve the issue at root, I am keeping this one open for proposal updates until tomorrow @neonbhai @truph01 if you can review this bug again and think of a better solution, or will ask on slack for more help!

You can go through my conversation with @shawnborton over the PR to understand more about the ideal solution

@truph01
Copy link
Contributor

truph01 commented Jun 25, 2024

@allgandalf Thanks for your feedback.

Proposal updated

@allgandalf
Copy link
Contributor

allgandalf commented Jun 27, 2024

I think both the proposals still don't solve the issue at root, according to the C+ doc:

If C+ wants to submit a proposal to fix the issue they do so and tag the internal engineer (by adding “ 🎀👀🎀”) to review the proposal

🎀👀🎀

I would like to submit my proposal and get it reviewed by an internal engineer, if they agree with my proposal then i guess we need a new C+ and if they go with other proposals i can still review it.

Proposal

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

Form button is bottom docked, we need to have some padding added to it and not keep it close to the bottom.

What is the root cause of that problem?

This is a new requirement, we need to always have safe padding for forms.

In our docs :

Any `FormProvider.js` that has a button will also add safe area padding by default. If the `<FormProvider>` is inside a `<ScreenWrapper>`, we will want to disable the default safe area padding applied there e.g.

We previously added this to prevent extra bottom padding for form buttons.

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

The default value of includeSafeAreaPaddingBottom is true:

includeSafeAreaPaddingBottom = true,

So it was only for form inside screenwrappers that we added includeSafeAreaPaddingBottom to false.

So with the new requirement that we should always have bottom padding, we can remove the below condition:

if (includeSafeAreaPaddingBottom || (isOffline && shouldShowOfflineIndicator)) {
paddingStyle.paddingBottom = paddingBottom;
}

We will remove the if condition and always add padding. we should also now remove the usage of includeSafeAreaPaddingBottom as we always want to add bottom padding

  • For desktop/macOS web, the value of bottom padding will be 0.
  • For native devices, it will get the value of bottom padding and apply it successfully
  • This will also solve the issue at root and will apply to all the places where we wrap form in screenwrapper

What alternative solutions did you explore? (Optional)

N/A

Copy link

melvin-bot bot commented Jun 27, 2024

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

@truph01
Copy link
Contributor

truph01 commented Jun 27, 2024

@allgandalf I think my solution and yours have the same implementation and output:

  1. Output: Both my solution and yours make sure we always add the padding-bottom to the screen.
  2. Implementation: Both solutions need to remove all the includeSafeAreaPaddingBottom={false} when using ScreenWrapper
  • What do you think? Please correct me if I am wrong.

@allgandalf
Copy link
Contributor

allgandalf commented Jun 27, 2024

I felt that in your solution, you never mentioned that we should get ride of the condition all together because it is redundant and that is what i felt missing (i.e. issue is not solved at root), which is why i initially asked both of you to update your solutions. Also you mentioned to remove the use of includeSafeAreaPaddingBottom from the component usage, but didn't mention that the code is redundant now and we should get rid of the condition altogether

Lets wait on the internal engineers comments now :)

@truph01
Copy link
Contributor

truph01 commented Jun 27, 2024

Proposal updated

  • I add the new solution in alternative solution.

Copy link

melvin-bot bot commented Jun 28, 2024

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

@allgandalf
Copy link
Contributor

cool, thanks shawn, that’s what my proposal does 👍

@truph01
Copy link
Contributor

truph01 commented Jun 29, 2024

@allgandalf

  • I see that your solution will make the padding bottom to 23.79px + 23.79px in my example, but we need 23.79px + 20px right?
  • Also, your solution introduce a regression with the screen that does not use form element as below:
Before After
image image

@truph01
Copy link
Contributor

truph01 commented Jun 29, 2024

Proposal updated

@truph01
Copy link
Contributor

truph01 commented Jun 29, 2024

I updated comment

@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@sakluger
Copy link
Contributor

sakluger commented Jul 1, 2024

Not overdue, Melvin, we're still discussing the proper solution.

@melvin-bot melvin-bot bot removed the Overdue label Jul 1, 2024
@puneetlath
Copy link
Contributor

It sounds like we have pretty much a working solution and the rest can be worked out in the PR. I'll assign @truph01 and @allgandalf can work with him in the PR to make sure we're not introducing any regressions. Thanks y'all!

Copy link

melvin-bot bot commented Jul 2, 2024

📣 @allgandalf 🎉 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

Copy link

melvin-bot bot commented Jul 2, 2024

📣 @truph01 🎉 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 melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 3, 2024
@truph01
Copy link
Contributor

truph01 commented Jul 3, 2024

@allgandalf PR #44761 is ready

@allgandalf
Copy link
Contributor

Update

Still working through the PR, the updated changes are in a base component, so testing and working with the contributor to not cause any regression

@allgandalf
Copy link
Contributor

Update

PR was deployed to staging, waiting to get it onto production

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] Bottom docked button views does not use correct SafeSpace in mobile [HOLD for payment 2024-08-05] [$250] Bottom docked button views does not use correct SafeSpace in mobile Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.13-4 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 2024-08-05. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 29, 2024

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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 5, 2024
@sakluger
Copy link
Contributor

sakluger commented Aug 5, 2024

All paid, thanks everyone.

@sakluger sakluger closed this as completed Aug 5, 2024
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
No open projects
Archived in project
Development

No branches or pull requests

7 participants