fix(tui): allow navigating filtered results after searching

enter now confirms the search and returns focus to the list so items
can be selected, toggled, etc. pressing / returns to the search bar
with the query intact, esc clears it.
This commit is contained in:
objz committed 2026-04-25 12:40:42 +02:00
1 parent 7c1de45a2a
commit aa19e5bde1
6 files changed
+32

No files matched your search

+9
View File
@@ -225,6 +225,10 @@ pub fn handle_key(key_event: &KeyEvent, state: &mut LogsState) -> bool {
if state.viewer_focused {
if state.viewer_search.active {
match key_event.code {
KeyCode::Enter => {
state.viewer_search.confirm();
state.viewer_scroll = 0;
}
KeyCode::Esc => {
state.viewer_search.deactivate();
state.viewer_scroll = 0;
@@ -288,6 +292,11 @@ pub fn handle_key(key_event: &KeyEvent, state: &mut LogsState) -> bool {
} else {
if state.search.active {
match key_event.code {
KeyCode::Enter => {
state.search.confirm();
state.list_state.selected = Some(0);
state.update_scrollbar();
}
KeyCode::Esc => {
state.search.deactivate();
state.list_state.selected = Some(0);