assistant: Fix inline assist not restarting transformation after pressing retry (#17301)

Bennet Bo Fenner created

Release Notes:

- Fixed an issue where the inline assist would be dismissed even when
instructed to regenerate the transformation after an error

Change summary

crates/assistant/src/inline_assistant.rs          | 5 ++++-
crates/assistant/src/terminal_inline_assistant.rs | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)

Detailed changes

crates/assistant/src/inline_assistant.rs 🔗

@@ -1794,13 +1794,16 @@ impl PromptEditor {
             CodegenStatus::Pending => {
                 cx.emit(PromptEditorEvent::DismissRequested);
             }
-            CodegenStatus::Done | CodegenStatus::Error(_) => {
+            CodegenStatus::Done => {
                 if self.edited_since_done {
                     cx.emit(PromptEditorEvent::StartRequested);
                 } else {
                     cx.emit(PromptEditorEvent::ConfirmRequested);
                 }
             }
+            CodegenStatus::Error(_) => {
+                cx.emit(PromptEditorEvent::StartRequested);
+            }
         }
     }
 

crates/assistant/src/terminal_inline_assistant.rs 🔗

@@ -805,13 +805,16 @@ impl PromptEditor {
             CodegenStatus::Pending => {
                 cx.emit(PromptEditorEvent::DismissRequested);
             }
-            CodegenStatus::Done | CodegenStatus::Error(_) => {
+            CodegenStatus::Done => {
                 if self.edited_since_done {
                     cx.emit(PromptEditorEvent::StartRequested);
                 } else {
                     cx.emit(PromptEditorEvent::ConfirmRequested);
                 }
             }
+            CodegenStatus::Error(_) => {
+                cx.emit(PromptEditorEvent::StartRequested);
+            }
         }
     }