assistant2: Add new conversation button, that also saves the current conversation (#11522)

This PR updates the new assistant with a button to start a new
conversation.

Clicking on it will reset the chat and put it into a fresh state.

The current conversation will be serialized and written to
`~/.config/zed/conversations`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-07 18:16:48 -04:00 committed by GitHub
parent c77dd8b9e0
commit 33a72219c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 126 additions and 6 deletions

View file

@ -106,6 +106,11 @@ impl SavedConversationMetadata {
.and_then(|name| name.to_str())
.zip(metadata)
{
// This is used to filter out conversations saved by the new assistant.
if !re.is_match(file_name) {
continue;
}
let title = re.replace(file_name, "");
conversations.push(Self {
title: title.into_owned(),