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-11-06] [$500] Android- 2FA- Input filed hides behind the keyboard #26695

Closed
1 of 6 tasks
kbecciv opened this issue Sep 4, 2023 · 65 comments
Closed
1 of 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 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@kbecciv
Copy link

kbecciv commented Sep 4, 2023

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


Action Performed:

  1. Go to Settings > Security > Two-factor authentication
  2. Copy code and click on Next button

Expected Result:

Input filed should not behind the keyboard same as other platforms

Actual Result:

Input filed hide behind the keyboard

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

Screen_Recording_20230831_153811_New.Expensify.1.mp4
Screen_Recording_20230826_110448_New.Expensify.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014386eb856f1f9542
  • Upwork Job ID: 1701881478410055680
  • Last Price Increase: 2023-09-27
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 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

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

@JmillsExpensify Still overdue 6 days?! Let's take care of this!

@JmillsExpensify
Copy link

I agree we should do something.

@melvin-bot melvin-bot bot removed the Overdue label Sep 13, 2023
@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Sep 13, 2023
@melvin-bot melvin-bot bot changed the title Android- 2FA- Input filed hides behind the keyboard [$500] Android- 2FA- Input filed hides behind the keyboard Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

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

melvin-bot bot commented Sep 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@akinwale
Copy link
Contributor

akinwale commented Sep 13, 2023

Proposal

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

The input field is hidden behind the keyboard on the 2FA verify step on Android.

What is the root cause of that problem?

The keyboard avoiding view does not seem to be working for the magic code input on Android possibly due to the fact that the ScrollView is not scrollable before the soft keyboard is visible. The ScrollView only becomes scrollable after the soft keyboard has been displayed, so the avoiding view behaviour does not work as expected.

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

Solution 1
Since the magic code input field is at the bottom of the scroll view, we can add a callback to check if the soft keyboard is visible and then scroll down to the end to make sure that the input is displayed.

  1. Add a ref for the scroll view.
const scrollViewRef = useRef(null);
...
<ScrollView
    style={styles.mb5}
    keyboardShouldPersistTaps="handled"
    ref={scrollViewRef}
>
  1. Add a useEffect hook to listen for the keyboardDidShow event and then scroll to the end of the scrollview.
useEffect(() => {
    const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
        if (!scrollViewRef.current) {
            return;
        }
        scrollViewRef.current.scrollToEnd();
    });
    return () => {
        if (!keyboardDidShowListener) {
            return;
        }
        keyboardDidShowListener.remove();
    }
}, []);

Solution 2

  1. Move the FixedFooter into the root ScrollView component in VerifyStep.
  2. Set the contentContainerStyle for the root scroll view styles.flexGrow1.
  3. Add a bottom margin for the magic input View container in the scroll view.

Solution 3

  1. Add a ref for the scroll view.
  2. Implement the onLayout handler for the scroll view. The onLayout event will be fired any time the soft keyboard shows, so the scroll view can be scrolled to the end at this point.
<ScrollView
    style={styles.mb5}
    keyboardShouldPersistTaps="handled"
+    ref={scrollViewRef}
+    onLayout={() => {
+        if (!scrollViewRef.current) {
+            return;
+        }
+        scrollViewRef.current.scrollToEnd();
+    }}
>

Solution 4
Move the magic code input outside the scroll view and place it below the scroll view. This will automatically shift the input above the keyboard when the soft keyboard opens. However, the text in the scroll view would be separately scrollable which may create a jarring experience for the user.

What alternative solutions did you explore? (Optional)

None.

@allroundexperts
Copy link
Contributor

@akinwale Are we using such pattern anywhere else in our app?

@akinwale
Copy link
Contributor

@akinwale Are we using such pattern anywhere else in our app?

@allroundexperts I could not find anywhere else this pattern is being used. I did find a KeyboardSpacer component however, which tries to do something similar with the Keyboard events (adjusting its height), but this component is not being used anywhere. I attempted to place this component at the end of the scroll view, but it still doesn't push the input area up when the keyboard is shown.

@akinwale
Copy link
Contributor

akinwale commented Sep 14, 2023

Proposal

Updated

I've updated my proposal with a second solution. Here's a video showing how that would work. Note that the entire screen (including the footer) will be scrollable when the soft keyboard is visible.

EDIT: I tested this on a smaller screen, and it still doesn't scroll up the input as expected. Solution 1 seems to be the best option for now until I can identify another root cause.

26695-solution-2.webm

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

@JmillsExpensify @allroundexperts this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

@JmillsExpensify, @allroundexperts Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@akinwale
Copy link
Contributor

@allroundexperts Any thoughts here? I added a third solution to my proposal which simplifies things a bit.

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

@JmillsExpensify, @allroundexperts Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

@JmillsExpensify, @allroundexperts 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@akinwale
Copy link
Contributor

@allroundexperts bump

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

@JmillsExpensify @allroundexperts this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@melvin-bot melvin-bot bot changed the title [$500] Android- 2FA- Input filed hides behind the keyboard [HOLD for payment 2023-11-06] [$500] Android- 2FA- Input filed hides behind the keyboard Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.92-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 2023-11-06. 🎊

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

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 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:

  • [@akinwale / @allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@akinwale / @allroundexperts] 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:
  • [@akinwale / @allroundexperts] 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:
  • [@akinwale / @allroundexperts] Determine if we should create a regression test for this bug.
  • [@akinwale / @allroundexperts] 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.
  • [@JmillsExpensify] 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 Overdue and removed Weekly KSv2 labels Nov 5, 2023
@JmillsExpensify
Copy link

@allroundexperts Do you mind kicking off the BZ checklist?

@melvin-bot melvin-bot bot removed the Overdue label Nov 8, 2023
@allroundexperts
Copy link
Contributor

allroundexperts commented Nov 8, 2023

Checklist

  1. This bug existed since we created this feature. As such there isn't any offending PR which introduced this.
  2. N/A
  3. N/A
  4. A regression test would help.

Regression test

  1. On Android, Go to Settings > Security > Two-factor authentication
  2. Copy code and click on Next button
  3. Verify that the input field does not hide behind the keyboard.

Do we 👍 or 👎 ?

@melvin-bot melvin-bot bot added the Overdue label Nov 10, 2023
Copy link

melvin-bot bot commented Nov 13, 2023

@JmillsExpensify, @akinwale, @allroundexperts, @roryabraham Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Nov 13, 2023

@JmillsExpensify, @akinwale, @allroundexperts, @roryabraham Eep! 4 days overdue now. Issues have feelings too...

1 similar comment
Copy link

melvin-bot bot commented Nov 13, 2023

@JmillsExpensify, @akinwale, @allroundexperts, @roryabraham Eep! 4 days overdue now. Issues have feelings too...

@roryabraham
Copy link
Contributor

@JmillsExpensify bump for payment

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 13, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

@JmillsExpensify, @akinwale, @allroundexperts, @roryabraham Still overdue 6 days?! Let's take care of this!

@JmillsExpensify
Copy link

JmillsExpensify commented Nov 22, 2023

Doesn't look like this one got merged in three days, which gives us the following payment summary:

If that looks good to everything then I'll issue payouts.

@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2023
@JmillsExpensify
Copy link

$500 payment approved for @allroundexperts based on summary above.

@JmillsExpensify
Copy link

I've sent upwork offers because I didn't see any automatic ones that went out. cc @gadhiyamanan @akinwale

@akinwale
Copy link
Contributor

I've sent upwork offers because I didn't see any automatic ones that went out. cc @gadhiyamanan @akinwale

Accepted. Thanks!

@gadhiyamanan
Copy link
Contributor

@JmillsExpensify i think reporting bonus should be $250 because it was reported before 30Aug

image

@JmillsExpensify
Copy link

@gadhiyamanan That makes sense. Please accept the offer and I'll pay out accordingly.

@gadhiyamanan
Copy link
Contributor

@JmillsExpensify offer accepted, thanks!

@JmillsExpensify
Copy link

Everyone paid out! Will close after creating the regression test.

@JmillsExpensify
Copy link

Regression test done, so closing!

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 Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

7 participants