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:
parent
294892c470
commit
be0ccf47ee
2 changed files with 98 additions and 40 deletions
|
@ -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 =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue