mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: remove 500-message limit to prevent scrollbar jumping in long conversations
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.
This commit is contained in:
parent
962df868bd
commit
7aec4cf634
1 changed files with 3 additions and 5 deletions
|
|
@ -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 handles virtualization efficiently for large lists
|
||||
const newVisibleMessages = modifiedMessages.filter((message: ClineMessage) => {
|
||||
if (everVisibleMessagesTsRef.current.has(message.ts)) {
|
||||
const alwaysHiddenOnceProcessedAsk: ClineAsk[] = [
|
||||
"api_req_failed",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue