Merge branch 'worktree-agent-a600c7fd560e06523'
Browse files at this commit14 changed files +222 -88
- crates/app/src/files.rs +2 -2
- crates/app/src/notices.rs +47 -0
- crates/app/src/player/actions.rs +3 -3
- crates/app/src/player/cards.rs +16 -20
- crates/app/src/player/export.rs +2 -2
- crates/app/src/player/library.rs +18 -26
- crates/app/src/player/timeline_edit.rs +16 -17
- crates/app/src/player/view.rs +3 -4
- crates/app/src/subs.rs +5 -6
- crates/app/src/tests/layout.rs +97 -0
- crates/app/src/tests/view.rs +3 -3
- crates/app/src/timeline_math.rs +2 -2
- crates/app/src/transport.rs +1 -1
- crates/app/src/ui/stance.rs +7 -2
crates/app/src/files.rsmodified+2 -2
| @@ -92,7 +92,7 @@ pub(crate) fn pick_file(title: &str) -> Result<Option<PathBuf>, &'static str> { | |||
| 92 | ("kdialog", vec!["--getopenfilename".into()]), | 92 | ("kdialog", vec!["--getopenfilename".into()]), |
| 93 | ]) | 93 | ]) |
| 94 | .ok_or( | 94 | .ok_or( |
| 95 | - "NO FILE CHOOSER — install zenity or kdialog, or drag the file onto this window to import it", | 95 | + "NO FILE CHOOSER — install zenity or kdialog", |
| 96 | ) | 96 | ) |
| 97 | } | 97 | } |
| 98 | 98 | ||
| @@ -116,7 +116,7 @@ pub(crate) fn pick_save(default: &std::path::Path) -> Result<Option<PathBuf>, &' | |||
| 116 | ("kdialog", vec!["--getsavefilename".into(), default]), | 116 | ("kdialog", vec!["--getsavefilename".into(), default]), |
| 117 | ]) | 117 | ]) |
| 118 | .ok_or( | 118 | .ok_or( |
| 119 | - "NO FILE CHOOSER — install zenity or kdialog to choose where; exporting beside the source", | 119 | + "NO FILE CHOOSER — exporting beside the source", |
| 120 | ) | 120 | ) |
| 121 | } | 121 | } |
| 122 | 122 | ||
crates/app/src/notices.rsmodified+47 -0
| @@ -51,6 +51,37 @@ pub(crate) fn audio_notice(session: &PlaybackSession) -> Option<String> { | |||
| 51 | .map(|reason| format!(" — NO AUDIO: {reason}")) | 51 | .map(|reason| format!(" — NO AUDIO: {reason}")) |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | +/// The strip's own width is finite and its message is one line: what a | ||
| 55 | +/// too-long line must never do is lose its *state* word, which sits at the | ||
| 56 | +/// front, or stop mid-word with nothing saying it stopped (user report, | ||
| 57 | +/// `OPENED he_is_not_the_only_one.mp4 — 1 subtitle track(s) in `). Every | ||
| 58 | +/// message is a handful of words plus a file name now (DESIGN §8), so the one | ||
| 59 | +/// part long enough to overflow the strip alone is the name -- elided through | ||
| 60 | +/// its middle here, head and tail kept, before gpui's own end ellipsis | ||
| 61 | +/// ([`crate::ui::stance`]) ever has to cut a word. | ||
| 62 | +pub(crate) const LEDGER_WORD_MAX: usize = 28; | ||
| 63 | + | ||
| 64 | +pub(crate) fn ledger_line(message: &str) -> String { | ||
| 65 | + message | ||
| 66 | + .split(' ') | ||
| 67 | + .map(|word| match word.chars().count() > LEDGER_WORD_MAX { | ||
| 68 | + false => word.to_string(), | ||
| 69 | + // Chars, not bytes: a name is whatever the filesystem holds. | ||
| 70 | + true => { | ||
| 71 | + let chars: Vec<char> = word.chars().collect(); | ||
| 72 | + let head = LEDGER_WORD_MAX / 2 - 1; | ||
| 73 | + let tail = LEDGER_WORD_MAX - head - 1; | ||
| 74 | + format!( | ||
| 75 | + "{}…{}", | ||
| 76 | + chars[..head].iter().collect::<String>(), | ||
| 77 | + chars[chars.len() - tail..].iter().collect::<String>() | ||
| 78 | + ) | ||
| 79 | + } | ||
| 80 | + }) | ||
| 81 | + .collect::<Vec<_>>() | ||
| 82 | + .join(" ") | ||
| 83 | +} | ||
| 84 | + | ||
| 54 | #[cfg(test)] | 85 | #[cfg(test)] |
| 55 | mod tests { | 86 | mod tests { |
| 56 | use super::*; | 87 | use super::*; |
| @@ -83,4 +114,20 @@ mod tests { | |||
| 83 | // message's text. | 114 | // message's text. |
| 84 | assert_eq!(notices.back().unwrap().as_ref(), refusal); | 115 | assert_eq!(notices.back().unwrap().as_ref(), refusal); |
| 85 | } | 116 | } |
| 117 | + | ||
| 118 | + /// The line the strip paints keeps its state word and never stops | ||
| 119 | + /// mid-word without a sign: a long name loses its middle, everything | ||
| 120 | + /// short is untouched, and the count at the end survives. | ||
| 121 | + #[test] | ||
| 122 | + fn a_long_name_loses_its_middle_rather_than_the_state_word() { | ||
| 123 | + assert_eq!(ledger_line("SNAP OFF"), "SNAP OFF"); | ||
| 124 | + let long = ledger_line("OPENED he_is_not_the_only_one_at_all_here.mp4 · 1 subtitle track(s)"); | ||
| 125 | + assert!(long.starts_with("OPENED "), "{long}"); | ||
| 126 | + assert!(long.ends_with(" · 1 subtitle track(s)"), "{long}"); | ||
| 127 | + assert!(long.contains('…'), "{long}"); | ||
| 128 | + assert!( | ||
| 129 | + long.split(' ').all(|w| w.chars().count() <= LEDGER_WORD_MAX), | ||
| 130 | + "{long}" | ||
| 131 | + ); | ||
| 132 | + } | ||
| 86 | } | 133 | } |
crates/app/src/player/actions.rsmodified+3 -3
| @@ -251,8 +251,8 @@ impl Player { | |||
| 251 | self.snap_cue = None; | 251 | self.snap_cue = None; |
| 252 | self.ghost.clear(); | 252 | self.ghost.clear(); |
| 253 | self.notify_user(match self.snap { | 253 | self.notify_user(match self.snap { |
| 254 | - true => "SNAP ON — drags land on clip edges, the playhead and the start".into(), | 254 | + true => "SNAP ON".into(), |
| 255 | - false => "SNAP OFF — drags land exactly where the hand leaves them".into(), | 255 | + false => "SNAP OFF".into(), |
| 256 | }); | 256 | }); |
| 257 | cx.notify(); | 257 | cx.notify(); |
| 258 | } | 258 | } |
| @@ -649,7 +649,7 @@ impl Player { | |||
| 649 | }; | 649 | }; |
| 650 | self.loop_trim = self.cut_span(lane, idx); | 650 | self.loop_trim = self.cut_span(lane, idx); |
| 651 | if self.loop_trim.is_some() { | 651 | if self.loop_trim.is_some() { |
| 652 | - self.notify_user("LOOP-TRIM ON — looping the subject cut while you trim".into()); | 652 | + self.notify_user("LOOP-TRIM ON".into()); |
| 653 | } | 653 | } |
| 654 | cx.notify(); | 654 | cx.notify(); |
| 655 | } | 655 | } |
crates/app/src/player/cards.rsmodified+16 -20
| @@ -244,7 +244,7 @@ impl Player { | |||
| 244 | return; | 244 | return; |
| 245 | } | 245 | } |
| 246 | let Some(session) = &self.session else { | 246 | let Some(session) = &self.session else { |
| 247 | - self.notify_user("no timeline to grade — open a file first".into()); | 247 | + self.notify_user("no timeline to grade — no file open".into()); |
| 248 | cx.notify(); | 248 | cx.notify(); |
| 249 | return; | 249 | return; |
| 250 | }; | 250 | }; |
| @@ -262,8 +262,7 @@ impl Player { | |||
| 262 | Some(half) => Some(half), | 262 | Some(half) => Some(half), |
| 263 | None => { | 263 | None => { |
| 264 | self.notify_user( | 264 | self.notify_user( |
| 265 | - "NOTHING TO GRADE — a caption has no picture; group it with a clip \ | 265 | + "NOTHING TO GRADE — a caption has no picture" |
| 266 | - first (ctrl-click both, then Group)" | ||
| 267 | .into(), | 266 | .into(), |
| 268 | ); | 267 | ); |
| 269 | cx.notify(); | 268 | cx.notify(); |
| @@ -400,7 +399,7 @@ impl Player { | |||
| 400 | return; | 399 | return; |
| 401 | } | 400 | } |
| 402 | let Some(session) = &self.session else { | 401 | let Some(session) = &self.session else { |
| 403 | - self.notify_user("no timeline to place — open a file first".into()); | 402 | + self.notify_user("no timeline to place — no file open".into()); |
| 404 | cx.notify(); | 403 | cx.notify(); |
| 405 | return; | 404 | return; |
| 406 | }; | 405 | }; |
| @@ -410,8 +409,7 @@ impl Player { | |||
| 410 | Some(half) => Some(half), | 409 | Some(half) => Some(half), |
| 411 | None => { | 410 | None => { |
| 412 | self.notify_user( | 411 | self.notify_user( |
| 413 | - "NOTHING TO PLACE — a caption has no picture; group it with a clip \ | 412 | + "NOTHING TO PLACE — a caption has no picture" |
| 414 | - first (ctrl-click both, then Group)" | ||
| 415 | .into(), | 413 | .into(), |
| 416 | ); | 414 | ); |
| 417 | cx.notify(); | 415 | cx.notify(); |
| @@ -533,7 +531,7 @@ impl Player { | |||
| 533 | return; | 531 | return; |
| 534 | } | 532 | } |
| 535 | let Some(session) = &self.session else { | 533 | let Some(session) = &self.session else { |
| 536 | - self.notify_user("no timeline to re-time — open a file first".into()); | 534 | + self.notify_user("no timeline to re-time — no file open".into()); |
| 537 | cx.notify(); | 535 | cx.notify(); |
| 538 | return; | 536 | return; |
| 539 | }; | 537 | }; |
| @@ -551,8 +549,7 @@ impl Player { | |||
| 551 | Some(half) => Some(half), | 549 | Some(half) => Some(half), |
| 552 | None => { | 550 | None => { |
| 553 | self.notify_user( | 551 | self.notify_user( |
| 554 | - "NOTHING TO RE-TIME — a caption has no speed of its own; group it \ | 552 | + "NOTHING TO RE-TIME — a caption has no speed of its own" |
| 555 | - with a clip first (ctrl-click both, then Group)" | ||
| 556 | .into(), | 553 | .into(), |
| 557 | ); | 554 | ); |
| 558 | cx.notify(); | 555 | cx.notify(); |
| @@ -696,7 +693,7 @@ impl Player { | |||
| 696 | return; | 693 | return; |
| 697 | } | 694 | } |
| 698 | let Some(session) = &self.session else { | 695 | let Some(session) = &self.session else { |
| 699 | - self.notify_user("no timeline to scan — open a file first".into()); | 696 | + self.notify_user("no timeline to scan — no file open".into()); |
| 700 | cx.notify(); | 697 | cx.notify(); |
| 701 | return; | 698 | return; |
| 702 | }; | 699 | }; |
| @@ -714,8 +711,7 @@ impl Player { | |||
| 714 | Some(half) => Some(half), | 711 | Some(half) => Some(half), |
| 715 | None => { | 712 | None => { |
| 716 | self.notify_user( | 713 | self.notify_user( |
| 717 | - "NOTHING TO SCAN — a caption has no sound of its own; group it with \ | 714 | + "NOTHING TO SCAN — a caption has no sound of its own" |
| 718 | - the take's sound first (ctrl-click both, then Group)" | ||
| 719 | .into(), | 715 | .into(), |
| 720 | ); | 716 | ); |
| 721 | cx.notify(); | 717 | cx.notify(); |
| @@ -1161,7 +1157,7 @@ impl Player { | |||
| 1161 | if self.silence_marks.is_empty() { | 1157 | if self.silence_marks.is_empty() { |
| 1162 | self.notify_user( | 1158 | self.notify_user( |
| 1163 | format!( | 1159 | format!( |
| 1164 | - "no silence under {:.0} dBFS lasting {:.2} s — raise the threshold or forgive less", | 1160 | + "no silence under {:.0} dBFS lasting {:.2} s", |
| 1165 | self.silence.threshold_db, self.silence.min_silence | 1161 | self.silence.threshold_db, self.silence.min_silence |
| 1166 | ) | 1162 | ) |
| 1167 | .into(), | 1163 | .into(), |
| @@ -1213,7 +1209,7 @@ impl Player { | |||
| 1213 | self.reset_after_reseek(); | 1209 | self.reset_after_reseek(); |
| 1214 | self.notify_user( | 1210 | self.notify_user( |
| 1215 | format!( | 1211 | format!( |
| 1216 | - "{count} SILENCES CUT {reach} — {} shorter, {} takes it back", | 1212 | + "{count} SILENCES CUT {reach} — {} shorter · undo {}", |
| 1217 | secs_label(saved), | 1213 | secs_label(saved), |
| 1218 | self.keymap.display(ActionId::Undo) | 1214 | self.keymap.display(ActionId::Undo) |
| 1219 | ) | 1215 | ) |
| @@ -1252,7 +1248,7 @@ impl Player { | |||
| 1252 | self.reset_after_reseek(); | 1248 | self.reset_after_reseek(); |
| 1253 | self.notify_user( | 1249 | self.notify_user( |
| 1254 | format!( | 1250 | format!( |
| 1255 | - "{count} SILENCES AT {rate} {reach} — {} takes it back", | 1251 | + "{count} SILENCES AT {rate} {reach} · undo {}", |
| 1256 | self.keymap.display(ActionId::Undo) | 1252 | self.keymap.display(ActionId::Undo) |
| 1257 | ) | 1253 | ) |
| 1258 | .into(), | 1254 | .into(), |
| @@ -1392,13 +1388,13 @@ impl Player { | |||
| 1392 | _ => self.selected.anchor(), | 1388 | _ => self.selected.anchor(), |
| 1393 | }; | 1389 | }; |
| 1394 | let refusal = match (anchor, &self.session) { | 1390 | let refusal = match (anchor, &self.session) { |
| 1395 | - (_, None) => Some("NO TIMELINE — open a file first".to_string()), | 1391 | + (_, None) => Some("NO TIMELINE — no file open".to_string()), |
| 1396 | (None, _) => Some(format!( | 1392 | (None, _) => Some(format!( |
| 1397 | - "NOTHING SELECTED — click an audio clip or press {}, then ask again", | 1393 | + "NOTHING SELECTED · select all {}", |
| 1398 | self.keymap.display(ActionId::Select) | 1394 | self.keymap.display(ActionId::Select) |
| 1399 | )), | 1395 | )), |
| 1400 | (Some((lane, _)), _) if lane.kind != LaneKind::Audio => Some( | 1396 | (Some((lane, _)), _) if lane.kind != LaneKind::Audio => Some( |
| 1401 | - "NOT AN AUDIO CLIP — the equalizer works on the sound, so pick a clip in an audio lane".to_string(), | 1397 | + "NOT AN AUDIO CLIP — the equalizer works on sound".to_string(), |
| 1402 | ), | 1398 | ), |
| 1403 | _ => None, | 1399 | _ => None, |
| 1404 | }; | 1400 | }; |
| @@ -1495,7 +1491,7 @@ impl Player { | |||
| 1495 | if self.eq_params.bands.len() >= EQ_BANDS_MAX { | 1491 | if self.eq_params.bands.len() >= EQ_BANDS_MAX { |
| 1496 | self.notify_user( | 1492 | self.notify_user( |
| 1497 | format!( | 1493 | format!( |
| 1498 | - "EQUALIZER FULL — {EQ_BANDS_MAX} bands is all this card holds; move one instead" | 1494 | + "EQUALIZER FULL — {EQ_BANDS_MAX} bands" |
| 1499 | ) | 1495 | ) |
| 1500 | .into(), | 1496 | .into(), |
| 1501 | ); | 1497 | ); |
| @@ -1512,7 +1508,7 @@ impl Player { | |||
| 1512 | /// is a card with nothing to edit, and flattening is what "off" means here. | 1508 | /// is a card with nothing to edit, and flattening is what "off" means here. |
| 1513 | pub(crate) fn remove_band(&mut self, cx: &mut Context<Self>) { | 1509 | pub(crate) fn remove_band(&mut self, cx: &mut Context<Self>) { |
| 1514 | if self.eq_params.bands.len() <= 1 { | 1510 | if self.eq_params.bands.len() <= 1 { |
| 1515 | - self.notify_user("LAST BAND — flatten it instead (r), or close the card".into()); | 1511 | + self.notify_user("LAST BAND · flatten r".into()); |
| 1516 | cx.notify(); | 1512 | cx.notify(); |
| 1517 | return; | 1513 | return; |
| 1518 | } | 1514 | } |
crates/app/src/player/export.rsmodified+2 -2
| @@ -451,7 +451,7 @@ impl Player { | |||
| 451 | // Nothing to write out, and a refusal rather than a card about it: the | 451 | // Nothing to write out, and a refusal rather than a card about it: the |
| 452 | // window is empty and the export path is not even chosen yet. | 452 | // window is empty and the export path is not even chosen yet. |
| 453 | if self.session.is_none() { | 453 | if self.session.is_none() { |
| 454 | - self.notify_user("NOTHING TO EXPORT — open a file first".into()); | 454 | + self.notify_user("NOTHING TO EXPORT — no file open".into()); |
| 455 | cx.notify(); | 455 | cx.notify(); |
| 456 | return; | 456 | return; |
| 457 | } | 457 | } |
| @@ -722,7 +722,7 @@ impl Player { | |||
| 722 | settings.subtitles = self.export_subs(); | 722 | settings.subtitles = self.export_subs(); |
| 723 | settings.range = self.range; | 723 | settings.range = self.range; |
| 724 | let Some(session) = &mut self.session else { | 724 | let Some(session) = &mut self.session else { |
| 725 | - self.notify_user("NOTHING TO EXPORT — open a file first".into()); | 725 | + self.notify_user("NOTHING TO EXPORT — no file open".into()); |
| 726 | cx.notify(); | 726 | cx.notify(); |
| 727 | return; | 727 | return; |
| 728 | }; | 728 | }; |
crates/app/src/player/library.rsmodified+18 -26
| @@ -180,7 +180,7 @@ impl Player { | |||
| 180 | true => { | 180 | true => { |
| 181 | self.close_session(); | 181 | self.close_session(); |
| 182 | format!( | 182 | format!( |
| 183 | - "REMOVED {} — the library is empty; import a file to start again", | 183 | + "REMOVED {} — the library is empty", |
| 184 | file_name(path) | 184 | file_name(path) |
| 185 | ) | 185 | ) |
| 186 | } | 186 | } |
| @@ -194,7 +194,7 @@ impl Player { | |||
| 194 | } | 194 | } |
| 195 | } | 195 | } |
| 196 | Some(Err(e)) => format!("NOT REMOVED — {e}"), | 196 | Some(Err(e)) => format!("NOT REMOVED — {e}"), |
| 197 | - None => "NO TIMELINE — open a file first".to_string(), | 197 | + None => "NO TIMELINE — no file open".to_string(), |
| 198 | }; | 198 | }; |
| 199 | self.notify_user(text.into()); | 199 | self.notify_user(text.into()); |
| 200 | cx.notify(); | 200 | cx.notify(); |
| @@ -218,7 +218,7 @@ impl Player { | |||
| 218 | return; | 218 | return; |
| 219 | } | 219 | } |
| 220 | let Some(session) = self.session.as_mut() else { | 220 | let Some(session) = self.session.as_mut() else { |
| 221 | - self.notify_user("NO TIMELINE — open a file first".into()); | 221 | + self.notify_user("NO TIMELINE — no file open".into()); |
| 222 | return; | 222 | return; |
| 223 | }; | 223 | }; |
| 224 | let Some(idx) = session | 224 | let Some(idx) = session |
| @@ -732,7 +732,7 @@ impl Player { | |||
| 732 | // and the film has a stand-in now. | 732 | // and the film has a stand-in now. |
| 733 | Some(Proxy::Ready) if showed_stop => { | 733 | Some(Proxy::Ready) if showed_stop => { |
| 734 | let text = format!( | 734 | let text = format!( |
| 735 | - "PROXY READY for {} — it finished before the stop; click again to delete it", | 735 | + "PROXY READY for {} — it finished before the stop", |
| 736 | file_name(path) | 736 | file_name(path) |
| 737 | ); | 737 | ); |
| 738 | eprintln!("{text}"); | 738 | eprintln!("{text}"); |
| @@ -904,9 +904,9 @@ impl Player { | |||
| 904 | let text = match (on, ready, making) { | 904 | let text = match (on, ready, making) { |
| 905 | (false, ..) => "PROXIES OFF — the films themselves are what play".to_string(), | 905 | (false, ..) => "PROXIES OFF — the films themselves are what play".to_string(), |
| 906 | (true, 0, 0) => { | 906 | (true, 0, 0) => { |
| 907 | - "PROXIES ON — no film here has one, so the films themselves play".to_string() | 907 | + "PROXIES ON — no film here has one".to_string() |
| 908 | } | 908 | } |
| 909 | - (true, 0, n) => format!("PROXIES ON — {n} still being made; the films play until then"), | 909 | + (true, 0, n) => format!("PROXIES ON — {n} still being made"), |
| 910 | (true, n, 0) => format!("PROXIES ON — cutting on {n}"), | 910 | (true, n, 0) => format!("PROXIES ON — cutting on {n}"), |
| 911 | (true, n, m) => format!("PROXIES ON — cutting on {n}, {m} still being made"), | 911 | (true, n, m) => format!("PROXIES ON — cutting on {n}, {m} still being made"), |
| 912 | }; | 912 | }; |
| @@ -951,8 +951,8 @@ impl Player { | |||
| 951 | session.set_auto_proxies(on); | 951 | session.set_auto_proxies(on); |
| 952 | } | 952 | } |
| 953 | let text = match on { | 953 | let text = match on { |
| 954 | - true => "AUTO PROXIES ON — a film that wants a stand-in gets one as it arrives", | 954 | + true => "AUTO PROXIES ON — every import gets a stand-in", |
| 955 | - false => "AUTO PROXIES OFF — no import makes one; Proxies on is what asks for them", | 955 | + false => "AUTO PROXIES OFF — no import makes one", |
| 956 | }; | 956 | }; |
| 957 | eprintln!("{text}"); | 957 | eprintln!("{text}"); |
| 958 | // Kept for the next launch, not only the next project -- a flip made | 958 | // Kept for the next launch, not only the next project -- a flip made |
| @@ -1114,7 +1114,7 @@ impl Player { | |||
| 1114 | .and_then(|session| subtitle_tail(session, subs)) | 1114 | .and_then(|session| subtitle_tail(session, subs)) |
| 1115 | .unwrap_or_default(); | 1115 | .unwrap_or_default(); |
| 1116 | format!( | 1116 | format!( |
| 1117 | - "IMPORTED {} to the library — drag it onto a lane to place it{tail}{}", | 1117 | + "IMPORTED {} to the library{tail}{}", |
| 1118 | file_name(path), | 1118 | file_name(path), |
| 1119 | audio_import_tail(path, self.has_video(path) && !no_video) | 1119 | audio_import_tail(path, self.has_video(path) && !no_video) |
| 1120 | ) | 1120 | ) |
| @@ -1207,7 +1207,7 @@ impl Player { | |||
| 1207 | let what = match place { | 1207 | let what = match place { |
| 1208 | true => format!("OPENED {name}"), | 1208 | true => format!("OPENED {name}"), |
| 1209 | false => { | 1209 | false => { |
| 1210 | - format!("IMPORTED {name} to the library — drag it onto a lane to place it") | 1210 | + format!("IMPORTED {name} to the library") |
| 1211 | } | 1211 | } |
| 1212 | }; | 1212 | }; |
| 1213 | let audio = match place { | 1213 | let audio = match place { |
| @@ -1396,7 +1396,7 @@ impl Player { | |||
| 1396 | self.keymap.display(ActionId::ToggleSubtitles) | 1396 | self.keymap.display(ActionId::ToggleSubtitles) |
| 1397 | ), | 1397 | ), |
| 1398 | Some(Err(e)) => format!("SUBTITLE IMPORT FAILED: {e}"), | 1398 | Some(Err(e)) => format!("SUBTITLE IMPORT FAILED: {e}"), |
| 1399 | - None => "NO SUBTITLES ADDED — open a file for them to run against first".to_string(), | 1399 | + None => "NO SUBTITLES ADDED — no file open".to_string(), |
| 1400 | }; | 1400 | }; |
| 1401 | eprintln!("{text}"); | 1401 | eprintln!("{text}"); |
| 1402 | self.notify_user(text.into()); | 1402 | self.notify_user(text.into()); |
| @@ -1461,7 +1461,7 @@ impl Player { | |||
| 1461 | ) | 1461 | ) |
| 1462 | } | 1462 | } |
| 1463 | Some(Err(e)) => format!("NO SUBTITLES REMOVED — {e}"), | 1463 | Some(Err(e)) => format!("NO SUBTITLES REMOVED — {e}"), |
| 1464 | - None => "NO SUBTITLES REMOVED — open a file first".to_string(), | 1464 | + None => "NO SUBTITLES REMOVED — no file open".to_string(), |
| 1465 | }; | 1465 | }; |
| 1466 | eprintln!("{text}"); | 1466 | eprintln!("{text}"); |
| 1467 | self.notify_user(text.into()); | 1467 | self.notify_user(text.into()); |
| @@ -1587,7 +1587,7 @@ impl Player { | |||
| 1587 | format!("SAVED {}", file_name(&self.project_path)) | 1587 | format!("SAVED {}", file_name(&self.project_path)) |
| 1588 | } | 1588 | } |
| 1589 | Some(Err(e)) => format!("SAVE FAILED: {e}"), | 1589 | Some(Err(e)) => format!("SAVE FAILED: {e}"), |
| 1590 | - None => "NOTHING TO SAVE — open a file first".to_string(), | 1590 | + None => "NOTHING TO SAVE — no file open".to_string(), |
| 1591 | }; | 1591 | }; |
| 1592 | eprintln!("{text}"); | 1592 | eprintln!("{text}"); |
| 1593 | self.notify_user(text.into()); | 1593 | self.notify_user(text.into()); |
| @@ -1751,22 +1751,14 @@ impl Player { | |||
| 1751 | let lane = session.add_lane(kind); | 1751 | let lane = session.add_lane(kind); |
| 1752 | self.notify_user( | 1752 | self.notify_user( |
| 1753 | format!( | 1753 | format!( |
| 1754 | - "{} ADDED — drag {} onto it, {} takes it back", | 1754 | + "{} ADDED · undo {}", |
| 1755 | lane.label(), | 1755 | lane.label(), |
| 1756 | - // A subtitle lane takes no clip at all: what lands on it | ||
| 1757 | - // is a palette row, so the notice names the panel the | ||
| 1758 | - // hand has to go to rather than "a clip", which is the | ||
| 1759 | - // one thing that will never work here. | ||
| 1760 | - match kind { | ||
| 1761 | - LaneKind::Subtitle => "a subtitle from the panel", | ||
| 1762 | - _ => "a clip", | ||
| 1763 | - }, | ||
| 1764 | self.keymap.display(ActionId::Undo) | 1756 | self.keymap.display(ActionId::Undo) |
| 1765 | ) | 1757 | ) |
| 1766 | .into(), | 1758 | .into(), |
| 1767 | ); | 1759 | ); |
| 1768 | } | 1760 | } |
| 1769 | - None => self.notify_user("NO TRACK ADDED — open a file first".into()), | 1761 | + None => self.notify_user("NO TRACK ADDED — no file open".into()), |
| 1770 | } | 1762 | } |
| 1771 | cx.notify(); | 1763 | cx.notify(); |
| 1772 | } | 1764 | } |
| @@ -1809,7 +1801,7 @@ impl Player { | |||
| 1809 | ) | 1801 | ) |
| 1810 | } | 1802 | } |
| 1811 | Some(Err(e)) => format!("NO TRACK REMOVED — {e}"), | 1803 | Some(Err(e)) => format!("NO TRACK REMOVED — {e}"), |
| 1812 | - None => "NO TRACK REMOVED — open a file first".to_string(), | 1804 | + None => "NO TRACK REMOVED — no file open".to_string(), |
| 1813 | }; | 1805 | }; |
| 1814 | self.notify_user(text.into()); | 1806 | self.notify_user(text.into()); |
| 1815 | cx.notify(); | 1807 | cx.notify(); |
| @@ -1863,7 +1855,7 @@ impl Player { | |||
| 1863 | } | 1855 | } |
| 1864 | self.notify_user( | 1856 | self.notify_user( |
| 1865 | format!( | 1857 | format!( |
| 1866 | - "{} IS TRACK {} NOW — {} puts it back", | 1858 | + "{} IS TRACK {} NOW · undo {}", |
| 1867 | moved.label(), | 1859 | moved.label(), |
| 1868 | to + 1, | 1860 | to + 1, |
| 1869 | self.keymap.display(ActionId::Undo) | 1861 | self.keymap.display(ActionId::Undo) |
| @@ -1901,7 +1893,7 @@ impl Player { | |||
| 1901 | LaneKind::Subtitle => "subtitle", | 1893 | LaneKind::Subtitle => "subtitle", |
| 1902 | } | 1894 | } |
| 1903 | ), | 1895 | ), |
| 1904 | - false => "NO TRACK REMOVED — open a file first".to_string(), | 1896 | + false => "NO TRACK REMOVED — no file open".to_string(), |
| 1905 | } | 1897 | } |
| 1906 | .into(), | 1898 | .into(), |
| 1907 | ); | 1899 | ); |
crates/app/src/player/timeline_edit.rsmodified+16 -17
| @@ -73,7 +73,7 @@ impl Player { | |||
| 73 | self.selected.clear(); | 73 | self.selected.clear(); |
| 74 | } else { | 74 | } else { |
| 75 | self.notify_user( | 75 | self.notify_user( |
| 76 | - "NOTHING TO REGROUP — put the playhead where two clips meet, on frames that were cut apart" | 76 | + "NOTHING TO REGROUP — no cut under the playhead" |
| 77 | .into(), | 77 | .into(), |
| 78 | ); | 78 | ); |
| 79 | } | 79 | } |
| @@ -98,7 +98,7 @@ impl Player { | |||
| 98 | } | 98 | } |
| 99 | } | 99 | } |
| 100 | (Some(_), None) => { | 100 | (Some(_), None) => { |
| 101 | - self.notify_user("NOTHING DETACHED — click the take to take apart first".into()) | 101 | + self.notify_user("NOTHING DETACHED — nothing selected".into()) |
| 102 | } | 102 | } |
| 103 | (None, _) => {} | 103 | (None, _) => {} |
| 104 | } | 104 | } |
| @@ -127,7 +127,7 @@ impl Player { | |||
| 127 | let picks = self.marks().0; | 127 | let picks = self.marks().0; |
| 128 | match (&mut self.session, self.selected.anchor(), picks.len()) { | 128 | match (&mut self.session, self.selected.anchor(), picks.len()) { |
| 129 | (_, None, _) => { | 129 | (_, None, _) => { |
| 130 | - self.notify_user("NOTHING GROUPED — click one of the halves first".into()) | 130 | + self.notify_user("NOTHING GROUPED — nothing selected".into()) |
| 131 | } | 131 | } |
| 132 | // The hand's group: every pick, one id. | 132 | // The hand's group: every pick, one id. |
| 133 | (Some(session), _, 2..) => { | 133 | (Some(session), _, 2..) => { |
| @@ -147,8 +147,7 @@ impl Player { | |||
| 147 | } | 147 | } |
| 148 | } | 148 | } |
| 149 | None => self.notify_user( | 149 | None => self.notify_user( |
| 150 | - "NOTHING TO GROUP WITH — no clip on another track covers exactly these \ | 150 | + "NOTHING TO GROUP WITH — no clip covers these frames" |
| 151 | - frames; ctrl-click the clips to group instead" | ||
| 152 | .into(), | 151 | .into(), |
| 153 | ), | 152 | ), |
| 154 | }, | 153 | }, |
| @@ -239,7 +238,7 @@ impl Player { | |||
| 239 | } | 238 | } |
| 240 | } | 239 | } |
| 241 | (Some(_), None) => { | 240 | (Some(_), None) => { |
| 242 | - self.notify_user("NOTHING LIFTED — click the half to remove first".into()) | 241 | + self.notify_user("NOTHING LIFTED — nothing selected".into()) |
| 243 | } | 242 | } |
| 244 | (None, _) => {} | 243 | (None, _) => {} |
| 245 | } | 244 | } |
| @@ -407,7 +406,7 @@ impl Player { | |||
| 407 | // cannot be dragged. | 406 | // cannot be dragged. |
| 408 | false if from.kind != to.kind => self.notify_user( | 407 | false if from.kind != to.kind => self.notify_user( |
| 409 | format!( | 408 | format!( |
| 410 | - "NOT ON {} — that is a {kind} clip; drop it on a {lanes} lane", | 409 | + "NOT ON {} — a {kind} clip takes a {lanes} lane", |
| 411 | to.label() | 410 | to.label() |
| 412 | ) | 411 | ) |
| 413 | .into(), | 412 | .into(), |
| @@ -530,10 +529,10 @@ impl Player { | |||
| 530 | // The row is greyed and says why in the list; here it says why at | 529 | // The row is greyed and says why in the list; here it says why at |
| 531 | // the moment somebody tried to use it anyway. | 530 | // the moment somebody tried to use it anyway. |
| 532 | (None, Some(_)) => Some( | 531 | (None, Some(_)) => Some( |
| 533 | - "NOT PLACED — that subtitle track has no cues to place; the list says why" | 532 | + "NOT PLACED — that subtitle track has no cues" |
| 534 | .to_string(), | 533 | .to_string(), |
| 535 | ), | 534 | ), |
| 536 | - (_, None) => Some("NOT PLACED — open a file first".to_string()), | 535 | + (_, None) => Some("NOT PLACED — no file open".to_string()), |
| 537 | }; | 536 | }; |
| 538 | match (text, marked) { | 537 | match (text, marked) { |
| 539 | (Some(text), _) => self.notify_user(text.into()), | 538 | (Some(text), _) => self.notify_user(text.into()), |
| @@ -679,7 +678,7 @@ impl Player { | |||
| 679 | .is_some_and(|session| session.lift_sub(lane, idx)); | 678 | .is_some_and(|session| session.lift_sub(lane, idx)); |
| 680 | let text = match lifted { | 679 | let text = match lifted { |
| 681 | true => format!( | 680 | true => format!( |
| 682 | - "CAPTION LIFTED — {} puts it back", | 681 | + "CAPTION LIFTED · undo {}", |
| 683 | self.keymap.display(ActionId::Undo) | 682 | self.keymap.display(ActionId::Undo) |
| 684 | ), | 683 | ), |
| 685 | false => "NOTHING LIFTED — that caption is not there any more".to_string(), | 684 | false => "NOTHING LIFTED — that caption is not there any more".to_string(), |
| @@ -1254,7 +1253,7 @@ impl Player { | |||
| 1254 | }; | 1253 | }; |
| 1255 | self.notify_user( | 1254 | self.notify_user( |
| 1256 | format!( | 1255 | format!( |
| 1257 | - "GAP CLOSED on {where_} — {} takes it back", | 1256 | + "GAP CLOSED on {where_} · undo {}", |
| 1258 | self.keymap.display(ActionId::Undo) | 1257 | self.keymap.display(ActionId::Undo) |
| 1259 | ) | 1258 | ) |
| 1260 | .into(), | 1259 | .into(), |
| @@ -1291,12 +1290,12 @@ impl Player { | |||
| 1291 | let notice = match (report.closed, skipped) { | 1290 | let notice = match (report.closed, skipped) { |
| 1292 | (0, 0) => format!("NO GAPS TO CLOSE on {}", lane.label()), | 1291 | (0, 0) => format!("NO GAPS TO CLOSE on {}", lane.label()), |
| 1293 | (0, 1) => format!( | 1292 | (0, 1) => format!( |
| 1294 | - "NO GAPS CLOSED on {} — 1 skipped at {}; match linked gaps or detach", | 1293 | + "NO GAPS CLOSED on {} — 1 linked gap skipped at {}", |
| 1295 | lane.label(), | 1294 | lane.label(), |
| 1296 | report.skipped[0].start | 1295 | report.skipped[0].start |
| 1297 | ), | 1296 | ), |
| 1298 | (0, n) => format!( | 1297 | (0, n) => format!( |
| 1299 | - "NO GAPS CLOSED on {} — {n} skipped; match linked gaps or detach", | 1298 | + "NO GAPS CLOSED on {} — {n} linked gaps skipped", |
| 1300 | lane.label() | 1299 | lane.label() |
| 1301 | ), | 1300 | ), |
| 1302 | (n, 0) => format!( | 1301 | (n, 0) => format!( |
| @@ -1592,7 +1591,7 @@ impl Player { | |||
| 1592 | _ => self.selected.anchor(), | 1591 | _ => self.selected.anchor(), |
| 1593 | }) else { | 1592 | }) else { |
| 1594 | self.notify_user( | 1593 | self.notify_user( |
| 1595 | - "NOTHING TO CROSSFADE — select an audio clip that has a neighbour".into(), | 1594 | + "NOTHING TO CROSSFADE — no audio clip selected".into(), |
| 1596 | ); | 1595 | ); |
| 1597 | cx.notify(); | 1596 | cx.notify(); |
| 1598 | return; | 1597 | return; |
| @@ -1601,7 +1600,7 @@ impl Player { | |||
| 1601 | if let Some(session) = &mut self.session { | 1600 | if let Some(session) = &mut self.session { |
| 1602 | if !session.crossfade(lane, idx, frames) { | 1601 | if !session.crossfade(lane, idx, frames) { |
| 1603 | self.notify_user( | 1602 | self.notify_user( |
| 1604 | - "NOTHING TO CROSSFADE — it takes two audio clips sitting end to end on one lane" | 1603 | + "NOTHING TO CROSSFADE — no neighbour end to end" |
| 1605 | .into(), | 1604 | .into(), |
| 1606 | ); | 1605 | ); |
| 1607 | } | 1606 | } |
| @@ -1624,7 +1623,7 @@ impl Player { | |||
| 1624 | _ => self.selected.anchor(), | 1623 | _ => self.selected.anchor(), |
| 1625 | }) else { | 1624 | }) else { |
| 1626 | self.notify_user( | 1625 | self.notify_user( |
| 1627 | - "NOTHING TO DISSOLVE — select a video clip that has a neighbour".into(), | 1626 | + "NOTHING TO DISSOLVE — no video clip selected".into(), |
| 1628 | ); | 1627 | ); |
| 1629 | cx.notify(); | 1628 | cx.notify(); |
| 1630 | return; | 1629 | return; |
| @@ -1641,7 +1640,7 @@ impl Player { | |||
| 1641 | }; | 1640 | }; |
| 1642 | if !session.set_transition_out(lane, idx, frames) { | 1641 | if !session.set_transition_out(lane, idx, frames) { |
| 1643 | self.notify_user( | 1642 | self.notify_user( |
| 1644 | - "NOTHING TO DISSOLVE — it takes two video clips sitting end to end on one lane" | 1643 | + "NOTHING TO DISSOLVE — no neighbour end to end" |
| 1645 | .into(), | 1644 | .into(), |
| 1646 | ); | 1645 | ); |
| 1647 | } else if removing { | 1646 | } else if removing { |
crates/app/src/player/view.rsmodified+3 -4
| @@ -55,7 +55,7 @@ impl Player { | |||
| 55 | pub(crate) fn select_under_playhead(&mut self, cx: &mut Context<Self>) { | 55 | pub(crate) fn select_under_playhead(&mut self, cx: &mut Context<Self>) { |
| 56 | let under = self.under_playhead(); | 56 | let under = self.under_playhead(); |
| 57 | let Some(&first) = under.first() else { | 57 | let Some(&first) = under.first() else { |
| 58 | - self.notify_user("NOTHING UNDER THE PLAYHEAD — move it onto a clip first".into()); | 58 | + self.notify_user("NOTHING UNDER THE PLAYHEAD".into()); |
| 59 | cx.notify(); | 59 | cx.notify(); |
| 60 | return; | 60 | return; |
| 61 | }; | 61 | }; |
| @@ -133,7 +133,7 @@ impl Player { | |||
| 133 | return; | 133 | return; |
| 134 | } | 134 | } |
| 135 | let Some(session) = &mut self.session else { | 135 | let Some(session) = &mut self.session else { |
| 136 | - self.notify_user("no timeline to fit — open a file first".into()); | 136 | + self.notify_user("no timeline to fit — no file open".into()); |
| 137 | cx.notify(); | 137 | cx.notify(); |
| 138 | return; | 138 | return; |
| 139 | }; | 139 | }; |
| @@ -151,8 +151,7 @@ impl Player { | |||
| 151 | Some(half) => Some(half), | 151 | Some(half) => Some(half), |
| 152 | None => { | 152 | None => { |
| 153 | self.notify_user( | 153 | self.notify_user( |
| 154 | - "NOTHING TO FIT — a caption has no picture; group it with a clip \ | 154 | + "NOTHING TO FIT — a caption has no picture" |
| 155 | - first (ctrl-click both, then Group)" | ||
| 156 | .into(), | 155 | .into(), |
| 157 | ); | 156 | ); |
| 158 | cx.notify(); | 157 | cx.notify(); |
crates/app/src/subs.rsmodified+5 -6
| @@ -320,10 +320,10 @@ pub(crate) type Subs = engine::Result<Vec<engine::subtitle::SubtitleTrack>>; | |||
| 320 | /// argv named, an import, and an import into an empty window cannot say the same | 320 | /// argv named, an import, and an import into an empty window cannot say the same |
| 321 | /// thing differently, whichever thread read the cues. | 321 | /// thing differently, whichever thread read the cues. |
| 322 | /// | 322 | /// |
| 323 | -/// Worded for where they actually land: a *list* beside the media and nothing | 323 | +/// A count and nothing else (DESIGN §8: the room never explains itself in |
| 324 | -/// over the picture -- a track shows when it is dragged onto a subtitle lane | 324 | +/// prose). The tracks land in a *list* beside the media, not over the picture |
| 325 | -/// ([`Player::subtitle_overlay`]), so the tail says the next move rather than | 325 | +/// ([`Player::subtitle_overlay`] shows one once it is on a subtitle lane) -- |
| 326 | -/// letting a count read as "and there they are on screen". | 326 | +/// where they went is the list's own geography to say, not this line's. |
| 327 | /// | 327 | /// |
| 328 | /// `None` for a file that gave none and for one whose tracks are on the timeline | 328 | /// `None` for a file that gave none and for one whose tracks are on the timeline |
| 329 | /// already -- an import that adds nothing says nothing about subtitles. A | 329 | /// already -- an import that adds nothing says nothing about subtitles. A |
| @@ -334,8 +334,7 @@ pub(crate) fn subtitle_tail(session: &mut PlaybackSession, subs: Subs) -> Option | |||
| 334 | Ok(tracks) => match session.add_subtitle_tracks(tracks) { | 334 | Ok(tracks) => match session.add_subtitle_tracks(tracks) { |
| 335 | 0 => None, | 335 | 0 => None, |
| 336 | n => Some(format!( | 336 | n => Some(format!( |
| 337 | - " — {n} subtitle track(s) in the file, in the subtitle list: drag one onto a \ | 337 | + " · {n} subtitle track(s)" |
| 338 | - subtitle track to show it" | ||
| 339 | )), | 338 | )), |
| 340 | }, | 339 | }, |
| 341 | Err(e) => Some(format!(" — SUBTITLES UNREAD: {e}")), | 340 | Err(e) => Some(format!(" — SUBTITLES UNREAD: {e}")), |
crates/app/src/tests/layout.rsmodified+97 -0
| @@ -3211,3 +3211,100 @@ fn the_cut_readout_counts_from_the_playhead() { | |||
| 3211 | "the readout must derive its odometer from the playhead" | 3211 | "the readout must derive its odometer from the playhead" |
| 3212 | ); | 3212 | ); |
| 3213 | } | 3213 | } |
| 3214 | + | ||
| 3215 | +/// DESIGN §8's rejected pattern, swept over the source rather than argued | ||
| 3216 | +/// per message: "the room never explains itself in prose ... any new string | ||
| 3217 | +/// over ~4 words that instructs rather than reports state is a defect". The | ||
| 3218 | +/// notices are what the ledger strip paints, and a sentence there is what cut | ||
| 3219 | +/// mid-word in the user's own screenshot (`OPENED ... 1 subtitle track(s) in `). | ||
| 3220 | +/// | ||
| 3221 | +/// The scan reads every notice-shaped literal -- one whose first word is a | ||
| 3222 | +/// state word in capitals, which is how every message this window pushes | ||
| 3223 | +/// opens -- and refuses one that is both long (over eight words) and | ||
| 3224 | +/// instructional (an imperative tell). A refusal *claim* may still be long: | ||
| 3225 | +/// those are the allowlist below, each one naming a genuine absent capability, | ||
| 3226 | +/// never a lesson in how to use the room. | ||
| 3227 | +#[test] | ||
| 3228 | +fn no_notice_teaches_the_room_in_prose() { | ||
| 3229 | + // Long refusal claims that report a capability genuinely absent from this | ||
| 3230 | + // machine (DESIGN §8, "a refusal string is a claim"), kept whole on | ||
| 3231 | + // purpose: the remedy is not a chord in this room because the missing | ||
| 3232 | + // thing is not in this room. | ||
| 3233 | + const ALLOWED: &[&str] = &["NO FILE CHOOSER"]; | ||
| 3234 | + const TELLS: &[&str] = &[ | ||
| 3235 | + "drag ", | ||
| 3236 | + "press ", | ||
| 3237 | + "pick ", | ||
| 3238 | + "type ", | ||
| 3239 | + "click ", | ||
| 3240 | + "to show", | ||
| 3241 | + "to use", | ||
| 3242 | + "takes it back", | ||
| 3243 | + "puts it back", | ||
| 3244 | + "first", | ||
| 3245 | + "instead", | ||
| 3246 | + ]; | ||
| 3247 | + let mut offenders = Vec::new(); | ||
| 3248 | + for path in source_files() { | ||
| 3249 | + let text = std::fs::read_to_string(&path).expect("a source file"); | ||
| 3250 | + for literal in string_literals(&text) { | ||
| 3251 | + // A notice opens with its state in capitals -- placeholders in | ||
| 3252 | + // front of it (`{count} SILENCES CUT`) are stepped over. | ||
| 3253 | + let head = literal | ||
| 3254 | + .split_whitespace() | ||
| 3255 | + .find(|word| !word.starts_with('{')) | ||
| 3256 | + .unwrap_or(""); | ||
| 3257 | + let shouty = head.len() >= 2 | ||
| 3258 | + && head | ||
| 3259 | + .chars() | ||
| 3260 | + .all(|c| c.is_ascii_uppercase() || c == '-' || c == ':'); | ||
| 3261 | + if !shouty || ALLOWED.iter().any(|allowed| literal.starts_with(allowed)) { | ||
| 3262 | + continue; | ||
| 3263 | + } | ||
| 3264 | + let long = literal.split_whitespace().count() > 8; | ||
| 3265 | + if long && TELLS.iter().any(|tell| literal.contains(tell)) { | ||
| 3266 | + offenders.push(format!("{}: {literal}", path.display())); | ||
| 3267 | + } | ||
| 3268 | + } | ||
| 3269 | + } | ||
| 3270 | + assert!( | ||
| 3271 | + offenders.is_empty(), | ||
| 3272 | + "a notice that instructs instead of reporting state (DESIGN §8):\n{}", | ||
| 3273 | + offenders.join("\n") | ||
| 3274 | + ); | ||
| 3275 | +} | ||
| 3276 | + | ||
| 3277 | +/// Every string literal in `text`, comments dropped first so the prose about | ||
| 3278 | +/// a message is never read as the message. | ||
| 3279 | +fn string_literals(text: &str) -> Vec<String> { | ||
| 3280 | + let code: String = text | ||
| 3281 | + .lines() | ||
| 3282 | + .filter(|line| !line.trim_start().starts_with("//")) | ||
| 3283 | + .collect::<Vec<_>>() | ||
| 3284 | + .join("\n"); | ||
| 3285 | + let mut out = Vec::new(); | ||
| 3286 | + let mut chars = code.chars().peekable(); | ||
| 3287 | + while let Some(c) = chars.next() { | ||
| 3288 | + if c != '"' { | ||
| 3289 | + continue; | ||
| 3290 | + } | ||
| 3291 | + let mut literal = String::new(); | ||
| 3292 | + while let Some(c) = chars.next() { | ||
| 3293 | + match c { | ||
| 3294 | + // A line continuation joins the halves of a wrapped message; | ||
| 3295 | + // every other escape is not a word either way. | ||
| 3296 | + '\\' => { | ||
| 3297 | + if chars.next() == Some('\n') { | ||
| 3298 | + while chars.peek() == Some(&' ') { | ||
| 3299 | + chars.next(); | ||
| 3300 | + } | ||
| 3301 | + } | ||
| 3302 | + } | ||
| 3303 | + '"' => break, | ||
| 3304 | + _ => literal.push(c), | ||
| 3305 | + } | ||
| 3306 | + } | ||
| 3307 | + out.push(literal); | ||
| 3308 | + } | ||
| 3309 | + out | ||
| 3310 | +} | ||
crates/app/src/tests/view.rsmodified+3 -3
| @@ -111,11 +111,11 @@ fn a_lane_refuses_the_files_it_cannot_hold_before_the_release_says_so() { | |||
| 111 | let movie = Path::new("/media/take.mp4"); | 111 | let movie = Path::new("/media/take.mp4"); |
| 112 | assert_eq!( | 112 | assert_eq!( |
| 113 | lane_refuses(sound, video, false).as_deref(), | 113 | lane_refuses(sound, video, false).as_deref(), |
| 114 | - Some("NOT ON V1 — take.mp3 has no picture; drop it on an audio lane") | 114 | + Some("NOT ON V1 — take.mp3 has no picture") |
| 115 | ); | 115 | ); |
| 116 | assert_eq!( | 116 | assert_eq!( |
| 117 | lane_refuses(still, audio, true).as_deref(), | 117 | lane_refuses(still, audio, true).as_deref(), |
| 118 | - Some("NOT ON A1 — card.png is a still image; drop it on a video lane") | 118 | + Some("NOT ON A1 — card.png is a still image") |
| 119 | ); | 119 | ); |
| 120 | // ...and every lane a file *can* go on says nothing at all, which is a | 120 | // ...and every lane a file *can* go on says nothing at all, which is a |
| 121 | // ghost drawn in the file's own colour. | 121 | // ghost drawn in the file's own colour. |
| @@ -131,7 +131,7 @@ fn a_lane_refuses_the_files_it_cannot_hold_before_the_release_says_so() { | |||
| 131 | // twin above got -- `has_video` is what decides it now, not the suffix. | 131 | // twin above got -- `has_video` is what decides it now, not the suffix. |
| 132 | assert_eq!( | 132 | assert_eq!( |
| 133 | lane_refuses(movie, video, false).as_deref(), | 133 | lane_refuses(movie, video, false).as_deref(), |
| 134 | - Some("NOT ON V1 — take.mp4 has no picture; drop it on an audio lane") | 134 | + Some("NOT ON V1 — take.mp4 has no picture") |
| 135 | ); | 135 | ); |
| 136 | // ...and a subtitle lane holds none of the three: a caption comes off the | 136 | // ...and a subtitle lane holds none of the three: a caption comes off the |
| 137 | // Subtitles list, which is where the refusal points. | 137 | // Subtitles list, which is where the refusal points. |
crates/app/src/timeline_math.rsmodified+2 -2
| @@ -659,10 +659,10 @@ pub(crate) fn lane_refuses(path: &Path, lane: Lane, has_video: bool) -> Option<S | |||
| 659 | let label = lane.label(); | 659 | let label = lane.label(); |
| 660 | match lane.kind { | 660 | match lane.kind { |
| 661 | LaneKind::Video if !has_video => Some(format!( | 661 | LaneKind::Video if !has_video => Some(format!( |
| 662 | - "NOT ON {label} — {name} has no picture; drop it on an audio lane" | 662 | + "NOT ON {label} — {name} has no picture" |
| 663 | )), | 663 | )), |
| 664 | LaneKind::Audio if engine::is_image(path) => Some(format!( | 664 | LaneKind::Audio if engine::is_image(path) => Some(format!( |
| 665 | - "NOT ON {label} — {name} is a still image; drop it on a video lane" | 665 | + "NOT ON {label} — {name} is a still image" |
| 666 | )), | 666 | )), |
| 667 | // A subtitle lane holds words and no media at all: the refusal is here | 667 | // A subtitle lane holds words and no media at all: the refusal is here |
| 668 | // rather than at the engine's door so the shadow is tinted red on the | 668 | // rather than at the engine's door so the shadow is tinted red on the |
crates/app/src/transport.rsmodified+1 -1
| @@ -8,7 +8,7 @@ pub(crate) const NO_FILE: &str = "no file open"; | |||
| 8 | 8 | ||
| 9 | /// What a press of play says when there is nothing to play: no timeline at all | 9 | /// What a press of play says when there is nothing to play: no timeline at all |
| 10 | /// and an emptied one are the same answer to the user, so they are one line. | 10 | /// and an emptied one are the same answer to the user, so they are one line. |
| 11 | -pub(crate) const NOTHING_TO_PLAY: &str = "NOTHING TO PLAY — put a clip on the timeline first"; | 11 | +pub(crate) const NOTHING_TO_PLAY: &str = "NOTHING TO PLAY — the timeline is empty"; |
| 12 | 12 | ||
| 13 | /// Whether a press of play would have anything to play. No timeline at all and | 13 | /// Whether a press of play would have anything to play. No timeline at all and |
| 14 | /// one every clip has been taken off are the same state to a transport, and the | 14 | /// one every clip has been taken off are the same state to a transport, and the |
crates/app/src/ui/stance.rsmodified+7 -2
| @@ -853,13 +853,18 @@ fn ledger(player: &Player, position: f64) -> impl IntoElement { | |||
| 853 | div() | 853 | div() |
| 854 | .flex_1() | 854 | .flex_1() |
| 855 | .min_w(px(0.)) | 855 | .min_w(px(0.)) |
| 856 | - .truncate() | 856 | + // Ellipsis, not a bare cut: `.truncate()` stops mid-word with |
| 857 | + // nothing saying it stopped (user report, `… 1 subtitle track(s) | ||
| 858 | + // in `). The name inside the message is elided through its | ||
| 859 | + // middle first ([`ledger_line`]) so the state word at the front | ||
| 860 | + // is never what the strip drops. | ||
| 861 | + .text_ellipsis() | ||
| 857 | .type_style(type_scale::mono( | 862 | .type_style(type_scale::mono( |
| 858 | type_scale::CHORD_METADATA_MIN_PX, | 863 | type_scale::CHORD_METADATA_MIN_PX, |
| 859 | gpui::FontWeight::MEDIUM, | 864 | gpui::FontWeight::MEDIUM, |
| 860 | )) | 865 | )) |
| 861 | .text_color(rgb(action_ink)) | 866 | .text_color(rgb(action_ink)) |
| 862 | - .child(last_action), | 867 | + .child(ledger_line(&last_action)), |
| 863 | ) | 868 | ) |
| 864 | .children(export.map(|e| { | 869 | .children(export.map(|e| { |
| 865 | div() | 870 | div() |