feat: show YouTube videos as two-line entries

This commit is contained in:
2026-10-18 10:48:52 +02:00
parent 3e701c99c9
commit 493edfcf3a
3 changed files with 47 additions and 30 deletions
+13 -4
View File
@@ -3010,9 +3010,9 @@ fn video_channel_colors_follow_category_membership_and_preserve_selection_contra
.draw(|frame| app.draw(frame, Duration::ZERO))
.unwrap();
let buffer = terminal.backend().buffer();
// One tab row, three search rows, then the table border and header.
// One tab row, three search rows, then the results border and two-line entries.
for (index, (label, _, _, tagged)) in cases.iter().enumerate() {
let y = 6 + index as u16;
let y = 6 + 2 * index as u16;
let row: String = (0..120).map(|x| buffer[(x, y)].symbol()).collect();
let x = row.find(label).expect("channel label is visible") as u16;
assert_eq!(
@@ -3024,8 +3024,17 @@ fn video_channel_colors_follow_category_membership_and_preserve_selection_contra
},
"{label} in row {index}, cleared={cleared}"
);
assert_eq!(buffer[(3, y)].fg, Color::Reset, "title stays uncolored");
assert_eq!(buffer[(108, y)].fg, Color::Reset, "date stays uncolored");
let title: String = (0..120).map(|x| buffer[(x, y - 1)].symbol()).collect();
assert!(title.contains("Video title"));
let date_x = row.find("2026-10-11").expect("date follows channel") as u16;
assert!(row.contains(&format!("{label} · 2026-10-11")));
assert_eq!(buffer[(3, y - 1)].fg, Color::Reset, "title stays uncolored");
assert_eq!(buffer[(date_x, y)].fg, Color::Reset, "date stays uncolored");
assert!(
buffer[(x, y)]
.modifier
.contains(ratatui::style::Modifier::DIM)
);
}
if !cleared {
app.views[0].selection.select(Some(0));