-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: remove 500-message limit to prevent scrollbar jumping in long conversations #7053
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
…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.
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.
Reviewing my own code is like debugging in a mirror - everything looks backwards but somehow still broken.
| 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) => { |
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'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.
|
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! |
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.