Skip to content

fix: concurrent animation across streaming blocks - #581

Merged
farnabaz merged 5 commits into
mainfrom
fix/animate
Aug 19, 2026
Merged

fix: concurrent animation across streaming blocks#581
farnabaz merged 5 commits into
mainfrom
fix/animate

Conversation

@farnabaz

Copy link
Copy Markdown
Collaborator

Streaming animation was fighting itself: sibling blocks faded in at the same time, spans stuck around after settle, un-animated streams could freeze next to busy siblings, and underlined links flashed early.

This takes the useful bits from earlier attempts — wall-clock stagger chaining from #493, the “don’t let the queue run away” idea from #531, and whitespace handling from #536 — and keeps the existing model instead of rewriting it.

Stagger now shares one timeline across blocks, compresses under a fast stream instead of stacking forever, tears spans down cleanly when isAnimating goes false, and glues trailing spaces into word spans so underlines don’t paint ahead.

No public API changes. stagger still works as usual; under heavy load the cascade compresses instead of overlapping or stalling.

Inspired by #493, #531, and #536.

Resolves #482
Resolves #535
Resolves #550
Resolves #570

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
streamdown Ready Ready Preview Aug 19, 2026 3:15pm

Inspired by #493, #531, and #536.

Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com>
Co-authored-by: Isaac Wasserman <isaacrwasserman@gmail.com>
Co-authored-by: aradhyacp <cparadhya@proton.me>
@farnabaz

Copy link
Copy Markdown
Collaborator Author

@sleitor, @aradhyacp, @isaacwasserman I would appreciate it if you could verify the behavior.

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Changeset body describes a nonexistent rehypeMarkdownInCustomTags rehype plugin instead of the actual preprocessing-based implementation

Fix on Vercel

…gs` rehype plugin instead of the actual preprocessing-based implementation

This commit fixes the issue reported at .changeset/fix-custom-tags-markdown.md:6

## Bug

The changeset `.changeset/fix-custom-tags-markdown.md` (which becomes the public `streamdown` CHANGELOG entry) claims:

> Adds a new rehype plugin (rehypeMarkdownInCustomTags) that re-parses raw text content of custom tag elements as Markdown.

No such plugin exists.

- `grep -r rehypeMarkdownInCustomTags` → **no matches** anywhere in the repo.
- The real mechanism is preprocessing: `preprocessCustomTags` (`packages/streamdown/lib/preprocess-custom-tags.ts`) rewrites multi-line custom tags into a blank-line-sandwiched HTML block so CommonMark interrupts the raw-HTML block and parses nested Markdown, and `parseMarkdownIntoBlocks` (`parse-blocks.tsx`) re-merges the interrupted open/content/close tokens. It is wired via `preprocessCustomTags(...)` in `packages/streamdown/index.tsx`, not added to any rehype plugin list.

## Impact

Users and maintainers reading the changelog will look for a nonexistent `rehypeMarkdownInCustomTags` plugin/export — misleading documentation of a public release note.

## Fix

Rewrote the changeset body to describe the actual preprocessing-based approach (`preprocessCustomTags` normalizing multiline tags into blank-line-sandwiched HTML blocks, with `parseMarkdownIntoBlocks` re-merging tokens). The accurate user-facing summary and `literalTagContent` exclusion note were preserved.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: farnabaz <farnabaz@gmail.com>
@aradhyacp

Copy link
Copy Markdown
Contributor

@farnabaz Tested it locally and everything looks clean from my side. The behavior looks good with no issues noticed. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment