mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
V3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user