Nit: Pop model effort picker on esc (#4642)
Pops the effort picker instead of dismissing the whole thing (on escape). https://github.com/user-attachments/assets/cef32291-cd07-4ac7-be8f-ce62b38145f9
This commit is contained in:
@@ -1633,7 +1633,7 @@ impl ChatWidget {
|
|||||||
description,
|
description,
|
||||||
is_current,
|
is_current,
|
||||||
actions,
|
actions,
|
||||||
dismiss_on_select: true,
|
dismiss_on_select: false,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1026,6 +1026,29 @@ fn model_reasoning_selection_popup_snapshot() {
|
|||||||
assert_snapshot!("model_reasoning_selection_popup", popup);
|
assert_snapshot!("model_reasoning_selection_popup", popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn reasoning_popup_escape_returns_to_model_popup() {
|
||||||
|
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();
|
||||||
|
|
||||||
|
chat.config.model = "gpt-5".to_string();
|
||||||
|
chat.open_model_popup();
|
||||||
|
|
||||||
|
let presets = builtin_model_presets(None)
|
||||||
|
.into_iter()
|
||||||
|
.filter(|preset| preset.model == "gpt-5-codex")
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
chat.open_reasoning_popup("gpt-5-codex".to_string(), presets);
|
||||||
|
|
||||||
|
let before_escape = render_bottom_popup(&chat, 80);
|
||||||
|
assert!(before_escape.contains("Select Reasoning Level"));
|
||||||
|
|
||||||
|
chat.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
|
||||||
|
|
||||||
|
let after_escape = render_bottom_popup(&chat, 80);
|
||||||
|
assert!(after_escape.contains("Select Model"));
|
||||||
|
assert!(!after_escape.contains("Select Reasoning Level"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn exec_history_extends_previous_when_consecutive() {
|
fn exec_history_extends_previous_when_consecutive() {
|
||||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();
|
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();
|
||||||
|
|||||||
Reference in New Issue
Block a user