feat: render loading placeholder for incomplete streaming images#504
Open
sleitor wants to merge 2 commits intovercel:mainfrom
Open
feat: render loading placeholder for incomplete streaming images#504sleitor wants to merge 2 commits intovercel:mainfrom
sleitor wants to merge 2 commits intovercel:mainfrom
Conversation
Incomplete images during streaming (e.g. ` now render an animated skeleton placeholder instead of being silently removed. Changes: - remend: emit `` for incomplete images instead of stripping them entirely, in both handleIncompleteUrl() and handleIncompleteText() - remend: add earlyReturn check for `streamdown:incomplete-image` marker - streamdown: ImageComponent renders animate-pulse skeleton div when src === 'streamdown:incomplete-image' - Tests updated to reflect new placeholder behavior Mirrors the existing incomplete link handling (streamdown:incomplete-link). Closes vercel#503
Contributor
|
@sleitor 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.
Summary
Fixes #503 — incomplete images during streaming now render an animated skeleton placeholder instead of being silently removed. This mirrors the existing behavior for incomplete links.
What changed
link-image-handler.ts: BothhandleIncompleteUrl()andhandleIncompleteText()now emitfor incomplete images instead of stripping them entirelyindex.ts: UpdatedearlyReturncheck to also short-circuit onstreamdown:incomplete-image; fixed JSDoc forimagesoptionpackages/streamdownlib/image.tsx:ImageComponentdetectssrc === 'streamdown:incomplete-image'and renders ananimate-pulseskeleton div withdata-incomplete="true"Changeset:
remend@patch+streamdown@patchBefore / After
Before:
After:
![logo](./assets/log→ animated grey skeleton placeholder shown until the stream completesTest coverage
All existing tests updated; 4 new tests added for the placeholder behavior.