From c10c6fcd4e797eeaf435198a06af22b7934d58e0 Mon Sep 17 00:00:00 2001 From: pdelfan Date: Thu, 15 Oct 2026 11:51:49 -0700 Subject: [PATCH] Older messages no longer render again on send. The Try again callback every message's row gets called chat.regenerate as a method, so React Compiler kept it on the whole chat object, which changes with every update, and every row ran again three times per send, though each then reused its message. ConversationView now takes regenerate, regenerating, and stop out of chat first, so the callbacks stay the same. Checked in the running app over a send and its reply in an 18-message chat: only the new message and the reply rendered. --- .../conversation/components/ConversationView.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/web/src/features/conversation/components/ConversationView.tsx b/apps/web/src/features/conversation/components/ConversationView.tsx index 7ccea77..d1b2180 100644 --- a/apps/web/src/features/conversation/components/ConversationView.tsx +++ b/apps/web/src/features/conversation/components/ConversationView.tsx @@ -32,6 +32,9 @@ export function ConversationView(props: Props) { const chat = useChat(props.skey, { onTurnStarted: () => stick.pin() }) // While another tab holds the local copy, the banner over the page says why it is waiting. const { info, messages, branch, waiting, running } = chat + // Called apart from `chat`, which changes with every update, so the callbacks every message gets + // stay the same and an unchanged message doesn't render again. + const { regenerate, regenerating, stop } = chat const me = useMe() const { models } = useModels() const actions = useConversationActions(props.skey) @@ -56,8 +59,8 @@ export function ConversationView(props: Props) { const operations: ConversationOperations = { edit: setEditingRkey, quote: (text) => composer.current?.quote(text), - regenerate: chat.regenerate, - stop: chat.stop, + regenerate, + stop, models, storedIn: me.storageMode === 'space' @@ -109,9 +112,9 @@ export function ConversationView(props: Props) {