assistant: Show error messages in popover notification (#15808)

<img width="644" alt="image"
src="https://github.com/user-attachments/assets/ee6f2e60-e50a-481e-98b4-6c4b72a9b882">


Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
This commit is contained in:
Bennet Bo Fenner 2024-08-05 17:11:42 +02:00 committed by GitHub
parent 294892c470
commit be0ccf47ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 98 additions and 40 deletions

View file

@ -281,6 +281,7 @@ impl ContextOperation {
#[derive(Debug, Clone)]
pub enum ContextEvent {
AssistError(String),
MessagesEdited,
SummaryChanged,
EditStepsChanged,
@ -1580,6 +1581,10 @@ impl Context {
.err()
.map(|error| error.to_string().trim().to_string());
if let Some(error_message) = error_message.as_ref() {
cx.emit(ContextEvent::AssistError(error_message.to_string()));
}
this.update_metadata(assistant_message_id, cx, |metadata| {
if let Some(error_message) = error_message.as_ref() {
metadata.status =