Skip to content

fix: artifact panel never auto-opens on a fast stream - #1538

Open
lcamargof wants to merge 1 commit into
vercel:mainfrom
lcamargof:fix/artifact-auto-open-fast-stream
Open

fix: artifact panel never auto-opens on a fast stream#1538
lcamargof wants to merge 1 commit into
vercel:mainfrom
lcamargof:fix/artifact-auto-open-fast-stream

Conversation

@lcamargof

@lcamargof lcamargof commented Aug 7, 2026

Copy link
Copy Markdown

The artifact panel is supposed to auto-open mid-stream once real content starts coming in. It basically never does.

It gates isVisible on 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:

text  current: realistic ~120-char deltas -> never opens | 1-char deltas -> opens
      fixed:   realistic                  -> opens once   | after you close it -> stays closed
code  current: realistic                  -> never opens | 1-char deltas -> opens
      fixed:   realistic                  -> opens once   | after you close it -> stays closed

This PR was AI-generated and human-curated. I verified the change against the code but didn't hand-write it.

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.
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@lcamargof is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants