Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
fix(tui): streamline notification messages and remove clear button on empty history
Samir Hossainsb70e9171cf7a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f3e43d9..7fa6ed2 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -71,6 +71,10 @@- Balanced search result card layout across three vertical rows: Row 1 displays title and resolution badge, Row 2 displays rating, release year, and media type, and Row 3 displays provider badge and genres/loading state.- Aligned all 3 rows of text with the 3 rows of the poster placeholder (`╭──────╮` on Row 1, `│ No Art │` on Row 2, `╰──────╯` on Row 3), eliminating the hanging bottom border and empty-line visual disconnect.### Fixed+- **History and Favorites Search Settle State**:+ - Set `has_search_settled` to `true` when querying `/history`, `/favorites`, and TV `/list`, preventing an empty watch history or favorites list from being permanently trapped in a `Searching for “...”` loading spinner.+ - Suppressed search action pills entirely on empty `/history` and `/favorites` views, cleanly presenting the empty state message without clutter.+ - Shortened and streamlined notification copy across commands (`Unknown command '{cmd}'. Type '/' for list.`), mode switches, playback guards, and settings actions to fit cleanly into compact notification cards.- **Details Screen Selector Panes Tight Label Highlighting**:- Replaced wide full-width block highlight bars across Audio, Seasons, and Episodes selector panes with compact, text-bounded highlight pills, eliminating awkward empty horizontal background strips across the lists.- **Stream Table Migration to Native Ratatui Table Architecture**:diff --git a/src/tui/app/favorites.rs b/src/tui/app/favorites.rsindex ade6dd5..4b19ba9 100644--- a/src/tui/app/favorites.rs+++ b/src/tui/app/favorites.rs@@ -243,6 +243,7 @@ impl App {pub(super) fn load_favorites_virtual_list(&mut self) {self.state.input_mode = InputMode::Normal;self.state.is_loading = false;+ self.state.has_search_settled = true;self.state.is_homepage_mode = false;self.state.active_browse_preset = None;self.state.browse_metrics.clear();diff --git a/src/tui/app/playback.rs b/src/tui/app/playback.rsindex 4607828..538f919 100644--- a/src/tui/app/playback.rs+++ b/src/tui/app/playback.rs@@ -222,7 +222,7 @@ impl App {self.state.notify(NotificationKind::Error,"Unsupported stream",- "Only HTTP and HTTPS stream protocols are supported for playback.",+ "Only HTTP/HTTPS streams supported.",);return;}@@ -460,8 +460,8 @@ impl App {if self.state.is_playing {self.state.notify(NotificationKind::Warning,- "Playback already active",- "Stop the current player before starting another.",+ "Playback active",+ "Player is already running.",);return None;}@@ -701,8 +701,8 @@ impl App {if self.state.is_playing {self.state.notify(NotificationKind::Warning,- "Playback already active",- "Stop the current player before starting another.",+ "Playback active",+ "Player is already running.",);return None;}diff --git a/src/tui/app/requests.rs b/src/tui/app/requests.rsindex 35a6260..ecf25c1 100644--- a/src/tui/app/requests.rs+++ b/src/tui/app/requests.rs@@ -136,6 +136,7 @@ impl App {{self.state.input_mode = InputMode::Normal;self.state.is_loading = false;+ self.state.has_search_settled = true;self.state.is_homepage_mode = false;self.state.active_browse_preset = None;self.state.browse_metrics.clear();diff --git a/src/tui/app/search.rs b/src/tui/app/search.rsindex f5d7787..00f9748 100644--- a/src/tui/app/search.rs+++ b/src/tui/app/search.rs@@ -48,6 +48,7 @@ impl App {}).collect();self.state.is_loading = false;+ self.state.has_search_settled = true;self.state.search_list_state.select(if self.state.search_results.is_empty() {@@ -87,7 +88,7 @@ impl App {self.state.notify(NotificationKind::Warning,"Unknown Command",- format!("Command '{cmd_name}' is not recognized. Type '/' to view available commands."),+ format!("Unknown command '{cmd_name}'. Type '/' for list."),);return Some(true);}@@ -147,7 +148,7 @@ impl App {self.state.notify(NotificationKind::Info,"TV Mode",- format!("Command /browse is available in Streaming Mode ({ctrl_s})."),+ format!("Available in Streaming Mode ({ctrl_s})."),);} else {self.action_sender.send(Action::ShowBrowseMenu).ok();@@ -159,7 +160,7 @@ impl App {self.state.notify(NotificationKind::Info,"TV Mode",- format!("Command /history is available in Streaming Mode ({ctrl_s})."),+ format!("Available in Streaming Mode ({ctrl_s})."),);Some(true)} else {@@ -171,7 +172,7 @@ impl App {self.state.notify(NotificationKind::Info,"TV Mode",- format!("Command /favorites is available in Streaming Mode ({ctrl_s})."),+ format!("Available in Streaming Mode ({ctrl_s})."),);Some(true)} else {@@ -185,9 +186,7 @@ impl App {self.state.notify(NotificationKind::Info,"TV Mode",- format!(- "Command /list is only available in TV Mode. Switch with {ctrl_t}."- ),+ format!("Available in TV Mode ({ctrl_t})."),);}Some(true)diff --git a/src/tui/app/system.rs b/src/tui/app/system.rsindex e85bda3..22a041e 100644--- a/src/tui/app/system.rs+++ b/src/tui/app/system.rs@@ -253,14 +253,14 @@ impl App {self.state.notify(NotificationKind::Success,"Cache Cleared",- "Temporary cache cleared. Reloading TV playlists...",+ "Cache cleared. Reloading playlists...",);self.reload_tv_playlists();} else {self.state.notify(NotificationKind::Success,"Cache Cleared",- "All temporary cache files cleared completely.",+ "Temporary cache files cleared.",);}}@@ -358,7 +358,7 @@ impl App {self.state.notify(NotificationKind::Warning,"Streaming Mode",- "Cannot disable: at least one mode must remain active.",+ "At least one mode must remain active.",);} else {self.state.streaming_enabled = enable_req;@@ -382,7 +382,7 @@ impl App {self.state.notify(NotificationKind::Warning,"Live TV Mode",- "Cannot disable: at least one mode must remain active.",+ "At least one mode must remain active.",);} else {self.state.tv_enabled = enable_req;@@ -487,7 +487,7 @@ impl App {self.state.notify(NotificationKind::Warning,"Streaming Mode",- "Cannot disable: at least one mode must remain active.",+ "At least one mode must remain active.",);} else {self.state.streaming_enabled = enable_req;@@ -511,7 +511,7 @@ impl App {self.state.notify(NotificationKind::Warning,"Live TV Mode",- "Cannot disable: at least one mode must remain active.",+ "At least one mode must remain active.",);} else {self.state.tv_enabled = enable_req;@@ -592,7 +592,7 @@ impl App {self.state.notify(NotificationKind::Warning,"Browser Launch Failed",- format!("Could not open browser: {error}\n{REPO_URL}"),+ format!("Could not open browser: {error}"),);}}diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rsindex b1b8fd8..25dc944 100644--- a/src/tui/screens/home.rs+++ b/src/tui/screens/home.rs@@ -240,7 +240,12 @@ fn render_search_state(let is_compact_btn = area.width < 56;let sep = if is_compact_btn { " " } else { " " };- let pills = if state.is_tv_mode {+ let is_history_or_fav = state.search_query.trim().eq_ignore_ascii_case("/history")+ || state.search_query.trim().eq_ignore_ascii_case("/favorites")+ || state.search_query.trim().eq_ignore_ascii_case("/fav");+ let pills = if is_history_or_fav {+ vec![]+ } else if state.is_tv_mode {let (btn1_label, btn2_label) = if is_compact_btn {("[ Reload (", "[ Clear (")} else {@@ -292,7 +297,9 @@ fn render_search_state(]};- lines.push(Line::from(pills));+ if !pills.is_empty() {+ lines.push(Line::from(pills));+ }}SearchViewState::Error => {let symbol = if state.basic_terminal { "!" } else { "×" };diff --git a/tests/history_audit.rs b/tests/history_audit.rsindex 574d09e..951fb63 100644--- a/tests/history_audit.rs+++ b/tests/history_audit.rs@@ -427,6 +427,22 @@ async fn test_history_slash_command_populates_search_results_accurately() {assert!(providers.contains(&ProviderKind::MovieBox));assert!(providers.contains(&ProviderKind::Addons));}++#[tokio::test]+async fn test_empty_history_slash_command_settles_search_state() {+ let mut app = App::new();+ app.state_mut().history.clear();+ app.state_mut().active_screen = Screen::Home;+ app.handle_action(Action::Search {+ query: "/history".to_string(),+ force_refresh: false,+ })+ .await;++ assert!(app.state().search_results.is_empty());+ assert!(!app.state().is_loading);+ assert!(app.state().has_search_settled);+}#[test]fn test_update_progress_precision_preservation() {let mut manager = HistoryManager::default();