-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: remove 500-message limit to prevent scrollbar jumping in long conversations #7064
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -897,11 +897,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |
| useMount(() => textAreaRef.current?.focus()) | ||
|
|
||
| const visibleMessages = useMemo(() => { | ||
| const currentMessageCount = modifiedMessages.length | ||
| const startIndex = Math.max(0, currentMessageCount - 500) | ||
| const recentMessages = modifiedMessages.slice(startIndex) | ||
|
|
||
| const newVisibleMessages = recentMessages.filter((message: ClineMessage) => { | ||
| // Remove the 500-message limit to prevent array index shifting | ||
| // Virtuoso is designed to efficiently handle large lists through virtualization | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider enhancing this comment to explain why removing the limit fixes the scrollbar jumping: This would help future developers understand the context better. |
||
| const newVisibleMessages = modifiedMessages.filter((message: ClineMessage) => { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While Virtuoso handles virtualization efficiently, have we considered adding telemetry or monitoring for extremely long conversations (thousands of messages)? This could help us track memory usage in production and identify if we need additional optimizations in the future. Perhaps we could log a metric when conversations exceed certain thresholds (e.g., 1000, 5000 messages)? |
||
| if (everVisibleMessagesTsRef.current.has(message.ts)) { | ||
| const alwaysHiddenOnceProcessedAsk: ClineAsk[] = [ | ||
| "api_req_failed", | ||
|
|
||
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.
Is this intentional? PR #7053 appears to implement the exact same fix and was created earlier. Should we close one to avoid confusion, or is there a specific reason for having both PRs open?