Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
fix(tui): lock details header height to stabilize poster geometry
Samir Hossains1df6aadd6473
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 75bf1ea..0f07f13 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -3,6 +3,9 @@## [Unreleased]### Fixed+- **Details Poster Geometry Stability Across Dub Synopsis Lengths**:+ - Locked `content_rows` to 6 in `DetailsLayoutTier::header_height` (`src/tui/screens/details.rs`) when `show_poster` is active, maintaining consistent 8-row header height and 6-row poster container dimensions.+ - Prevented poster image shrinking and header layout shifts caused by variable synopsis text lengths across audio dubs and releases.- **Single-Line Input Windowing & Overflow Prevention**:- Fixed text overflow in `render_single_line_input` (`src/tui/widgets/input.rs`) where appending ellipsis (`...`) without sufficient budget caused line length to exceed modal width and trigger word wrapping onto a second line.- Reserved 3 columns for trailing ellipsis when characters remain past the cursor and removed `Wrap` on single-line input widgets, keeping prompt symbols and text strictly single-line across all cursor movements.diff --git a/src/tui/screens/details.rs b/src/tui/screens/details.rsindex 266dcc7..8239672 100644--- a/src/tui/screens/details.rs+++ b/src/tui/screens/details.rs@@ -80,7 +80,7 @@ impl DetailsLayoutTier {.clamp(1, synopsis_limit)};let content_rows = if show_poster {- (meta_lines + synopsis_rows).max(5)+ 6} else {meta_lines + synopsis_rows};@@ -2808,7 +2808,52 @@ mod tests {let area = Rect::new(0, 0, 120, 30);let tier = DetailsLayoutTier::for_area(area);let height = tier.header_height(area, Some(&details));- assert_eq!(height, 7);+ assert_eq!(height, 8);+ }++ #[test]+ fn test_details_header_height_stable_with_poster_across_audio_dub_synopsis_lengths() {+ let details_original = MediaDetails {+ id: ProviderMediaId {+ provider: ProviderKind::MovieBox,+ value: "100".to_string(),+ },+ title: "Obsession".to_string(),+ media_type: MediaType::Movie,+ year: Some("2026".to_string()),+ description: Some("After breaking the mysterious \"One Wish Willow\" to win his crush's heart, a hopeless romantic finds himself getting exactly what he asked for but soon discovers that some desires come at a dark, si...".to_string()),+ tagline: None,+ imdb_rating: Some("7.8".to_string()),+ director: None,+ stars: None,+ prints: None,+ audios: None,+ poster_url: Some("https://example.com/obsession.jpg".to_string()),+ duration: Some("1h 49m".to_string()),+ genres: vec![],+ seasons: vec![],+ dubs: vec![],+ };+ let mut details_hindi = details_original.clone();+ details_hindi.description = Some(+ "A hopeless romantic's wish for his crush's love triggers a dark enchantment."+ .to_string(),+ );+ details_hindi.duration = Some("1h 40m".to_string());++ let mut details_empty_synopsis = details_original.clone();+ details_empty_synopsis.description = None;++ let area = Rect::new(0, 0, 120, 30);+ let tier = DetailsLayoutTier::for_area(area);++ let height_original = tier.header_height(area, Some(&details_original));+ let height_hindi = tier.header_height(area, Some(&details_hindi));+ let height_empty = tier.header_height(area, Some(&details_empty_synopsis));++ assert_eq!(height_original, 8);+ assert_eq!(height_hindi, 8);+ assert_eq!(height_empty, 8);}#[test]