Skip to content
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

[feat] Improved AI Chat Scrolling #801

Open
drfarrell opened this issue Nov 19, 2024 · 3 comments
Open

[feat] Improved AI Chat Scrolling #801

drfarrell opened this issue Nov 19, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@drfarrell
Copy link
Collaborator

drfarrell commented Nov 19, 2024

Applying these conditions to our AI chat for the best user experience.

LLM Scrolljacking Manifesto

  1. If the user scrolls to bottom of generated text while still generating, enable auto-scroll
  2. Stop auto-scroll if the user manually scrolls up at any point & do not turn it back on until the user manually scrolls to bottom
  3. On mobile, stop auto-scroll if the user's finger is touching the screen
  4. If you choose to enable auto-scroll by default, stop auto-scrolling when the start of the response gets to the top of the visible window.

Performance tips

  1. Do not trigger auto-scroll callback on every token, only set new scroll position (or animate) when height of the container changes.
  2. If using React hooks, your state machine will depend on re-renders which can add jank due to latency. Use a class component & class variables to keep track of scroll state independent of renders.

From: https://x.com/mayfer/status/1858698456086282583?s=46&t=pd3uh4BnhkMVspxVU9blSQ

image

@drfarrell drfarrell added the enhancement New feature or request label Nov 19, 2024
@tasbi03
Copy link

tasbi03 commented Nov 23, 2024

hey,can you assign me this?

@Kitenite
Copy link
Contributor

For sure go for it @tasbi03

@drfarrell
Copy link
Collaborator Author

@tasbi03 how's it going so far? Need any help or advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants