Inline Assist: replace "accept" action on generation error with "restart" (#15476)
Release Notes: - N/A
This commit is contained in:
parent
530feecdaa
commit
21ebbc387a
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue