Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

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?

// Virtuoso is designed to efficiently handle large lists through virtualization
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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",
Expand Down
Loading