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

[$250] Workspace - mWeb - Currency selector scrolls to the top when I scroll down quickly #55601

Open
1 of 8 tasks
izarutskaya opened this issue Jan 22, 2025 · 24 comments
Open
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Jan 22, 2025

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: 9.0.88-3
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #53845
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Apple iPhone 12 Pro / Safari
App Component: Workspace Settings

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with a Gmail account that already has a workspace
  3. Navigate to Settings - Workspaces
  4. Tap on the "New workspace" button
  5. Tap on "Default currency" and quickly swipe up

Expected Result:

Currency selector should scroll down.

Actual Result:

Currency selector scrolls to the top when I scroll down quickly.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6719916_1737467985381.RTSM3943.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882074796298844828
  • Upwork Job ID: 1882074796298844828
  • Last Price Increase: 2025-01-22
  • Automatic offers:
    • ZhenjaHorbach | Reviewer | 105822350
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach
@izarutskaya izarutskaya added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlockerCash This issue or pull request should block deployment labels Jan 22, 2025
Copy link

melvin-bot bot commented Jan 22, 2025

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

Copy link

melvin-bot bot commented Jan 22, 2025

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

melvin-bot bot commented Jan 22, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jan 22, 2025
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.

@allgandalf
Copy link
Contributor

@Krishna2323 will fix this one too as part of #55575

@Beamanator
Copy link
Contributor

Looks like this exists in the prod app, as proven here: https://expensify.slack.com/archives/C01GTK53T8Q/p1737550239414369?thread_ts=1737487302.110339&cid=C01GTK53T8Q

@Beamanator Beamanator added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jan 22, 2025
@carlosmiceli
Copy link
Contributor

@allgandalf should I assign this issue to @Krishna2323 or no need?

@allgandalf
Copy link
Contributor

naah, this is an exisiting bug on production, so you and @RachCHopkins would need to decide if you want to get this fixed now and if so then open it up for proposals, happy to help as C+ as well to review proposals

@carlosmiceli
Copy link
Contributor

Gotcha, just wasn't sure if the PR that got CPed also fixed this issue, but I guess you're saying that that's not the case in the end, right?

@parasharrajat
Copy link
Member

parasharrajat commented Jan 22, 2025

I can also help.. Let me see root cause as well.

@allgandalf
Copy link
Contributor

but I guess you're saying that that's not the case in the end, right?

BINGOOOO! , you're right

@carlosmiceli carlosmiceli added the External Added to denote the issue can be worked on by a contributor label Jan 22, 2025
@melvin-bot melvin-bot bot changed the title Workspace - mWeb - Currency selector scrolls to the top when I scroll down quickly [$250] Workspace - mWeb - Currency selector scrolls to the top when I scroll down quickly Jan 22, 2025
Copy link

melvin-bot bot commented Jan 22, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 22, 2025
Copy link

melvin-bot bot commented Jan 22, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Jan 22, 2025

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Jan 22, 2025

Gotcha, just wasn't sure if the PR that got CPed also fixed this issue, but I guess you're saying that that's not the case in the end, right?

Yeah
I also confirm that this is another issue
And it is still being reproduced
So we are waiting for proposals !

Copy link

melvin-bot bot commented Jan 22, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@rbreecedev
Copy link

Can I have access to the repo to Propose Solutions and Apply on Upwork?

https://www.upwork.com/freelancers/~0139632a87702aa65c?companyReference=852033097033912321&mp_source=share

Copy link

melvin-bot bot commented Jan 23, 2025

📣 @rbreecedev! 📣
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>

@rbreecedev
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~0139632a87702aa65c?companyReference=852033097033912321&mp_source=share

Copy link

melvin-bot bot commented Jan 23, 2025

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

@bernhardoj
Copy link
Contributor

Proposal

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

Currently selector list scrolls up if we scroll down immediately after the page opens.

What is the root cause of that problem?

This all happens because of useSyncFocus.

const didScreenTransitionEnd = contextValue ? contextValue.didScreenTransitionEnd : true;
useLayoutEffect(() => {
if (!isFocused || !shouldSyncFocus || !didScreenTransitionEnd) {
return;
}
ref.current?.focus();
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [didScreenTransitionEnd, isFocused, ref]);

useSyncFocus purpose is to synchronize the list focused index with the browser focused element. For example, if we press the arrow down key to focus on the next item, the focused/active element (document.activeElement) of the web now is the next item.

In our case, when we open the page and scroll down quickly, the useSyncFocus kicks in and focuses on the focused item which will by default scroll the list into the focused element. useSyncFocus doesn't happen immediately because we wait for screen transition (didScreenTransitionEnd).

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

We have 2 options. First, we can disable the list scrolling and only enable it after the screen transition ends.

The 2nd option is to prevent scrolling from useSyncFocus.

ref.current?.focus({ preventScroll: true });

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

@ZhenjaHorbach
Copy link
Contributor

@bernhardoj
Thanks for your proposal !
Your root cause makes sense to me

But I'm not sure about the first option
Since we have quite a large delay before transitionEnds becomes equal to true
As result this will make the user experience much worse

On the other side I like the second option
This option fixes the issue and does not break the original functionality of the hook !

So I don't mind to go with this proposal !
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 23, 2025

Current assignee @carlosmiceli is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 23, 2025
Copy link

melvin-bot bot commented Jan 23, 2025

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants