-
Notifications
You must be signed in to change notification settings - Fork 3.2k
perf: disable hover when scrolling on web and desktop #27236
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
perf: disable hover when scrolling on web and desktop #27236
Conversation
… perf/disable-hover-when-scrolling
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@hurali97 There is lint failure as well. |
@abdulrahuman5196 Thanks for the review. Addressed all reviews apart from the platform specific one. I am up to tackle it in this PR, it shouldn't take much time. @mountiny what do you think ? 🤔 |
yes please, try to tackle it in this PR, we have deployed now so there is around 24 hours til the next deploy |
@mountiny @abdulrahuman5196 Can you guys re-review at your ease, much appreciated. I have addressed the platform specific change ✅ |
thanks! great to get it in so quick, running the checks again @abdulrahuman5196 can yu please check again now? |
Sure will do in 1-2 hours |
Code Looks fine to me. I have 2 questions
|
I agree there is probably not an easy way to measure this but just from the experience on some longer chat with attachments and such, did it feel smoother? |
Hey @abdulrahuman5196,
|
@abdulrahuman5196 let me know if this is good to be merged, thanks! |
Triggered a build for testing |
@mountiny I am not exactly sure on the performance impact. Sometimes it felt like the changes caused negative impact. But I am not sure though, maybe could be due to dev or my machine. I will test again in the testing build. I think it's best to do some more testing before merging the change. |
🧪🧪 Use the links below to test this build in android and iOS. Happy testing! 🧪🧪 |
I agree with this! |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-18.at.10.45.57.PM.mp4Mobile Web - Chromeaz_recorder_20230918_225706.mp4Mobile Web - SafariScreen.Recording.2023-09-18.at.11.16.10.PM.mp4DesktopScreen.Recording.2023-09-18.at.11.07.03.PM.mp4iOSScreen.Recording.2023-09-18.at.10.48.53.PM.mp4Androidaz_recorder_20230918_230211.mp4 |
NAB: @hurali97 Kindly update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good and works well. Reviewers checklist is also complete.
Note: The scrolling is similar to that of staging IMO, but i also agree its hard to test performance objectively here. We can go ahead since the theory seems to be intact.
All yours. @mountiny
🎀 👀 🎀
C+ Reviewed
… perf/disable-hover-when-scrolling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.72-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.72-11 🚀
|
Details
This adds a prop
shouldHandleScroll
to Hoverable component, which decides whether we want to toggleisHovered
state while scrolling or not. IfshouldHandleScroll
is set totrue
the Hoverable component will only toggle theisHovered
state once the scroll is started and ended.Since, react-native-web doesn't have support for
onScrollBeginDrag
andonScrollEndDrag
, I moved forward with a temporary work around following here.The implemented solution looks like this:
DeviceEventEmitter
.shouldHandleScroll
prop istrue
and listener is not already set.isHoveredRef
and use this once the scrolling is ended to update theisHovered
state.Fixed Issues
$ #27214
PROPOSAL: #27214 ( Proposal is in the issue description )
Tests
Manual Test:
Go to any Report which contains some messages.
Start scrolling and notice that the hover and reaction bar doesn't display while you're scrolling.
Once you stop the scroll, the hover and reaction bar will display.
Verify that no errors appear in the JS console
Offline tests
Same as tests
QA Steps
Go to any Report which contains some messages.
Start scrolling and notice that the hover and reaction bar doesn't display while you're scrolling.
Once you stop the scroll, the hover and reaction bar will display.
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web-recording.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
desktop-recording.mp4
iOS
Android