Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

fix(tui): align search bar header on results screen and remove Ctrl+U shortcut

Samir Hossains90db6005185b
diff --git a/README.md b/README.md
index 7a3b0cd..d5c7316 100644
--- a/README.md
+++ b/README.md
@@ -194,7 +194,6 @@ moviebox-tui
| `r` | Refresh current content |
| `Ctrl+P` | Switch content provider |
| `Ctrl+T` | Toggle IPTV mode |
-| `Ctrl+U` | Clear active search query |
| `?` | Show help |
| `q` | Quit |
diff --git a/src/tui/app/keyboard.rs b/src/tui/app/keyboard.rs
index 03a0a6a..747b9e8 100644
--- a/src/tui/app/keyboard.rs
+++ b/src/tui/app/keyboard.rs
@@ -156,12 +156,6 @@ impl App {
self.action_sender.send(action).ok();
}
}
- KeyCode::Char('u') if key.modifiers.contains(KeyModifiers::CONTROL) => {
- self.state.search_query.clear();
- self.state.suggest_index = None;
- self.state.search_suggestions.clear();
- self.state.last_search_edit = std::time::Instant::now();
- }
KeyCode::Backspace => {
crate::tui::text::remove_last_grapheme(&mut self.state.search_query);
self.state.suggest_index = None;
diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rs
index 3c0cf28..61e61a4 100644
--- a/src/tui/screens/home.rs
+++ b/src/tui/screens/home.rs
@@ -460,9 +460,17 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
.split(area)
};
- let search_width = search_deck_width(area, state, false);
- search_bar_area = centered_width(chunks[0], search_width);
let results_chunk = if has_results { chunks[2] } else { chunks[4] };
+ search_bar_area = if has_results {
+ Rect {
+ x: chunks[0].x + 2,
+ width: chunks[0].width.saturating_sub(4),
+ ..chunks[0]
+ }
+ } else {
+ let search_width = search_deck_width(area, state, false);
+ centered_width(chunks[0], search_width)
+ };
suggestion_area = chunks[2];
render_search_bar(
frame,