fix: artifact panel never auto-opens on a fast stream - #1538
Open
lcamargof wants to merge 1 commit into
Open
Conversation
The auto-open gate is a narrow length window (text 400<len<450, code 300<len<310) checked per delta. Real deltas arrive in chunks, so the length jumps past the window in one step and it never opens. Replace it with a latch on the crossing, keeping each artifact's content model.
Contributor
|
@lcamargof is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
rhiannonrossi31-max
approved these changes
Aug 7, 2026
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.
The artifact panel is supposed to auto-open mid-stream once real content starts coming in. It basically never does.
It gates
isVisibleon a tiny length window (text> 400 && < 450, code> 300 && < 310) re-checked on each delta. But deltas come in chunks, not one char at a time, so the length jumps straight over the window in a single delta and the check never passes. You only ever hit it if the stream happens to arrive ~1 char at a time.image and sheet artifacts don't have this, they just flip the panel visible on the first delta. it's only text and code that gate it behind the length window, so they're the two that silently never open.
Swapped the window for a latch on the crossing (
prev <= 400 && new > 400). Opens the moment content goes past the threshold, once, and won't reopen if you close the panel (guessing that's what the upper bound was for).Ran it in a container against the actual reducers, not a paraphrase:
This PR was AI-generated and human-curated. I verified the change against the code but didn't hand-write it.