fix: add scroll listener for loading conversation history#24003
Closed
qiaofenlin wants to merge 2 commits intolanggenius:mainfrom
Closed
fix: add scroll listener for loading conversation history#24003qiaofenlin wants to merge 2 commits intolanggenius:mainfrom
qiaofenlin wants to merge 2 commits intolanggenius:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where users cannot load more historical messages when scrolling to the top in chatflow conversation detail view. The InfiniteScroll component was not properly detecting scroll events in inverse mode, preventing users from accessing conversation history beyond the initial 10 messages.
- Added manual scroll event listener to detect when user scrolls near the top of the conversation
- Implemented loading state management to prevent duplicate requests
- Enhanced error handling and code structure improvements
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Add scroll event listener to trigger loading more historical messages when user scrolls to top in conversation detail vie w.
9a35084 to
4afb574
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add scroll event listener to trigger loading more historical messages when user scrolls to top in conversation detail view.
Fixes: #23971
Important
Fixes #<issue number>.Summary
This PR fixes an issue where users cannot load more historical messages when scrolling to the top in chatflow conversation detail view. Previously, the InfiniteScroll component was not properly detecting scroll events in inverse mode, causing users to only see the most recent 10 conversation messages.
Problem
inverse={true})Solution
fetchDatafunction whenscrollTop < 50to load more historical messagesScreenshots
Note: Screenshots show the conversation detail view before and after the fix. Users can now scroll to the top to load more historical messages.
Testing
Steps to Test
Expected Behavior
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint godsAdditional Notes