Skip to content

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.

2 participants