-
Notifications
You must be signed in to change notification settings - Fork 13k
regression: fix jump from message lists #35880
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 not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
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:
|
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35880 +/- ##
========================================
Coverage 61.15% 61.15%
========================================
Files 3014 3015 +1
Lines 71597 71635 +38
Branches 16398 16405 +7
========================================
+ Hits 43782 43810 +28
- Misses 24843 24860 +17
+ Partials 2972 2965 -7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
2daa7e3 to
e746d93
Compare
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:
|
0591ad0 to
36549c9
Compare
d7a9981 to
c199c78
Compare
206aef5 to
78cf141
Compare
a2b7d39 to
0f2819c
Compare
0f2819c to
07d5fc9
Compare
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:
|
07d5fc9 to
558cd9e
Compare
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:
|
aleksandernsilva
left a comment
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.
Considering this is a regression, I assume some previous behavior wasn't working as expected. Did our existing tests catch it? Is there anything that can be added to the existing test cases?
| </li> | ||
| ) : ( | ||
| <MessageListProvider messageListRef={jumpToRef}> | ||
| <MessageListProvider messageListRef={jumpToRef as unknown as RefCallback<HTMLElement>}> |
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.
This cast seems a bit risky. If MessageListProvider can receive RefCallback<HTMLElement> | MutableRefObject<HTMLElement> shouldn't that be its type?
not exactly now, I plan to do unit testing as soon as we finish removing meteor dependencies. luckily this is a feature we use daily so we are still somewhat protected |
dougfabris
left a comment
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.
Since we do not have virtualization in the room, I'm afraid we add some e2e test to handle scroll in this list and as it's unstable we'll introduce some intermittence. As we discussed, we're going to add some unit in a near feature, so IMO we are ok to move forward with this now
Proposed changes (including videos or screenshots)
Introduced here: #35818
Issue(s)
Steps to test or reproduce
Further comments
CORE-1097
CORE-1098
CORE-1099
This pull request addresses a regression issue related to message list navigation in the Rocket.Chat application. The changes focus on improving the user experience when loading older messages by implementing scroll position saving and restoration within the
RoomHistoryManager. Specifically, the current scroll position is saved when older messages are loaded using thegetMoremethod, and a newrestoreScrollmethod is introduced to adjust for content height changes. Additionally, aloaded-messagesevent is emitted after messages are loaded in bothgetMoreandgetMoreNext, and a utility functionwaitAfterFlushis added.In the
useJumpToMessagehook, modifications are made to enhance listRef handling and message scrolling behavior. TheuseGetMorehook is refactored to useasync/awaitfor fetching older messages, introducesflushSyncfor smoother scroll restoration, and optimizes performance by addingpassive: trueto the scroll listener. The throttled handler is also ensured to be cancelled on unmount. These improvements aim to enhance the history loading mechanism, although further enhancements in type safety and error handling are suggested.