You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(dekstop): when streaming markdown with code blocks, scroll jumped erratically. #10372
when streaming markdown with code blocks, scroll jumped erratically.
found the cause: setupCodeCopy() ran on every render, wrapping <pre> blocks with <div data-component="markdown-code"> + copy buttons. these wrappers weren't in the HTML
output, so on next render the DOM was completely replaced via innerHTML, destroying wrappers, then setupCodeCopy re-added them. This cycle caused layout thrashing → scroll jumping.
While there are related scroll/rendering issues in the repository (#9886 for disruptive auto-scroll behavior, #6172 for high CPU during streaming), this issue appears to have a distinct root cause related to the setupCodeCopy() function being called on every render and causing DOM replacement via innerHTML. The related issues have different underlying causes and solutions, so this is likely not a duplicate. However, it's worth noting these exist as they may interact with each other's fixes.
Activity
github-actions commentedon Jan 24, 2026
While there are related scroll/rendering issues in the repository (#9886 for disruptive auto-scroll behavior, #6172 for high CPU during streaming), this issue appears to have a distinct root cause related to the
setupCodeCopy()function being called on every render and causing DOM replacement via innerHTML. The related issues have different underlying causes and solutions, so this is likely not a duplicate. However, it's worth noting these exist as they may interact with each other's fixes.