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:
dedrisian-oai
2025-10-02 21:07:47 -07:00
committed by GitHub
parent 231c36f8d3
commit 16b6951648
2 changed files with 24 additions and 1 deletions

View File

@@ -1633,7 +1633,7 @@ impl ChatWidget {
description,
is_current,
actions,
dismiss_on_select: true,
dismiss_on_select: false,
..Default::default()
});
}

View File

@@ -1026,6 +1026,29 @@ fn model_reasoning_selection_popup_snapshot() {
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]
fn exec_history_extends_previous_when_consecutive() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();