fix: preserve streaming animations across text and code - #619
Open
rogersnm wants to merge 4 commits into
Open
Conversation
Contributor
|
@rogersnm is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Streaming updates can truncate active fades, completion can reveal pending text instantly, replay can skip opening animations, generated list whitespace can make new words appear already displayed, and code blocks can appear ahead of the text before them. Preserve animation history and use the shared animation timeline for text and code.
Type of Change
Changes Made
Animation.finished, handles cancellation, and is invalidated when streaming resumes or the final content changes.Animation defaults and the public API are unchanged. Code uses the configured duration and timeline; it does not get per-token syntax animations. Existing callbacks retain their streaming-state semantics.
Testing
pnpm checkpasses.The existing package/website build and six-package test validation from the earlier commits remains described in the linked history. The optional
apps/testproduction build requires an AI Gateway credential; it was not used as a gate.Screenshots/Demos
Original before/after animation recording · Quarter-speed recording
The original recording covers the update/completion/replay fixes; it predates the list-offset and code-entry additions. Its 50 ms updates, 250 ms fades and 10 ms stagger are comparison settings, not changed defaults.
List reproduction: render
1. First\n\n2. *But in ourselves, that we, then appendare underlings.. Previously “are” could receive a zero-duration fade while adjacent words remained mid-animation.Code reproduction: deliver a heading and fenced code in the same update with staggered animation enabled. Previously the code bypassed the timeline; now its wrapper receives one slot after the heading and keeps the same fade when the fence grows.
The consumer's separate fix for changing its React key when its maths plugin loads is application-side and is not included here.
Checklist