Skip to content

add smooth scrolling to chat #5290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025

Conversation

uinstinct
Copy link
Contributor

Description

Recently I was used Gemini Code Assist and the chat smooth scrolling (and last prompt's sticky behaviour) on a new prompt was something I liked. I wanted to add this to Continue as well.

Whenever a new prompt is given, the chat scrolls to the bottom in smoothly.

(I wanted to also add the sticky behaviour of the prompt. It would require changes to how we render the history items such that all other items remain constant during generation)

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screenshots

before.mp4
after.mp4

Testing instructions

  1. open the chat messages area
  2. add 2 or 3 prompts and long answers
  3. see that when you prompt next, the last message is smoothly scrolled into view

@uinstinct uinstinct requested a review from a team as a code owner April 22, 2025 13:27
@uinstinct uinstinct requested review from tomasz-stefaniak and removed request for a team April 22, 2025 13:27
Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 2361b03
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/68090a2fe607ff00081f3d89

@Patrick-Erichsen
Copy link
Collaborator

The main difference here is that currently we just jump to the last prompt, but this instead smooth scrolls?

@Patrick-Erichsen
Copy link
Collaborator

Also it appears this change is breaking one of the e2e tests: https://github.com/continuedev/continue/actions/runs/14595994283/job/40979633741?pr=5290#step:13:85

@PlebeiusGaragicus
Copy link

instead - I like when the newly submitted prompt "pops" to the top of the window and as the agent reply streams it will again scroll once the window is filled.

@uinstinct
Copy link
Contributor Author

uinstinct commented Apr 23, 2025

The main difference here is that currently we just jump to the last prompt, but this instead smooth scrolls?

Yes, we jump to the last prompt using smooth scroll.

Also it appears this change is breaking one of the e2e tests: https://github.com/continuedev/continue/actions/runs/14595994283/job/40979633741?pr=5290#step:13:85

checking this and fixing

@uinstinct
Copy link
Contributor Author

instead - I like when the newly submitted prompt "pops" to the top of the window and as the agent reply streams it will again scroll once the window is filled.

this will require some modifications to how we are rendering the history items as it was indicated here.

(I wanted to also add the sticky behaviour of the prompt. It would require changes to how we render the history items such that all other items remain constant during generation)

@Patrick-Erichsen
Copy link
Collaborator

cc @RomneyDa here, I think you'll have an opinion.

@Patrick-Erichsen Patrick-Erichsen requested review from RomneyDa and Patrick-Erichsen and removed request for tomasz-stefaniak April 23, 2025 04:20
check first expect

recheck

try adding timeout

place delay at correct position
@uinstinct uinstinct force-pushed the smooth-scroll-chat branch from 53543a9 to 95b7239 Compare April 23, 2025 14:16
@Patrick-Erichsen Patrick-Erichsen merged commit ff63c8c into continuedev:main Apr 28, 2025
31 checks passed
@RomneyDa
Copy link
Collaborator

RomneyDa commented Apr 28, 2025

@uinstinct this can look nice especially if there's a long delay up to first token. I think it ends up looking worse if you're on a tall screen and the model responds quickly, because it's still scrolling while the model starts responding. To make it scroll fast enough we'd have to have the scroll finish in a couple hundred milliseconds which at that point looks jenky.

Also, would need screenshots/more testing on truncating messages, one of the main reasons we abandoned autoscroll in the past was it often felt jenky when you go back and truncate the history at e.g. message 3/20

EDIT this was merged and then reverted #5408

@uinstinct
Copy link
Contributor Author

Fair points @RomneyDa
I made a note of these these points and will try to add smooth scrolling once again. I think we will need to tweak how we are rendering the messages the above cases you mentioned and this one as well.

@uinstinct uinstinct deleted the smooth-scroll-chat branch April 29, 2025 03:25
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.

4 participants