mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 02:20:10 +00:00
assistant: Show more details for assist errors (#20740)
This PR updates the Assistant to show more detailed error messages when the user encounters an assist error. Here are some examples: <img width="415" alt="Screenshot 2024-11-15 at 1 47 03 PM" src="https://github.com/user-attachments/assets/5e7c5d5f-bd78-4af3-86ed-af4c6712770f"> <img width="417" alt="Screenshot 2024-11-15 at 2 11 14 PM" src="https://github.com/user-attachments/assets/02cb659b-1239-4e24-865f-3a512703a94f"> The notification will scroll if the error lines overflow the set maximum height. Release Notes: - Updated the Assistant to show more details in error cases.
This commit is contained in:
parent
4327459d2a
commit
da09cbd055
2 changed files with 6 additions and 2 deletions
|
@ -3920,7 +3920,7 @@ impl ContextEditor {
|
|||
.child(
|
||||
div()
|
||||
.id("error-message")
|
||||
.max_h_24()
|
||||
.max_h_32()
|
||||
.overflow_y_scroll()
|
||||
.child(Label::new(error_message.clone())),
|
||||
)
|
||||
|
|
|
@ -2383,7 +2383,11 @@ impl Context {
|
|||
});
|
||||
Some(error.to_string())
|
||||
} else {
|
||||
let error_message = error.to_string().trim().to_string();
|
||||
let error_message = error
|
||||
.chain()
|
||||
.map(|err| err.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
cx.emit(ContextEvent::ShowAssistError(SharedString::from(
|
||||
error_message.clone(),
|
||||
)));
|
||||
|
|
Loading…
Reference in a new issue