coleam00 / bolt.new-any-llm

Prompt, run, edit, and deploy full-stack web applications using any LLM you want!
https://bolt.new
MIT License
4.29k stars 1.76k forks source link

feat: Add chat history backup and restore functionality" #280

Open sidbetatester opened 1 week ago

sidbetatester commented 1 week ago

Added chat history backup and restore functionality:

Features and Usage

Export Chat History

  1. Look for the download icon (↓) next to "Your Chats" in the sidebar
  2. Click the icon to download your chat history
  3. A JSON file named bolt-chat-history-[date].json will be downloaded
  4. You'll see a success notification when the export is complete

Import Chat History

  1. Look for the upload icon (↑) next to "Your Chats" in the sidebar
  2. Click the icon to open the file picker
  3. Select a previously exported JSON backup file
  4. The page will automatically reload after successful import
  5. You'll see your imported chats in the sidebar

Technical Changes

Error Handling

Notes

Chat_history_backup_restore

sidbetatester commented 1 week ago

This is a simple feature to backup and restore the projects, mainly helpful if you need to clear browser history and restore on the same system, or to take it around different systems. I kept the changes very minimal to not affect any existing code.

one way to use it is also you could edit the backed up chat history in case you want to remove unwanted information to reduce the chat length and hence meet the context length when it gets too big. I might make this possible in the future.

wonderwhy-er commented 4 days ago

Was thinking to add this too, but do it per one chat, not all of them Though I guess doing it for all of them is good too, will review now

wonderwhy-er commented 4 days ago
  1. Something broken around deleting chats, there is not item and description. Try to delete a chat

  2. I also think that you need to split that large function in to smaller parts. Harder to understand what it does.

  3. There were couple of typescheck issues when I runned workflows

  4. Also there is empty app/utils/backup.ts file?

coleam00 commented 6 hours ago

@sidbetatester Could you reply to @wonderwhy-er feedback when you get the chance? Thanks for that by the way Eduard!