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-09-23] [Search v2.3] - List scrolls back to the top after selecting saved search at the bottom of list #49218

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 14, 2024 · 48 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

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 14, 2024

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: 9.0.35-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • There is a long list of saved search until the saved search list is scrollable.
  1. Go to staging.new.expensify.com
  2. Go to Search.
  3. Scroll the saved search list to the bottom.
  4. Note that the Saved title is also scrolled and hidden.
  5. Select a search from the bottom of the list.
  6. Note that the list scrolls up and the selected search is hidden.

Expected Result:

In Step 4, the Saved title should remain on top when the list is scrolled down.
In Step 6, the list will not scroll up after selecting the search at the bottom of the list, or the selected search will move to the top.

Actual Result:

In Step 4, the Saved title is also scrolled and hidden.
In Step 6, the list scrolls up and the selected search is hidden.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6603231_1726300553520.20240914_155008.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @anmurali
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 14, 2024
Copy link

melvin-bot bot commented Sep 14, 2024

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

Copy link

melvin-bot bot commented Sep 14, 2024

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

@dominictb
Copy link
Contributor

Proposal

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

  • Issue 1. The list scrolls up and the selected search is hidden.
  • Issue 2. The Saved title is also scrolled.

What is the root cause of that problem?

  1. The list scrolls up and the selected search is hidden
  • Once we select any saved search option, the saved search options list is re-rendered, so it always scrolls to top:
    <ScrollView>{renderSavedSearchesSection(savedSearchesMenuItems())}</ScrollView>
  1. The Saved title is also scrolled
  • The "Saved" title is displayed inside the ScrollView, so it is also scrolled along with the saved search option.

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

  1. The list scrolls up and the selected search is hidden
  • We need to preserve the scroll position after choosing any saved search option.

  • To do it, in here, add:

    const route = useRoute();
    const scrollViewRef = useRef<RNScrollView>(null);
    const {saveScrollOffset, getScrollOffset} = useContext(ScrollOffsetContext);
    const onScroll = useCallback<NonNullable<ScrollViewProps['onScroll']>>(
        (e) => {
            // If the layout measurement is 0, it means the flashlist is not displayed but the onScroll may be triggered with offset value 0.
            // We should ignore this case.
            if (e.nativeEvent.layoutMeasurement.height === 0) {
                return;
            }
            saveScrollOffset(route, e.nativeEvent.contentOffset.y);
        },
        [route, saveScrollOffset],
    );
    useLayoutEffect(() => {
        const scrollOffset = getScrollOffset(route);
        if (!scrollOffset || !scrollViewRef.current) {
            return;
        }
        scrollViewRef.current.scrollTo({y: scrollOffset, animated: false});
    }, [getScrollOffset, route]);
                    <ScrollView
                        onScroll={onScroll}
                        ref={scrollViewRef}
                    >
  1. The Saved title is also scrolled

and add it to:

The detail style can be add later.

What alternative solutions did you explore? (Optional)

@luacmartins
Copy link
Contributor

@lakchote will address this as a follow up to his PR

@luacmartins
Copy link
Contributor

@dominictb are you available to work on a fix?

@dominictb
Copy link
Contributor

@luacmartins Yes. I can work on it

@luacmartins
Copy link
Contributor

@dominictb how's the PR coming along?

@dominictb
Copy link
Contributor

@luacmartins I drafted the PR. I am testing a few test cases.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Daily KSv2 labels Sep 16, 2024
@garrettmknight
Copy link
Contributor

garrettmknight commented Oct 15, 2024

@anmurali
Copy link

Waiting on @dominictb

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 16, 2024
Copy link

melvin-bot bot commented Oct 21, 2024

@anmurali, @lakchote, @luacmartins, @rushatgabhane, @dominictb Huh... This is 4 days overdue. Who can take care of this?

@luacmartins
Copy link
Contributor

Waiting on payment

Copy link

melvin-bot bot commented Oct 23, 2024

@anmurali, @lakchote, @luacmartins, @rushatgabhane, @dominictb Still overdue 6 days?! Let's take care of this!

@lakchote
Copy link
Contributor

@dominictb could you please give us your Upwork profile in order to pay you?

Copy link

melvin-bot bot commented Oct 25, 2024

@anmurali, @lakchote, @luacmartins, @rushatgabhane, @dominictb 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

@lakchote
Copy link
Contributor

bump @dominictb for your Upwork profile.

@dominictb
Copy link
Contributor

@lakchote Sorry I missed this, mine is https://www.upwork.com/freelancers/~01f70bed1934fd35d5

Copy link

melvin-bot bot commented Oct 29, 2024

@anmurali, @lakchote, @luacmartins, @rushatgabhane, @dominictb 12 days overdue. Walking. Toward. The. Light...

@anmurali
Copy link

@dominictb - offer is here

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
@dominictb
Copy link
Contributor

Accepted, thank you @anmurali

@melvin-bot melvin-bot bot added the Overdue label Nov 1, 2024
@lakchote
Copy link
Contributor

lakchote commented Nov 4, 2024

Not overdue. Should we close this?

@luacmartins
Copy link
Contributor

Seems like we're all set. Gonna close the issue, please reopen if needed.

@melvin-bot melvin-bot bot removed the Overdue label Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

@anmurali @lakchote @luacmartins Be sure to fill out the Contact List!

@dominictb
Copy link
Contributor

dominictb commented Nov 4, 2024

@luacmartins @lakchote My contract was not paid by @anmurali yet, please help to reopen

@luacmartins luacmartins reopened this Nov 4, 2024
@luacmartins
Copy link
Contributor

Sorry, I thought that had been handled based on this comment. My bad 😅

@luacmartins
Copy link
Contributor

Bump for payment @anmurali

@melvin-bot melvin-bot bot added the Overdue label Nov 7, 2024
@lakchote
Copy link
Contributor

friendly bump @anmurali ^

@anmurali
Copy link

Paid. Sorry, I thought I already did that as well.

@melvin-bot melvin-bot bot removed the Overdue label Nov 12, 2024
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
Projects
Status: Done
Development

No branches or pull requests

8 participants