vercel / ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
https://chat.vercel.ai
Other
9.27k stars 2.37k forks source link

Sidebar chat title and New chat button does not work when UI is generated as a response #402

Open jayabdulraman opened 2 months ago

jayabdulraman commented 2 months ago

When creating a new chat that generates a UI, the chat title does not auto-generate and update on the sidebar but will appear after manual page refresh. Additionally, after the assistant responds with the UI, clicking "New Chat" does not move the page to the root route even though the route changes from the address bar.

Steps to Reproduce:

  1. Clone repo, add env config and run as local
  2. Create a new chat that generates a UI
  3. Notice the sidebar will not update with new chat title
  4. Notice when "New Chat" is clicked, the page won't move
  5. However, if the assistant streams text response, the sidebar updates with new chat title and "New chat" button works

See attached video:

https://github.com/user-attachments/assets/d85e4b26-6efd-4f04-80e7-cd7908bffa2e

skeleton1231 commented 2 months ago

404

I think you update the code follow this can solve the problem it works for me it is about saveChat maybe later than the ui update