Skip to content

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

fix(tui): hide top search bar during loading state

Samir Hossains9e94ce4d9177
diff --git a/src/tui/app/mouse.rs b/src/tui/app/mouse.rs
index a39ba1e..ef859e5 100644
--- a/src/tui/app/mouse.rs
+++ b/src/tui/app/mouse.rs
@@ -247,6 +247,10 @@ impl App {
}
fn handle_home_mouse(&mut self, col: u16, row: u16, area: Rect) -> Option<Action> {
+ if self.state.is_loading && self.state.search_results.is_empty() {
+ return None;
+ }
+
let is_landing = self.state.search_results.is_empty();
let logo_height = if self.state.basic_terminal { 2 } else { 6 };
let search_width =
diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rs
index abcd7ce..f0d8333 100644
--- a/src/tui/screens/home.rs
+++ b/src/tui/screens/home.rs
@@ -453,6 +453,11 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
vertical_chunks[7],
);
} else {
+ if state.is_loading && state.search_results.is_empty() {
+ render_search_state(frame, area, state, theme, SearchViewState::Loading);
+ return;
+ }
+
let has_results = !state.search_results.is_empty();
let suggestion_height =
if state.input_mode == InputMode::Editing && !state.search_suggestions.is_empty() {
@@ -504,9 +509,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
);
let list_block = Block::default();
- if state.is_loading && state.search_results.is_empty() {
- render_search_state(frame, results_chunk, state, theme, SearchViewState::Loading);
- } else if !state.search_results.is_empty() {
+ if !state.search_results.is_empty() {
let poster_width = if state.image_supported {
state.poster_rows.saturating_mul(4).div_ceil(3).max(6)
} else {