fix(rich-md-editor): stop the editor flashing during an agent rewrite#5160
Conversation
Only reveal streamed chunks that extend what's already shown. A divergent chunk (an agent rewrite/edit, e.g. removing appended text) would collapse the document to the partial result and flash on every chunk; now the current content is held in place and the final result is applied once on settle. Fresh writes still reveal live.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Also avoids redundant Reviewed by Cursor Bugbot for commit 5b42a7b. Configure here. |
|
@cursor review |
|
@greptile |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1149fd8. Configure here.
… local edits Seed lastSyncedBodyRef from a settled (non-streaming) mount and update it on local edits via onUpdate, so the streaming hold engages on the very first agent rewrite chunk (no collapse/flash) and the settle still applies the rewrite that removes a local edit.
|
@greptile good catch on the P2 — confirmed real and fixed in The gap: Fix (two complementary parts):
Empirically verified in the e2e harness with a settled mount: removing both the seed and the |
|
@cursor review |
|
@greptile review |
|
The fix is well-targeted and the reasoning is solid. A few observations on the implementation: The seed is correct. The One minor observation: The fix is clean — two complementary invariants, minimal surface area, no regressions to the streaming path. LGTM. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5b42a7b. Configure here.
Summary
Empirical validation (e2e harness)
an agent rewrite does not collapse the editor mid-stream). Full e2e harness (568) + file-viewer vitest (142) + typecheck all green.Type of Change
Testing
Validated empirically via the rich-markdown-editor e2e harness (streaming lifecycle), plus the full suite.
Checklist