Skip to content

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

fix(tui): remove blocking resize intercept to prevent blank screens and fix image refresh

Samir Hossains3ef51a86b412
diff --git a/src/tui/app/run.rs b/src/tui/app/run.rs
index 3176b4b..db45d75 100644
--- a/src/tui/app/run.rs
+++ b/src/tui/app/run.rs
@@ -101,9 +101,7 @@ impl App {
}
async fn handle_action(&mut self, action: Action) -> Option<()> {
- if self.state.last_resize_time.is_some()
- || !matches!(action, Action::Tick | Action::UpdateDownload(..))
- {
+ if !matches!(action, Action::Tick | Action::UpdateDownload(..)) {
self.state.dirty = true;
}
match action {
@@ -248,43 +246,6 @@ impl App {
return;
}
- if let Some((time, w, h)) = self.state.last_resize_time {
- if time.elapsed() < std::time::Duration::from_millis(150) {
- let pill_w = 42_u16.min(area.width.saturating_sub(4));
- let pill_h = 3_u16;
- let pill_x = area.x + (area.width.saturating_sub(pill_w)) / 2;
- let pill_y = area.y + (area.height.saturating_sub(pill_h)) / 2;
- let pill_area = ratatui::layout::Rect {
- x: pill_x,
- y: pill_y,
- width: pill_w,
- height: pill_h,
- };
-
- let line = ratatui::text::Line::from(vec![
- ratatui::text::Span::styled("● ", self.theme.accent),
- ratatui::text::Span::styled("Resizing Window", self.theme.title),
- ratatui::text::Span::styled(" · ", self.theme.text_dim),
- ratatui::text::Span::styled(format!("{} × {} cols", w, h), self.theme.text),
- ]);
-
- let block = ratatui::widgets::Block::default()
- .borders(ratatui::widgets::Borders::ALL)
- .border_type(ratatui::widgets::BorderType::Rounded)
- .border_style(self.theme.accent);
-
- let p = ratatui::widgets::Paragraph::new(line)
- .block(block)
- .alignment(ratatui::layout::Alignment::Center);
-
- frame.render_widget(p, pill_area);
- return;
- } else {
- self.state.last_resize_time = None;
- self.state.clear_terminal_before_draw = true;
- }
- }
-
let mut main_area = frame.area();
let mut download_area = None;
diff --git a/src/tui/app/system.rs b/src/tui/app/system.rs
index 11c6e9d..b734a68 100644
--- a/src/tui/app/system.rs
+++ b/src/tui/app/system.rs
@@ -96,9 +96,11 @@ impl App {
self.prepare_image_soft_refresh();
}
- Action::Resize(w, h) => {
- self.state.last_resize_time = Some((std::time::Instant::now(), w, h));
+ Action::Resize(_w, _h) => {
+ self.state.last_resize_time = None;
self.state.poster_protocol = None;
+ self.state.search_poster_protocols.clear();
+ self.state.clear_terminal_before_draw = true;
self.state.dirty = true;
}