fix: left-align thumbnails and tuck text beside the image

This commit is contained in:
2026-10-11 11:48:29 +02:00
parent 4205b56653
commit 755c87f918
2 changed files with 28 additions and 17 deletions
+6 -3
View File
@@ -17,7 +17,8 @@
//! Esc closes the popup; j/k loads the selected video's description and i returns to editing.
//! Normal-mode t toggles a thumbnail in the same-sized popup; j/k follows selection, Esc closes.
//! Images use native terminal graphics when supported, otherwise colored half-block characters.
//! Thumbnails scale proportionally in the left pane, aligned one column from the text.
//! Thumbnails scale proportionally and align to the popup's left inner edge.
//! Left-aligned text starts one column after the actual image width, including height-limited images.
//! A blank row separates the bold title from the dimmed author · publication date.
//! Text retains a two-column right gutter; overflowing excerpts end with … without splitting wide glyphs.
//! Both previews share asynchronous full-description fetching and per-video caching.
@@ -1031,6 +1032,10 @@ impl App {
Constraint::Fill(2),
])
.areas(block.inner(popup));
let image_width = self.thumbnail.draw(frame, image);
let reclaimed = image.width - image_width;
details.x -= reclaimed;
details.width += reclaimed;
details.width = details.width.saturating_sub(2);
let metadata = Paragraph::new(vec![
Line::raw(video.title.as_str()).bold(),
@@ -1102,8 +1107,6 @@ impl App {
.set_symbol("…")
.set_style(Style::new().dim());
}
// Drawing polls completion and starts resize work before we choose the title state.
self.thumbnail.draw(frame, image);
frame.render_widget(
block.title(loading_title(
" Thumbnail ",