This commit is contained in:
jimmyfraiture
2025-09-08 10:42:56 -07:00
parent fdf52e87c2
commit 10537867ad
2 changed files with 22 additions and 5 deletions
+17
View File
@@ -816,6 +816,12 @@ impl Session {
}
Err(error) => {
warn!("failed to prepare undo patch: {error:#}");
self.clear_last_undo_patch();
self.notify_background_event(
&context.sub_id,
format!("Undo is unavailable for this turn: {error:#}"),
)
.await;
}
}
}
@@ -827,6 +833,17 @@ impl Session {
}
Err(error) => {
warn!("failed to compute unified diff: {error:#}");
if *exit_code == 0 {
self.clear_last_undo_patch();
self
.notify_background_event(
&context.sub_id,
format!(
"Undo is unavailable for this turn: failed to compute diff: {error:#}"
),
)
.await;
}
}
}
}
+5 -5
View File
@@ -1267,21 +1267,21 @@ impl ChatWidget {
tx.send(AppEvent::CodexOp(Op::UndoLastTurnDiff));
})];
let mut items = Vec::new();
items.push(SelectionItem {
let items = vec![
SelectionItem {
name: "Undo last turn diff".to_string(),
description: Some(
"Revert files that Codex changed during the most recent turn.".to_string(),
),
is_current: false,
actions: undo_actions,
});
items.push(SelectionItem {
},
SelectionItem {
name: "Cancel".to_string(),
description: Some("Close without undoing any files.".to_string()),
is_current: false,
actions: Vec::new(),
});
}];
self.bottom_pane.show_selection_view(
"Undo last Codex turn?".to_string(),