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

(Ready for review and merge) Add Chat Rewind, Duplicate, and Fork Features #305

Merged

Conversation

wonderwhy-er
Copy link
Collaborator

@wonderwhy-er wonderwhy-er commented Nov 16, 2024

Video

2024-11-18.21-25-34.mp4

Summary

This PR introduces several new features:

  • ability to rewind the chat to an earlier state
  • duplicate chat sessions
  • fork chats starting from a specific message
  • tooltips for for rewind and fork buttons

Dependency Updates

  • Added @radix-ui/react-tooltip for improved tooltip functionality.
  • Updated pnpm-lock.yaml to ensure compatibility and resolve dependency conflicts.

@lassecapel
Copy link

lassecapel commented Nov 16, 2024

There was a discussion about a feature like this earlier: #114 the proposal was to use isomorphic-git. But that requires a browserFS. This approch doesn't add to much overhead and makes it easy to move back in time. Although what happens when you make changes, the downstream chat messages are not aware of that, Or am
I wrong?

@wonderwhy-er
Copy link
Collaborator Author

wonderwhy-er commented Nov 16, 2024

There was a discussion about a feature like this earlier: #114 the proposal was to use isomorphic-git. But that requires a browserFS. This approch doesn't add to much overhead and makes it easy to move back in time. Although what happens when you make changes, the downstream chat messages are not aware of that, Or am I wrong?

Currently downstream chats will be overwritten after you make a new chat message call.

As for referenced PR. It does way more and differently, and I am not sure AI is aware of those manipulations, I don't see it changing messages. In that sense proposal here seems to be more in line with how Bolt.New works, is smaller and more elegant in that way.

But does not yet do anything to import/export to git.

@Digitl-Alchemyst
Copy link
Collaborator

This is super clean code-wise. It appears to be super light weight, especially compared to the other method mentioned, which relied on a whole lot of state manipulation. I never tested the other method, but just looking at it, it seemed too slow.

My only complaint on this interaction of the idea is your icon choice. even though its facing the other direction it still feels like a refresh/reload icon
I think something closer to what the OG bolt has would be more intuitive either with the shape of the icon, theirs has more of a turn vibe to it, or even doing a button that just says rewind or rewind to here
image
My thoughts are some users maybe confused about what the button does.

@Digitl-Alchemyst Digitl-Alchemyst self-requested a review November 17, 2024 15:58
@Digitl-Alchemyst
Copy link
Collaborator

I was also looking at this one this morning
#280
While these 2 features are slightly different, I see the potential for overlap.
If you want also to compare these 2 for functionality conflicts

I see them both as powerful features that will likely get merged in pretty quick.

@wonderwhy-er wonderwhy-er changed the title Proposal: Add ability to return to older chat message state Work In Progress: Add ability to return to older chat message state Nov 17, 2024
@wonderwhy-er
Copy link
Collaborator Author

@Digitl-Alchemyst thanks for feedback, I will take a look at better icon and hint on hover.

I will be adding few more things after discussion in community.
Duplicate in of chats in side bar.
And ability to fork from any message which allows to start a new chat with copy of current chat up to a message.

@wonderwhy-er wonderwhy-er changed the title Work In Progress: Add ability to return to older chat message state (Ready for review and merge) Add duplicate, rewind and fork for chats Nov 18, 2024
@wonderwhy-er wonderwhy-er changed the title (Ready for review and merge) Add duplicate, rewind and fork for chats (Ready for review and merge) Add Chat Rewind, Duplicate, and Fork Features Nov 18, 2024
@chrismahoney
Copy link
Collaborator

This is really clean and good. Just one point to note, there's an existing issue I'm not sure we've captured where a revisited chat doesn't behave like the first run: For React at least, first run generates package.json and will not run the npm install until it's complete. On revisit, it doesn't care and runs both in tandem; in that case the install step always fails.

More making a note for myself, that isn't related to this change so I think this is worth bringing in for now. I'll look for/create an issue related to that behavior shortly.

👍 from me to merge

@wonderwhy-er
Copy link
Collaborator Author

Ok, merging then
And yeah, there are issues to fix, many :)

@wonderwhy-er wonderwhy-er merged commit a101dc7 into stackblitz-labs:main Nov 19, 2024
1 check passed
@dhairya13703
Copy link

Hey @wonderwhy-er
I'm having trouble with chat history storage when running the application with pnpm start or docker run. I'm unsure if the issue lies with the code or Wrangler configuration.
image

@wonderwhy-er
Copy link
Collaborator Author

Hey @wonderwhy-er I'm having trouble with chat history storage...

You did not describe the issue, chat history is gone when you restart server?

@dhairya13703
Copy link

Hey @wonderwhy-er I'm having trouble with chat history storage...

You did not describe the issue, chat history is gone when you restart server?

No it is running without any restart.

@wonderwhy-er
Copy link
Collaborator Author

Weird, works fine for me in hosted variant
https://ottodev-bolt.myaibuilt.app/

Are you using cancary or may be incognito?

@dhairya13703
Copy link

No I am deploying with docker on coolify.
You have deployed with cloudflare pages?
My code - https://github.com/dhairya13703/bolt.new-any-llm
I am not using incognito.

@dustinwloring1988
Copy link
Collaborator

would you be willing to rebase these changes in the (almost original) bolt - https://github.com/Bolt-CE/bolt

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.

6 participants