Skip to content

Conversation

@ProdigyRahul
Copy link
Contributor

@ProdigyRahul ProdigyRahul commented Jan 24, 2026

What does this PR do?

Fixes scroll jumping/flickering that occurred when streaming markdown content with code blocks.

Adam (@adamdotdevin) What I did is

  • Replace innerHTML with morphdom for incremental DOM updates
  • Configure morphdom to preserve copy button wrappers (data-component="markdown-code") and buttons (data-slot="markdown-copy-button")
  • Debounce setupCodeCopy() by 150ms so it only runs after content settles, not on every streaming update (for better ux uk)

Watch this videos for see the diff:

Issue:
Video: https://www.youtube.com/watch?v=rn7zQlxb1yU
(make sure you watch this video before 24 hours of pr created otherwise it will get deleted xD)

Solution:
Video: https://www.youtube.com/watch?v=B3NQV7KJp3o
(make sure you watch this video before 24 hours of pr created otherwise it will get deleted xD)

How did you verify your code works?

  • Tested streaming responses with multiple code blocks
  • Verified scroll follows content smoothly without jumping
  • Verified copy buttons appear and work correctly after streaming completes
  • Verified user scroll-up pauses auto-scroll, scroll-to-bottom resumes it

@adamdotdevin ready for merge!
solves issue: #10372

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@ProdigyRahul ProdigyRahul changed the title fix(app): markdown rendering with morphdom for better dom functions (solves #10372) fix(app): markdown rendering with morphdom for better dom functions Jan 24, 2026
@adamdotdevin adamdotdevin force-pushed the fix/markdown-rendering branch from 9c6a8b3 to ce85ada Compare January 24, 2026 23:25
@adamdotdevin adamdotdevin merged commit 399fec7 into anomalyco:dev Jan 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants