Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

⚡️ perf(conversation): give the message list an item size hint (#23375)

Inneie7d2940cae11
diff --git a/src/features/Conversation/ChatList/components/VirtualizedList.tsx b/src/features/Conversation/ChatList/components/VirtualizedList.tsx
index eff91f110fb..8dc29333350 100644
--- a/src/features/Conversation/ChatList/components/VirtualizedList.tsx
+++ b/src/features/Conversation/ChatList/components/VirtualizedList.tsx
@@ -512,10 +512,14 @@ const VirtualizedList = memo<VirtualizedListProps>(
<DebugInspector />
</Suspense>
)}
+ {/* Without a hint virtua sizes unmeasured rows at 40px, so the first frame
+ of a topic mounts every row that fits viewport + buffer at 40px —
+ ~20 rows of long replies, each a full markdown parse, for 1–2 visible. */}
<VList
bufferSize={typeof window !== 'undefined' ? window.innerHeight : 0}
className={VLIST_CLASS_NAME}
data={dataWithSlots}
+ itemSize={300}
keepMounted={keepMountedIndicesWithSlots}
ref={virtuaRef}
shift={shift}