Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
feat(tui): replace halfblocks fallback with clean text placeholders on basic terminals
Samir Hossainsd307396b79e6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 92dd65c..16e1a9c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -37,8 +37,11 @@- Unified image caching under a shared namespace with automatic cross-namespace lookup across MovieBox, 4KHDHub, IPTV, CircleFTP, and DhakaFlix.- **Streamlined Browse Views**:- Curated `/browse` views into 4 categorized shelves (Popular, Top Rated, Trending, Most Watched) with proper filtering.-- **Terminal Graphics Fallback Overrides**:- - Added `MOVIEBOX_NO_IMAGE=1` and `MOVIEBOX_HALFBLOCKS=1` environment overrides to disable terminal image querying or force Unicode halfblock graphics for SSH, tmux, and slow remote connections.+- **Native Graphics & Clean Text Placeholders**:+ - Replaced noisy halfblock mosaic fallback with clean, organized text cards (`Poster unavailable` in search results, `No Art` in details) on non-graphics terminals.+ - Eliminated ANSI block characters, yellow/white selection redraw bars, and unnecessary background image downloads on basic terminals.+ - Preserved full native high-resolution graphical rendering on Sixel, Kitty, and iTerm2 supported terminals.+ - Added `MOVIEBOX_NO_IMAGE=1` environment override to disable image probing on slow or headless sessions.### Fixed- **Default Audio Track Prioritization (Original / English)**:diff --git a/docs/config.md b/docs/config.mdindex b5123eb..fab2333 100644--- a/docs/config.md+++ b/docs/config.md@@ -33,7 +33,6 @@ macOS `~/Library/Application Support/moviebox-tui`, Linux `~/.config/moviebox-tu| `MOVIEBOX_FOURKHDHUB_URL` | Override the 4KHDHub base URL. || `MOVIEBOX_THEME` | Force a theme (e.g. `Mocha`, `Latte`). || `MOVIEBOX_NO_IMAGE` | Disable poster image queries (set to `1` or `true`). |-| `MOVIEBOX_HALFBLOCKS` | Force halfblock Unicode character graphics for posters (set to `1` or `true`). |## CLIdiff --git a/docs/cross-platform.md b/docs/cross-platform.mdindex e2ac072..cd35e71 100644--- a/docs/cross-platform.md+++ b/docs/cross-platform.md@@ -16,9 +16,7 @@ Supported: macOS, Linux, Windows, and Android (Termux). The codebase usesThe app probes the terminal at startup via `ratatui_image`:-- **Poster rendering**: Sixel / Kitty / iTerm2 / HalfBlocks per terminal support; the- image protocol is re-queried on resize and scroll, and focus changes use a soft- refresh so launching a player does not flash the screen. Users can explicitly disable image querying via `MOVIEBOX_NO_IMAGE=1` or force Unicode halfblock rendering via `MOVIEBOX_HALFBLOCKS=1`.+- **Poster rendering**: High-resolution graphics via Sixel, Kitty, and iTerm2 protocols when supported by the terminal. Non-graphics terminals (e.g. standard Apple Terminal.app, basic xterm) gracefully display clean, aligned text placeholders (`Poster unavailable` / `No Art`) with zero block redraw artifacts. Image queries can be disabled via `MOVIEBOX_NO_IMAGE=1`.- **Terminal classification**: `TERM=dumb`/`linux` fall back to a basic UI.- Focus events (focus loss/gain) are used to re-render in place without clearing.diff --git a/src/main.rs b/src/main.rsindex 557fdfb..f20ef1e 100644--- a/src/main.rs+++ b/src/main.rs@@ -72,7 +72,6 @@ async fn main() -> std::io::Result<()> {println!(" MOVIEBOX_IINA_PATH Custom iina-cli binary path");println!(" MOVIEBOX_FOURKHDHUB_URL Custom 4KHDHub base URL");println!(" MOVIEBOX_NO_IMAGE Disable poster image queries (1/true)");- println!(" MOVIEBOX_HALFBLOCKS Force halfblock terminal graphics (1/true)");return Ok(());}if argsdiff --git a/src/tui/app/navigation.rs b/src/tui/app/navigation.rsindex ce295ed..096a3f4 100644--- a/src/tui/app/navigation.rs+++ b/src/tui/app/navigation.rs@@ -121,12 +121,7 @@ impl App {}pub(super) fn prepare_image_refresh(&mut self) {- if self.state.image_picker.as_ref().is_some_and(|picker| {- !matches!(- picker.protocol_type(),- ratatui_image::picker::ProtocolType::Halfblocks- )- }) {+ if self.state.image_picker.is_some() {self.state.clear_terminal_before_draw = true;}}diff --git a/src/tui/app/run.rs b/src/tui/app/run.rsindex fe1aa63..87d76e1 100644--- a/src/tui/app/run.rs+++ b/src/tui/app/run.rs@@ -14,22 +14,26 @@ impl App {{if self.state.image_picker.is_none() && self.state.image_supported {let picker = if crate::tui::terminal::should_query_images() {- if std::env::var("MOVIEBOX_HALFBLOCKS")- .is_ok_and(|v| v == "1" || v.eq_ignore_ascii_case("true"))- {- ratatui_image::picker::Picker::halfblocks()- } else {- ratatui_image::picker::Picker::from_query_stdio()- .unwrap_or_else(|_| ratatui_image::picker::Picker::halfblocks())- }+ ratatui_image::picker::Picker::from_query_stdio().ok()} else {- ratatui_image::picker::Picker::halfblocks()+ None};- let cell_h = picker.font_size().height;- if cell_h > 0 {- self.state.poster_rows = (96_u16.div_ceil(cell_h)).max(3);+ if let Some(picker) = picker+ && !matches!(+ picker.protocol_type(),+ ratatui_image::picker::ProtocolType::Halfblocks+ )+ {+ let cell_h = picker.font_size().height;+ if cell_h > 0 {+ self.state.poster_rows = (96_u16.div_ceil(cell_h)).max(3);+ }+ self.state.image_picker = Some(picker);+ self.state.image_supported = true;+ } else {+ self.state.image_supported = false;+ self.state.image_picker = None;}- self.state.image_picker = Some(picker);}let mut events = EventHandler::new(Duration::from_millis(100));diff --git a/src/tui/screens/details.rs b/src/tui/screens/details.rsindex b12ebcb..0a7bcd2 100644--- a/src/tui/screens/details.rs+++ b/src/tui/screens/details.rs@@ -301,11 +301,11 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme).border_style(theme.muted);let inner = placeholder_block.inner(poster_area);- let lines = if inner.height >= 5 {- let pad_top = "\n".repeat((inner.height.saturating_sub(5) / 2) as usize);- format!("{pad_top}Poster preview\nunsupported\n\nUse a graphics-\ncapable terminal")+ let lines = if inner.height >= 4 {+ let pad_top = "\n".repeat((inner.height.saturating_sub(2) / 2) as usize);+ format!("{pad_top}No\nPoster")} else {- "Poster\nunsupported".to_string()+ "No Art".to_string()};let placeholder = Paragraph::new(lines)diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rsindex 4da86be..1020fb7 100644--- a/src/tui/screens/home.rs+++ b/src/tui/screens/home.rs@@ -592,7 +592,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)width: 12,height: placeholder_height,};- let placeholder = Paragraph::new("Poster\nunsupported")+ let placeholder = Paragraph::new("Poster\nunavailable").style(theme.text_dim).alignment(Alignment::Center);frame.render_widget(placeholder, p_area);