From 1e1d06328cc9aefa354b7ce463f9f2d254395662 Mon Sep 17 00:00:00 2001 From: Bryan Lee <38807139+liby@users.noreply.github.com> Date: Wed, 8 Jul 2026 01:54:42 +0800 Subject: fix: preserve navigator search commands (#1140) Navigator search treated Escape as either modal close or query reset, which left no way to return to command mode while keeping the filtered row set. `/` also rebuilt search mode by clearing the query, so a user could not resume editing the same filter after backing out. Make Escape leave search focus only, reserve command-mode Escape for closing the picker, and let `/` refocus the existing query. The footer now lists the shortcuts for the active mode so command keys are not advertised while text input owns them. refs #1115 --- src/ui/navigator.rs | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'src/ui') diff --git a/src/ui/navigator.rs b/src/ui/navigator.rs index 5b7b2f37..8bfe6531 100644 --- a/src/ui/navigator.rs +++ b/src/ui/navigator.rs @@ -479,17 +479,30 @@ fn render_footer(app: &AppState, frame: &mut Frame, area: Rect) { let p = &app.palette; let key = Style::default().fg(p.accent).add_modifier(Modifier::BOLD); let dim = Style::default().fg(p.overlay0); - let line = Line::from(vec![ - Span::styled(" enter", key), - Span::styled(" switch ", dim), - Span::styled("/", key), - Span::styled(" search ", dim), - Span::styled("b/w/i/d/a", key), - Span::styled(" states ", dim), - Span::styled("j/k/↑↓", key), - Span::styled(" move ", dim), - Span::styled("esc", key), - Span::styled(" close", dim), - ]); + let line = if app.navigator.search_focused { + Line::from(vec![ + Span::styled(" enter", key), + Span::styled(" switch ", dim), + Span::styled("↑↓", key), + Span::styled(" move ", dim), + Span::styled("ctrl+u", key), + Span::styled(" clear ", dim), + Span::styled("esc", key), + Span::styled(" back", dim), + ]) + } else { + Line::from(vec![ + Span::styled(" enter", key), + Span::styled(" switch ", dim), + Span::styled("/", key), + Span::styled(" search ", dim), + Span::styled("b/w/i/d/a", key), + Span::styled(" states ", dim), + Span::styled("j/k/↑↓", key), + Span::styled(" move ", dim), + Span::styled("esc", key), + Span::styled(" close", dim), + ]) + }; frame.render_widget(Paragraph::new(line), area); } -- cgit v1.2.3