fix: remove 500-message limit to prevent scrollbar jumping in long conversations#7053
Closed
roomote-v0[bot] wants to merge 2 commits intomainfrom
Closed
fix: remove 500-message limit to prevent scrollbar jumping in long conversations#7053roomote-v0[bot] wants to merge 2 commits intomainfrom
roomote-v0[bot] wants to merge 2 commits intomainfrom
Conversation
…nversations Fixes #7052 The issue was caused by array index shifting when conversations exceeded 500 messages. Each new message would cause the oldest message to be dropped and all indices to shift, making Virtuoso lose track of the current scroll position. This fix removes the message limit entirely and lets Virtuoso handle virtualization of all messages efficiently, completely eliminating the index shifting problem.
| const newVisibleMessages = recentMessages.filter((message: ClineMessage) => { | ||
| // Remove the 500-message limit to prevent array index shifting | ||
| // Virtuoso handles virtualization efficiently for large lists | ||
| const newVisibleMessages = modifiedMessages.filter((message: ClineMessage) => { |
Contributor
Author
There was a problem hiding this comment.
Since we're removing the message limit entirely, it might be worth adding tests that verify:
- Messages are correctly filtered without slicing
- Virtuoso receives all messages for virtualization
- Scroll position is maintained when new messages arrive
I noticed there aren't specific tests for ChatView's message handling - this would be a good opportunity to add them.
4 tasks
Member
|
Closing this PR as the issue has been resolved in PR #7064 which removed the 500-message limit that was causing the scrollbar jumping. The fix has been merged to main. Let me know if you notice this issue again! |
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.
Fixes #7052
Summary
This PR fixes the scrollbar jumping issue that occurs in long conversations (>500 messages) by removing the array slicing that was causing index shifting.
Problem
When conversations exceeded 500 messages, the chat view would limit the visible messages to the last 500 by slicing the array. This caused:
Solution
Implemented Option 1 from the issue analysis: Remove the 500-message limit entirely and let Virtuoso handle virtualization of all messages. Virtuoso is designed to efficiently handle large lists through virtualization, so the memory impact is minimal.
Changes
Testing
✅ All existing ChatView tests pass
✅ Linting passes
✅ Type checking passes
✅ The fix completely eliminates array index shifting
Impact
This fix ensures that users can follow along with streaming responses in long conversations without the view jumping around, significantly improving the user experience for extended chat sessions.
Important
Removes 500-message limit in
ChatView.tsxto prevent scrollbar jumping, allowingVirtuosoto handle large message lists efficiently.ChatView.tsxto prevent scrollbar jumping in long conversations.Virtuosoto handle virtualization of all messages efficiently.visibleMessagesuseMemo inChatView.tsx.ChatView.tsx.This description was created by
for 7aec4cf. You can customize this summary. It will automatically update as commits are pushed.