From f9d70635b8fdeeff4b57c0ab944da8685d94c5d0 Mon Sep 17 00:00:00 2001 From: Bryant Kelley Date: Fri, 1 Aug 2025 19:01:14 -0700 Subject: [PATCH] Change ChatBox to reorder the messages so that the visual and DOM order are the same --- src/components/ChatBox.tsx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/components/ChatBox.tsx b/src/components/ChatBox.tsx index 0806903..f713a54 100644 --- a/src/components/ChatBox.tsx +++ b/src/components/ChatBox.tsx @@ -142,6 +142,16 @@ export default function ChatBox({ showAllMessagesTab = false, className = "", st fetchMessages(undefined, true); }; + const LoadMoreButton = () => ( + + ); + return (
-
+
{messages.length === 0 && !loading && (
No chat messages found.
)} - {messages.map((msg, i) => ( + {hasMore && !startExpanded && ( + + )} + {(startExpanded ? messages : messages.toReversed()).map((msg, i) => ( ))} - {hasMore && ( - + {hasMore && startExpanded && ( + )}