assistant2: Add support for referencing other threads as context (#22092)

This PR adds the ability to reference other threads as context:

<img width="1159" alt="Screenshot 2024-12-16 at 11 29 54 AM"
src="https://github.com/user-attachments/assets/bb8a24ff-56d3-4406-ab8c-6657e65d8c70"
/>

<img width="1159" alt="Screenshot 2024-12-16 at 11 29 35 AM"
src="https://github.com/user-attachments/assets/7a02ebda-a2f5-40e9-9dd4-1bb029cb1c43"
/>


Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-12-16 11:50:57 -05:00 committed by GitHub
parent 188c55c8a6
commit 88f7942f11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 278 additions and 11 deletions

View file

@ -94,7 +94,9 @@ impl AssistantPanel {
cx,
)
}),
message_editor: cx.new_view(|cx| MessageEditor::new(workspace, thread.clone(), cx)),
message_editor: cx.new_view(|cx| {
MessageEditor::new(workspace, thread_store.downgrade(), thread.clone(), cx)
}),
tools,
local_timezone: UtcOffset::from_whole_seconds(
chrono::Local::now().offset().local_minus_utc(),
@ -123,8 +125,14 @@ impl AssistantPanel {
cx,
)
});
self.message_editor =
cx.new_view(|cx| MessageEditor::new(self.workspace.clone(), thread, cx));
self.message_editor = cx.new_view(|cx| {
MessageEditor::new(
self.workspace.clone(),
self.thread_store.downgrade(),
thread,
cx,
)
});
self.message_editor.focus_handle(cx).focus(cx);
}
@ -146,8 +154,14 @@ impl AssistantPanel {
cx,
)
});
self.message_editor =
cx.new_view(|cx| MessageEditor::new(self.workspace.clone(), thread, cx));
self.message_editor = cx.new_view(|cx| {
MessageEditor::new(
self.workspace.clone(),
self.thread_store.downgrade(),
thread,
cx,
)
});
self.message_editor.focus_handle(cx).focus(cx);
}