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

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

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
@melvin-bot melvin-bot bot added the Weekly KSv2 label Sep 16, 2024
@lakchote
Copy link
Contributor

@dominictb how is it looking? Do you think you'd be able to raise a PR soon? Thank you!

@dominictb
Copy link
Contributor

@lakchote PR is ready for review.

@lakchote
Copy link
Contributor

@lakchote PR is ready for review.

Thank you, I've assigned a C+ available for review.

@lakchote
Copy link
Contributor

Fix has been deployed to staging.

Screen.Recording.2024-09-16.at.15.05.32.mov

Demoting from blocker.

@lakchote lakchote removed the DeployBlockerCash This issue or pull request should block deployment label Sep 16, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 16, 2024
@melvin-bot melvin-bot bot changed the title Saved search - List scrolls back to the top after selecting saved search at the bottom of list [HOLD for payment 2024-09-23] Saved search - List scrolls back to the top after selecting saved search at the bottom of list Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 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 Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.35-7 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-09-23. 🎊

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

  • @dominictb requires payment (Needs manual offer from BZ)

Copy link

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

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

@luacmartins luacmartins changed the title [HOLD for payment 2024-09-23] Saved search - List scrolls back to the top after selecting saved search at the bottom of list [HOLD for payment 2024-09-23] [Search v2.3] - List scrolls back to the top after selecting saved search at the bottom of list Sep 19, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

Payment Summary

Upwork Job

  • ROLE: @dominictb paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@anmurali)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 26, 2024

@anmurali, @lakchote, @luacmartins, @dominictb Whoops! This issue is 2 days overdue. Let's get this updated quick!

@dominictb
Copy link
Contributor

@anmurali Ready for payment.

@lakchote lakchote removed the Overdue label Sep 30, 2024
@lakchote
Copy link
Contributor

Not overdue. Waiting for payment.

@melvin-bot melvin-bot bot added the Overdue label Sep 30, 2024
@lakchote lakchote removed the Overdue label Sep 30, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 30, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

@anmurali, @lakchote, @luacmartins, @dominictb 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

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 Overdue
Projects
Status: Done
Development

No branches or pull requests

6 participants