A settings value says a state, not a cut word
Browse files at this commit0501b2ae4f7d243ab2cd6c24f7ce127024ffb4ffParent: 22a8a53- fix
- a settings value says a state, not a cut word
3 changed files +78 -15
- crates/app/src/export_ui.rs +9 -4
- crates/app/src/tests/cards.rs +43 -2
- crates/app/src/ui/settings_stance.rs +26 -9
crates/app/src/export_ui.rsmodified+9 -4
| @@ -47,7 +47,10 @@ pub(crate) fn sample_rate_choices(current: Option<u32>) -> Vec<ChoiceRow> { | ||
| 47 | 47 | let mut rows = vec![( |
| 48 | 48 | Choice::SampleRate(None), |
| 49 | 49 | "Source".into(), |
| 50 | - "the first audio source's own rate".into(), | |
| 50 | + // A state word, the resolution list's rule: the six-word phrase this | |
| 51 | + // row wore ran past `MENU_W` and was cut mid-word like the size | |
| 52 | + // list's was. Nothing is resampled -- that is what the row means. | |
| 53 | + "unchanged".into(), | |
| 51 | 54 | current.is_none(), |
| 52 | 55 | )]; |
| 53 | 56 | rows.extend(SAMPLE_RATES.into_iter().map(|rate| { |
| @@ -338,9 +341,11 @@ pub(crate) fn resolution_choices(current: (u32, u32), native: (u32, u32)) -> Vec | ||
| 338 | 341 | Choice::Size(w, h), |
| 339 | 342 | format!("{h}p").into(), |
| 340 | 343 | match (w, h) == native { |
| 341 | - // Short enough to sit beside the label inside `MENU_W`: | |
| 342 | - // the longer phrase lost its last word to the truncation. | |
| 343 | - true => format!("{w}x{h} · the media's own"), | |
| 344 | + // A state word, not prose (DESIGN §8): "· the media's own" | |
| 345 | + // lost its last word to `MENU_W` on the row a user read | |
| 346 | + // ("word cut"). `source` is the word the sample-rate list | |
| 347 | + // already says the same fact in. | |
| 348 | + true => format!("{w}x{h} source"), | |
| 344 | 349 | false => format!("{w}x{h}"), |
| 345 | 350 | } |
| 346 | 351 | .into(), |
crates/app/src/tests/cards.rsmodified+43 -2
| @@ -1393,9 +1393,10 @@ fn a_choice_list_offers_every_value_and_fits_the_smallest_window() { | ||
| 1393 | 1393 | assert_eq!(*picked, *size == (1280, 720)); |
| 1394 | 1394 | } |
| 1395 | 1395 | // The media's own size says so: it is the one rung a person cannot read |
| 1396 | - // off a number they chose. | |
| 1396 | + // off a number they chose -- in the one word the sample-rate list says | |
| 1397 | + // the same fact in, since prose gets cut by `MENU_W` (user: "word cut"). | |
| 1397 | 1398 | let (.., native_detail, _) = &rows[3]; |
| 1398 | - assert!(native_detail.contains("the media's own"), "{native_detail}"); | |
| 1399 | + assert!(native_detail.ends_with(" source"), "{native_detail}"); | |
| 1399 | 1400 | // A project at a size nobody listed still gets the whole list, with |
| 1400 | 1401 | // nothing marked rather than a wrong row marked. |
| 1401 | 1402 | assert!( |
| @@ -2093,3 +2094,43 @@ fn the_seat_probe_is_not_keyed_on_the_budget() { | ||
| 2093 | 2094 | "the export no longer writes at the budget on the row" |
| 2094 | 2095 | ); |
| 2095 | 2096 | } |
| 2097 | + | |
| 2098 | +/// DESIGN §8, the class behind the user's "word cut" (2026-09-09): a picker | |
| 2099 | +/// row's tail is a *state word* -- at most two -- because the plate is | |
| 2100 | +/// `MENU_W` wide and prose loses its last word to the truncation on exactly | |
| 2101 | +/// the row a reader is looking at (the resolution list's checked row read | |
| 2102 | +/// "3840x2160 · the medi…"). The same rule for the settings page's own row | |
| 2103 | +/// values: a value slot carries the state, never the door's noun elided to | |
| 2104 | +/// an ellipsis ("Subtitle font Font…", "Mix Tracks…"). | |
| 2105 | +#[test] | |
| 2106 | +fn picker_row_tails_are_state_words_and_settings_values_carry_no_ellipsis() { | |
| 2107 | + let lists = [ | |
| 2108 | + resolution_choices((1280, 720), (3840, 2160)), | |
| 2109 | + pending_resolution_choices(Some(RESOLUTIONS[1])), | |
| 2110 | + pending_fps_choices(Some(FRAME_RATES[0])), | |
| 2111 | + sample_rate_choices(None), | |
| 2112 | + ]; | |
| 2113 | + for (.., detail, _) in lists.iter().flatten() { | |
| 2114 | + let words = detail.split_whitespace().count(); | |
| 2115 | + assert!( | |
| 2116 | + words <= 2, | |
| 2117 | + "picker row tail {detail:?} is {words} words -- `MENU_W` cuts prose" | |
| 2118 | + ); | |
| 2119 | + assert!( | |
| 2120 | + !detail.contains('\u{2026}') && !detail.contains('\u{b7}'), | |
| 2121 | + "picker row tail {detail:?} carries prose punctuation" | |
| 2122 | + ); | |
| 2123 | + } | |
| 2124 | + // Code lines only: the comments above the two rows this fixed quote the | |
| 2125 | + // strings the bug shipped as. | |
| 2126 | + let settings = src_text("ui/settings_stance.rs"); | |
| 2127 | + for line in settings | |
| 2128 | + .lines() | |
| 2129 | + .filter(|l| !l.trim_start().starts_with("//")) | |
| 2130 | + { | |
| 2131 | + assert!( | |
| 2132 | + !line.contains('\u{2026}'), | |
| 2133 | + "a settings row value is elided with an ellipsis again: {line}" | |
| 2134 | + ); | |
| 2135 | + } | |
| 2136 | +} |
crates/app/src/ui/settings_stance.rsmodified+26 -9
| @@ -373,14 +373,25 @@ fn project_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen | ||
| 373 | 373 | None, |
| 374 | 374 | content_ink, |
| 375 | 375 | )) |
| 376 | - .child(row( | |
| 377 | - "settings-mix", | |
| 378 | - "Mix", | |
| 379 | - "Tracks…", | |
| 380 | - "a fader per track and the limiter over the sum of them", | |
| 381 | - player, | |
| 382 | - cx.listener(|this, _: &ClickEvent, _, cx| this.open_mix(None, cx)), | |
| 383 | - )) | |
| 376 | + // A door row's value is the state behind the door, never the door's | |
| 377 | + // own noun: `Tracks…` read as a cut word and said nothing (user: | |
| 378 | + // "word cut"). No project, no tracks -- the page's one empty state. | |
| 379 | + .child({ | |
| 380 | + let (mix_val, mix_ink) = match player.mix_lanes().len() { | |
| 381 | + 0 => ("\u{2014}".to_string(), INK4()), | |
| 382 | + 1 => ("1 track".to_string(), INK1()), | |
| 383 | + n => (format!("{n} tracks"), INK1()), | |
| 384 | + }; | |
| 385 | + row_ink( | |
| 386 | + "settings-mix", | |
| 387 | + "Mix", | |
| 388 | + mix_val, | |
| 389 | + "a fader per track and the limiter over the sum of them", | |
| 390 | + player, | |
| 391 | + cx.listener(|this, _: &ClickEvent, _, cx| this.open_mix(None, cx)), | |
| 392 | + mix_ink, | |
| 393 | + ) | |
| 394 | + }) | |
| 384 | 395 | } |
| 385 | 396 | |
| 386 | 397 | /// EDITOR: this window's own decode/import policy and this person's own |
| @@ -431,10 +442,16 @@ fn editor_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement | ||
| 431 | 442 | this.open_picker(Pick::Theme, event.position(), cx) |
| 432 | 443 | }), |
| 433 | 444 | )) |
| 445 | + // The family in force, said (user: "Subtitle font Font…" -- the | |
| 446 | + // value slot carried the door's noun, elided, never the pick). With | |
| 447 | + // nothing picked the window draws its own, which is one word. | |
| 434 | 448 | .child(row( |
| 435 | 449 | "settings-subtitle-style", |
| 436 | 450 | "Subtitle font", |
| 437 | - "Font…", | |
| 451 | + player | |
| 452 | + .sub_family | |
| 453 | + .clone() | |
| 454 | + .unwrap_or_else(|| "default".to_string()), | |
| 438 | 455 | "the cue plate's own font and size -- kept in ~/.config/edith, never in a project", |
| 439 | 456 | player, |
| 440 | 457 | cx.listener(|this, _: &ClickEvent, _, cx| this.open_subtitle_style(cx)), |