From 1fd9f8c259a8a3871d4aaa562c38a6172377fe0f Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Tue, 31 Mar 2026 23:15:14 -0700 Subject: [PATCH] feat(claudbg-vqhj): '/' key focuses filter/search bar Press '/' to immediately focus the filter input on the session-list screen and the search input on the transcript screen, matching the less(1) convention. Updates help modal and placeholder hint text. Co-Authored-By: Claude Sonnet 4.6 --- .beans/claudbg-vqhj--tui-key-focuses-filtersearch-bar.md | 5 +++-- src/tui/modals/help_modal.rs | 9 +++++++-- src/tui/screens/session_list.rs | 4 ++-- src/tui/screens/transcript.rs | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.beans/claudbg-vqhj--tui-key-focuses-filtersearch-bar.md b/.beans/claudbg-vqhj--tui-key-focuses-filtersearch-bar.md index caeca6e..6dde022 100644 --- a/.beans/claudbg-vqhj--tui-key-focuses-filtersearch-bar.md +++ b/.beans/claudbg-vqhj--tui-key-focuses-filtersearch-bar.md @@ -1,10 +1,11 @@ --- # claudbg-vqhj title: 'TUI: ''/'' key focuses filter/search bar' -status: todo +status: in-progress type: feature +priority: normal created_at: 2026-04-01T06:10:47Z -updated_at: 2026-04-01T06:10:47Z +updated_at: 2026-04-01T06:13:37Z --- Pressing '/' in the session list or transcript screen should immediately focus the filter/search input, matching the less(1) convention. Currently 't' and Tab are the only bindings that open the filter. The '/' binding should work on both the session-list screen (opens the filter bar) and the transcript screen (opens the search bar). diff --git a/src/tui/modals/help_modal.rs b/src/tui/modals/help_modal.rs index b0a0143..dff2117 100644 --- a/src/tui/modals/help_modal.rs +++ b/src/tui/modals/help_modal.rs @@ -16,7 +16,7 @@ use crate::tui::state::AppState; /// Dialog dimensions. const DIALOG_WIDTH: u16 = 32; -const DIALOG_HEIGHT: u16 = 20; +const DIALOG_HEIGHT: u16 = 26; /// Compute a centered [`Rect`] of the given size within `area`. fn centered_rect(width: u16, height: u16, area: Rect) -> Rect { @@ -43,9 +43,14 @@ const HELP_TEXT: &str = "\ Tab cycle panes\n\ Enter open/select\n\ Esc go back\n\ +\n\ + Filter (sessions)\n\ + t / / open filter\n\ + Enter apply & close\n\ + Esc clear input\n\ \n\ Search (transcript)\n\ - t open search\n\ + t / / open search\n\ n / N next/prev match\n\ Enter apply & close\n\ Esc clear & close\n\ diff --git a/src/tui/screens/session_list.rs b/src/tui/screens/session_list.rs index ea328d0..8b6749b 100644 --- a/src/tui/screens/session_list.rs +++ b/src/tui/screens/session_list.rs @@ -182,7 +182,7 @@ fn render_filter_bar(f: &mut Frame, area: Rect, state: &AppState) { Line::from(vec![ label, Span::styled( - "Press 't' or Tab to focus — type a query and press Enter", + "Press '/', 't', or Tab to focus — type a query and press Enter", Style::default().fg(Color::DarkGray), ), ]) @@ -259,7 +259,7 @@ pub fn handle_session_list_event(event: Event, state: &mut AppState) -> bool { true } // Focus the filter input directly. - KeyCode::Char('t') => { + KeyCode::Char('t') | KeyCode::Char('/') => { state.focus = Focus::FilterInput; true } diff --git a/src/tui/screens/transcript.rs b/src/tui/screens/transcript.rs index 96fe827..ddc159b 100644 --- a/src/tui/screens/transcript.rs +++ b/src/tui/screens/transcript.rs @@ -584,7 +584,7 @@ pub fn handle_transcript_event(event: Event, state: &mut AppState) -> bool { true } // Jump directly to the search input. - KeyCode::Char('t') => { + KeyCode::Char('t') | KeyCode::Char('/') => { state.focus = Focus::SearchInput; true }