Skip to content

feat(chat): autoscroll to newest message#4

Merged
chtnnh merged 1 commit into
mainfrom
cursor/chat-autoscroll-ec9a
Jun 23, 2026
Merged

feat(chat): autoscroll to newest message#4
chtnnh merged 1 commit into
mainfrom
cursor/chat-autoscroll-ec9a

Conversation

@chtnnh

@chtnnh chtnnh commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Quick UX patch: the chat now auto-scrolls to the newest message.

Change

  • New ChatMessages component in emoji-chat.tsx that owns the scroll container and auto-scrolls to the bottom on new messages — but only when the viewer is already pinned to the bottom (within 48px). If someone scrolls up to re-read history, incoming messages won't yank them back down.
  • room-client.tsx uses <ChatMessages> in place of the inline message list (chat renders in both the desktop sidebar and the mobile tab, so encapsulating the ref avoids a shared-ref collision).

Walkthrough

chat_autoscroll_demo.mp4
Sending Message 1→40 keeps the newest message in view; the log overflows (older messages scroll off the top) and scrolling up to read history is uninterrupted.

Newest message pinned at bottom after overflow

Testing

  • pnpm --filter @together/web typecheck
  • ✅ Manual (recorded): 40 messages sent — newest stays pinned at bottom, container overflows (top edge Message 13, bottom Message 40), and scrolling up to view Message 1 works without snap-back.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Co-authored-by: Chaitanya Mittal <chtnnh@users.noreply.github.com>
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
together-web Ready Ready Preview, Comment Jun 23, 2026 12:16pm

@chtnnh chtnnh marked this pull request as ready for review June 23, 2026 12:21
@chtnnh chtnnh merged commit d7020f9 into main Jun 23, 2026
4 checks passed
@chtnnh chtnnh deleted the cursor/chat-autoscroll-ec9a branch June 23, 2026 12:38
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.

2 participants