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 2025-01-07] [$250] Android - Expense - Submit button jumps when proceeding to confirmation page #53182

Closed
2 of 8 tasks
IuliiaHerets opened this issue Nov 27, 2024 · 47 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 27, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.67-1
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch the app.
  2. Go to FAB > Create expense > Manual.
  3. Enter amount > Next.
  4. With the keyboard up, select any user at the top.

Expected Result:

Submit button will not jump when proceeding to confirmation page.

Actual Result:

Submit button jumps when proceeding to confirmation page.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6677445_1732656649279.Screen_Recording_20241127_052722.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861729998144839111
  • Upwork Job ID: 1861729998144839111
  • Last Price Increase: 2024-11-27
  • Automatic offers:
    • suneox | Reviewer | 105169308
    • huult | Contributor | 105169309
Issue OwnerCurrent Issue Owner: @sonialiap / @MitchExpensify
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

Triggered auto assignment to @techievivek (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Nov 27, 2024

Triggered auto assignment to @sonialiap (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.

Copy link

melvin-bot bot commented Nov 27, 2024

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot added the Daily KSv2 label Nov 27, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Nov 27, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@techievivek
Copy link
Contributor

techievivek commented Nov 27, 2024

Not a blocker, demoting it and sending to to external

@techievivek techievivek added External Added to denote the issue can be worked on by a contributor Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Nov 27, 2024
@melvin-bot melvin-bot bot changed the title Android - Expense - Submit button jumps when proceeding to confirmation page [$250] Android - Expense - Submit button jumps when proceeding to confirmation page Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

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

@mountiny
Copy link
Contributor

cc @kirillzyusko @c3024 This is something to look into/ follow up on later

@huult
Copy link
Contributor

huult commented Nov 27, 2024

Edited by proposal-police: This proposal was edited at 2024-11-27 15:03:55 UTC.

Proposal

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

Submit button jumps when proceeding to confirmation page

What is the root cause of that problem?

We use KeyboardAvoidingView in the ScreenWrapper to adjust its height, position, or bottom padding based on the keyboard height, ensuring it remains visible while the virtual keyboard is displayed.

<KeyboardAvoidingView

When we navigate to IOURequestStepConfirmation, KeyboardAvoidingView still detects the keyboard as open and adjusts the bottom padding, causing the submit button to jump up when the keyboard is visible and then jump down after it hides

That's why we don't encounter this issue when the keyboard is not open.

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

To resolve this issue, dismissing the keyboard before navigation ensures that KeyboardAvoidingView works correctly

// src/pages/iou/request/step/IOURequestStepParticipants.tsx#L110
    const goToNextStep = useCallback(() => {
+        Keyboard.dismiss();
        ...
    }

Or

// src/pages/iou/request/step/IOURequestStepParticipants.tsx#L110
    const goToNextStep = useCallback(() => {
        ...
        if (isCategorizing) {
            Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, selectedReportID.current || reportID, iouConfirmationPageRoute));
        } else {
+            KeyboardUtils.dismiss().then(() => {
                Navigation.navigate(iouConfirmationPageRoute);
+            });
    }

Or

        if (isCategorizing) {
+            KeyboardUtils.dismiss().then(() => {
                Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, selectedReportID.current || reportID, iouConfirmationPageRoute));
+            });
        } else {
+            KeyboardUtils.dismiss().then(() => {
                Navigation.navigate(iouConfirmationPageRoute);
+            });
        }
POC
Screen.Recording.2024-11-27.at.21.51.38.mov

What alternative solutions did you explore? (Optional)

We use shouldEnableKeyboardAvoidingView props of ScreenWrapper to disable KeyboardAvoidingView

//src/pages/iou/request/step/IOURequestStepConfirmation.tsx#L604
        <ScreenWrapper
            includeSafeAreaPaddingBottom={false}
            shouldEnableMaxHeight={DeviceCapabilities.canUseTouchScreen()}
            testID={IOURequestStepConfirmation.displayName}
+            shouldEnableKeyboardAvoidingView={false}
        >

@melvin-bot melvin-bot bot added the Overdue label Nov 30, 2024
@huult
Copy link
Contributor

huult commented Nov 30, 2024

Proposal updated

  • Updated new RCA
  • Add alternative solutions

@suneox
Copy link
Contributor

suneox commented Nov 30, 2024

Proposal updated

  • Updated new RCA
  • Add alternative solutions

@huult Your main solution doesn’t seem to work consistently

Screen.Recording.2024-12-01.at.00.16.47.mp4

Could you please provide more details about the RCA for your alternative solution?

@melvin-bot melvin-bot bot removed the Overdue label Nov 30, 2024
@ikevin127
Copy link
Contributor

ikevin127 commented Dec 1, 2024

Edited by proposal-police: This proposal was edited at 2024-12-02 13:19:46 UTC.

Proposal

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

Submit button jumps when proceeding to confirmation page.

What is the root cause of that problem?

The issue seems to be caused by the recent implementation of android specific KeyboardAvoidingView component:

const KeyboardAvoidingView = forwardRef<View, React.PropsWithChildren<KeyboardAvoidingViewProps>>(

from this PR:

which make it such that ScreenWrapper props like shouldDismissKeyboardBeforeClose (true by default) and keyboardAvoidingViewBehavior to have custom implementation and not work as expected anymore.

The same PR brought about changes related to how the keyboard / layout interactions behave and are being handled / animated / transitioned on Android: Native, which I think is also related to causing our glitch / delay when transitioning from one page to another where the keyboard is not needed and we have a button which is supposed to be fixed at the bottom.

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

Note

I also tried to play around with props like shouldEnableKeyboardAvoidingView and use Keyboard.dismiss() but none of those seem to fix the issue given the new android specific KeyboardAvoidingView implementation detailed above.

TLDR: Prevent displaying the Submit {amount} button until Keyboard.isVisible becomes false.

To do this we need to apply some changes to the FixedFooter component. We can do this in at least two different ways:

  1. Add a new prop like onlyShowWhenKeyboardIsHidden and in BaseSelectionList where FixedFooter is used -> pass onlyShowWhenKeyboardIsHidden={Platform.OS === CONST.PLATFORM.ANDROID}.
  2. Split the FixedFooter component into index.tsx which will remain unchanged and index.android.tsx where we will add specific logic to prevent displaying the children until Keyboard.isVisible becomes false (I know this is the recommended way).

For this proposal's sake I'm going with the first option (if selected we can further discuss the best way):

  1. Modify FixedFooter as below, making sure to import Keyboard from react-native and the new prop type (boolean):
function FixedFooter({style, children, onlyShowWhenKeyboardIsHidden = false}: FixedFooterProps) {
    const styles = useThemeStyles();
    const isKeyboardVisible = Keyboard.isVisible();
    const shouldHide = onlyShowWhenKeyboardIsHidden ? isKeyboardVisible : false;

    if (!children || shouldHide) {
        return null;
    }

    return <View style={[styles.ph5, styles.pb5, styles.flexShrink0, style]}>{children}</View>;
}
  1. In BaseSelectionList on this line, pass onlyShowWhenKeyboardIsHidden={Platform.OS === CONST.PLATFORM.ANDROID}.

Alternative solution

We should use await KeyboardUtils.dismiss() before calling the navigation to the confirmation screen.

A similar fix was already implemented in our FormProvider component.

Result video (before / after)

Android: Native (OnePlus 7T - Android 14 - Real device)
Before After
before.mp4
after.mp4

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Dec 13, 2024
@sonialiap
Copy link
Contributor

I'm OOO Dec 16-20, adding a leave buddy

next steps:

  • waiting for PR to be finished

@sonialiap sonialiap self-assigned this Dec 13, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

@suneox, @sonialiap, @huult, @techievivek, @MitchExpensify Eep! 4 days overdue now. Issues have feelings too...

@MitchExpensify
Copy link
Contributor

@huult what is the latest on the PR?

@suneox
Copy link
Contributor

suneox commented Dec 24, 2024

@huult what is the latest on the PR?

I'm still reviewing the PR and will finish testing it today.

Copy link

melvin-bot bot commented Dec 31, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Dec 31, 2024
@melvin-bot melvin-bot bot changed the title [$250] Android - Expense - Submit button jumps when proceeding to confirmation page [HOLD for payment 2025-01-07] [$250] Android - Expense - Submit button jumps when proceeding to confirmation page Dec 31, 2024
Copy link

melvin-bot bot commented Dec 31, 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 Dec 31, 2024
Copy link

melvin-bot bot commented Dec 31, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.79-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 2025-01-07. 🎊

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

Copy link

melvin-bot bot commented Dec 31, 2024

@suneox @sonialiap / @MitchExpensify @suneox The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@MitchExpensify
Copy link
Contributor

MitchExpensify commented Jan 2, 2025

Payment summary:

@MitchExpensify
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 7, 2025
@sonialiap
Copy link
Contributor

@suneox please complete the checklist. Once done we'll issue the payment :)

@suneox
Copy link
Contributor

suneox commented Jan 7, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: feat: edge-to-edge mode on Android #52392 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
    N/A: It isn't an impactful bug

@suneox
Copy link
Contributor

suneox commented Jan 7, 2025

@suneox please complete the checklist. Once done we'll issue the payment :)

I’ve completed the checklist, and the PR for this issue has introduced this regression

@melvin-bot melvin-bot bot added the Overdue label Jan 10, 2025
@parasharrajat
Copy link
Member

@MitchExpensify Looks like there was a regression from this PR so that summary is wrong #53182 (comment)

cc: @sonialiap

Copy link

melvin-bot bot commented Jan 13, 2025

@suneox, @sonialiap, @huult, @techievivek, @MitchExpensify Huh... This is 4 days overdue. Who can take care of this?

@sonialiap
Copy link
Contributor

Payment summary updated here to reflect the regression price decrease to 125

@suneox payment made ✔
@huult partial refund requested ✔

@melvin-bot melvin-bot bot removed the Overdue label Jan 13, 2025
@huult
Copy link
Contributor

huult commented Jan 13, 2025

@sonialiap I’ve quickly created a pull request to fix the regression test without needing to pick or rent out anything else. Could you please consider issuing a refund? Thank you.

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants