Repository navigation
fix(wework): smooth streaming message rendering - #1858
Merged
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR adds buffered streaming markdown rendering, stable streaming-message height handling, cached layout measurement, and memoized workspace components, callbacks, and control objects. It also updates related tests and English and Chinese performance documentation. ChangesStreaming rendering and performance
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AssistantMarkdown
participant useBufferedStreamingText
participant requestAnimationFrame
participant Streamdown
AssistantMarkdown->>useBufferedStreamingText: pass content and streaming state
useBufferedStreamingText->>requestAnimationFrame: schedule text advancement
requestAnimationFrame-->>useBufferedStreamingText: provide next buffered prefix
useBufferedStreamingText-->>AssistantMarkdown: return display content
AssistantMarkdown->>Streamdown: render buffered markdown
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Root cause
Executor deltas arrive in bursts with occasional network or IPC gaps. Rendering every burst directly made the visible cadence uneven, while repeated Markdown component creation, full streaming-height measurement, and unstable workspace/composer props amplified frontend work. Per-character DOM animation was evaluated and removed because it substantially increased style and paint work.
User impact
Streaming responses advance at a steadier visible cadence without limiting the underlying event rate. Final content still aligns immediately when the stream ends or content is replaced, and completed messages retain normal static Markdown DOM.
Validation
Summary by CodeRabbit
New Features
Performance
Documentation
Tests