feat(platform): streaming markdown line buffer and split rendering#903
Conversation
Extract line-buffering logic into a dedicated utility for cleaner stream chunk handling. Update incremental markdown to use a single visible cursor via layout-effect deduplication. Simplify the stream buffer hook and typewriter text component accordingly.
…ns for faster rendering Introduce a block-level split point that separates already-completed markdown blocks from the in-progress block during typewriter animation. Stable blocks are parsed once and memoized via a new StableMarkdown component, reducing per-frame work from O(full_text) to O(last_block). Also adds tilde fence support to remendMarkdown, fixes trailing marker detection for underscores and CJK text, and guards against targetCPS=0 in useStreamBuffer.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Knip flagged `unified` as an unlisted dependency. Derive the PluggableList type from react-markdown's own Options instead.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR refactors the streaming markdown reveal mechanism from anchor-based to block-based splitting. It removes the Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
remendMarkdownwith tilde fence support, better trailing marker detection for underscores and CJK text, and atargetCPS=0guard inuseStreamBufferTest plan
line-buffer,find-block-split, and updatedremend-markdowntestsuse-stream-bufferandincremental-markdownSummary by CodeRabbit
New Features
Improvements
aria-busyattributes for animated elements