diff --git a/codex-rs/tui/src/bottom_pane/help_view.rs b/codex-rs/tui/src/bottom_pane/help_view.rs index b82ab8f633..e88596acd2 100644 --- a/codex-rs/tui/src/bottom_pane/help_view.rs +++ b/codex-rs/tui/src/bottom_pane/help_view.rs @@ -204,9 +204,9 @@ impl SlashHelpView { return Line::from(vec![ "Search: ".dim(), format!("/{input}").cyan(), - " ".into(), + " | ".dim(), key_hint::plain(KeyCode::Enter).into(), - " apply ".dim(), + " apply | ".dim(), key_hint::plain(KeyCode::Esc).into(), " cancel".dim(), ]); @@ -216,17 +216,22 @@ impl SlashHelpView { key_hint::plain(KeyCode::Up).into(), "/".into(), key_hint::plain(KeyCode::Down).into(), - " scroll ".dim(), + " scroll | [".dim(), key_hint::ctrl(KeyCode::Char('p')).into(), - "/".into(), + " / ".dim(), key_hint::ctrl(KeyCode::Char('n')).into(), - " page ".dim(), - "/ search ".dim(), + "] page | ".dim(), + "/ search".dim(), ]; if !self.search.active_query.is_empty() { - spans.push("n/p match ".dim()); + spans.push(" | ".dim()); + spans.push("n/p match".dim()); } - spans.extend([key_hint::plain(KeyCode::Esc).into(), " close".dim()]); + spans.extend([ + " | ".dim(), + key_hint::plain(KeyCode::Esc).into(), + " close".dim(), + ]); Line::from(spans) } diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output.snap index 5061875738..ca20b0e2df 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output.snap @@ -240,4 +240,4 @@ expression: popup /debug-m-drop - ↑/↓ scroll ctrl + p/ctrl + n page / search esc close 1-232/239 + ↑/↓ scroll | [ctrl + p / ctrl + n] page | / search | esc close 1-232/239 diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output.snap index 8604d08e9d..9752769d79 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output.snap @@ -240,4 +240,4 @@ expression: searching /debug-m-drop - Search: /maintainers enter apply esc cancel 1 match | 1-232/239 + Search: /maintainers | enter apply | esc cancel 1 match | 1-232/239 diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 7dfb92b9af..737fa29c19 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -6043,7 +6043,7 @@ async fn slash_help_search_jumps_to_lower_match() { let popup = render_bottom_popup(&chat, 100); assert!(popup.contains("/feedback")); - assert!(popup.contains("1/1 |")); + assert!(popup.contains("n/p match")); } #[tokio::test] @@ -6060,24 +6060,24 @@ async fn slash_help_search_navigates_matches_with_n_and_p() { chat.handle_key_event(KeyEvent::from(KeyCode::Enter)); let first = render_bottom_popup(&chat, 100); - assert!(first.contains("1/3 |")); + assert!(first.contains("n/p match")); + assert!(first.contains("/fast")); chat.handle_key_event(KeyEvent::from(KeyCode::Char('n'))); let second = render_bottom_popup(&chat, 100); - assert!(second.contains("2/3 |")); + assert!(second.contains("/experimental")); chat.handle_key_event(KeyEvent::from(KeyCode::Char('n'))); let third = render_bottom_popup(&chat, 100); - assert!(third.contains("3/3 |")); assert!(third.contains("/realtime")); chat.handle_key_event(KeyEvent::from(KeyCode::Char('p'))); let previous = render_bottom_popup(&chat, 100); - assert!(previous.contains("2/3 |")); + assert!(previous.contains("/experimental")); chat.handle_key_event(KeyEvent::new(KeyCode::Char('N'), KeyModifiers::SHIFT)); let shifted_previous = render_bottom_popup(&chat, 100); - assert!(shifted_previous.contains("1/3 |")); + assert!(shifted_previous.contains("/fast")); } #[tokio::test] @@ -6092,7 +6092,6 @@ async fn slash_help_search_restarts_from_empty_input() { chat.handle_key_event(KeyEvent::from(KeyCode::Enter)); let active = render_bottom_popup(&chat, 100); - assert!(active.contains("1/1 |")); assert!(active.contains("n/p match")); chat.handle_key_event(KeyEvent::from(KeyCode::Char('/'))); @@ -6126,7 +6125,7 @@ async fn slash_help_esc_clears_active_search_before_dismissing_popup() { chat.handle_key_event(KeyEvent::from(KeyCode::Enter)); let active = render_bottom_popup(&chat, 100); - assert!(active.contains("1/3 |")); + assert!(active.contains("n/p match")); assert!(chat.bottom_pane.has_active_view()); chat.handle_key_event(KeyEvent::from(KeyCode::Esc));