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,