From 3803e394a7d76dae0e0003d29a059e12927ca18d Mon Sep 17 00:00:00 2001 From: pakrym-oai Date: Sat, 31 Jan 2026 21:44:57 -0800 Subject: [PATCH] tui: make Enter save experimental features popup --- .../src/bottom_pane/experimental_features_view.rs | 12 +++++++++--- ...atwidget__tests__experimental_features_popup.snap | 2 +- codex-rs/tui/src/chatwidget/tests.rs | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/codex-rs/tui/src/bottom_pane/experimental_features_view.rs b/codex-rs/tui/src/bottom_pane/experimental_features_view.rs index 07cfce163f..e8b1302a37 100644 --- a/codex-rs/tui/src/bottom_pane/experimental_features_view.rs +++ b/codex-rs/tui/src/bottom_pane/experimental_features_view.rs @@ -175,10 +175,16 @@ impl BottomPaneView for ExperimentalFeaturesView { .. } => self.move_down(), KeyEvent { - code: KeyCode::Enter, + code: KeyCode::Char(' '), modifiers: KeyModifiers::NONE, .. } => self.toggle_selected(), + KeyEvent { + code: KeyCode::Enter, + .. + } => { + self.on_ctrl_c(); + } KeyEvent { code: KeyCode::Esc, .. } => { @@ -287,9 +293,9 @@ impl Renderable for ExperimentalFeaturesView { fn experimental_popup_hint_line() -> Line<'static> { Line::from(vec![ "Press ".into(), + key_hint::plain(KeyCode::Char(' ')).into(), + " to toggle, ".into(), key_hint::plain(KeyCode::Enter).into(), - " to toggle or ".into(), - key_hint::plain(KeyCode::Esc).into(), " to save for next conversation".into(), ]) } diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup.snap index 4101717cf9..a1f25ecf5f 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup.snap @@ -8,4 +8,4 @@ expression: popup › [ ] Ghost snapshots Capture undo snapshots each turn. [x] Shell tool Allow the model to run shell commands. - Press enter to toggle or esc to save for next conversation + Press space to toggle, enter to save for next conversation diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index d24504578c..9642314582 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -2992,7 +2992,7 @@ 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(),