Skip to content

scroll down to latest msg when switching chats#1733

Open
iyernaveenr wants to merge 1 commit into
eigent-ai:mainfrom
iyernaveenr:naveen_r_iyer/fix-project-switch-scroll-to-bottom
Open

scroll down to latest msg when switching chats#1733
iyernaveenr wants to merge 1 commit into
eigent-ai:mainfrom
iyernaveenr:naveen_r_iyer/fix-project-switch-scroll-to-bottom

Conversation

@iyernaveenr

Copy link
Copy Markdown

Problem

Switching to a different project in the sidebar leaves the chat scrolled to the top instead of showing the latest message at the bottom.

Root cause

In ProjectChatContainer, the auto-scroll effect only fires when a new user message is appended (the message count increases and the last message is from the user). The other scroll effects only handle explicit sidebar navigation. Nothing scrolls the viewport when the active project changes, so a switch renders the newly selected project's messages but keeps the previous scroll position (the top).

Fix

Add an effect keyed on the active project id that scrolls the chat container to the bottom after a short defer (so the newly rendered messages have laid out). It uses instant scrolling so switching does not visibly scroll through the whole history, and it does not affect in-conversation scrolling or the existing "scroll to bottom on new user message" behavior.

Testing

Switch between projects in the left sidebar - each now opens at the latest message (bottom) instead of the top.

@iyernaveenr iyernaveenr changed the title scroll down to latest msq when switching chats scroll down to latest msg when switching chats Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants