Jelajahi Sumber

fix: remove 500-message limit to prevent scrollbar jumping in long conversations (#7064)

- Removed array slicing logic that limited messages to 500
- This eliminates array index shifting that caused Virtuoso to lose scroll position
- Virtuoso is designed to efficiently handle large lists through virtualization
- Fixes the scrollbar jumping issue reported in #7063 and #7052

Co-authored-by: Roo Code <[email protected]>
roomote[bot] 6 bulan lalu
induk
melakukan
dcbb7a673f
1 mengubah file dengan 3 tambahan dan 5 penghapusan
  1. 3 5
      webview-ui/src/components/chat/ChatView.tsx

+ 3 - 5
webview-ui/src/components/chat/ChatView.tsx

@@ -897,11 +897,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
 	useMount(() => textAreaRef.current?.focus())
 	useMount(() => textAreaRef.current?.focus())
 
 
 	const visibleMessages = useMemo(() => {
 	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
+		const newVisibleMessages = modifiedMessages.filter((message: ClineMessage) => {
 			if (everVisibleMessagesTsRef.current.has(message.ts)) {
 			if (everVisibleMessagesTsRef.current.has(message.ts)) {
 				const alwaysHiddenOnceProcessedAsk: ClineAsk[] = [
 				const alwaysHiddenOnceProcessedAsk: ClineAsk[] = [
 					"api_req_failed",
 					"api_req_failed",