Skip to content

Commit 03754f6

Browse files
authored
Virtuoso footer re-rendering issue (#4209)
The Virtuoso component has a inner footer component that serves only as a bottom spacer, after investigation this component keeps re-rendering, beccause its unnecessary it was removed and the spaccing added to the component itselve
1 parent 98f5542 commit 03754f6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,10 +1415,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
14151415
<Virtuoso
14161416
ref={virtuosoRef}
14171417
key={task.ts} // trick to make sure virtuoso re-renders when task changes, and we use initialTopMostItemIndex to start at the bottom
1418-
className="scrollable grow overflow-y-scroll"
1419-
components={{
1420-
Footer: () => <div className="h-[5px]" />, // Add empty padding at the bottom
1421-
}}
1418+
className="scrollable grow overflow-y-scroll mb-[5px]"
14221419
// increasing top by 3_000 to prevent jumping around when user collapses a row
14231420
increaseViewportBy={{ top: 3_000, bottom: Number.MAX_SAFE_INTEGER }} // hack to make sure the last message is always rendered to get truly perfect scroll to bottom animation when new messages are added (Number.MAX_SAFE_INTEGER is safe for arithmetic operations, which is all virtuoso uses this value for in src/sizeRangeSystem.ts)
14241421
data={groupedMessages} // messages is the raw format returned by extension, modifiedMessages is the manipulated structure that combines certain messages of related type, and visibleMessages is the filtered structure that removes messages that should not be rendered

0 commit comments

Comments
 (0)