From 355fbd96d5e90b52961ac5f1e035112fc3bad4a9 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 2 Sep 2026 19:01:00 -0700 Subject: [PATCH] fix(web): stop remounting markdown on every activity delta (#9306) Co-authored-by: Claude Code --- apps/web/src/components/chat/MessagesTimeline.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx index 64ca547ee1ae1baffca05c446677f193d4449cc5..26a2881322ba9f0d6230edf90725e6b419ba14f2 100644 --- a/apps/web/src/components/chat/MessagesTimeline.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.tsx @@ -623,7 +623,11 @@ export const MessagesTimeline = memo(function MessagesTimeline({ listRef, timestampFormat, routeThreadKey, - threadRef: parseScopedThreadKey(routeThreadKey), + // Must be referentially stable: ChatMarkdown keys its react-markdown + // component map on threadRef, and a fresh object here remounts every + // rendered markdown node whenever this memo recomputes (e.g. on each + // activity delta while the thread is working). + threadRef: citationThreadRef, markdownCwd, resolvedTheme, workspaceRoot, @@ -648,6 +652,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({ listRef, timestampFormat, routeThreadKey, + citationThreadRef, markdownCwd, resolvedTheme, workspaceRoot, -- 2.54.0