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

fix: chat response auto scroll #1209

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

Stijnus
Copy link
Collaborator

@Stijnus Stijnus commented Jan 29, 2025

Fix for chat response auto scroll :

Benefits

  • More reliable auto-scrolling during streaming
  • Better handling of user scroll interactions
  • Improved mobile device support
  • Smoother initial load with instant scroll
  • Cleaner code organization and maintainability

Testing

The changes can be verified by:

  1. Loading chat - should instantly scroll to bottom
  2. Streaming messages - should smoothly auto-scroll
  3. Manual scroll up - should stay at user's position
  4. Scroll to bottom - should resume auto-scroll
  5. Mobile testing - should work with touch interactions

Fix for chat response auto scroll :

### Benefits
- More reliable auto-scrolling during streaming
- Better handling of user scroll interactions
- Improved mobile device support
- Smoother initial load with instant scroll
- Cleaner code organization and maintainability

### Testing
The changes can be verified by:
1. Loading chat - should instantly scroll to bottom
2. Streaming messages - should smoothly auto-scroll
3. Manual scroll up - should stay at user's position
4. Scroll to bottom - should resume auto-scroll
5. Mobile testing - should work with touch interactions
@Stijnus Stijnus changed the title fix: fix for chat response auto scroll fix: chat response auto scroll Jan 29, 2025
Copy link
Collaborator

@leex279 leex279 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stijnus works. can be merged.

@thecodacus
Copy link
Collaborator

thecodacus commented Jan 29, 2025

this feature is already present in the existing codebase useSnapScroll.ts. its just not configured correctly.

Chat.client.tsx
image

in my last PR I just fixed that scroll, we can just add some additional improvement on top it instead of reimplementing it
BaseChat.tsx
image

@coleam00 coleam00 merged commit 9e8d05c into stackblitz-labs:main Feb 10, 2025
3 checks passed
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