Skip to content

Commit 1c5e341

Browse files
authored
typing animation for multi cells (#6867)
1 parent 4e43bd8 commit 1c5e341

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

torchci/components/TorchAgentPage.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,18 @@ export const TorchAgentPage = () => {
449449

450450
if (animatingItems.length === 0) return;
451451

452+
// If more than 1 item is animating, just display all without animation
453+
if (animatingItems.length > 1) {
454+
setParsedResponses((prev) =>
455+
prev.map((item) => ({
456+
...item,
457+
isAnimating: false,
458+
displayedContent: item.content,
459+
}))
460+
);
461+
return;
462+
}
463+
452464
const itemIndex = parsedResponses.findIndex((item) => item.isAnimating);
453465
if (itemIndex === -1) return;
454466

0 commit comments

Comments
 (0)