From 388faa687ffebab4e908adee3d144cfd81f17bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 9 Sep 2026 18:05:29 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(app):=20the=20export=20momen?= =?UTF-8?q?t's=20file=20name=20is=20one=20line,=20ellipsized?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/app/src/tests/cards.rs | 13 +++++++++++++ crates/app/src/ui/cards.rs | 10 ++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/app/src/tests/cards.rs b/crates/app/src/tests/cards.rs index 59da863..e23a5cd 100644 --- a/crates/app/src/tests/cards.rs +++ b/crates/app/src/tests/cards.rs @@ -985,6 +985,19 @@ fn the_export_moment_is_three_rows_one_chip_and_no_list() { for gone in ["Advanced", "preset", "Quality", "Subtitles", "GPU: ", "Built in"] { assert!(!body.contains(gone), "the old card's {gone} is still here"); } + // Row 1 is one line at every width: the stem ellipsizes and the + // extension rides beside it (at 1280 the nested block child wrapped + // `.mp4` onto a second line and the moment read as four rows). + let name = &body[body.find("\"destination\"").expect("the file row")..]; + let name = &name[..name.find("\"budget\"").unwrap_or(name.len())]; + assert!( + name.contains(".truncate()"), + "the file name wraps again -- it must ellipsize on one line" + ); + assert!( + name.contains(".flex_none()") && name.contains("ext.to_string()"), + "the extension must sit beside the stem, not under it" + ); // Its three rows, each reachable by pointer as well as by chord. for id in ["destination", "budget", "budget-track", "export-confirm"] { assert!(body.contains(&format!("\"{id}\"")), "{id} is on no row"); diff --git a/crates/app/src/ui/cards.rs b/crates/app/src/ui/cards.rs index 7653588..2c9185a 100644 --- a/crates/app/src/ui/cards.rs +++ b/crates/app/src/ui/cards.rs @@ -359,15 +359,21 @@ impl Player { .cursor_pointer() .on_click(cx.listener(|this, _: &ClickEvent, _, cx| this.pick_destination(cx))) .child( + // One line, always: the stem gives way with an ellipsis and + // the extension rides beside it. A nested block child would + // wrap it under the name instead, which is what the narrow + // window showed. div() .flex_1() .min_w(px(0.)) - .truncate() + .flex() + .items_baseline() .type_style(type_scale::mono(18., gpui::FontWeight::BOLD)) .text_color(rgb(INK1())) - .child(stem.to_string()) + .child(div().min_w(px(0.)).truncate().child(stem.to_string())) .child( div() + .flex_none() .text_color(rgb(INK2())) .child(ext.to_string()), ),