fix(file-preview): gate streaming animation to prevent file patch issue with scroll based re-render#4946
Conversation
…ue with scroll based re-render
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 36ff136. Configure here. |
Greptile SummaryThis PR fixes two sources of spurious re-animation in the file-preview panel: an unstable
Confidence Score: 5/5Safe to merge — both changes are narrowly scoped to the file-preview streaming animation path and carry no risk to data or state persistence. The No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[New render: content, isStreaming] --> B{isStreaming changed?}
B -- yes --> C{isStreaming = true AND\ncontent.length <= RESUME_SKIP_THRESHOLD?}
C -- yes --> D[animateRef = true\nfresh stream from scratch]
C -- no --> E[animateRef = false\nresume / pre-existing doc]
B -- no --> F{isStreaming=true AND\nanimateRef=true AND\nnon-append content change?}
F -- yes --> G[animateRef = false\npatch/rewrite detected — latch off]
F -- no --> H[animateRef unchanged]
D --> I[return isStreaming AND animateRef]
E --> I
G --> I
H --> I
I --> J{shouldAnimateStream?}
J -- true --> K[Streamdown: animated=STREAM_ANIMATION]
J -- false --> L[Streamdown: animated=false]
Reviews (1): Last reviewed commit: "fix(file-preview): gate streaming animat..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 36ff136. Configure here.

Summary
Stop streamed file previews from replaying the fade-in on already-visible text by stabilizing Streamdown's allowedTags identity and gating the per-char animation to from-scratch streams.
Type of Change
Testing
Tested manually
Checklist