Conversation
…g streaming, enhance message handling in NewChatPage, and improve thread viewport scrolling behavior
…switch and add new SSE event for document updates
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 3d74cca..2a06d03
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (4)
• surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
• surfsense_web/components/assistant-ui/markdown-text.tsx
• surfsense_web/components/assistant-ui/thread.tsx
• surfsense_web/lib/chat/streaming-state.ts
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.
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR fixes chat UI responsiveness issues by introducing a batching mechanism (
FrameBatchedUpdater) that throttles rapid state updates during SSE streaming. The changes reduce unnecessary React reconciliation passes by batching text-delta events into ~50ms intervals while immediately flushing on tool events, eliminating UI flicker during message streaming. Additionally, the PR fixes a thread initialization bug where switching search spaces with the same chat ID wouldn't re-initialize properly, disables smooth scrolling in markdown rendering, and improves auto-scroll behavior after message submission by polling for viewport height changes.⏱️ Estimated Review Time: 30-90 minutes
💡 Review Order Suggestion
surfsense_web/lib/chat/streaming-state.tssurfsense_web/components/assistant-ui/markdown-text.tsxsurfsense_web/components/assistant-ui/thread.tsxsurfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx