Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
feat(tui): cursor shape, basic glyph sweep, notification click-dismiss, and draw decomposition
Samir Hossainsec45232488ae
diff --git a/src/main.rs b/src/main.rsindex 17d83f6..1e1998d 100644--- a/src/main.rs+++ b/src/main.rs@@ -9,6 +9,7 @@ struct TerminalGuard;fn restore_terminal() {let _ = crossterm::execute!(std::io::stdout(),+ crossterm::cursor::SetCursorStyle::DefaultUserShape,crossterm::cursor::Show,crossterm::event::DisableMouseCapture,crossterm::event::DisableFocusChange,diff --git a/src/tui/app/favorites.rs b/src/tui/app/favorites.rsindex 20f98dd..1b2360f 100644--- a/src/tui/app/favorites.rs+++ b/src/tui/app/favorites.rs@@ -180,7 +180,7 @@ impl App {.get(&subject_id).or_else(|| self.state.search_posters.get(&subject_id)){- self.state.poster_image = Some((**cached).clone());+ self.state.poster_image = Some(std::sync::Arc::clone(cached));} else {self.state.poster_image = None;}diff --git a/src/tui/app/mouse.rs b/src/tui/app/mouse.rsindex 7d52d59..10ba793 100644--- a/src/tui/app/mouse.rs+++ b/src/tui/app/mouse.rs@@ -26,6 +26,32 @@ impl App {}fn handle_overlay_mouse(&mut self, col: u16, row: u16, area: Rect) -> bool {+ if !self.state.notifications.is_empty() {+ let rects = crate::tui::overlay::notification_rects(+ area,+ &self.state.notifications,+ self.state.basic_terminal,+ );+ for (idx, rect) in rects {+ if rect.contains(ratatui::layout::Position::new(col, row)) {+ self.state.notifications.remove(idx);+ return true;+ }+ }+ }++ if self.state.download_progress.is_some() {+ let chunks = Layout::default()+ .direction(Direction::Vertical)+ .constraints([Constraint::Min(1), Constraint::Length(3)])+ .split(area);+ let dl_area = chunks[1];+ if dl_area.contains(ratatui::layout::Position::new(col, row)) {+ self.action_sender.send(Action::CancelDownload).ok();+ return true;+ }+ }+if self.state.show_theme_popup {let items: Vec<String> = crate::tui::theme::AVAILABLE_THEMES.iter()@@ -314,12 +340,7 @@ impl App {self.addon_manager_activate();}} else if row == button_y {- let rel_x = col.saturating_sub(popup.x + 1);- if rel_x <= 25 {- self.state.addon_manager_selected = addons_count + 1;- } else {- self.state.addon_manager_selected = addons_count + 2;- }+ self.state.addon_manager_selected = addons_count + 1;self.addon_manager_activate();}}@@ -974,7 +995,7 @@ fn click_in_picker(if !popup.contains(ratatui::layout::Position::new(col, row)) {return None;}- let visible_rows = total_items.clamp(1, 8);+ let visible_rows = total_items.clamp(1, crate::tui::overlay::max_picker_rows(popup));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/navigation.rs b/src/tui/app/navigation.rsindex d71e214..1983d4c 100644--- a/src/tui/app/navigation.rs+++ b/src/tui/app/navigation.rs@@ -871,7 +871,7 @@ impl App {.get(&item.id).or_else(|| self.state.search_posters.get(&item.id)){- self.state.poster_image = Some((**cached).clone());+ self.state.poster_image = Some(std::sync::Arc::clone(cached));} else {self.state.poster_image = None;}diff --git a/src/tui/app/requests.rs b/src/tui/app/requests.rsindex 7da8973..3579624 100644--- a/src/tui/app/requests.rs+++ b/src/tui/app/requests.rs@@ -707,7 +707,7 @@ impl App {self.state.poster_image = None;self.state.poster_protocol = None;if let Some(img) = self.state.image_cache.get(&id) {- self.state.poster_image = Some((**img).clone());+ self.state.poster_image = Some(std::sync::Arc::clone(img));} else if let Some(url) = cached.get("cover").and_then(|c| c.get("url"))@@ -822,7 +822,7 @@ impl App {self.state.poster_image = None;self.state.poster_protocol = None;if let Some(cached_img) = self.state.image_cache.get(&id) {- self.state.poster_image = Some((**cached_img).clone());+ self.state.poster_image = Some(std::sync::Arc::clone(cached_img));} else if let Some(url) = crate::tui::app::playback::extract_cover_url(&json) {self.state.history.update_cover_url(&id, &url);let url_clone = url.to_string();@@ -877,7 +877,7 @@ impl App {};if current_id.as_deref() == Some(id.as_str()) {- self.state.poster_image = Some((*img).clone());+ self.state.poster_image = Some(img);self.state.poster_protocol = None;}}@@ -1051,7 +1051,7 @@ impl App {.get(&id).or_else(|| self.state.search_posters.get(&id)){- self.state.poster_image = Some((**cached_img).clone());+ self.state.poster_image = Some(std::sync::Arc::clone(cached_img));} else if let Some(url) = crate::tui::app::playback::extract_cover_url(&payload){self.state.history.update_cover_url(&id, &url);@@ -1297,7 +1297,7 @@ impl App {.get(&id).or_else(|| self.state.search_posters.get(&id)){- self.state.poster_image = Some((**cached_img).clone());+ self.state.poster_image = Some(std::sync::Arc::clone(cached_img));} else if let Some(details) = &self.state.selected_details {if let Some(url) =crate::tui::app::playback::extract_cover_url(details)diff --git a/src/tui/app/run.rs b/src/tui/app/run.rsindex 238cba4..7c1b79c 100644--- a/src/tui/app/run.rs+++ b/src/tui/app/run.rs@@ -5,7 +5,7 @@ use crate::tui::{event::EventHandler,state::{InputMode, Screen},};-use ratatui::Frame;+use ratatui::{Frame, layout::Rect};use std::time::Duration;enum ForcedProtocol {@@ -67,6 +67,18 @@ impl App {}loop {+ let want_beam =+ self.state.input_mode == InputMode::Editing && !self.state.basic_terminal;+ if want_beam != self.state.cursor_beam {+ use crossterm::cursor::SetCursorStyle;+ let style = if want_beam {+ SetCursorStyle::SteadyBar+ } else {+ SetCursorStyle::DefaultUserShape+ };+ let _ = crossterm::execute!(std::io::stdout(), style);+ self.state.cursor_beam = want_beam;+ }self.state.normalize_result_view();if self.state.clear_terminal_before_draw {if let Err(err) = terminal.clear() {@@ -450,6 +462,65 @@ impl App {pub fn draw(&mut self, frame: &mut Frame) {let area = frame.area();+ if self.draw_resize_badge(frame, area) {+ return;+ }++ if self.draw_too_small_gate(frame, area) {+ return;+ }++ let mut main_area = frame.area();+ let mut download_area = None;++ if self.state.download_progress.is_some() {+ use ratatui::layout::{Constraint, Direction, Layout};+ let chunks = Layout::default()+ .direction(Direction::Vertical)+ .constraints([Constraint::Min(0), Constraint::Length(3)])+ .split(main_area);++ main_area = chunks[0];+ download_area = Some(chunks[1]);+ }++ let screen_area = ratatui::layout::Rect {+ height: main_area.height.saturating_sub(1),+ ..main_area+ };+ match self.state.active_screen {+ Screen::Home => {+ crate::tui::screens::home::draw(frame, screen_area, &mut self.state, &self.theme);+ }+ Screen::Details => {+ crate::tui::screens::details::draw(+ frame,+ screen_area,+ &mut self.state,+ &self.theme,+ );+ }+ }++ if self.state.show_help {+ crate::tui::screens::help::draw(frame, main_area, &self.state, &self.theme);+ }++ self.draw_status_strip(frame, area);+ self.draw_download_gauge(frame, download_area);+ self.draw_theme_picker(frame, area);+ self.draw_update_modal(frame, area);++ crate::tui::overlay::notifications(+ frame,+ area,+ &self.state.notifications,+ &self.theme,+ self.state.basic_terminal,+ );+ }++ fn draw_resize_badge(&self, frame: &mut Frame, area: Rect) -> bool {if let Some((_, w, h)) = self.state.last_resize_time {let sep = if self.state.basic_terminal { "x" } else { "×" };let label = format!("{} {} {}", w, sep, h);@@ -473,16 +544,20 @@ impl App {.alignment(ratatui::layout::Alignment::Center),badge_area,);- return;+ true+ } else {+ false}+ }+ fn draw_too_small_gate(&self, frame: &mut Frame, area: Rect) -> bool {if area.width < 50 || area.height < 14 {use ratatui::layout::Alignment;use ratatui::text::Line;use ratatui::widgets::{Block, Borders, Paragraph};if area.width < 4 || area.height < 2 {- return;+ return true;}if area.width < 25 || area.height < 5 {@@ -490,7 +565,7 @@ impl App {.style(self.theme.lavender).alignment(Alignment::Center);frame.render_widget(p, area);- return;+ return true;}let msg_lines = vec![@@ -518,54 +593,23 @@ impl App {.alignment(Alignment::Center);frame.render_widget(p, area);- return;- }-- let mut main_area = frame.area();- let mut download_area = None;-- if self.state.download_progress.is_some() {- use ratatui::layout::{Constraint, Direction, Layout};- let chunks = Layout::default()- .direction(Direction::Vertical)- .constraints([Constraint::Min(0), Constraint::Length(3)])- .split(main_area);-- main_area = chunks[0];- download_area = Some(chunks[1]);- }-- let screen_area = ratatui::layout::Rect {- height: main_area.height.saturating_sub(1),- ..main_area- };- match self.state.active_screen {- Screen::Home => {- crate::tui::screens::home::draw(frame, screen_area, &mut self.state, &self.theme);- }- Screen::Details => {- crate::tui::screens::details::draw(- frame,- screen_area,- &mut self.state,- &self.theme,- );- }+ true+ } else {+ false}+ }- if self.state.show_help {- crate::tui::screens::help::draw(frame, main_area, &self.state, &self.theme);- }+ fn draw_status_strip(&self, frame: &mut Frame, area: Rect) {if self.state.status_timer > 0 && !self.state.status_message.is_empty() {- let bottom = frame.area().height.saturating_sub(1);+ let bottom = area.height.saturating_sub(1);let message = crate::tui::text::truncate_width(- &self.state.status_message.clone(),- (frame.area().width as usize).saturating_sub(4),+ &self.state.status_message,+ (area.width as usize).saturating_sub(4),);let strip_area = ratatui::layout::Rect {x: 0,y: bottom,- width: frame.area().width,+ width: area.width,height: 1,};frame.render_widget(@@ -575,7 +619,9 @@ impl App {strip_area,);}+ }+ fn draw_download_gauge(&self, frame: &mut Frame, download_area: Option<Rect>) {if let Some(prog) = self.state.download_progress {if let Some(dl_area) = download_area {use ratatui::widgets::{Block, Borders, Gauge};@@ -614,7 +660,9 @@ impl App {frame.render_widget(gauge, dl_area);}}+ }+ fn draw_theme_picker(&mut self, frame: &mut Frame, area: Rect) {if self.state.show_theme_popup {let items: Vec<String> = crate::tui::theme::AVAILABLE_THEMES.iter()@@ -634,7 +682,9 @@ impl App {self.state.basic_terminal,);}+ }+ fn draw_update_modal(&self, frame: &mut Frame, area: Rect) {if let Some((version, notes)) = &self.state.update_available {use ratatui::layout::Alignment;use ratatui::text::{Line, Span};@@ -651,7 +701,7 @@ impl App {.filter(|l| !l.is_empty()).collect();- crate::tui::clear_area(frame, area, &self.theme);+ crate::tui::overlay::clear_modal_area(frame, area, popup_area, &self.theme);let mut text = vec![Line::from(vec![Span::styled(@@ -693,7 +743,14 @@ impl App {|| trimmed.starts_with("# "){let text_start = trimmed.find(' ').unwrap_or(0);- spans.push(Span::styled("▌ ", self.theme.accent));+ spans.push(Span::styled(+ if self.state.basic_terminal {+ "> "+ } else {+ "▌ "+ },+ self.theme.accent,+ ));spans.push(Span::styled(crate::tui::text::truncate_width(&trimmed[text_start..],@@ -703,7 +760,14 @@ impl App {));} else if trimmed.starts_with("- ") || trimmed.starts_with("* ") {let text_start = trimmed.find(' ').unwrap_or(0) + 1;- spans.push(Span::styled("• ", self.theme.accent));+ spans.push(Span::styled(+ if self.state.basic_terminal {+ "- "+ } else {+ "• "+ },+ self.theme.accent,+ ));spans.push(Span::raw(crate::tui::text::truncate_width(trimmed[text_start..].trim_start(),line_width.saturating_sub(4),@@ -751,13 +815,5 @@ impl App {let popup = Paragraph::new(text).block(block);frame.render_widget(popup, popup_area);}-- crate::tui::overlay::notifications(- frame,- area,- &self.state.notifications,- &self.theme,- self.state.basic_terminal,- );}}diff --git a/src/tui/overlay.rs b/src/tui/overlay.rsindex 9ad6940..cec78fa 100644--- a/src/tui/overlay.rs+++ b/src/tui/overlay.rs@@ -13,7 +13,7 @@ use crate::tui::theme::Theme;const MAX_PICKER_ROWS_CAP: usize = 14;-fn max_picker_rows(area: Rect) -> usize {+pub(crate) fn max_picker_rows(area: Rect) -> usize {(area.height.saturating_sub(6) as usize / 2).clamp(4, MAX_PICKER_ROWS_CAP)}@@ -158,8 +158,21 @@ pub fn picker(let scrollbar = Scrollbar::new(ScrollbarOrientation::VerticalRight).thumb_style(theme.lavender).track_style(theme.surface1)- .begin_symbol(Some("▲"))- .end_symbol(Some("▼"));+ .begin_symbol(if basic_terminal {+ Some("^")+ } else {+ Some("▲")+ })+ .end_symbol(if basic_terminal {+ Some("v")+ } else {+ Some("▼")+ })+ .track_symbol(if basic_terminal {+ Some("|")+ } else {+ Some("│")+ });frame.render_stateful_widget(scrollbar, sections[0], &mut scrollbar_state);}@@ -424,14 +437,102 @@ pub(crate) fn selection_style(theme: &Theme, basic_terminal: bool) -> Style {fn notification_style(kind: NotificationKind,theme: &Theme,- _basic_terminal: bool,+ basic_terminal: bool,) -> (&'static str, Style) {match kind {- NotificationKind::Info => ("INFO", theme.sapphire),- NotificationKind::Success => ("SUCCESS", theme.success),- NotificationKind::Warning => ("WARNING", theme.rating),- NotificationKind::Error => ("ERROR", theme.error),+ NotificationKind::Info => (+ if basic_terminal { "i INFO" } else { "ℹ INFO" },+ theme.sapphire,+ ),+ NotificationKind::Success => (+ if basic_terminal {+ "+ SUCCESS"+ } else {+ "✔ SUCCESS"+ },+ theme.success,+ ),+ NotificationKind::Warning => (+ if basic_terminal {+ "! WARNING"+ } else {+ "⚠ WARNING"+ },+ theme.rating,+ ),+ NotificationKind::Error => (+ if basic_terminal {+ "x ERROR"+ } else {+ "✖ ERROR"+ },+ theme.error,+ ),+ }+}++pub fn notification_rects(+ area: Rect,+ notifications: &std::collections::VecDeque<Notification>,+ basic_terminal: bool,+) -> Vec<(usize, Rect)> {+ let mut rects = Vec::new();+ let mut y = area.bottom().saturating_sub(2);+ let theme_placeholder = Theme::default();++ for (rev_idx, notification) in notifications.iter().rev().take(3).enumerate() {+ let (badge, _) = notification_style(notification.kind, &theme_placeholder, basic_terminal);+ let has_message =+ !notification.message.is_empty() && notification.message != notification.title;++ let max_card_width = (area.width.saturating_sub(4) as usize).min(72);+ let title_w = crate::tui::text::width(¬ification.title).saturating_add(6);+ let badge_w = badge.len().saturating_add(6);+ let raw_msg_w = if has_message {+ crate::tui::text::width(¬ification.message).saturating_add(6)+ } else {+ 0+ };++ let target_card_width = title_w+ .max(badge_w)+ .max(raw_msg_w)+ .clamp(20, max_card_width.max(20)) as u16;++ let inner_width = (target_card_width.saturating_sub(4) as usize).max(1);++ let msg_lines: Vec<String> = if has_message {+ crate::tui::text::wrap_text(¬ification.message, inner_width)+ .into_iter()+ .take(4)+ .collect()+ } else {+ Vec::new()+ };++ let height = 2 + 1 + msg_lines.len() as u16;++ if target_card_width < 10 || y < area.y.saturating_add(height) {+ break;+ }++ y = y.saturating_sub(height);++ let toast_area = Rect::new(+ area.right()+ .saturating_sub(target_card_width)+ .saturating_sub(2),+ y,+ target_card_width,+ height,+ );++ let original_idx = notifications.len().saturating_sub(1 + rev_idx);+ rects.push((original_idx, toast_area));++ y = y.saturating_sub(1);}+ rects}#[derive(Debug, Clone, Copy, PartialEq, Eq)]diff --git a/src/tui/screens/details.rs b/src/tui/screens/details.rsindex 6a8f2e1..5b7bca7 100644--- a/src/tui/screens/details.rs+++ b/src/tui/screens/details.rs@@ -294,7 +294,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme){let size = ratatui::layout::Size::new(poster_area.width, poster_area.height);if let Ok(proto) =- picker.new_protocol(img.clone(), size, ratatui_image::Resize::Fit(None))+ picker.new_protocol((**img).clone(), size, ratatui_image::Resize::Fit(None)){state.poster_protocol = Some((poster_area, proto));}@@ -375,7 +375,11 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)));title_spans.push(Span::styled(" ", theme.text));title_spans.push(Span::styled(- format!("★ IMDb {}", imdb_rating),+ format!(+ "{}IMDb {}",+ if state.basic_terminal { "* " } else { "★ " },+ imdb_rating+ ),theme.rating,));let title_line = Line::from(title_spans);@@ -415,7 +419,11 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme).unwrap_or_default();metadata.push(format!("{p_bar} {pct}{rem}"));} else if hist.completed {- metadata.push("[✓ Watched]".to_string());+ metadata.push(if state.basic_terminal {+ "[Watched]".to_string()+ } else {+ "[✓ Watched]".to_string()+ });}}}@@ -630,6 +638,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)language_count,state.language_list_state.selected().unwrap_or(0),theme,+ state.basic_terminal,);}}@@ -686,6 +695,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)state.available_seasons.len(),state.season_list_state.selected().unwrap_or(0),theme,+ state.basic_terminal,);}@@ -703,6 +713,8 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)let subject_id = state.active_subject_id.as_deref().unwrap_or("");let provider = subject_provider(state, subject_id).cache_key();+ let check_sym = if state.basic_terminal { "[x] " } else { "✓ " };+ let play_sym = if state.basic_terminal { "> " } else { "▶ " };ep_numbers.iter().map(|&ep| {@@ -712,7 +724,8 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme).get_item(provider, subject_id, se_num, ep, Some(&title)){if hist.completed {- ListItem::new(format!("✓ Episode {}", ep)).style(theme.text_dim)+ ListItem::new(format!("{}Episode {}", check_sym, ep))+ .style(theme.text_dim)} else if hist.is_in_progress() {let pct = hist.progress_percentage()@@ -722,13 +735,13 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme).formatted_remaining().map(|r| format!(" • {r}")).unwrap_or_default();- ListItem::new(format!("▶ Episode {}{pct}{remaining}", ep))+ ListItem::new(format!("{}Episode {}{pct}{remaining}", play_sym, ep)).style(theme.accent)} else {ListItem::new(format!(" Episode {}", ep)).style(theme.text)}} else if state.history.is_watched(provider, subject_id, se_num, ep) {- ListItem::new(format!("✓ Episode {}", ep)).style(theme.text_dim)+ ListItem::new(format!("{}Episode {}", check_sym, ep)).style(theme.text_dim)} else {ListItem::new(format!(" Episode {}", ep)).style(theme.text)}@@ -784,6 +797,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)episode_count,state.episode_list_state.selected().unwrap_or(0),theme,+ state.basic_terminal,);}}@@ -1078,6 +1092,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)content_height,rendered_position,theme,+ state.basic_terminal,);} else {let has_multiple_dubs = state@@ -1690,6 +1705,7 @@ fn render_scroll_indicator(content_length: usize,position: usize,theme: &Theme,+ basic_terminal: bool,) {let viewport_length = area.height.saturating_sub(2) as usize;if content_length <= viewport_length || viewport_length == 0 {@@ -1704,8 +1720,21 @@ fn render_scroll_indicator(.orientation(ScrollbarOrientation::VerticalRight).thumb_style(theme.lavender).track_style(theme.surface1)- .begin_symbol(Some("▲"))- .end_symbol(Some("▼"));+ .begin_symbol(if basic_terminal {+ Some("^")+ } else {+ Some("▲")+ })+ .end_symbol(if basic_terminal {+ Some("v")+ } else {+ Some("▼")+ })+ .track_symbol(if basic_terminal {+ Some("|")+ } else {+ Some("│")+ });frame.render_stateful_widget(scrollbar,area.inner(ratatui::layout::Margin {diff --git a/src/tui/screens/help.rs b/src/tui/screens/help.rsindex fcd6748..2a1388c 100644--- a/src/tui/screens/help.rs+++ b/src/tui/screens/help.rs@@ -258,16 +258,15 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {let p = Paragraph::new(window).block(block).alignment(Alignment::Left);- frame.render_widget(- p,- crate::tui::overlay::centered(- area,- (content_width + 8).min(area.width.saturating_sub(2)),- capacity as u16 + 2,- 46,- 120,- ),+ let popup_chunk = crate::tui::overlay::centered(+ area,+ (content_width + 8).min(area.width.saturating_sub(2)),+ capacity as u16 + 2,+ 46,+ 120,);+ crate::tui::overlay::clear_modal_area(frame, area, popup_chunk, theme);+ frame.render_widget(p, popup_chunk);return;}@@ -287,7 +286,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {let popup_chunk = crate::tui::overlay::centered(area, desired_width, desired_height, 46, 120);- crate::tui::clear_area(frame, area, theme);+ crate::tui::overlay::clear_modal_area(frame, area, popup_chunk, theme);let title = format!(" Help · {mode_title} ");let block = Block::default()diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rsindex e9688e7..2c60645 100644--- a/src/tui/screens/home.rs+++ b/src/tui/screens/home.rs@@ -58,9 +58,23 @@ pub(crate) fn slash_command_description(cmd: &str, state: &AppState) -> Option<&crate::tui::commands::SlashCommand::description_for(cmd, state)}-pub(crate) fn poster_placeholder_lines(basic: bool) -> &'static str {+pub(crate) fn poster_placeholder_lines(basic: bool, is_loading: bool, tick: u64) -> &'static str {if basic {- "[ no poster ]"+ if is_loading {+ match (tick / 4) % 3 {+ 0 => "[ . . . . . ]",+ 1 => "[ o o o o o ]",+ _ => "[ O O O O O ]",+ }+ } else {+ "[ no poster ]"+ }+ } else if is_loading {+ match (tick / 4) % 3 {+ 0 => "┌──────┐\n│ · · │\n│ ── │\n│ · · │\n└──────┘",+ 1 => "┌──────┐\n│ ◦ ◦ │\n│ ── │\n│ ◦ ◦ │\n└──────┘",+ _ => "┌──────┐\n│ ○ ○ │\n│ ── │\n│ ○ ○ │\n└──────┘",+ }} else {"┌──────┐\n│ ▓ ▓ │\n│ ── │\n│ ▓ ▓ │\n└──────┘"}@@ -418,9 +432,11 @@ fn search_content(view: SearchViewState,show_cursor: bool,width: u16,+ real_cursor: bool,) -> String {let prefix = if state.basic_terminal { "> " } else { "❯ " };- let cursor_width = usize::from(view == SearchViewState::Editing);+ let editing = view == SearchViewState::Editing;+ let cursor_width = usize::from(editing && !real_cursor);let available = width.saturating_sub(4).saturating_sub(crate::tui::text::width(prefix) as u16)@@ -436,7 +452,7 @@ fn search_content(} else {crate::tui::text::truncate_width(&state.search_query, available)};- let cursor = if view == SearchViewState::Editing {+ let cursor = if editing && !real_cursor {if show_cursor { "█" } else { " " }} else {""@@ -473,11 +489,13 @@ fn render_search_bar(Constraint::Length(status_width.saturating_add(u16::from(status_width > 0) * 2)),]).split(area);+ let real_cursor = view == SearchViewState::Editing && show_cursor && !state.basic_terminal;let mut paragraph = Paragraph::new(search_content(state,view,show_cursor,content_row[0].width,+ real_cursor,)).style(if view == SearchViewState::Editing {theme.text@@ -490,6 +508,18 @@ fn render_search_bar(paragraph = paragraph.alignment(Alignment::Center);}frame.render_widget(paragraph, content_row[0]);+ if real_cursor {+ let prefix_width = 2u16;+ let text_width = crate::tui::text::width(&state.search_query) as u16;+ let shown = text_width.min(content_row[0].width.saturating_sub(6));+ let line_offset = if centered {+ (content_row[0].width.saturating_sub(prefix_width + shown)) / 2+ } else {+ 0+ };+ let cursor_x = content_row[0].x + line_offset + prefix_width + shown;+ frame.set_cursor_position((cursor_x, content_row[0].y));+ }if let Some(status) = result_status {frame.render_widget(Paragraph::new(status)@@ -882,10 +912,18 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)frame.render_widget(ratatui_image::Image::new(proto), p_area);}} else {- let placeholder =- Paragraph::new(poster_placeholder_lines(state.basic_terminal))- .style(theme.text_dim)- .alignment(Alignment::Center);+ let is_in_flight = state.in_flight_posters.contains(&res.id);+ let placeholder = Paragraph::new(poster_placeholder_lines(+ state.basic_terminal,+ is_in_flight,+ state.tick_count,+ ))+ .style(if is_in_flight {+ theme.lavender+ } else {+ theme.text_dim+ })+ .alignment(Alignment::Center);frame.render_widget(placeholder, poster_area);}} else {@@ -1006,8 +1044,14 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)));info_spans.push(ratatui::text::Span::styled(" • ", theme.text_dim));} else if hist.completed {- info_spans- .push(ratatui::text::Span::styled("[✓ Completed]", theme.text_dim));+ info_spans.push(ratatui::text::Span::styled(+ if state.basic_terminal {+ "[Completed]"+ } else {+ "[✓ Completed]"+ },+ theme.text_dim,+ ));info_spans.push(ratatui::text::Span::styled(" • ", theme.text_dim));info_spans.push(ratatui::text::Span::styled(format!("Watched {}", hist.formatted_relative_time()),@@ -1069,8 +1113,16 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)push_year!();info_spans.push(ratatui::text::Span::styled(&type_tag, theme.text));info_spans.push(ratatui::text::Span::styled(" • ", theme.text_dim));- info_spans- .push(ratatui::text::Span::styled("Loading...", theme.text_dim));+ let dots = match (state.tick_count / 4) % 4 {+ 0 => "",+ 1 => ".",+ 2 => "..",+ _ => "...",+ };+ info_spans.push(ratatui::text::Span::styled(+ format!("Loading{dots}"),+ theme.text_dim,+ ));} else {push_year!();info_spans.push(ratatui::text::Span::styled(&type_tag, theme.text));@@ -1095,9 +1147,21 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)if content_len > metrics.visible_items {let scrollbar = ratatui::widgets::Scrollbar::default().orientation(ratatui::widgets::ScrollbarOrientation::VerticalRight)- .begin_symbol(Some("▲"))- .end_symbol(Some("▼"))- .track_symbol(Some("│"))+ .begin_symbol(if state.basic_terminal {+ Some("^")+ } else {+ Some("▲")+ })+ .end_symbol(if state.basic_terminal {+ Some("v")+ } else {+ Some("▼")+ })+ .track_symbol(if state.basic_terminal {+ Some("|")+ } else {+ Some("│")+ }).thumb_symbol(if state.basic_terminal { "|" } else { "█" });let mut scrollbar_state = ratatui::widgets::ScrollbarState::default()@@ -1127,7 +1191,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)let is_centered = state.search_results.is_empty();let search_text_len = if is_centered {- let content_sample = search_content(state, view, false, search_bar_area.width);+ let content_sample = search_content(state, view, false, search_bar_area.width, false);crate::tui::text::width(&content_sample) as u16} else {0@@ -1601,7 +1665,6 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme).map(|preset| preset.label().to_string()).collect()};- crate::tui::clear_area(frame, area, theme);crate::tui::overlay::picker(frame,area,diff --git a/src/tui/state.rs b/src/tui/state.rsindex b23cf3d..e41a379 100644--- a/src/tui/state.rs+++ b/src/tui/state.rs@@ -110,7 +110,7 @@ pub struct AppState {pub preview_loading: bool,pub tick_count: u64,- pub poster_image: Option<image::DynamicImage>,+ pub poster_image: Option<std::sync::Arc<image::DynamicImage>>,pub show_theme_popup: bool,pub active_theme_kind: String,@@ -135,6 +135,7 @@ pub struct AppState {pub show_help: bool,pub help_scroll: usize,+ pub cursor_beam: bool,pub last_result_metrics: Option<ResultMetrics>,pub result_scroll: usize,@@ -288,6 +289,7 @@ impl Default for AppState {image_cache: lru::LruCache::new(cache_capacity(10)),show_help: false,help_scroll: 0,+ cursor_beam: false,last_result_metrics: None,result_scroll: 0,active_resource_request: 0,