assistant panel: Stop animation & show explicit state if canceled (#16200)

This fixes a bug by stopping the animation when a completion is canceled
and it also makes the state more explicit, which I think is very
valuable.



https://github.com/user-attachments/assets/9ede9b25-86ac-4901-8434-7407896bb799


Release Notes:

- N/A
This commit is contained in:
Thorsten Ball 2024-08-14 11:18:40 +02:00 committed by GitHub
parent 97469cd049
commit 8b8335f449
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 31 deletions

View file

@ -102,6 +102,7 @@ pub enum MessageStatus {
Pending,
Done,
Error(SharedString),
Canceled,
}
impl MessageStatus {
@ -112,6 +113,7 @@ impl MessageStatus {
Some(proto::context_message_status::Variant::Error(error)) => {
MessageStatus::Error(error.message.into())
}
Some(proto::context_message_status::Variant::Canceled(_)) => MessageStatus::Canceled,
None => MessageStatus::Pending,
}
}
@ -135,6 +137,11 @@ impl MessageStatus {
},
)),
},
MessageStatus::Canceled => proto::ContextMessageStatus {
variant: Some(proto::context_message_status::Variant::Canceled(
proto::context_message_status::Canceled {},
)),
},
}
}
}