Skip to content

[HOLD for payment 2024-08-05] [$250] Bottom docked button views does not use correct SafeSpace in mobile #44056

Description

@m-natarajan

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 20, 2024
  2. melvin-bot commented on Jun 20, 2024

    @melvin-bot

    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.

  3. truph01 commented on Jun 20, 2024

    @truph01
    Contributor

    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.

  4. shawnborton commented on Jun 20, 2024

    @shawnborton
    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.

  5. truph01 commented on Jun 20, 2024

    @truph01
    Contributor

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

  6. neonbhai commented on Jun 20, 2024

    @neonbhai
    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]}

  7. shawnborton commented on Jun 20, 2024

    @shawnborton
    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.

  8. allgandalf commented on Jun 20, 2024

    @allgandalf
    Contributor

    @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
  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 21, 2024
  10. melvin-bot commented on Jun 21, 2024

    @melvin-bot
  11. 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[/+] on Jun 21, 2024
  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 21, 2024
  13. 37 remaining items

  14. truph01 commented on Jul 3, 2024

    @truph01
    Contributor

    @allgandalf PR #44761 is ready

  15. allgandalf commented on Jul 23, 2024

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

  16. allgandalf commented on Jul 29, 2024

    @allgandalf
    Contributor

    Update

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

  17. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jul 29, 2024
  18. 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[/+] on Jul 29, 2024
  19. melvin-bot commented on Jul 29, 2024

    @melvin-bot

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

  20. melvin-bot commented on Jul 29, 2024

    @melvin-bot

    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:

  21. melvin-bot commented on Jul 29, 2024

    @melvin-bot

    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:
  22. sakluger commented on Aug 5, 2024

    @sakluger
    Contributor

    All paid, thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions