Repository navigation
Commit ff3883a
fix(web): stop remounting markdown on every activity delta
MessagesTimeline's shared row state built a fresh threadRef object each
time it recomputed, which happens on every activity delta while a thread
is working. ChatMarkdown keys its react-markdown component map on that
threadRef, so a new identity replaced every renderer's element type and
React remounted the whole rendered markdown subtree of each visible
assistant message. That destroyed the DOM nodes under any native text
selection, so the "cite" toolbar dropped within a second on working
threads.
Reuse the memoized citationThreadRef so the prop stays stable and
ChatMarkdown's memo bails out.
Co-Authored-By: Claude Code <[email protected]>1 parent ca63d42 commit ff3883a
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
630 | 634 | | |
631 | 635 | | |
632 | 636 | | |
| |||
650 | 654 | | |
651 | 655 | | |
652 | 656 | | |
| 657 | + | |
653 | 658 | | |
654 | 659 | | |
655 | 660 | | |
| |||
0 commit comments