tui: clean up slash help footer hints

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charles Cunningham
2026-03-13 04:54:32 -07:00
parent e477780626
commit 2268f98488
4 changed files with 22 additions and 18 deletions

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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

View File

@@ -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));