aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorBryan Lee <38807139+liby@users.noreply.github.com>2026-07-08 01:54:42 +0800
committerGitHub <noreply@github.com>2026-07-07 20:54:42 +0300
commit1e1d06328cc9aefa354b7ce463f9f2d254395662 (patch)
tree8b1d6bbeab7916a48a9db99e2671e323d1a78b04 /src/ui
parentd0b75de0252ff70a8f43c221b506bf4a0ab3c54d (diff)
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
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/navigator.rs37
1 files changed, 25 insertions, 12 deletions
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);
}