Skip to content

fix: chat UI issues#1033

Merged
MODSetter merged 3 commits intodevfrom
dev_mod
Mar 29, 2026
Merged

fix: chat UI issues#1033
MODSetter merged 3 commits intodevfrom
dev_mod

Conversation

@MODSetter
Copy link
Copy Markdown
Owner

@MODSetter MODSetter commented Mar 29, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

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
Order File Path
1 surfsense_web/lib/chat/streaming-state.ts
2 surfsense_web/components/assistant-ui/markdown-text.tsx
3 surfsense_web/components/assistant-ui/thread.tsx
4 surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx

Need help? Join our Discord

Analyze latest changes

…g streaming, enhance message handling in NewChatPage, and improve thread viewport scrolling behavior
…switch and add new SSE event for document updates
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment Mar 29, 2026 9:54am

Request Review

@MODSetter MODSetter merged commit 05030f6 into dev Mar 29, 2026
7 of 8 checks passed
Copy link
Copy Markdown

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant