Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
UI/UX: Deep visual polish and widget safety overhaul
Samir Hossainsa212a567abcf
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8cffe8b..e43be72 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -134,6 +134,15 @@chunk before rendering search cards, eliminating ghost text artifacts (such as ASCIIheaders or landing row labels) bleeding through beneath unselected cards in multi-column grids.- **Modal key trapping & isolation**: structural modal gating prevents mode+- **Search dropdown alignment & bleed**: Pinned the suggestion dropdown position to the search bar for stability, fixed layout starvation edge cases allowing background colors to bleed, and padded visual pill badges to standard widths.+- **Search bar view normalization**: Search bar correctly fills terminal width rather than floating when active in empty, No Results, and Error states.+- **Centered text-aligned error cards**: Replaced per-line centering on multiline diagnostic error states with block-level centering containing cleanly left-aligned text, making diagnostics far more readable.+- **Adaptive No Results layout**: Wrapped action pill shortcuts (`[Ctrl+P]`, `[/browse]`, `[Ctrl+U]`) across multiple lines rather than clipping on terminal windows narrower than 76 columns.+- **Text poster fallback clamp**: Fixed an edge case where text-based "No Poster" fallbacks expanded beyond visual limits in compact window modes.+- **Results metadata line truncation**: Added defensive truncation across styled multi-span metadata lines in search results to protect multi-column layouts from overflow crashes.+- **TV & Addon Manager visual polish**: Aligned the selection cursor perfectly in TV playlist manager without introducing a visual shift, and switched the Addon Manager to `render_stateful_widget` enabling deep scrolling with vertical scrollbars.+- **Dual-column Help overlay layout**: Implemented a responsive two-column Help layout for wide viewports (>=90 cols), fitting the entire Help guide on one screen without scrolling.+- **Picker & Stream list mouse offsets**: Rectified a bounds calculation mapping `click_in_picker` to the popup height instead of the active screen area which restricted clicks, and repaired stream-row mouse tracking which was previously ignoring `stream_scroll` offsets.chords (`Ctrl+T`, `Ctrl+A`, `Ctrl+S`, `Ctrl+P`), download cancellation (`x`),and background pane navigation from leaking into open dialogs and inputs.- **Modal exact clears**: replaced 3-column halo clear with exact popup bounding boxdiff --git a/src/tui/app/mouse.rs b/src/tui/app/mouse.rsindex 5b5d092..278bd6a 100644--- a/src/tui/app/mouse.rs+++ b/src/tui/app/mouse.rs@@ -60,6 +60,7 @@ impl App {row,&self.state.theme_list_state,items.len(),+ area,) {Some(Some(clicked_idx)) => {self.state.theme_list_state.select(Some(clicked_idx));@@ -103,6 +104,7 @@ impl App {row,&self.state.browse_list_state,browse_items.len(),+ area,) {Some(Some(clicked_idx)) => {self.state.browse_list_state.select(Some(clicked_idx));@@ -170,6 +172,7 @@ impl App {row,&self.state.player_picker_state,items.len(),+ area,) {Some(Some(clicked_idx)) => {self.state.player_picker_state.select(Some(clicked_idx));@@ -207,6 +210,7 @@ impl App {row,&self.state.subtitle_list_state,items.len(),+ area,) {Some(Some(clicked_idx)) => {self.state.subtitle_list_state.select(Some(clicked_idx));@@ -817,7 +821,9 @@ impl App {.cloned().unwrap_or_default();- let clicked_stream_row = row.saturating_sub(streams_area.y + 1);+ let clicked_stream_row = row+ .saturating_sub(streams_area.y + 1)+ .saturating_add(self.state.resource_list_state.offset() as u16);let mut line_offset = 0_u16;let mut prev_resolution = None;let mut matched_idx = None;@@ -988,11 +994,12 @@ fn click_in_picker(row: u16,state: &ratatui::widgets::ListState,total_items: usize,+ area: Rect,) -> Option<Option<usize>> {if !popup.contains(ratatui::layout::Position::new(col, row)) {return None;}- let visible_rows = total_items.clamp(1, crate::tui::overlay::max_picker_rows(popup));+ let visible_rows = total_items.clamp(1, crate::tui::overlay::max_picker_rows(area));let offset = state.offset();let item_y = popup.y.saturating_add(1);if row >= item_y && (row - item_y) < visible_rows as u16 {diff --git a/src/tui/app/run.rs b/src/tui/app/run.rsindex 0d1771b..c7c55c7 100644--- a/src/tui/app/run.rs+++ b/src/tui/app/run.rs@@ -646,7 +646,16 @@ impl App {};let gauge = Gauge::default()- .block(Block::default().borders(Borders::ALL).title(title_text))+ .block(+ Block::default()+ .borders(Borders::ALL)+ .title(title_text)+ .border_style(self.theme.lavender)+ .title_style(self.theme.title)+ .border_type(crate::tui::overlay::border_type(+ self.state.basic_terminal,+ )),+ ).gauge_style(self.theme.accent).ratio((prog / 100.0).clamp(0.0, 1.0));diff --git a/src/tui/screens/help.rs b/src/tui/screens/help.rsindex c374997..8e74a14 100644--- a/src/tui/screens/help.rs+++ b/src/tui/screens/help.rs@@ -259,10 +259,17 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {]));let content_width = help_text.iter().map(Line::width).max().unwrap_or(42) as u16;- let total_lines = help_text.len() as u16;let capacity = area.height.saturating_sub(6).max(4) as usize;- if total_lines as usize > capacity {+ let two_columns = area.width >= 90;++ let required_lines = if two_columns {+ help_text.len().div_ceil(2)+ } else {+ help_text.len()+ };++ if required_lines > capacity && !two_columns {let max_scroll = help_text.len().saturating_sub(capacity);let scroll = state.help_scroll.min(max_scroll);let window: Vec<Line> = help_text[scroll..scroll + capacity.min(help_text.len())].to_vec();@@ -294,19 +301,13 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {return;}- let two_columns = total_lines as usize > capacity;-let desired_width = if two_columns {content_width.saturating_mul(2).saturating_add(8)} else {content_width.saturating_add(4)};- let desired_height = if two_columns {- total_lines.div_ceil(2) + 2- } else {- total_lines + 2- };+ let desired_height = required_lines as u16 + 2;let popup_chunk = crate::tui::overlay::centered(area, desired_width, desired_height, 46, 120);diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rsindex 4813a82..7dbce99 100644--- a/src/tui/screens/home.rs+++ b/src/tui/screens/home.rs@@ -236,7 +236,7 @@ fn render_search_state(return;}- let card_width = area.width.min(64);+ let mut card_width = area.width.min(64);let query = crate::tui::text::truncate_width(&state.search_query,card_width.saturating_sub(10) as usize,@@ -308,22 +308,43 @@ fn render_search_state(Span::styled(msg, theme.text),]));lines.push(Line::from(""));- lines.push(Line::from(vec![- Span::styled("[", theme.text_dim),- Span::styled(&ctrl_p, theme.shortcut),- Span::styled("] ", theme.text_dim),- Span::styled("Switch provider", theme.text_dim),- Span::styled(bullet, theme.text_dim),- Span::styled("[", theme.text_dim),- Span::styled("/browse", theme.shortcut),- Span::styled("] ", theme.text_dim),- Span::styled("Browse categories", theme.text_dim),- Span::styled(bullet, theme.text_dim),- Span::styled("[", theme.text_dim),- Span::styled(&ctrl_u, theme.shortcut),- Span::styled("] ", theme.text_dim),- Span::styled("Clear", theme.text_dim),- ]));+ if area.width < 76 {+ lines.push(Line::from(vec![+ Span::styled("[", theme.text_dim),+ Span::styled(&ctrl_p, theme.shortcut),+ Span::styled("] ", theme.text_dim),+ Span::styled("Switch provider", theme.text_dim),+ ]));+ lines.push(Line::from(vec![+ Span::styled("[", theme.text_dim),+ Span::styled("/browse", theme.shortcut),+ Span::styled("] ", theme.text_dim),+ Span::styled("Browse categories", theme.text_dim),+ ]));+ lines.push(Line::from(vec![+ Span::styled("[", theme.text_dim),+ Span::styled(&ctrl_u, theme.shortcut),+ Span::styled("] ", theme.text_dim),+ Span::styled("Clear", theme.text_dim),+ ]));+ } else {+ lines.push(Line::from(vec![+ Span::styled("[", theme.text_dim),+ Span::styled(&ctrl_p, theme.shortcut),+ Span::styled("] ", theme.text_dim),+ Span::styled("Switch provider", theme.text_dim),+ Span::styled(bullet, theme.text_dim),+ Span::styled("[", theme.text_dim),+ Span::styled("/browse", theme.shortcut),+ Span::styled("] ", theme.text_dim),+ Span::styled("Browse categories", theme.text_dim),+ Span::styled(bullet, theme.text_dim),+ Span::styled("[", theme.text_dim),+ Span::styled(&ctrl_u, theme.shortcut),+ Span::styled("] ", theme.text_dim),+ Span::styled("Clear", theme.text_dim),+ ]));+ }}SearchViewState::Error => {let symbol = if state.basic_terminal { "!" } else { "×" };@@ -377,6 +398,11 @@ fn render_search_state(_ => return,};+ let max_line_width = lines.iter().map(|l| l.width()).max().unwrap_or(0) as u16;+ if matches!(view, SearchViewState::Error | SearchViewState::NoResults) {+ card_width = max_line_width.clamp(20, area.width.min(64));+ }+let card_height = (lines.len() as u16).min(area.height);let card = Rect {x: area.x + area.width.saturating_sub(card_width) / 2,@@ -385,7 +411,13 @@ fn render_search_state(height: card_height,};- frame.render_widget(Paragraph::new(lines).alignment(Alignment::Center), card);+ let alignment = if matches!(view, SearchViewState::Error | SearchViewState::NoResults) {+ Alignment::Left+ } else {+ Alignment::Center+ };++ frame.render_widget(Paragraph::new(lines).alignment(alignment), card);}fn render_favorites_landing(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {if area.height < 2 || area.width < 20 {@@ -859,15 +891,10 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)};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)+ search_bar_area = Rect {+ x: chunks[0].x + 2,+ width: chunks[0].width.saturating_sub(4),+ ..chunks[0]};render_search_bar(frame,diff --git a/src/tui/widgets/input.rs b/src/tui/widgets/input.rsindex 3873d05..233b910 100644--- a/src/tui/widgets/input.rs+++ b/src/tui/widgets/input.rs@@ -27,7 +27,7 @@ pub fn render_single_line_input(let mut before_cursor: String = segments[start..cursor].concat();if start > 0 && before_cursor.chars().count() > 3 {- before_cursor = format!("...{}", &before_cursor[3..]);+ before_cursor = format!("...{}", before_cursor.chars().skip(3).collect::<String>());}let cursor_char = if cursor < segments.len() {