forge
Explore
Log in

Don't you dare go Hollow

The export moment's file name is one line, ellipsized

Browse files at this commit

388faa687ffebab4e908adee3d144cfd81f17bbaAhmet Kaan GümüşParent: 166e4a1
  • fix
    • the export moment's file name is one line, ellipsized
Show full message
🐛 fix(app): the export moment's file name is one line, ellipsized
crates/app/src/tests/cards.rsmodified+13 -0
@@ -985,6 +985,19 @@ fn the_export_moment_is_three_rows_one_chip_and_no_list() {
985985 for gone in ["Advanced", "preset", "Quality", "Subtitles", "GPU: ", "Built in"] {
986986 assert!(!body.contains(gone), "the old card's {gone} is still here");
987987 }
988+ // Row 1 is one line at every width: the stem ellipsizes and the
989+ // extension rides beside it (at 1280 the nested block child wrapped
990+ // `.mp4` onto a second line and the moment read as four rows).
991+ let name = &body[body.find("\"destination\"").expect("the file row")..];
992+ let name = &name[..name.find("\"budget\"").unwrap_or(name.len())];
993+ assert!(
994+ name.contains(".truncate()"),
995+ "the file name wraps again -- it must ellipsize on one line"
996+ );
997+ assert!(
998+ name.contains(".flex_none()") && name.contains("ext.to_string()"),
999+ "the extension must sit beside the stem, not under it"
1000+ );
9881001 // Its three rows, each reachable by pointer as well as by chord.
9891002 for id in ["destination", "budget", "budget-track", "export-confirm"] {
9901003 assert!(body.contains(&format!("\"{id}\"")), "{id} is on no row");
crates/app/src/ui/cards.rsmodified+8 -2
@@ -359,15 +359,21 @@ impl Player {
359359 .cursor_pointer()
360360 .on_click(cx.listener(|this, _: &ClickEvent, _, cx| this.pick_destination(cx)))
361361 .child(
362+ // One line, always: the stem gives way with an ellipsis and
363+ // the extension rides beside it. A nested block child would
364+ // wrap it under the name instead, which is what the narrow
365+ // window showed.
362366 div()
363367 .flex_1()
364368 .min_w(px(0.))
365- .truncate()
369+ .flex()
370+ .items_baseline()
366371 .type_style(type_scale::mono(18., gpui::FontWeight::BOLD))
367372 .text_color(rgb(INK1()))
368- .child(stem.to_string())
373+ .child(div().min_w(px(0.)).truncate().child(stem.to_string()))
369374 .child(
370375 div()
376+ .flex_none()
371377 .text_color(rgb(INK2()))
372378 .child(ext.to_string()),
373379 ),