mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
feat(tui): default reasoning selection to medium (#7040)
## Summary - allow selection popups to request an initial highlighted row - begin the /models reasoning selector focused on the default effort ## Testing - just fmt - just fix -p codex-tui - cargo test -p codex-tui https://github.com/user-attachments/assets/b322aeb1-e8f3-4578-92f7-5c2fa5ee4c98 ------ [Codex Task](https://chatgpt.com/codex/tasks/task_i_691f75e8fc188322a910fbe2138666ef)
This commit is contained in:
@@ -2120,6 +2120,14 @@ impl ChatWidget {
|
||||
} else {
|
||||
default_choice
|
||||
};
|
||||
let selection_choice = highlight_choice.or(default_choice);
|
||||
let initial_selected_idx = choices
|
||||
.iter()
|
||||
.position(|choice| choice.stored == selection_choice)
|
||||
.or_else(|| {
|
||||
selection_choice
|
||||
.and_then(|effort| choices.iter().position(|choice| choice.display == effort))
|
||||
});
|
||||
let mut items: Vec<SelectionItem> = Vec::new();
|
||||
for choice in choices.iter() {
|
||||
let effort = choice.display;
|
||||
@@ -2196,6 +2204,7 @@ impl ChatWidget {
|
||||
header: Box::new(header),
|
||||
footer_hint: Some(standard_popup_hint_line()),
|
||||
items,
|
||||
initial_selected_idx,
|
||||
..Default::default()
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user