-
Notifications
You must be signed in to change notification settings - Fork 13k
refactor: dont use useEffect anymore to control thread scroll
#35818
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
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35818 +/- ##
===========================================
- Coverage 60.96% 60.95% -0.02%
===========================================
Files 2952 2952
Lines 70308 70286 -22
Branches 16137 16135 -2
===========================================
- Hits 42866 42844 -22
+ Misses 24495 24493 -2
- Partials 2947 2949 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
…lement in RoomBody components refactor: remove unused useRef import in ThreadMessageList component
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
.../meteor/client/views/room/contextualBar/Threads/hooks/useLegacyThreadMessageListScrolling.ts
Outdated
Show resolved
Hide resolved
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
tested and looks all good |
useEffect anymore to control thread scroll
https://rocketchat.atlassian.net/browse/ARCH-1580
Everything started with a flaky test and some reports that the scrolling was behaving strangely. Then it was realized that the control of the scrolls was erratic and not reliable in terms of repetitive testing. Therefore, a refactor was necessary.
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
This pull request refactors the thread scrolling mechanism in the Rocket.Chat application. The changes include:
MessageListContextto useMutableRefObjectinstead ofRefObjectformessageListRef, enhancing reference management flexibility.useJumpToMessagehook to incorporate auseSafeRefCallbackand anIntersectionObserverfor improved message scrolling and highlighting.messageListReftype definition in theMessageListProvidercomponent.innerBoxReffromHTMLDivElementtoHTMLElementinRoomBody.tsxandRoomBodyV2.tsx, initializing it withundefinedinstead ofnull.ThreadMessageListcomponent by removing unused imports and optimizing the use of refs for scrolling and navigation.useLegacyThreadMessageListScrolling, to manage legacy thread message list scrolling with added functionality for throttling scroll actions and using safe ref callbacks.These changes aim to improve the efficiency and reliability of thread navigation and scrolling within the application.