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-03-11] [HOLD for payment 2024-02-19] [$500] mWeb - Workspace - "Next" button's placement has a delay after the keypad disappears #33546

Closed
2 of 6 tasks
kbecciv opened this issue Dec 23, 2023 · 57 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Dec 23, 2023

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: 1.4.16.3
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with an expensifail account
  3. Create a workspace
  4. Invite a new member
  5. Type in the full email address and make sure that the keypad is visible
  6. Tap on the checkbox next to the email

Expected Result:

There shouldn't be a delay.

Actual Result:

"Next" button's placement has a delay after the keypad disappears.

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

Add any screenshot/video evidence

Bug6324864_1703334991241.QBAP2569.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01241daac204a80575
  • Upwork Job ID: 1738559249320325120
  • Last Price Increase: 2023-12-30
  • Automatic offers:
    • shubham1206agra | Reviewer | 28088091
    • suneox | Contributor | 28088092
Issue OwnerCurrent Issue Owner: @shubham1206agra
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 23, 2023
@melvin-bot melvin-bot bot changed the title mWeb - Workspace - "Next" button's placement has a delay after the keypad disappears [$500] mWeb - Workspace - "Next" button's placement has a delay after the keypad disappears Dec 23, 2023
Copy link

melvin-bot bot commented Dec 23, 2023

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

Copy link

melvin-bot bot commented Dec 23, 2023

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

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

melvin-bot bot commented Dec 23, 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

Copy link

melvin-bot bot commented Dec 23, 2023

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

@maazakn
Copy link

maazakn commented Dec 23, 2023

When adding a new member, the button lags whenever the keypad is opened or closed, regardless of whether a checkbox is selected.

Copy link

melvin-bot bot commented Dec 23, 2023

📣 @maazakn! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@samuelralak
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~011e010bd867c901e3

Proposal

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

  • A delay in the repositioning of the "Next" button when keyboard is dismissed.

What is the root cause of that problem?

Mismatch in timing of the keyboard's retraction animation and button's position update

A similar behaviour can be observed in the following routes:

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

Quick

Set shouldEnableMaxHeight prop of ScreenWrapper to false or just don't include it. This makes the button position static, gracefully hiding it behind the keyboard when input is in focus thus maintaining a consistent user experience with the following routes:

Long Term

Incorporate the KeyboardAvoidingView component, along with appropriate padding and animation configurations, to automatically adjust the layout when the keyboard is visible. Disclaimer - this is a trial and error approach, mostly due to my limited familiarity with the codebase now.

What alternative solutions did you explore? (Optional)

  • None

Copy link

melvin-bot bot commented Dec 24, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot melvin-bot bot added the Overdue label Dec 25, 2023
@bfitzexpensify
Copy link
Contributor

Proposal in #33546 (comment) ready for review when you get a moment @shubham1206agra

@melvin-bot melvin-bot bot removed the Overdue label Dec 25, 2023
@suneox
Copy link
Contributor

suneox commented Dec 26, 2023

Proposal

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

mWeb - Workspace - "Next" button's placement has a delay after the keypad disappears

What is the root cause of that problem?

The windowHeight get from useWindowDimensions return is delayed after the keyboard open or close, due to indeep the implemetation at react-native-web using window.visualViewport and the resize event from window.visualViewport isn't triggered immediately after the keyboard opens or closes.

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

This issue also happen on a lot of page has ScreenWrapper using shouldEnableMaxHeight so we will apply one fix for all page.
At hook useWindowDimensions for web we will create varible initalViewportHeight and cachedViewportHeight if Browser.isMobile we will add listener focusin and focusout for input, textarea, ...element can trigger keyboard, If keyboard is open we will set windowHeight to cachedViewportHeight and when keyboard is close we will set windowHeight to initalViewportHeight

    const [windowHeight, setWindowHeight] = useState(height);
    
    const handleFocusIn = (event: FocusEvent) => {
        const targetElement = event.target as HTMLElement;
        if (targetElement.tagName === "INPUT" || targetElement.tagName === "TEXTAREA") {
            setWindowHeight(cachedViewportHeight);
        }
    }
    useEffect(() => {
        if (!Browser.isMobileSafari()) return;
        window.addEventListener('focusin', handleFocusIn)
        return () => {
            window.removeEventListener('focusin', handleFocusIn)
        }
    },[]);

    const handleFocusOut = (event: FocusEvent) => {
        const targetElement = event.target as HTMLElement;
        if (targetElement.tagName === "INPUT" || targetElement.tagName === "TEXTAREA") {
            setWindowHeight(initalViewportHeight);
        }
    }

    useEffect(() => {
        if (!Browser.isMobileSafari()) return;
        window.addEventListener('focusout', handleFocusOut)
        return () => {
            window.removeEventListener('focusout', handleFocusOut)
        }
    },[])


    useEffect(() => {
        // check is mobile browser and portrait mode
        if (Browser.isMobileSafari() && height > windowWidth) {
            if (height < initalViewportHeight) {
                cachedViewportHeight = height;
            }
        }
        setWindowHeight(height);
    }, [windowWidth, height])

We also can update condition useWindowDimensions at ScreenWrapper only handle when shouldEnableMaxHeight is true and Browser.isMobileSafari(), some thing like that to reduce affect for code change above

    const {windowHeight, isSmallScreenWidth} = useWindowDimensions({shouldHandleKeyboardOpenHeight: shouldEnableMaxHeight && Browser.isMobileSafari()});

full implementation at this commit

POC: After fix
Screen.Recording.2023-12-26.at.10.54.29.mov
Before fix
Screen.Recording.2023-12-26.at.08.31.04.mov

What alternative solutions did you explore? (Optional)

@shubham1206agra
Copy link
Contributor

@suneox The proposal looks promising (I just need to test it on few different cases). I have some questions about it

Why can't we do the fix upstream in this case?

@suneox
Copy link
Contributor

suneox commented Dec 26, 2023

Hi @shubham1206agra

Why can't we do the fix upstream in this case?

We should fix it inside the app implementation because we have a specific use case. Currently, this hook is used on a lot of pages so we don't have the context to make the assumption

I have cleanup the code lint for my change at this commit could you please check-out it to verify?

@melvin-bot melvin-bot bot added the Overdue label Dec 28, 2023
Copy link

melvin-bot bot commented Dec 29, 2023

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

@bfitzexpensify
Copy link
Contributor

Thoughts on #33546 (comment) @shubham1206agra?

@melvin-bot melvin-bot bot removed the Overdue label Dec 29, 2023
@shubham1206agra
Copy link
Contributor

Sorry @bfitzexpensify. I haven't tested this yet. I will test this today.

Copy link

melvin-bot bot commented Dec 30, 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 melvin-bot bot added the Overdue label Jan 1, 2024
Copy link

melvin-bot bot commented Jan 1, 2024

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

@bfitzexpensify
Copy link
Contributor

Any update here @shubham1206agra?

Copy link

melvin-bot bot commented Mar 4, 2024

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

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

Copy link

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

  • [@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@shubham1206agra] 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:
  • [@shubham1206agra] 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:
  • [@shubham1206agra] Determine if we should create a regression test for this bug.
  • [@shubham1206agra] 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.
  • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@bfitzexpensify bfitzexpensify added Daily KSv2 and removed Weekly KSv2 labels Mar 6, 2024
@bfitzexpensify
Copy link
Contributor

Switching this to Daily so that I'm on top of payment

@bfitzexpensify
Copy link
Contributor

Payment due Monday

@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

@suneox, @techievivek, @bfitzexpensify, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!

@bfitzexpensify
Copy link
Contributor

Payment complete for @suneox

@shubham1206agra, I had to re-issue your contract, that's been sent now. Also, a bump on the BZ checklist - thanks!

@melvin-bot melvin-bot bot removed the Overdue label Mar 12, 2024
@shubham1206agra
Copy link
Contributor

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:

  • [@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR: New Feature
  • [@shubham1206agra] 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: NA
  • [@shubham1206agra] 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: Not Required
  • [@shubham1206agra] Determine if we should create a regression test for this bug. Yes
  • [@shubham1206agra] 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.
  1. Navigate to App.
  2. Go to a workspace in which you want to invite the member.
  3. Type in the full email address and ensure the keypad is visible.
  4. Tap on the checkbox next to the email.
  • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@shubham1206agra
Copy link
Contributor

@bfitzexpensify Can you hold my payment temporarily as per https://expensify.slack.com/archives/C02NK2DQWUX/p1710150138788529?

@bfitzexpensify
Copy link
Contributor

Sure - flicking this to Weekly.

@shubham1206agra just bump the issue when you're ready for payment to be processed.

@shubham1206agra
Copy link
Contributor

@bfitzexpensify I have discussed this internally. You may close this issue as I am keeping track of payment internally and will ask to pay once the issue is resolved. Just write in the payment summary that I have not been paid yet.

@bfitzexpensify
Copy link
Contributor

Sure thing.

Payment summary:

@suneox due $500 for contributor work (paid via Upwork ✅)
@shubham1206agra due $500 for C+ work (payment outstanding)

@shubham1206agra
Copy link
Contributor

@bfitzexpensify Can you process payment here now?

@bfitzexpensify
Copy link
Contributor

I think the old offer might have expired - just sent a new one to you @shubham1206agra

@shubham1206agra
Copy link
Contributor

Accepted

@bfitzexpensify
Copy link
Contributor

Thanks! Paid out, closing this out.

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

No branches or pull requests

9 participants