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-02-05] [$500] Workspace - User is scrolled down in Workspace invite page #30999

Closed
3 of 6 tasks
lanitochka17 opened this issue Nov 7, 2023 · 42 comments
Closed
3 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 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 7, 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.3.96-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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch app
  2. Tap profile icon
  3. Tap Workspaces
  4. Tap on a Workspace
  5. Tap Members
  6. Tap on Invite
  7. When keypad is open, scroll up the page after contacts are displayed

Expected Result:

When user scrolls up the contacts, the Workspace invite page must not scroll down

Actual Result:

When user scrolls up the contacts, the workspace invite page scrolls down and top of contacts section is shown instead of showing mid section where user stops scrolling the page

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

Bug6267308_1699361048416.ES.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0173287fc1604c0e73
  • Upwork Job ID: 1721905199058337792
  • Last Price Increase: 2024-01-04
  • Automatic offers:
    • Krishna2323 | Contributor | 28091046
@lanitochka17 lanitochka17 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 Nov 7, 2023
@melvin-bot melvin-bot bot changed the title Workspace - User is scrolled down in Workspace invite page [$500] Workspace - User is scrolled down in Workspace invite page Nov 7, 2023
Copy link

melvin-bot bot commented Nov 7, 2023

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

Copy link

melvin-bot bot commented Nov 7, 2023

Triggered auto assignment to @joekaufmanexpensify (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 Nov 7, 2023
Copy link

melvin-bot bot commented Nov 7, 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 Nov 7, 2023

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 7, 2023

Proposal

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

Workspace - User is scrolled down in Workspace invite page

What is the root cause of that problem?

We are resetting sections every time when didScreenTransitionEnd and due to that the focus on first index is called and the list scrolls up.

const sections = didScreenTransitionEnd ? getSections() : [];

useEffect(() => {
// do not change focus on the first render, as it should focus on the selected item
if (firstLayoutRef.current) {
return;
}
// set the focus on the first item when the sections list is changed
if (sections.length > 0) {
updateAndScrollToFocusedIndex(0);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sections]);

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

I think we shouldn't be using didScreenTransitionEnd to change sections according to that. Or if we need we can set a state for that using useMemo, like we are doing with other components, where we use the SelectionList
We should move const sections = didScreenTransitionEnd ? getSections() : []; out of return statement and without didScreenTransitionEnd

Updated code:

    const sectionsList = useMemo(() => {
        if (!transitionEnded) {
            return [];
        }
        const sections = [];
        let indexOffset = 0;

        sections.push({
            title: undefined,
            data: selectedOptions,
            shouldShow: true,
            indexOffset,
        });
        indexOffset += selectedOptions.length;

        // Filtering out selected users from the search results
        const selectedLogins = _.map(selectedOptions, ({login}) => login);
        const personalDetailsWithoutSelected = _.filter(personalDetails, ({login}) => !_.contains(selectedLogins, login));
        const personalDetailsFormatted = _.map(personalDetailsWithoutSelected, OptionsListUtils.formatMemberForList);

        sections.push({
            title: translate('common.contacts'),
            data: personalDetailsFormatted,
            shouldShow: !_.isEmpty(personalDetailsFormatted),
            indexOffset,
        });
        indexOffset += personalDetailsFormatted.length;

        _.each(usersToInvite, (userToInvite) => {
            const hasUnselectedUserToInvite = !_.contains(selectedLogins, userToInvite.login);

            if (hasUnselectedUserToInvite) {
                sections.push({
                    title: undefined,
                    data: [OptionsListUtils.formatMemberForList(userToInvite)],
                    shouldShow: true,
                    indexOffset: indexOffset++,
                });
            }
        });

        return sections;
    }, [personalDetails, selectedOptions, translate, usersToInvite, transitionEnded]);

We also need to update RoomInvitePage.

We get a warning Cannot update a component from inside the function body of a different component., but that can be easily fixed by using navigation listener transitionEnd to set didScreenTransitionEnd state.

Result

@tienifr
Copy link
Contributor

tienifr commented Nov 7, 2023

Proposal

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

Workspace - User is scrolled down in Workspace invite page

What is the root cause of that problem?

In

if (sections.length > 0) {
updateAndScrollToFocusedIndex(0);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sections]);

We put selection in the dependencies so whenever the selection get changed, updateAndScrollToFocusedIndex will be called.

In WorkspaceInvitePage, we did not put sections in useMemo, that makes sections changed for every re-renders

const sections = didScreenTransitionEnd ? getSections() : [];

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

We should put getSections function into useMemo. And fix other places that have the same problems

Result

Screen.Recording.2023-11-08.at.00.09.38.mov

@joekaufmanexpensify
Copy link
Contributor

I just tried to reproduce this, and it's working fine for me on both Mac chrome, and Android mobile web. Closing, as I don't think there's anything we need to fix here.

@Krishna2323
Copy link
Contributor

@joekaufmanexpensify, I can reproduce it easily on native and mWeb.

WhatsApp.Video.2023-11-08.at.03.36.25.mp4

@tienifr
Copy link
Contributor

tienifr commented Nov 8, 2023

@joekaufmanexpensify i also can reproduce

@joekaufmanexpensify
Copy link
Contributor

Is what you're saying you can reproduce that if you try and scroll down with the keyboard open, we begin scrolling belatedly close the keyboard, and then navigate back to the top of the list?

@Krishna2323
Copy link
Contributor

@joekaufmanexpensify, yes.

@kbecciv
Copy link

kbecciv commented Dec 27, 2023

Issue is reproducible in QA side on build 1.4.18.2

Record_2023-12-27-22-04-05_4f9154176b47c00da84e32064abf1c48.mp4

@kbecciv kbecciv reopened this Dec 27, 2023
Copy link

melvin-bot bot commented Dec 28, 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
@joekaufmanexpensify
Copy link
Contributor

Got it, I'll take a look.

@melvin-bot melvin-bot bot removed the Overdue label Jan 1, 2024
@joekaufmanexpensify
Copy link
Contributor

Hm, yeah I can reproduce now too. Probably worth fixing, as the member invite flow is pretty important.

2024-01-02_17-01-50.mp4

@joekaufmanexpensify
Copy link
Contributor

@mananjadhav feel free to go ahead with reviewing proposals

@mananjadhav
Copy link
Collaborator

I'll review the proposals by tomorrow.

@joekaufmanexpensify
Copy link
Contributor

TY!

Copy link

melvin-bot bot commented Jan 4, 2024

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

@Krishna2323
Copy link
Contributor

@mananjadhav, PR ready for review.

@joekaufmanexpensify
Copy link
Contributor

Pending review from @mananjadhav

@mananjadhav
Copy link
Collaborator

I had some issues with build yesterday. I'll review it tomorrow.

@joekaufmanexpensify
Copy link
Contributor

PR out on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Workspace - User is scrolled down in Workspace invite page [HOLD for payment 2024-02-05] [$500] Workspace - User is scrolled down in Workspace invite page Jan 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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

Copy link

melvin-bot bot commented Jan 29, 2024

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

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

Copy link

melvin-bot bot commented Jan 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:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR: N/A
  • [@mananjadhav] 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: N/A
  • [@mananjadhav] 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: N/A
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] 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.
  • [@joekaufmanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/366895

@joekaufmanexpensify joekaufmanexpensify added Daily KSv2 and removed Weekly KSv2 labels Feb 5, 2024
@melvin-bot melvin-bot bot added the Overdue label Feb 5, 2024
@joekaufmanexpensify
Copy link
Contributor

@mananjadhav could you please handle the BZ checklist so we can prep to issue payments?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Feb 5, 2024
@mananjadhav
Copy link
Collaborator

I don't think we have an offending PR for this one. The change that we made was adding them to useMemo. I am on the fence if we should add a test, hence I think we should one.

Regression Test

  1. Launch app
  2. Tap profile icon
  3. Tap Workspaces
  4. Tap on a Workspace
  5. Tap Members
  6. Tap on Invite
  7. When keypad is open, scroll up the page after contacts are displayed
  8. Verify page isn't scrolled down when keyboard is closed

@joekaufmanexpensify Can you post the payout summary?

@joekaufmanexpensify
Copy link
Contributor

BZ checklist all set! All good to issue payment. We need to make the following payments:

@joekaufmanexpensify
Copy link
Contributor

@Krishna2323 $500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@mananjadhav please request $500 via NewDot, and confirm here once done.

@JmillsExpensify
Copy link

$500 approved for @mananjadhav based on summary above.

@joekaufmanexpensify
Copy link
Contributor

Great. TY! Closing as this is all set.

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
None yet
Development

No branches or pull requests

8 participants