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

Implement auto-scroll to top of message for new chat messages #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brylie
Copy link
Owner

@brylie brylie commented Jul 6, 2024

Related to #22

Implement auto-scroll to top of message for new chat messages.

  • HTML Template Changes: Add hx-on attributes to the form element to trigger scroll behavior and add a JavaScript function scrollToMessage to handle scrolling in app/templates/chat.html.
  • FastAPI Endpoint Update: Update the /chat endpoint in app/main.py to generate and return message IDs and modify the response HTML to include the message IDs.
  • JavaScript Changes: Add a scrollToBottom function to handle auto-scrolling and call scrollToBottom after appending user messages and bot responses in app/static/script.js.
  • CSS Changes: Ensure the chat container has proper scrolling behavior and add styles for smooth scrolling in app/static/styles.css.

For more details, open the Copilot Workspace session.

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.

1 participant