experimental_features: make space toggle and enter save popup

This commit is contained in:
pakrym-oai
2026-01-31 22:00:49 -08:00
parent fa566bc1fa
commit a4f5680727
3 changed files with 9 additions and 11 deletions

View File

@@ -178,13 +178,13 @@ impl BottomPaneView for ExperimentalFeaturesView {
code: KeyCode::Char(' '),
modifiers: KeyModifiers::NONE,
..
}
| KeyEvent {
} => self.toggle_selected(),
KeyEvent {
code: KeyCode::Enter,
modifiers: KeyModifiers::NONE,
..
} => self.toggle_selected(),
KeyEvent {
}
| KeyEvent {
code: KeyCode::Esc, ..
} => {
self.on_ctrl_c();
@@ -293,10 +293,8 @@ fn experimental_popup_hint_line() -> Line<'static> {
Line::from(vec![
"Press ".into(),
key_hint::plain(KeyCode::Char(' ')).into(),
" or ".into(),
" to select or ".into(),
key_hint::plain(KeyCode::Enter).into(),
" to toggle; ".into(),
key_hint::plain(KeyCode::Esc).into(),
" to save for next conversation".into(),
])
}

View File

@@ -8,4 +8,4 @@ expression: popup
[ ] Ghost snapshots Capture undo snapshots each turn.
[x] Shell tool Allow the model to run shell commands.
Press space or enter to toggle; esc to save for next conversation
Press space to select or enter to save for next conversation

View File

@@ -2992,14 +2992,14 @@ async fn experimental_features_toggle_saves_on_exit() {
);
chat.bottom_pane.show_view(Box::new(view));
chat.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE));
chat.handle_key_event(KeyEvent::new(KeyCode::Char(' '), KeyModifiers::NONE));
assert!(
rx.try_recv().is_err(),
"expected no updates until exiting the popup"
"expected no updates until saving the popup"
);
chat.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
chat.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE));
let mut updates = None;
while let Ok(event) = rx.try_recv() {