perf: trim observer work and defer Prism during streaming

- Drop characterData from scroll-follow and file-link MutationObservers;
  ResizeObserver already catches content growth.
- extractMermaidBlocks: bail out when markdown has no 'mermaid' at all.
- MarkdownCodeBlock: skip Prism highlighting while code is actively
  changing, render plain pre until settled for 300ms.
This commit is contained in:
Bohdan Triapitsyn
2026-04-20 20:52:57 +03:00
parent ad7790b3ec
commit 9f81c8fa46
2 changed files with 50 additions and 11 deletions
+1 -1
View File
@@ -159,7 +159,7 @@ export const useScrollEngine = ({
resize.observe(container);
const mutation = new MutationObserver(onChange);
mutation.observe(container, { childList: true, subtree: true, characterData: true });
mutation.observe(container, { childList: true, subtree: true });
followObserversRef.current = { resize, mutation };
}, [containerRef, runFollowBurst]);