Inline Assist: replace "accept" action on generation error with "restart" (#15476)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-07-30 13:40:22 +02:00 committed by GitHub
parent 530feecdaa
commit 21ebbc387a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1219,7 +1219,8 @@ impl EventEmitter<PromptEditorEvent> for PromptEditor {}
impl Render for PromptEditor {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
let gutter_dimensions = *self.gutter_dimensions.lock();
let buttons = match &self.codegen.read(cx).status {
let status = &self.codegen.read(cx).status;
let buttons = match status {
CodegenStatus::Idle => {
vec![
IconButton::new("cancel", IconName::Close)
@ -1272,7 +1273,7 @@ impl Render for PromptEditor {
.on_click(
cx.listener(|_, _, cx| cx.emit(PromptEditorEvent::CancelRequested)),
),
if self.edited_since_done {
if self.edited_since_done || matches!(status, CodegenStatus::Error(_)) {
IconButton::new("restart", IconName::RotateCw)
.icon_color(Color::Info)
.shape(IconButtonShape::Square)