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 2023-09-29] Disable hover effect while scrolling in Report Screen on Web #27214

Closed
mountiny opened this issue Sep 12, 2023 · 15 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

Comments

@mountiny
Copy link
Contributor

Part of #26087

Problem

As a user, scrolling the Report screen on web appears to be janky due to hover effect as components keep changing the background and Reaction bar keeps toggling based on the successive hover effect due to the scrolling and cursor stays in one place. This might not be janky in actual but as a user, we perceive it as the scroll is janky.

Solution

We can take example of Slack and how it disables the hover effect and hides the reaction bar, when the user is scrolling through the messages. Once the user stops scrolling, the hover effect is applied to that message and reaction bar is shown. ( You can quickly give it a try in any slack channel ). So we can move forward with fixing the perceived performance here.

To implement something similar, I tried the following steps:

The issue with this solution was that the scroll would delay for a while due to the extra re-render which happens due to isScrolling state being set in BaseInvertedFlatList . As a result, we see the re-renders of all the renderItem too. It happens when we start to scroll and once, when we stop the scroll.

To fix this, I re-structured my approach towards event driven data passing. Below are the steps:

  • From BaseInvertedFlatList , I removed the isScrolling state and also removed passing this state to renderItem .
  • I added the event emitter in BaseInvertedFlatList which would fire once the scroll is started and once the scroll is ended.
  • Then in Hoverable , I added the event listener and also added two refs, one to hold the event value for scrolling and second to hold the mouse hovered value, to avoid re-rendering all the items and re-render only what’s the last hovered item.
  • To prevent Hoverable from misbehaving in different parts of the app, where we don’t need this behaviour, I passed in a prop handleScroll (Boolean) , if it’s true we will execute the scroll logic and add event listeners.
  • With this, the scroll doesn’t delay and we have much better user experience 🎉.

Before:
See the attached video with title: recording-before

recording-before.mov

After:
See the attached video with title: recording-after

recording-after.mov

Testing Environment:
Macbook M1 Pro, 16GB Ram, Ventura 13.4.1

@mountiny mountiny added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2023
@mountiny mountiny self-assigned this Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@melvin-bot
Copy link

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

@hurali97
Copy link
Contributor

Hey @mountiny !

You can assign this to me, Hur from callstack !

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

📣 @hurali97! 📣
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. 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.
  2. 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.
  3. 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>

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

⚠️ 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.

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

⚠️ 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.

@mountiny
Copy link
Contributor Author

Lies

@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 22, 2023
@melvin-bot melvin-bot bot changed the title Disable hover effect while scrolling in Report Screen on Web [HOLD for payment 2023-09-29] Disable hover effect while scrolling in Report Screen on Web Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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:

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

@MitchExpensify
Copy link
Contributor

Payment Summary:

No payment due here

@mountiny
Copy link
Contributor Author

@MitchExpensify sorry, there should be $500 to @abdulrahuman5196 for internal review and testing

@MitchExpensify
Copy link
Contributor

Ok great, thanks for confirming @mountiny

I'll create a payment issue in Upwork here https://www.upwork.com/jobs/~018fc17964696bfa2d

Offer sent to you @abdulrahuman5196

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Determine if we should create a regression test for this bug.

Yes.

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. Go to any Report which contains some messages.
  2. Start scrolling and notice that the hover and reaction bar doesn't display while you're scrolling.
  3. Once you stop the scroll, the hover and reaction bar will display.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 29, 2023
@MitchExpensify
Copy link
Contributor

Paid and test request added

@github-project-automation github-project-automation bot moved this from CRITICAL to Done in [#whatsnext] #quality Sep 29, 2023
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
Projects
Development

No branches or pull requests

4 participants