smallcloudai / refact-chat-js

Shared chat code for all IDEs
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

wip: Make autoscroll opt in. #205

Closed MarcMcIntosh closed 4 days ago

MarcMcIntosh commented 5 days ago

Make auto scroll opt in

Description

auto scrolling when streaming has been causing some issues, making it opt in could provided a better user experience.

This PR replaced the ref to the div to follow when auto scrolling with a ref to the scroll area.

ref.current.scrollIntoView was replaced with mutating ref.current.scrollHeight, it seems to be smoother :)

Along with other refactoring.

Type of change

How to Test

  1. Start a chat that is gonig to be quite long.
  2. wait until the down arrow button shows up.
  3. click on it to enable following the stream.
  4. wheel up to disable it.
  5. scroll some more.

Screenshots (if applicable)

Checklist

Linked Issues

https://refact.fibery.io/Software_Development/UI-chat-js-133#Task/Auto-scroll-is-still-broken-384

Additional Notes