forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'main' into worktree-agent-a955ece7297a7169d

Browse files at this commit

166e4a18dd23d9409064da9fe875f7c1f14595d4Ahmet Kaan GümüşParent: e5fd6102e8c290

27 changed files +1744 -305

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/importing.rsmodified+1 -1
@@ -45,7 +45,7 @@ impl LibraryTab {
45 pub(crate) fn empty(self) -> &'static str {45 pub(crate) fn empty(self) -> &'static str {
46 match self {46 match self {
47 LibraryTab::Media => "No video",47 LibraryTab::Media => "No video",
48- LibraryTab::Audio => "No sound",48+ LibraryTab::Audio => "none",
49 LibraryTab::Text => "No subtitles",49 LibraryTab::Text => "No subtitles",
50 }50 }
51 }51 }
crates/app/src/interact.rsmodified+47 -17
@@ -247,6 +247,17 @@ pub(crate) fn drag_scrim(cx: &mut Context<Player>) -> Div {
247 /// dragging right now ([`Player::split_drag`]), which the pointer leaves on the247 /// dragging right now ([`Player::split_drag`]), which the pointer leaves on the
248 /// first move -- so the lit line has to come from the model, not from `hover`.248 /// first move -- so the lit line has to come from the model, not from `hover`.
249 ///249 ///
250+/// What the *hand* aims at is wider than what the eye is given: the press and
251+/// the resize cursor live on a [`GRAB_W`] band centred on the *line the eye
252+/// sees* -- one row above the strip, so it reaches past the panel edge the
253+/// strip stands in front of rather than being centred on the strip -- mounted
254+/// absolutely so it overlays its neighbours instead of pushing them (the strip
255+/// keeps its [`SPLIT_W`] of layout, and `layout::split_drag_size` keeps
256+/// answering in strip coordinates). A 6 px target missed by 5 px is a resize
257+/// the hand cannot find, which is the same as no resize at all (user
258+/// 2026-09-09: "panes should be enlargable and shrinkable" -- they already
259+/// were).
260+///
250 /// A double press resets the seam to the window's own share261 /// A double press resets the seam to the window's own share
251 /// ([`Splits::clear`]): the cheap way back from a layout dragged somewhere262 /// ([`Splits::clear`]): the cheap way back from a layout dragged somewhere
252 /// unusable, and the one every editor's dividers answer to.263 /// unusable, and the one every editor's dividers answer to.
@@ -269,23 +280,42 @@ pub(crate) fn divider(split: Split, held: bool, cx: &mut Context<Player>) -> Div
269 .when(!held, |d| {280 .when(!held, |d| {
270 d.hover(|s| s.border_color(rgb(STROKE_DIVIDER())))281 d.hover(|s| s.border_color(rgb(STROKE_DIVIDER())))
271 })282 })
272- .on_mouse_down(283+ .relative()
273- MouseButton::Left,284+ .child(
274- cx.listener(move |this, event: &MouseDownEvent, _, cx| {285+ div()
275- match event.click_count >= 2 {286+ .absolute()
276- // The reset is written where a release would have written287+ .when(across, |d| {
277- // the drag, the same small round trip: a seam put back by288+ d.left_0()
278- // hand must not come back on the next launch.289+ .right_0()
279- true => {290+ .top(px(-1.))
280- this.split_drag = None;291+ .h(px(GRAB_W))
281- this.splits.clear(split);292+ .cursor_row_resize()
282- crate::layout::save_stance_splits(&this.splits);293+ })
283- }294+ .when(!across, |d| {
284- false => this.split_drag = Some(split),295+ d.top_0()
285- }296+ .bottom_0()
286- cx.notify();297+ .left(px(-1.))
287- cx.stop_propagation();298+ .w(px(GRAB_W))
288- }),299+ .cursor_col_resize()
300+ })
301+ .on_mouse_down(
302+ MouseButton::Left,
303+ cx.listener(move |this, event: &MouseDownEvent, _, cx| {
304+ match event.click_count >= 2 {
305+ // The reset is written where a release would have written
306+ // the drag, the same small round trip: a seam put back by
307+ // hand must not come back on the next launch.
308+ true => {
309+ this.split_drag = None;
310+ this.splits.clear(split);
311+ crate::layout::save_stance_splits(&this.splits);
312+ }
313+ false => this.split_drag = Some(split),
314+ }
315+ cx.notify();
316+ cx.stop_propagation();
317+ }),
318+ ),
289 )319 )
290 }320 }
291 321
crates/app/src/layout.rsmodified+19 -0
@@ -93,6 +93,13 @@ pub(crate) const EXPORT_KEY_W: f32 = 26.;
93 pub(crate) const MENU_W: f32 = 260.;93 pub(crate) const MENU_W: f32 = 260.;
94 pub(crate) const MENU_ROW_H: f32 = HIT_MIN;94 pub(crate) const MENU_ROW_H: f32 = HIT_MIN;
95 pub(crate) const MENU_PAD: f32 = 6.;95 pub(crate) const MENU_PAD: f32 = 6.;
96+/// The breathing room a hanging menu keeps against every window edge. Without
97+/// it `menu_at`'s clamp let a menu sit flush on the bottom edge -- the last row
98+/// touching the frame reads as a list cut off rather than a list that ended,
99+/// which is what the user saw at 1280x720 (`f-clip-menu.png`, rows running to
100+/// y=720 exactly). Taken out of the room the list may fill as well as off the
101+/// clamp, so a floored menu never grows back up over the picture to buy it.
102+pub(crate) const MENU_EDGE: f32 = 4.;
96 103
97 /// A cue's text, and the line it sits on. Fixed rather than a share of the104 /// A cue's text, and the line it sits on. Fixed rather than a share of the
98 /// picture: the video region is 108 px tall at the 640x360 floor and a105 /// picture: the video region is 108 px tall at the 640x360 floor and a
@@ -293,6 +300,18 @@ impl Split {
293 /// it looks like.300 /// it looks like.
294 pub(crate) const SPLIT_W: f32 = 6.;301 pub(crate) const SPLIT_W: f32 = 6.;
295 302
303+/// How wide the same seam is *aimed at*. The strip above is what the layout
304+/// spends and the hairline is what the eye is given; this is the band the hand
305+/// gets, centred on the strip and overlaid on the two panels it parts, so
306+/// growing it moves nothing. 6 px asked the hand for precision it does not
307+/// have -- the lead's own press one row into the bench missed the seam by 5 px
308+/// and focused the bench instead ("panes should be enlargable and shrinkable",
309+/// of panes that already resized). 12 px is the ±6 px of aim every editor's
310+/// dividers allow, and it is hung one row above the strip rather than centred
311+/// on it: what a hand aims at is the line it can see (the panel's own edge at
312+/// the strip's far side), not the six transparent pixels in front of it.
313+pub(crate) const GRAB_W: f32 = 14.;
314+
296 /// The most of the window one side column may be dragged to. A third each, so315 /// The most of the window one side column may be dragged to. A third each, so
297 /// the picture keeps the middle at every size -- the rule [`library_w`] and316 /// the picture keeps the middle at every size -- the rule [`library_w`] and
298 /// [`inspector_w`] already lay an untouched window out by, kept once the hand317 /// [`inspector_w`] already lay an untouched window out by, kept once the hand
crates/app/src/menus.rsmodified+24 -18
@@ -112,8 +112,9 @@ pub(crate) enum Choice {
112 pub(crate) type ChoiceRow = (Choice, SharedString, SharedString, bool);112 pub(crate) type ChoiceRow = (Choice, SharedString, SharedString, bool);
113 113
114 /// What a library row's menu offers, in the order it lists them. Unlike the clip114 /// What a library row's menu offers, in the order it lists them. Unlike the clip
115-/// menu's items none of these is a stroke -- there is no keyboard way to a row --115+/// menu's items only one of these ([`RowItem::Add`]) is a stroke, and that one
116-/// so the label and the hint are written here rather than read off the keymap.116+/// is not a bindable [`ActionId`] but `ui/stance.rs`'s own `enter` branch, so
117+/// the label and the chord are written here rather than read off the keymap.
117 #[derive(Clone, Copy, PartialEq)]118 #[derive(Clone, Copy, PartialEq)]
118 pub(crate) enum RowItem {119 pub(crate) enum RowItem {
119 Add,120 Add,
@@ -142,29 +143,34 @@ impl RowItem {
142 match self {143 match self {
143 Self::Add => "Add at playhead",144 Self::Add => "Add at playhead",
144 Self::Remove => "Remove from library",145 Self::Remove => "Remove from library",
145- // Same label as the plain remove: only ever one of the two is on146+ // The consequence is in the label now rather than in the hint
146- // the plate (the oracle hides the other), so what differs is the147+ // column beside a label identical to the plain remove's: that
147- // consequence, and the consequence belongs in the hint column148+ // column carries chords ([`RowItem::hint`]), and a destructive
148- // where every other row states its own. The long dashed title149+ // verb whose difference from the row above it lived in dim grey
149- // truncated its own hint at `MENU_W`.150+ // prose is a verb that reads as the same verb. It fits `MENU_W`
150- Self::RemoveWithClips => "Remove from library",151+ // whole exactly because nothing is printed to its right.
152+ Self::RemoveWithClips => "Remove with its clips",
151 Self::Reveal => "Reveal in files",153 Self::Reveal => "Reveal in files",
152 Self::Properties => "Properties",154 Self::Properties => "Properties",
153 }155 }
154 }156 }
155 157
156- /// The dim right-hand column, where the clip menu prints the stroke: what158+ /// The dim right-hand column: the *stroke* that does the same thing, the
157- /// the item will do to the timeline, so nothing here is a surprise.159+ /// one thing DESIGN §4 puts there ("every command wears its chord"), and
160+ /// nothing at all where no stroke reaches the verb.
161+ ///
162+ /// It used to carry a prose gloss on every row -- a phrase about the whole
163+ /// file, one about the desktop's file browser, one about clips -- which is
164+ /// §8's instructional copy sitting in the column the sibling clip menu
165+ /// spends on chords, and which the user read as the crowding it is. The
166+ /// only row a stroke reaches is the add (`ui/stance.rs`'s `enter` branch,
167+ /// live while a dock row is picked); its own row in the dock already wears
168+ /// the same `↵`. A refusal still prints here in place of the chord
169+ /// (`oracle::row_enable`) -- that is state, not instruction.
158 pub(crate) fn hint(self) -> &'static str {170 pub(crate) fn hint(self) -> &'static str {
159 match self {171 match self {
160- // Short enough to sit beside its label inside `MENU_W`, the clip172+ Self::Add => "↵",
161- // menu's rule for a refusal: this column truncates, and a hint cut173+ Self::Remove | Self::RemoveWithClips | Self::Reveal | Self::Properties => "",
162- // off mid-word says less than a shorter one.
163- Self::Add => "the whole file",
164- Self::Remove => "nothing plays it",
165- Self::RemoveWithClips => "clips too",
166- Self::Reveal => "file manager",
167- Self::Properties => "…",
168 }174 }
169 }175 }
170 }176 }
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/oracle.rsmodified+9 -5
@@ -451,18 +451,22 @@ pub(crate) fn row_items(ctx: RowCtx) -> Vec<RowItem> {
451 /// How tall a menu's list may draw: the whole of it where the window has room,451 /// How tall a menu's list may draw: the whole of it where the window has room,
452 /// and what the window has where it has not -- only then does the list scroll.452 /// and what the window has where it has not -- only then does the list scroll.
453 /// A cap fixed at twelve rows put the last items behind a scroll on a window453 /// A cap fixed at twelve rows put the last items behind a scroll on a window
454-/// with room to spare, which reads as a menu cut off by the bottom edge.454+/// with room to spare, which reads as a menu cut off by the bottom edge. Both
455+/// [`MENU_EDGE`] margins come off the room first, so the plate `menu_at` places
456+/// from this always fits between them whatever the anchor.
455 pub(crate) fn menu_rows_h(rows: usize, viewport: Size<Pixels>) -> f32 {457 pub(crate) fn menu_rows_h(rows: usize, viewport: Size<Pixels>) -> f32 {
456- let room = f32::from(viewport.height) - MENU_PAD * 2.;458+ let room = f32::from(viewport.height) - MENU_PAD * 2. - MENU_EDGE * 2.;
457 (rows as f32 * MENU_ROW_H).min(room.max(MENU_ROW_H))459 (rows as f32 * MENU_ROW_H).min(room.max(MENU_ROW_H))
458 }460 }
459 461
460 /// Where the menu actually hangs: at the pointer, pulled back inside the window462 /// Where the menu actually hangs: at the pointer, pulled back inside the window
461 /// when it would not fit -- an item off the bottom edge is an item nobody can463 /// when it would not fit -- an item off the bottom edge is an item nobody can
462-/// click. Never negative, so a window smaller than the menu loses the bottom of464+/// click. All four edges, [`MENU_EDGE`] clear of each: a plate flush on the
463-/// it rather than the top, where the items are.465+/// frame reads as a list that was cut, not one that ended. Never past the top
466+/// or left edge, so a window smaller than the menu loses the bottom of it
467+/// rather than the top, where the items are.
464 pub(crate) fn menu_at(at: Point<Pixels>, viewport: Size<Pixels>, height: f32) -> (f32, f32) {468 pub(crate) fn menu_at(at: Point<Pixels>, viewport: Size<Pixels>, height: f32) -> (f32, f32) {
465- let fit = |v: f32, size: f32, room: f32| v.min(room - size).max(0.);469+ let fit = |v: f32, size: f32, room: f32| v.min(room - MENU_EDGE - size).max(MENU_EDGE);
466 (470 (
467 fit(f32::from(at.x), MENU_W, f32::from(viewport.width)),471 fit(f32::from(at.x), MENU_W, f32::from(viewport.width)),
468 fit(f32::from(at.y), height, f32::from(viewport.height)),472 fit(f32::from(at.y), height, f32::from(viewport.height)),
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+69 -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();
@@ -870,6 +866,45 @@ impl Player {
870 /// Nothing here is a clip's or even the project's -- it never reaches the866 /// Nothing here is a clip's or even the project's -- it never reaches the
871 /// export, which never burns a cue into the picture -- so like the mix867 /// export, which never burns a cue into the picture -- so like the mix
872 /// card it opens with no timeline required and nothing to refuse.868 /// card it opens with no timeline required and nothing to refuse.
869+ /// The settings page's Picture row: the next file this machine can write
870+ /// ([`ui::settings_stance::next_picture`] -- codec and container in one
871+ /// cycle now), through [`Self::set_format`] like every other pick, so the
872+ /// destination follows the format and a refusal is still said out loud.
873+ pub(crate) fn cycle_export_picture(&mut self) {
874+ let next = crate::ui::settings_stance::next_picture(self.format, |f| {
875+ self.session
876+ .as_ref()
877+ .and_then(|session| format_refusal(session, f))
878+ .is_some()
879+ });
880+ self.set_format(next);
881+ }
882+
883+ /// The Sound row: the next rate in [`engine::export::AUDIO_KBPS`], and
884+ /// nothing at all where the picked format's codec carries no rate -- the
885+ /// row shows no chord there either.
886+ pub(crate) fn cycle_audio_kbps(&mut self) {
887+ if !crate::ui::settings_stance::sound_codec(self.format).1 {
888+ return;
889+ }
890+ let at = AUDIO_KBPS
891+ .iter()
892+ .position(|&kbps| kbps == self.audio_kbps)
893+ .unwrap_or_default();
894+ self.audio_kbps = AUDIO_KBPS[(at + 1) % AUDIO_KBPS.len()];
895+ }
896+
897+ /// The Encoder row: the next seat, through [`Self::apply_encoder`] so the
898+ /// pick is said and saved with the project exactly as the card's own list
899+ /// row saves it.
900+ pub(crate) fn cycle_encoder(&mut self, cx: &mut Context<Self>) {
901+ let at = EncoderSeat::ALL
902+ .iter()
903+ .position(|&seat| seat == self.encoder_seat())
904+ .unwrap_or_default();
905+ self.apply_encoder(EncoderSeat::ALL[(at + 1) % EncoderSeat::ALL.len()], cx);
906+ }
907+
873 /// Opens the settings page (PROJECT rows beside EDITOR rows,908 /// Opens the settings page (PROJECT rows beside EDITOR rows,
874 /// `ui::settings_stance`): the one door for "edit project and editor909 /// `ui::settings_stance`): the one door for "edit project and editor
875 /// settings" -- refused while an export is running, same as every other910 /// settings" -- refused while an export is running, same as every other
@@ -1161,7 +1196,7 @@ impl Player {
1161 if self.silence_marks.is_empty() {1196 if self.silence_marks.is_empty() {
1162 self.notify_user(1197 self.notify_user(
1163 format!(1198 format!(
1164- "no silence under {:.0} dBFS lasting {:.2} s — raise the threshold or forgive less",1199+ "no silence under {:.0} dBFS lasting {:.2} s",
1165 self.silence.threshold_db, self.silence.min_silence1200 self.silence.threshold_db, self.silence.min_silence
1166 )1201 )
1167 .into(),1202 .into(),
@@ -1213,7 +1248,7 @@ impl Player {
1213 self.reset_after_reseek();1248 self.reset_after_reseek();
1214 self.notify_user(1249 self.notify_user(
1215 format!(1250 format!(
1216- "{count} SILENCES CUT {reach} — {} shorter, {} takes it back",1251+ "{count} SILENCES CUT {reach} — {} shorter · undo {}",
1217 secs_label(saved),1252 secs_label(saved),
1218 self.keymap.display(ActionId::Undo)1253 self.keymap.display(ActionId::Undo)
1219 )1254 )
@@ -1252,7 +1287,7 @@ impl Player {
1252 self.reset_after_reseek();1287 self.reset_after_reseek();
1253 self.notify_user(1288 self.notify_user(
1254 format!(1289 format!(
1255- "{count} SILENCES AT {rate} {reach} — {} takes it back",1290+ "{count} SILENCES AT {rate} {reach} · undo {}",
1256 self.keymap.display(ActionId::Undo)1291 self.keymap.display(ActionId::Undo)
1257 )1292 )
1258 .into(),1293 .into(),
@@ -1392,13 +1427,13 @@ impl Player {
1392 _ => self.selected.anchor(),1427 _ => self.selected.anchor(),
1393 };1428 };
1394 let refusal = match (anchor, &self.session) {1429 let refusal = match (anchor, &self.session) {
1395- (_, None) => Some("NO TIMELINE — open a file first".to_string()),1430+ (_, None) => Some("NO TIMELINE — no file open".to_string()),
1396 (None, _) => Some(format!(1431 (None, _) => Some(format!(
1397- "NOTHING SELECTED — click an audio clip or press {}, then ask again",1432+ "NOTHING SELECTED · select all {}",
1398 self.keymap.display(ActionId::Select)1433 self.keymap.display(ActionId::Select)
1399 )),1434 )),
1400 (Some((lane, _)), _) if lane.kind != LaneKind::Audio => Some(1435 (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(),1436+ "NOT AN AUDIO CLIP — the equalizer works on sound".to_string(),
1402 ),1437 ),
1403 _ => None,1438 _ => None,
1404 };1439 };
@@ -1495,7 +1530,7 @@ impl Player {
1495 if self.eq_params.bands.len() >= EQ_BANDS_MAX {1530 if self.eq_params.bands.len() >= EQ_BANDS_MAX {
1496 self.notify_user(1531 self.notify_user(
1497 format!(1532 format!(
1498- "EQUALIZER FULL — {EQ_BANDS_MAX} bands is all this card holds; move one instead"1533+ "EQUALIZER FULL — {EQ_BANDS_MAX} bands"
1499 )1534 )
1500 .into(),1535 .into(),
1501 );1536 );
@@ -1512,7 +1547,7 @@ impl Player {
1512 /// is a card with nothing to edit, and flattening is what "off" means here.1547 /// 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>) {1548 pub(crate) fn remove_band(&mut self, cx: &mut Context<Self>) {
1514 if self.eq_params.bands.len() <= 1 {1549 if self.eq_params.bands.len() <= 1 {
1515- self.notify_user("LAST BAND — flatten it instead (r), or close the card".into());1550+ self.notify_user("LAST BAND · flatten r".into());
1516 cx.notify();1551 cx.notify();
1517 return;1552 return;
1518 }1553 }
@@ -1788,6 +1823,20 @@ impl Player {
1788 }1823 }
1789 return true;1824 return true;
1790 }1825 }
1826+ // The settings page's EXPORT rows: `c` steps the file, `b` the rate
1827+ // its sound is coded at and `e` the encoder seat. Card-local like the
1828+ // colour and transform branches above -- and only these three, so
1829+ // escape still closes the page and every other key falls through to
1830+ // the room.
1831+ if self.settings_open {
1832+ match key {
1833+ "c" => self.cycle_export_picture(),
1834+ "b" => self.cycle_audio_kbps(),
1835+ "e" => self.cycle_encoder(cx),
1836+ _ => return false,
1837+ }
1838+ return true;
1839+ }
1791 // The export moment: its own chords, and every other stroke1840 // The export moment: its own chords, and every other stroke
1792 // swallowed while it is up -- a chord this surface consumes must1841 // swallowed while it is up -- a chord this surface consumes must
1793 // never also reach the room's keymap underneath it1842 // never also reach the room's keymap underneath it
crates/app/src/player/export.rsmodified+2 -2
@@ -449,7 +449,7 @@ impl Player {
449 // Nothing to write out, and a refusal rather than a card about it: the449 // Nothing to write out, and a refusal rather than a card about it: the
450 // window is empty and the export path is not even chosen yet.450 // window is empty and the export path is not even chosen yet.
451 if self.session.is_none() {451 if self.session.is_none() {
452- self.notify_user("NOTHING TO EXPORT — open a file first".into());452+ self.notify_user("NOTHING TO EXPORT — no file open".into());
453 cx.notify();453 cx.notify();
454 return;454 return;
455 }455 }
@@ -769,7 +769,7 @@ impl Player {
769 settings.subtitles = self.export_subs();769 settings.subtitles = self.export_subs();
770 settings.range = self.range;770 settings.range = self.range;
771 let Some(session) = &mut self.session else {771 let Some(session) = &mut self.session else {
772- self.notify_user("NOTHING TO EXPORT — open a file first".into());772+ self.notify_user("NOTHING TO EXPORT — no file open".into());
773 cx.notify();773 cx.notify();
774 return;774 return;
775 };775 };
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) = session224 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 made958 // 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 at529 // 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].start1295 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 same320 /// 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 nothing323+/// 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 lane324+/// 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 than325+/// ([`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 timeline328 /// `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. A329 /// 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/cards.rsmodified+1 -1
@@ -1428,7 +1428,7 @@ fn a_choice_list_offers_every_value_and_fits_the_smallest_window() {
1428 assert!(tall <= 360., "the list is taller than the floor");1428 assert!(tall <= 360., "the list is taller than the floor");
1429 assert_eq!(1429 assert_eq!(
1430 menu_at(point(px(600.), px(340.)), size(px(640.), px(360.)), tall),1430 menu_at(point(px(600.), px(340.)), size(px(640.), px(360.)), tall),
1431- (640. - MENU_W, 360. - tall),1431+ (640. - crate::layout::MENU_EDGE - MENU_W, 360. - crate::layout::MENU_EDGE - tall),
1432 "the list would hang off the smallest window"1432 "the list would hang off the smallest window"
1433 );1433 );
1434 }1434 }
crates/app/src/tests/editing.rsmodified+67 -4
@@ -983,12 +983,14 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() {
983 assert_eq!(menu_at(point(px(10.), px(10.)), viewport, 150.), (10., 10.));983 assert_eq!(menu_at(point(px(10.), px(10.)), viewport, 150.), (10., 10.));
984 assert_eq!(984 assert_eq!(
985 menu_at(point(px(700.), px(380.)), viewport, 150.),985 menu_at(point(px(700.), px(380.)), viewport, 150.),
986- (800. - MENU_W, 250.)986+ (800. - crate::layout::MENU_EDGE - MENU_W, 400. - crate::layout::MENU_EDGE - 150.)
987 );987 );
988- // A window smaller than the menu loses its bottom, never its top.988+ // A window smaller than the menu loses its bottom, never its top: the
989+ // top-left margin wins over the bottom-right one, because the items are
990+ // at the top.
989 assert_eq!(991 assert_eq!(
990 menu_at(point(px(90.), px(40.)), size(px(100.), px(50.)), 150.),992 menu_at(point(px(90.), px(40.)), size(px(100.), px(50.)), 150.),
991- (0., 0.)993+ (crate::layout::MENU_EDGE, crate::layout::MENU_EDGE)
992 );994 );
993 // Every item is an action the registry knows, so the menu and the keys995 // Every item is an action the registry knows, so the menu and the keys
994 // menu say the same thing about it -- and none of them is unreachable996 // menu say the same thing about it -- and none of them is unreachable
@@ -1015,7 +1017,7 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() {
1015 menu_at(point(px(0.), px(0.)), floor, {1017 menu_at(point(px(0.), px(0.)), floor, {
1016 MENU_PAD * 2. + menu_rows_h(items, floor)1018 MENU_PAD * 2. + menu_rows_h(items, floor)
1017 }),1019 }),
1018- (0., 0.)1020+ (crate::layout::MENU_EDGE, crate::layout::MENU_EDGE)
1019 );1021 );
1020 // The picker is the same card and the longest list in it is the palette1022 // The picker is the same card and the longest list in it is the palette
1021 // family list, which grows every time somebody asks for more colours.1023 // family list, which grows every time somebody asks for more colours.
@@ -1219,6 +1221,67 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() {
1219 assert!(menu_rows_h(items, size(px(640.), px(360.))) < items as f32 * MENU_ROW_H);1221 assert!(menu_rows_h(items, size(px(640.), px(360.))) < items as f32 * MENU_ROW_H);
1220 }1222 }
1221 1223
1224+/// Defects 2 and 3 of the menu-placement lane, as source guards -- this binary
1225+/// has no `VisualTestContext`, so where an element *mounts* and what its dim
1226+/// column *says* are read off the source the way every other layout scan here
1227+/// is.
1228+///
1229+/// 1. All three hanging menus mount on the room's ROOT. Mounted inside
1230+/// `stance-centre` the clip menu's window-coordinate anchor was laid out
1231+/// from the centre column's own origin and painted under the dock, which is
1232+/// the "chords cut mid-word" the user photographed.
1233+/// 2. The library menu hangs a row clear of the pointer, so it cannot cover the
1234+/// row it is about.
1235+/// 3. The library rows carry chords, not prose. DESIGN §4 puts the stroke in
1236+/// that column and §8 forbids the instructional copy that used to sit there.
1237+#[test]
1238+fn the_hanging_menus_mount_at_the_room_root_and_their_rows_wear_chords_not_prose() {
1239+ let stance = src_text("ui/stance.rs");
1240+ let (centre, root) = stance
1241+ .split_once(".child(divider(Split::Dock,")
1242+ .expect("the dock seam splits the centre column from the room root");
1243+ for menu in [
1244+ "children(player.context_card(",
1245+ "children(player.library_card(",
1246+ "children(player.picker_card(",
1247+ ] {
1248+ assert!(
1249+ root.contains(menu),
1250+ "{menu} must mount after the dock, on the room root"
1251+ );
1252+ assert!(
1253+ !centre.contains(menu),
1254+ "{menu} mounted inside stance-centre paints under the dock"
1255+ );
1256+ }
1257+ let library = src_text("ui/library.rs");
1258+ assert!(
1259+ library.contains("menu.at.y + px(ROW_CLEAR)"),
1260+ "the library menu must hang clear of the row it names"
1261+ );
1262+ // Exactly one row wears a chord, and it is the one `ui/stance.rs`'s
1263+ // `enter` branch actually answers; every other row's column is empty.
1264+ for item in ROW_ITEMS {
1265+ let hint = item.hint();
1266+ match item {
1267+ RowItem::Add => {
1268+ assert_eq!(hint, "↵");
1269+ assert!(
1270+ stance.contains("if key == \"enter\"\n && this.dock_src_active"),
1271+ "the ↵ this menu advertises must still be the stroke that adds"
1272+ );
1273+ }
1274+ _ => assert!(hint.is_empty(), "{:?} prints prose: {hint:?}", item.label()),
1275+ }
1276+ // §9: no junk drawer. A label that fits the plate whole beside its
1277+ // chord, and never a sentence.
1278+ assert!(item.label().split_whitespace().count() <= 4, "{}", item.label());
1279+ }
1280+ // The two removes must not read as the same verb now that the column
1281+ // beside them is empty.
1282+ assert_ne!(RowItem::Remove.label(), RowItem::RemoveWithClips.label());
1283+}
1284+
1222 /// The other half of the keys menu's guarantee, and the audit this batch was1285 /// The other half of the keys menu's guarantee, and the audit this batch was
1223 /// asked for kept as a test: no action may be a stroke and nothing else.1286 /// asked for kept as a test: no action may be a stroke and nothing else.
1224 /// The actions card answers it for all of them at once -- its rows come off1287 /// The actions card answers it for all of them at once -- its rows come off
crates/app/src/tests/layout.rsmodified+638 -5
@@ -2206,9 +2206,11 @@ fn every_darkroom_menu_sizes_its_list_against_the_floor_room_not_the_raw_viewpor
2206 to the picture floor (the 'menu in somewhere nonsense' defect)"2206 to the picture floor (the 'menu in somewhere nonsense' defect)"
2207 );2207 );
2208 assert!(2208 assert!(
2209- library.contains("menu_at(menu.at, viewport"),2209+ library.contains("menu_at(at, viewport, h)")
2210- "ui/library.rs no longer anchors its menu to the pointer through \2210+ && library.contains("point(menu.at.x, menu.at.y + px(ROW_CLEAR))"),
2211- menu_at -- update this guard"2211+ "ui/library.rs no longer anchors its menu to the pointer -- one row \
2212+ clear of it, so the menu cannot cover the row it names -- through \
2213+ menu_at; update this guard"
2212 );2214 );
2213 }2215 }
2214 2216
@@ -2724,7 +2726,9 @@ fn the_bench_answers_a_wheel_notch_anywhere_over_it() {
2724 "the row's wheel lost the mapping or its stop: {}",2726 "the row's wheel lost the mapping or its stop: {}",
2725 &row_wheel[..200]2727 &row_wheel[..200]
2726 );2728 );
2727- let content = bench.find(".id(\"bench-content\")").expect("no bench content");2729+ let content = bench
2730+ .find(".id(\"bench-content\")")
2731+ .expect("no bench content");
2728 let content_wheel = bench[content..]2732 let content_wheel = bench[content..]
2729 .find(".on_scroll_wheel(")2733 .find(".on_scroll_wheel(")
2730 .expect("the bench container does not answer the wheel");2734 .expect("the bench container does not answer the wheel");
@@ -2791,7 +2795,14 @@ fn the_seam_paints_nothing_until_a_pointer_finds_it() {
2791 body.contains("gpui::transparent_black()"),2795 body.contains("gpui::transparent_black()"),
2792 "the divider's line is inked at rest: {body}"2796 "the divider's line is inked at rest: {body}"
2793 );2797 );
2794- for step in [".hover(", "STROKE_DIVIDER()", "INK3()", "border_t_1()", "border_l_1()"] {2798+ for step in [
2799+ ".hover(",
2800+ "GRAB_W",
2801+ "STROKE_DIVIDER()",
2802+ "INK3()",
2803+ "border_t_1()",
2804+ "border_l_1()",
2805+ ] {
2795 assert!(body.contains(step), "the divider is missing {step}");2806 assert!(body.contains(step), "the divider is missing {step}");
2796 }2807 }
2797 }2808 }
@@ -2814,3 +2825,625 @@ fn the_lane_bed_clips_its_clips_at_the_pinned_heads() {
2814 pinned lane heads: {bed}"2825 pinned lane heads: {bed}"
2815 );2826 );
2816 }2827 }
2828+
2829+/// A source row is its name first (user 2026-09-09: "clunky, crowded and
2830+/// problematic"). At DOCK_W 280 the name used to be the only flexible child
2831+/// among six, so it measured 0px and the library showed
2832+/// `● V1 A1 · 2 uses Preview Add ↵ ○` -- every part of a row except the one
2833+/// thing the row is for. The fix is subtraction, not a hover gate (DESIGN §8):
2834+/// the name keeps 60% of the row, usage joins the metadata line under it, and
2835+/// the three verbs shrink to glyph ghosts at the right edge.
2836+#[test]
2837+fn a_source_row_shows_its_name_before_anything_else() {
2838+ let dock = src_text("ui/dock_stance.rs");
2839+ let start = dock.find("fn source_row(").expect("the source row");
2840+ let row = &dock[start..dock.find("/// Imported subtitle tracks").expect("its end")];
2841+ assert!(
2842+ row.contains(".min_w(relative(0.6))"),
2843+ "the row name can still collapse under its siblings"
2844+ );
2845+ assert!(
2846+ !row.contains(".min_w(px(0.))"),
2847+ "the row name is still allowed to measure nothing"
2848+ );
2849+ // The usage moved to the second line, beside codec/length, in ink3.
2850+ assert!(
2851+ row.contains(r#".child(format!("{usage} · {under}"))"#),
2852+ "usage is not folded into the metadata line"
2853+ );
2854+ // Preview / Add / proxy are glyph+chord ghosts now, not word buttons:
2855+ // ~66px for the three together, inside the 96px the name can spare.
2856+ for glyph in [r#".child("▷")"#, r#".child("+")"#, r#".child("↵")"#] {
2857+ assert!(row.contains(glyph), "the right-edge verbs lost {glyph}");
2858+ }
2859+ for word in [r#".child("Preview")"#, r#".child("Add")"#] {
2860+ assert!(!row.contains(word), "{word} still spends the name's width");
2861+ }
2862+ // Every verb keeps its own hitmap name and its chord.
2863+ for id in ["source.{i}.preview", "source.{i}.add", "source.{i}.proxy"] {
2864+ assert!(row.contains(id), "{id} lost its hitmap entry");
2865+ }
2866+ // DESIGN §8: the permanent footer telling the editor how to use a list
2867+ // ("drag · ↵ add · double-click plays") is instructional copy and is gone.
2868+ assert!(
2869+ !dock.contains("double-click plays"),
2870+ "the dock still carries an instruction footer"
2871+ );
2872+ // ...and an Audio tab with no audio-only file in it is a single noun, not
2873+ // the claim `No sound` over a source whose A1 stream is on the bench.
2874+ assert_eq!(crate::LibraryTab::Audio.empty(), "none");
2875+}
2876+
2877+/// Focus and selection rings are drawn, never inserted: a `when(focused,
2878+/// border_1())` puts a pixel of box into the flow and every row in the dock
2879+/// steps sideways the moment the surface takes focus (hunter: h-clip-tab.png
2880+/// vs i-library-menu.png).
2881+#[test]
2882+fn a_dock_ring_never_moves_what_it_rings() {
2883+ let dock = src_text("ui/dock_stance.rs");
2884+ for gate in [
2885+ ".when(picked, |d| d.border_1()",
2886+ ".when(focused, |d| d.border_1()",
2887+ ] {
2888+ assert!(
2889+ !dock.contains(gate),
2890+ "a dock ring is still added on state ({gate}), shifting its content"
2891+ );
2892+ }
2893+ assert_eq!(
2894+ dock.matches("gpui::transparent_black()").count(),
2895+ 4,
2896+ "a dock ring lost its at-rest transparent border"
2897+ );
2898+}
2899+
2900+/// The spine is 56px and every pair must fit inside it. Measured at
2901+/// 1280x720 the full-size halves did not: hitmap `action.WalkCutPrev10
2902+/// x=-5 w=31`, `action.AddVideoLane x=-2 w=28` -- the `‹10` glyph was cut
2903+/// at the window's own left edge. Fixed by subtraction (13px + 1px padding
2904+/// for the paired halves, 3px row gap), so this scan is what keeps a new
2905+/// pair from being written at the full row size again.
2906+#[test]
2907+fn every_paired_spine_glyph_is_drawn_at_the_narrow_size() {
2908+ let src = src_text("ui/spine_stance.rs");
2909+ // Inside every `pair(...)` call, both halves come from `small`.
2910+ let mut rest = src.as_str();
2911+ let mut pairs = 0;
2912+ while let Some(at) = rest.find("pair(") {
2913+ let after = &rest[at..];
2914+ // The definition and the doc comments are not call sites.
2915+ if rest[..at].ends_with("fn ") || rest[..at].ends_with('`') {
2916+ rest = &after[5..];
2917+ continue;
2918+ }
2919+ let mut depth = 0i32;
2920+ let mut end = after.len();
2921+ for (i, c) in after.char_indices() {
2922+ match c {
2923+ '(' => depth += 1,
2924+ ')' => {
2925+ depth -= 1;
2926+ if depth == 0 {
2927+ end = i;
2928+ break;
2929+ }
2930+ }
2931+ _ => {}
2932+ }
2933+ }
2934+ let body = &after[..end];
2935+ assert!(
2936+ !body.contains("glyph("),
2937+ "a spine pair draws a full-size glyph, which lays out past the \
2938+ 56px rail: {}",
2939+ &body[..body.len().min(120)]
2940+ );
2941+ pairs += 1;
2942+ rest = &after[end..];
2943+ }
2944+ assert!(pairs >= 8, "the spine's pairs went missing ({pairs} found)");
2945+ // And `small` is the narrow one: one step down the §3 scale, 1px sides.
2946+ assert!(
2947+ src.contains("type_scale::CHORD_METADATA_MIN_PX")
2948+ && src.contains("let pad = if paired { 1. } else { 3. };"),
2949+ "the paired size/padding subtraction is gone from spine_stance"
2950+ );
2951+ assert!(
2952+ src.contains(".gap(px(3.))\n .child(left)"),
2953+ "the pair row's own gap grew again"
2954+ );
2955+}
2956+
2957+/// DESIGN §8 (no instructional copy) and §9: the keys plate's heading is one
2958+/// noun, its way out is a chord like every other row, and its bottom edge is
2959+/// inside the window -- the shipped plate said `ALL COMMANDS · HOLD ? ·
2960+/// RELEASE TO CLOSE` while sitting there latched after a click, with its last
2961+/// rows cut off below y=720.
2962+#[test]
2963+fn the_keys_plate_says_one_noun_and_ends_inside_the_window() {
2964+ let src = src_text("ui/stance.rs");
2965+ let lower = src.to_lowercase();
2966+ assert!(
2967+ !lower.contains("hold ? · release to close") && !lower.contains("all commands"),
2968+ "the keys plate still tells the hand what to do"
2969+ );
2970+ assert!(
2971+ src.contains("section_head(\"keys\")") && src.contains(".child(\"esc\")"),
2972+ "the keys plate lost its noun or its escape chord"
2973+ );
2974+ assert!(
2975+ src.contains(".h(px((bench_h + LEDGER_H - 16.).max(0.)))"),
2976+ "the keys plate is no longer capped inside the bench+ledger footprint"
2977+ );
2978+}
2979+
2980+
2981+/// The ruler's right edge was soup: `bench-select-all` sits `right(4.)` over
2982+/// the tick band while tick suppression only guarded the LEFT plate, so the
2983+/// `00:20` label drew straight under the `all` chord. The control's band is
2984+/// reserved now -- a label whose right edge would enter it is dropped, the
2985+/// mirror of the left rule.
2986+#[test]
2987+fn the_ruler_reserves_a_band_for_its_select_all_control() {
2988+ use crate::ui::bench_stance::{SELECT_ALL_PAD, char_w};
2989+ use crate::ui::type_scale::{CHORD_METADATA_MIN_PX, FLOOR_PX};
2990+ let bench = src_text("ui/bench_stance.rs");
2991+ assert!(
2992+ bench.contains("x + label_w <= bed_w - all_w"),
2993+ "the tick loop no longer keeps the select-all band clear"
2994+ );
2995+ // The rule itself, with the shipped widths: `all` + `^a` at the chord
2996+ // size, a `00:20` label at the floor size, a 850 px bed.
2997+ let all_w = ("all".len() + "^a".len()) as f32 * char_w(CHORD_METADATA_MIN_PX) + SELECT_ALL_PAD;
2998+ let label_w = "00:20".len() as f32 * char_w(FLOOR_PX);
2999+ let clear = |x: f32| x + label_w <= 850. - all_w;
3000+ assert!(!clear(820.), "a tick at the right edge still draws under `all`");
3001+ assert!(
3002+ !clear(850. - all_w - label_w + 1.),
3003+ "the band's own edge leaks"
3004+ );
3005+ assert!(clear(700.), "the rule eats ticks that clear the band");
3006+}
3007+
3008+/// Clicking `all` selected all AND scrubbed: the control lives inside
3009+/// `bench-ruler`, whose `on_mouse_down` seeks, and the press reached it (the
3010+/// playhead jumped 00:00:11:12 -> 00:00:20:14). The scrub refuses the
3011+/// control's reserved band now -- a `stop_propagation` on the control is what
3012+/// this looks like at first and it does NOT work: gpui builds the control's
3013+/// own click out of that same mouse-down, so stopping it drops the selection
3014+/// (measured live, run 20260909-174243-jZzccm/after-all.png: nothing but the
3015+/// hover changed).
3016+#[test]
3017+fn a_press_on_the_select_all_band_does_not_scrub_the_ruler() {
3018+ use crate::ui::bench_stance::select_all_band;
3019+ let bench = src_text("ui/bench_stance.rs");
3020+ let at = bench.find(r#".id("bench-ruler")"#).expect("no ruler");
3021+ let listener = &bench[at..at + bench[at..].find(".children(ticks").expect("its ticks")];
3022+ assert!(
3023+ listener.contains("bed_w - band") && listener.contains("select_all_band("),
3024+ "the ruler's scrub takes the select-all band's presses again: {listener}"
3025+ );
3026+ assert!(
3027+ !bench[at..].contains("cx.stop_propagation()"),
3028+ "a press stopped inside the ruler also swallows the control's own click"
3029+ );
3030+ // The rule the listener runs, at the shipped widths: a 850 px bed, `^a`.
3031+ let band = select_all_band("^a");
3032+ assert!(band > 30. && band < 70., "the band is not a control's width: {band}");
3033+ assert!(850. - 4. >= 850. - band, "a press on the control still seeks");
3034+ assert!(500. < 850. - band, "a press mid-ruler stopped seeking");
3035+}
3036+
3037+/// DESIGN §4/§5: the hero timecode leads the time band and the ledger carries
3038+/// position. The ruler's left plate was a third resting copy of the same
3039+/// reading -- it stays only for the state change it belongs to, a live scrub.
3040+#[test]
3041+fn the_ruler_plate_shows_the_timecode_only_while_a_scrub_is_live() {
3042+ let bench = src_text("ui/bench_stance.rs");
3043+ let at = bench
3044+ .find(".child(playhead_tc)")
3045+ .expect("no playhead timecode in the ruler");
3046+ let before = &bench[..at];
3047+ let guard = before
3048+ .rfind(".when(player.scrubbing")
3049+ .expect("the ruler plate draws its timecode at rest -- the third copy");
3050+ assert!(
3051+ before[guard..].matches(".child(").count() <= 2,
3052+ "the scrubbing guard is not the plate's own: {}",
3053+ &before[guard..guard + 200]
3054+ );
3055+ assert!(
3056+ bench.contains("let plate_w = if player.scrubbing { PLATE_W } else { 0. };"),
3057+ "the ticks still lose the plate's width at rest"
3058+ );
3059+}
3060+
3061+
3062+/// The band overflowed its own column at 1280x720 (`$EDITH_HITMAP`:
3063+/// `action.Export x=1113 w=80` with the column ending at x=995, the contact
3064+/// strip measured `w=0`), so the Export chip was invisible under the dock and
3065+/// a click on blank dock space at (1130,435) opened the export card. Three
3066+/// things hold that shut: the row clips itself, the strip keeps a floor, and
3067+/// the ladder sheds groups above it.
3068+#[test]
3069+fn the_time_band_never_paints_outside_its_own_column() {
3070+ let src = src_text("ui/timeband_stance.rs");
3071+ let start = src.find(r#".id("stance-time-band-row")"#).expect("the band row");
3072+ let row = &src[start..start + src[start..].find(".child(hero_timecode(").expect("the timecode")];
3073+ assert!(
3074+ row.contains(".overflow_hidden()"),
3075+ "the band row lets its children paint (and be clicked) under the dock: {row}"
3076+ );
3077+ assert!(
3078+ src.contains(".min_w(px(STRIP_MIN_W))"),
3079+ "the contact strip is the flex_1 that absorbs the slack; without a floor it measures 0"
3080+ );
3081+ assert!(crate::ui::timeband_stance::STRIP_MIN_W >= 120.);
3082+}
3083+
3084+/// DESIGN §7's ladder, one layer per threshold: the four things the band is
3085+/// *for* -- timecode, cut readout, contact strip, Export -- survive every
3086+/// rung, and the sheddable groups go in a fixed order (chords, then the
3087+/// monitoring cluster, then sync/loop, then the range marks), never all at
3088+/// once. Thresholds are the measured group widths; this pins their order and
3089+/// the 1280x720 column (939px measured, spine 56 + dock 285) landing on the
3090+/// marks-only rung, which is what makes Export fit there (it ended at x=991
3091+/// inside a column ending at 995, against x=1113 under the dock before).
3092+#[test]
3093+fn the_band_sheds_one_layer_per_threshold_in_a_fixed_order() {
3094+ use crate::ui::timeband_stance::band_layers;
3095+ let ladder = [2000., 1300., 1100., 939., 800., 0.]
3096+ .map(|w| band_layers(w))
3097+ .map(|l| (l.chords, l.volume, l.sync, l.marks));
3098+ assert_eq!(
3099+ ladder,
3100+ [
3101+ (true, true, true, true),
3102+ (false, true, true, true),
3103+ (false, false, true, true),
3104+ (false, false, false, true),
3105+ (false, false, false, false),
3106+ (false, false, false, false),
3107+ ],
3108+ "the band must drop chords, then the monitoring cluster, then sync/loop, then the marks"
3109+ );
3110+ // Monotone: a wider band never shows less than a narrower one.
3111+ let mut prev = band_layers(0.);
3112+ for w in (0..2400).step_by(10).map(|w| w as f32) {
3113+ let now = band_layers(w);
3114+ for (a, b) in [
3115+ (prev.chords, now.chords),
3116+ (prev.volume, now.volume),
3117+ (prev.sync, now.sync),
3118+ (prev.marks, now.marks),
3119+ ] {
3120+ assert!(b || !a, "layer came back off at {w}px");
3121+ }
3122+ prev = now;
3123+ }
3124+}
3125+
3126+/// Every door in this band is at least `HIT_MIN` wide and tall (WCAG 2.5.8).
3127+/// The hitmap read `SetIn w=8`, `VolumeDown w=12`, `Loop w=13`, `SetOut w=15`,
3128+/// `Prev/NextSyncPoint w=16` before this: padding on the shared `ghost`, not a
3129+/// bigger glyph.
3130+#[test]
3131+fn every_ghost_in_the_time_band_carries_a_full_hit_area() {
3132+ let src = src_text("ui/timeband_stance.rs");
3133+ let start = src.find("fn ghost(").expect("the band's ghost");
3134+ let ghost = &src[start..start + src[start..].find(".child(glyph.into())").expect("its glyph")];
3135+ for needle in [".min_w(px(HIT_MIN))", ".min_h(px(HIT_MIN))"] {
3136+ assert!(ghost.contains(needle), "the band's ghost lost {needle}: {ghost}");
3137+ }
3138+ assert!(HIT_MIN >= 24.);
3139+}
3140+
3141+/// Mute wore `"{volume}%"` as its glyph while the slider beside it drew the
3142+/// same value: one number, two places, and a toggle with no verb of its own.
3143+/// The level is a mono readout beside the slider now, once.
3144+#[test]
3145+fn the_level_is_written_once_and_mute_wears_a_glyph() {
3146+ let src = src_text("ui/timeband_stance.rs");
3147+ assert_eq!(
3148+ src.matches(r#"player.volume.percent()"#).count(),
3149+ 1,
3150+ "the volume level must be written in exactly one place in the band"
3151+ );
3152+ assert!(
3153+ src.contains(r#"if player.volume.muted { "◁×" } else { "◁))" }"#),
3154+ "mute must wear a speaker glyph, struck when muted"
3155+ );
3156+ assert!(src.contains("fn volume_readout("), "the level readout is the one place it is written");
3157+}
3158+
3159+/// `Play` and `StepForward` drew the same solid right-triangle: two verbs one
3160+/// shape, told apart only by their chords. Step wears the frame-step pair.
3161+#[test]
3162+fn transport_verbs_differ_by_shape_not_only_by_chord() {
3163+ let src = src_text("ui/timeband_stance.rs");
3164+ let glyph = |action: &str| {
3165+ let at = src.find(&format!("ActionId::{action},")).expect("the call");
3166+ src[..at].rsplit('"').nth(1).expect("its glyph").to_string()
3167+ };
3168+ let shapes = ["Play", "StepBack", "StepForward", "JumpBack", "JumpForward"].map(glyph);
3169+ let mut seen = shapes.to_vec();
3170+ seen.sort();
3171+ seen.dedup();
3172+ assert_eq!(seen.len(), shapes.len(), "two transport verbs share one glyph: {shapes:?}");
3173+}
3174+
3175+/// DESIGN §6: "the cut readout is the odometer". Keyed off the selection it
3176+/// read `cut —/—` immediately after a split -- two clips on the bench, the
3177+/// playhead resting on the new cut, nothing picked. It reads the playhead
3178+/// now: the cut under it, else the next one ahead, else the selection.
3179+#[test]
3180+fn the_cut_readout_counts_from_the_playhead() {
3181+ use crate::ui::timeband_stance::odometer_cut;
3182+ let at = |start: u32, len: u32| Clip {
3183+ fade_in: 0,
3184+ fade_out: 0,
3185+ transition_out: 0,
3186+ start,
3187+ in_frame: 0,
3188+ out_frame: len,
3189+ source: 0,
3190+ link: None,
3191+ eq: None,
3192+ color: None,
3193+ transform: None,
3194+ fit: FitPolicy::Fit,
3195+ speed: Speed::NORMAL,
3196+ };
3197+ let lane = [at(0, 30), at(30, 30)];
3198+ assert_eq!(odometer_cut(&lane, 0), Some(0));
3199+ assert_eq!(odometer_cut(&lane, 29), Some(0));
3200+ // The split's own frame: the playhead rests on the SECOND cut's head.
3201+ assert_eq!(odometer_cut(&lane, 30), Some(1));
3202+ assert_eq!(odometer_cut(&lane, 59), Some(1));
3203+ // Past the last cut there is nothing to count -- the selection answers.
3204+ assert_eq!(odometer_cut(&lane, 60), None);
3205+ // In a gap: the next cut ahead of the playhead.
3206+ let gapped = [at(0, 10), at(40, 10)];
3207+ assert_eq!(odometer_cut(&gapped, 20), Some(1));
3208+ assert_eq!(odometer_cut(&[], 0), None);
3209+ assert!(
3210+ src_text("ui/timeband_stance.rs").contains("odometer_cut(s.lane_clips(lane), frame)"),
3211+ "the readout must derive its odometer from the playhead"
3212+ );
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+}
3311+
3312+/// The export moment holds the file and the budget; everything a project is
3313+/// *delivered as* is a settings row now (user: the export card was "too
3314+/// complicated"). Four rows, and a fifth would be the card growing back --
3315+/// this is a source scan for the same reason every guard on this page is.
3316+#[test]
3317+fn the_export_section_is_four_rows_and_no_fifth() {
3318+ let source = src_text("ui/settings_stance.rs");
3319+ let start = source
3320+ .find("fn export_section(")
3321+ .expect("the export section");
3322+ let body = &source[start..];
3323+ let end = body.find("\n/// The page itself").expect("the page's render fn");
3324+ let body = &body[..end];
3325+ let rows = [
3326+ "settings-export-picture",
3327+ "settings-export-sound",
3328+ "settings-export-encoder",
3329+ "settings-export-range",
3330+ ];
3331+ for row in rows {
3332+ assert!(body.contains(row), "the EXPORT section has no {row} row");
3333+ }
3334+ // The Sound row is written twice -- a rated codec's keyed row and an
3335+ // unrated one's readout, never both at once -- so the count is by label,
3336+ // not by id.
3337+ for label in ["\"Picture\"", "\"Sound\"", "\"Encoder\"", "\"Range\""] {
3338+ assert!(body.contains(label), "the EXPORT section has no {label} row");
3339+ }
3340+ let ids = body.match_indices("\"settings-export-").count();
3341+ assert_eq!(ids, 5, "the EXPORT section grew a row past the four (the two Sound rows are one row's two shapes)");
3342+ assert!(
3343+ source.contains("what a delivery is written as"),
3344+ "the section lost its head"
3345+ );
3346+ // Every row wears its chord (DESIGN §4): three keyed rows plus the
3347+ // range's own marks, which are keymap actions.
3348+ for chord in ["\"c\"", "\"b\"", "\"e\"", "ActionId::SetIn"] {
3349+ assert!(body.contains(chord), "an EXPORT row lost its chord {chord}");
3350+ }
3351+}
3352+
3353+/// `c` walks the nine files in one order -- a codec's two boxes side by side,
3354+/// the sound-only formats last -- and never stops on a format this machine
3355+/// cannot write, because [`Player::set_format`] would only refuse it back.
3356+#[test]
3357+fn the_picture_row_cycles_codec_and_container_together_and_skips_a_refusal() {
3358+ use crate::ui::settings_stance::{PICTURE_CYCLE, next_picture, picture_label};
3359+ assert_eq!(
3360+ PICTURE_CYCLE,
3361+ [
3362+ Format::Mp4,
3363+ Format::Av1Mp4,
3364+ Format::Av1,
3365+ Format::Hevc,
3366+ Format::HevcMp4,
3367+ Format::Wav,
3368+ Format::Flac,
3369+ Format::Mp3,
3370+ Format::Ogg,
3371+ ]
3372+ );
3373+ // Nothing refused: the whole ring, wrapping back to the head.
3374+ let mut at = Format::Mp4;
3375+ let mut walked = vec![at];
3376+ for _ in 1..PICTURE_CYCLE.len() {
3377+ at = next_picture(at, |_| false);
3378+ walked.push(at);
3379+ }
3380+ assert_eq!(walked, PICTURE_CYCLE.to_vec());
3381+ assert_eq!(next_picture(at, |_| false), Format::Mp4);
3382+
3383+ // HEVC unavailable (no plugin): `c` steps over both of its boxes rather
3384+ // than parking on a pick the setter refuses.
3385+ let no_hevc = |f: Format| matches!(f, Format::Hevc | Format::HevcMp4);
3386+ assert_eq!(next_picture(Format::Av1, no_hevc), Format::Wav);
3387+ // Everything refused: the row keeps what it has instead of cycling to
3388+ // nothing.
3389+ assert_eq!(next_picture(Format::Mp4, |_| true), Format::Mp4);
3390+
3391+ assert_eq!(picture_label(Format::Mp4), "H.264 · MP4");
3392+ assert_eq!(picture_label(Format::Av1), "AV1 · MKV");
3393+ assert_eq!(picture_label(Format::Av1Mp4), "AV1 · MP4");
3394+ assert_eq!(picture_label(Format::Wav), "WAV");
3395+}
3396+
3397+/// A refused codec is greyed with its reason, never hidden (DESIGN §8), and
3398+/// the reason is short enough to sit beside a value: six words, the rest of
3399+/// the sentence still said by the export moment's own banner. The sound row
3400+/// wears a chord only where its codec has a rate to step.
3401+#[test]
3402+fn a_refusal_is_six_words_beside_the_value_and_soundless_codecs_wear_no_chord() {
3403+ use crate::ui::settings_stance::{encoder_word, short_reason, sound_codec};
3404+ let long = "HEVC needs the VA-API plugin, which this machine has not built";
3405+ assert_eq!(short_reason(long), "HEVC needs the VA-API plugin, which");
3406+ assert!(short_reason(long).split_whitespace().count() <= 6);
3407+ assert_eq!(short_reason("no encoder here"), "no encoder here");
3408+
3409+ for (format, codec, rated) in [
3410+ (Format::Mp4, "AAC", true),
3411+ (Format::Av1, "AAC", true),
3412+ (Format::Mp3, "MP3", true),
3413+ (Format::Wav, "PCM", false),
3414+ (Format::Flac, "FLAC", false),
3415+ (Format::Ogg, "Vorbis", false),
3416+ ] {
3417+ assert_eq!(sound_codec(format), (codec, rated), "{format:?}");
3418+ }
3419+
3420+ assert_eq!(encoder_word(EncoderSeat::Auto), "auto");
3421+ assert_eq!(encoder_word(EncoderSeat::Hardware), "GPU");
3422+ assert_eq!(encoder_word(EncoderSeat::Software), "software");
3423+}
3424+
3425+/// The one amber line on the page is the AV1-on-the-GPU seat, and it is the
3426+/// only hue the EXPORT rows introduce -- every other value is an ink.
3427+#[test]
3428+fn the_only_hue_in_the_export_section_is_the_av1_gpu_notice() {
3429+ let source = src_text("ui/settings_stance.rs");
3430+ let start = source
3431+ .find("fn export_section(")
3432+ .expect("the export section");
3433+ let body = &source[start..];
3434+ let body = &body[..body.find("\n/// The page itself").expect("the render fn")];
3435+ assert!(
3436+ body.contains("NOTICE_LOOK()"),
3437+ "the AV1-on-the-GPU row lost its amber"
3438+ );
3439+ assert_eq!(
3440+ crate::ui::settings_stance::AV1_GPU_NOTICE,
3441+ "ignores the budget \u{2014} constant quality"
3442+ );
3443+ for hue in ["ACCENT_", "STATUS_", "NOTICE_TELL", "NOTICE_DECIDE"] {
3444+ assert!(
3445+ !body.contains(hue),
3446+ "the EXPORT rows reached for a second hue ({hue})"
3447+ );
3448+ }
3449+}
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 a120 // ...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 the136 // ...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 here667 // 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 the668 // 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 all9 /// 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 and13 /// 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 the14 /// one every clip has been taken off are the same state to a transport, and the
crates/app/src/ui/bench_stance.rsmodified+60 -13
@@ -63,6 +63,25 @@ const TICK_MIN_PX: f64 = 64.;
63 const PLATE_W: f32 = 11. * crate::layout::LIST_CHAR_W / type_scale::CHORD_METADATA_MIN_PX63 const PLATE_W: f32 = 11. * crate::layout::LIST_CHAR_W / type_scale::CHORD_METADATA_MIN_PX
64 * type_scale::CHORD_METADATA_MAX_PX64 * type_scale::CHORD_METADATA_MAX_PX
65 + 9.;65 + 9.;
66+/// The reserved right-edge band `bench-select-all` sits in: its own
67+/// `right(4.)` offset, the `px(3.)` either side of its text and the `gap(3.)`
68+/// between the label and its chord. The band's text width is measured per
69+/// render (the chord is keymap-dependent) and added to this.
70+pub(crate) const SELECT_ALL_PAD: f32 = 4. + 3. + 3. + 3.;
71+/// The width of that band for a given chord: `all`, the chord, and the
72+/// padding around them. Read by the tick loop (no label may enter it) and by
73+/// the ruler's own scrub listener (no press inside it seeks) -- one rule, so
74+/// the two can never disagree about where the control's edge is.
75+pub(crate) fn select_all_band(chord: &str) -> f32 {
76+ ("all".len() + chord.chars().count()) as f32 * char_w(type_scale::CHORD_METADATA_MIN_PX)
77+ + SELECT_ALL_PAD
78+}
79+/// A mono character's width at `size_px`, from the shared
80+/// [`crate::layout::LIST_CHAR_W`] calibration (taken at
81+/// [`type_scale::CHORD_METADATA_MIN_PX`]).
82+pub(crate) fn char_w(size_px: f32) -> f32 {
83+ crate::layout::LIST_CHAR_W / type_scale::CHORD_METADATA_MIN_PX * size_px
84+}
66 /// The pinned track-head column: wide enough for its lane-specific ghost85 /// The pinned track-head column: wide enough for its lane-specific ghost
67 /// verbs and their compact chords without shrinking their pointer targets.86 /// verbs and their compact chords without shrinking their pointer targets.
68 const HEAD_W: f32 = 72.;87 const HEAD_W: f32 = 72.;
@@ -1278,18 +1297,26 @@ pub(crate) fn render(
1278 // first tick at or after the bed's left edge to the bed's right edge.1297 // first tick at or after the bed's left edge to the bed's right edge.
1279 // Guarded on `pps > 0` -- a zero scale (no session yet) has no interval1298 // Guarded on `pps > 0` -- a zero scale (no session yet) has no interval
1280 // that ever advances past the bed's own width, which would loop forever.1299 // that ever advances past the bed's own width, which would loop forever.
1281- // FAULT 4: the playhead timecode plate is pinned at `left_0`..`PLATE_W`1300+ // The ruler's two reserved bands, and no tick label may enter either.
1282- // over the ruler (DESIGN §5), so a tick whose label would land under it1301+ // Left: the playhead timecode plate, which now shows only while a scrub
1283- // is suppressed here rather than drawn and overlapped -- the plate1302+ // drag is live (the hero timecode leads the time band at rest, DESIGN
1284- // already owns that lane.1303+ // §4, and the ledger keeps position, §5 -- a third resting copy is the
1304+ // crowding) -- at rest the band is zero and the ticks have the width
1305+ // back. Right: `bench-select-all`, which used to be drawn straight over
1306+ // the `00:20` label because only the left plate was ever suppressed.
1307+ let plate_w = if player.scrubbing { PLATE_W } else { 0. };
1308+ let all_chord = player.keymap.chord(ActionId::SelectAll);
1309+ let all_w = select_all_band(&all_chord);
1285 let mut ticks = Vec::new();1310 let mut ticks = Vec::new();
1286 if scale.pps > 0. {1311 if scale.pps > 0. {
1287 let interval = tick_interval(scale.pps);1312 let interval = tick_interval(scale.pps);
1288 let mut t = (scale.start / interval).ceil() * interval;1313 let mut t = (scale.start / interval).ceil() * interval;
1289 while scale.px_at(t) <= bed_w {1314 while scale.px_at(t) <= bed_w {
1290 let x = scale.px_at(t).max(0.);1315 let x = scale.px_at(t).max(0.);
1291- if x >= PLATE_W {1316+ let label = tick_mmss(t);
1292- ticks.push((x, tick_mmss(t)));1317+ let label_w = label.chars().count() as f32 * char_w(type_scale::FLOOR_PX);
1318+ if x >= plate_w && x + label_w <= bed_w - all_w {
1319+ ticks.push((x, label));
1293 }1320 }
1294 t += interval;1321 t += interval;
1295 }1322 }
@@ -1331,6 +1358,21 @@ pub(crate) fn render(
1331 .on_mouse_down(1358 .on_mouse_down(
1332 MouseButton::Left,1359 MouseButton::Left,
1333 cx.listener(|this, event: &MouseDownEvent, _, cx| {1360 cx.listener(|this, event: &MouseDownEvent, _, cx| {
1361+ // The reserved right-edge band is `bench-select-all`'s,
1362+ // not the scrub's: a press there used to select all AND
1363+ // seek the playhead under the control (11:12 -> 20:14).
1364+ // The guard lives here rather than as a
1365+ // `stop_propagation` on the control, because stopping
1366+ // the press also swallows the control's own click --
1367+ // gpui builds a click out of that same mouse-down.
1368+ let bounds = this.ruler.get();
1369+ let bed_w = f32::from(bounds.size.width).max(1.);
1370+ let band = select_all_band(&this.keymap.chord(ActionId::SelectAll));
1371+ if f32::from(crate::timeline_math::px_along(event.position.x, bounds))
1372+ >= bed_w - band
1373+ {
1374+ return;
1375+ }
1334 this.scrubbing = true;1376 this.scrubbing = true;
1335 this.scrub_to(event.position.x, true, cx);1377 this.scrub_to(event.position.x, true, cx);
1336 }),1378 }),
@@ -1362,11 +1404,15 @@ pub(crate) fn render(
1362 .w(px(1.))1404 .w(px(1.))
1363 .bg(rgb(LAMP_WHITE())),1405 .bg(rgb(LAMP_WHITE())),
1364 )1406 )
1365- .child(1407+ .when(player.scrubbing, |ruler| {
1366- // The pinned playhead timecode plate, DESIGN §5's own1408+ // The playhead timecode plate, and ONLY while a scrub drag
1367- // "playhead's own timecode in a plate at the left edge" --1409+ // is live: a drag is a state change, which is what a plate
1368- // always at `left_0`, never following the scrubbed x, so1410+ // is for. At rest the hero timecode leads the time band
1369- // it never overlaps the picture region above it.1411+ // (DESIGN §4) and the ledger carries position (§5); this
1412+ // was the third resting copy of the same reading. Always
1413+ // at `left_0`, never following the scrubbed x, so it never
1414+ // overlaps the picture region above it.
1415+ ruler.child(
1370 div()1416 div()
1371 .absolute()1417 .absolute()
1372 .top_0()1418 .top_0()
@@ -1383,7 +1429,8 @@ pub(crate) fn render(
1383 ))1429 ))
1384 .text_color(rgb(INK1()))1430 .text_color(rgb(INK1()))
1385 .child(playhead_tc),1431 .child(playhead_tc),
1386- )1432+ )
1433+ })
1387 .child(1434 .child(
1388 div()1435 div()
1389 .id("bench-select-all")1436 .id("bench-select-all")
@@ -1411,7 +1458,7 @@ pub(crate) fn render(
1411 ))1458 ))
1412 .text_color(rgb(INK3()))1459 .text_color(rgb(INK3()))
1413 .child("all")1460 .child("all")
1414- .child(player.keymap.chord(ActionId::SelectAll)),1461+ .child(all_chord),
1415 ),1462 ),
1416 )1463 )
1417 .child(1464 .child(
crates/app/src/ui/dock_stance.rsmodified+39 -30
@@ -353,7 +353,14 @@ fn source_row(
353 // carries no film ink of its own to complement, it is a plain list353 // carries no film ink of its own to complement, it is a plain list
354 // line, so the general focus/selection ring applies, the same one354 // line, so the general focus/selection ring applies, the same one
355 // the bench already uses for the same job.355 // the bench already uses for the same job.
356- .when(picked, |d| d.border_1().border_color(rgb(INK1())))356+ .border_1()
357+ .border_color(match picked {
358+ // The ring is always in flow -- transparent at rest, ink1 when
359+ // picked -- because a `when(picked, border_1())` added a pixel of
360+ // box on selection and shoved every row's text sideways.
361+ true => rgb(INK1()).into(),
362+ false => gpui::transparent_black(),
363+ })
357 // Right-click ANYWHERE on the row opens the row's menu -- Add,364 // Right-click ANYWHERE on the row opens the row's menu -- Add,
358 // Remove, Reveal, Properties (DESIGN §9: "verbs of the thing under365 // Remove, Reveal, Properties (DESIGN §9: "verbs of the thing under
359 // the cursor"). It used to hang off the 8px ink dot alone, and only366 // the cursor"). It used to hang off the 8px ink dot alone, and only
@@ -446,22 +453,22 @@ fn source_row(
446 let style = mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM);453 let style = mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM);
447 div()454 div()
448 .flex_1()455 .flex_1()
449- .min_w(px(0.))456+ // FAULT: this was `min_w(px(0.))` -- the row's five
457+ // flex_none siblings (usage, Preview, Add ↵, proxy)
458+ // took their full width first and the name, the one
459+ // thing a row is *for*, collapsed to nothing at the
460+ // default dock width: the library read `● V1 A1 · 2
461+ // uses Preview Add ↵ ○` with no filename at all. The
462+ // name is the first line and keeps at least 60% of
463+ // the row; the verbs shrank to glyph ghosts and the
464+ // usage moved down to the metadata line.
465+ .min_w(relative(0.6))
450 .truncate()466 .truncate()
451 .font(style.font)467 .font(style.font)
452 .text_size(style.size)468 .text_size(style.size)
453 .text_color(rgb(INK1()))469 .text_color(rgb(INK1()))
454 .child(name)470 .child(name)
455 })471 })
456- .child({
457- let style = mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM);
458- div()
459- .flex_none()
460- .font(style.font)
461- .text_size(style.size)
462- .text_color(rgb(INK3()))
463- .child(usage)
464- })
465 .when(usable, |d| {472 .when(usable, |d| {
466 d.child({473 d.child({
467 let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM);474 let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM);
@@ -490,7 +497,7 @@ fn source_row(
490 .font(style.font)497 .font(style.font)
491 .text_size(style.size)498 .text_size(style.size)
492 .text_color(rgb(INK2()))499 .text_color(rgb(INK2()))
493- .child("Preview"),500+ .child("▷"),
494 )501 )
495 })502 })
496 })503 })
@@ -544,7 +551,7 @@ fn source_row(
544 .font(label_style.font)551 .font(label_style.font)
545 .text_size(label_style.size)552 .text_size(label_style.size)
546 .text_color(rgb(INK2()))553 .text_color(rgb(INK2()))
547- .child("Add"),554+ .child("+"),
548 )555 )
549 .child(556 .child(
550 div()557 div()
@@ -612,7 +619,7 @@ fn source_row(
612 .font(style.font)619 .font(style.font)
613 .text_size(style.size)620 .text_size(style.size)
614 .text_color(rgb(INK3()))621 .text_color(rgb(INK3()))
615- .child(under)622+ .child(format!("{usage} · {under}"))
616 })623 })
617 }624 }
618 625
@@ -707,7 +714,14 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A
707 .pr(px(8.))714 .pr(px(8.))
708 .py(px(4.))715 .py(px(4.))
709 .rounded(px(3.))716 .rounded(px(3.))
710- .when(picked, |d| d.border_1().border_color(rgb(INK1())))717+ .border_1()
718+ .border_color(match picked {
719+ // The ring is always in flow -- transparent at rest, ink1 when
720+ // picked -- because a `when(picked, border_1())` added a pixel of
721+ // box on selection and shoved every row's text sideways.
722+ true => rgb(INK1()).into(),
723+ false => gpui::transparent_black(),
724+ })
711 .when(!usable, |d| d.opacity(0.5))725 .when(!usable, |d| d.opacity(0.5))
712 .when(usable, |d| {726 .when(usable, |d| {
713 d.cursor_pointer()727 d.cursor_pointer()
@@ -963,7 +977,11 @@ fn sources_tab(player: &Player, window: &mut Window, cx: &mut Context<Player>) -
963 .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| {977 .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| {
964 cycle_on_key_down(Surface::Dock)(this, event, window, cx)978 cycle_on_key_down(Surface::Dock)(this, event, window, cx)
965 }))979 }))
966- .when(focused, |d| d.border_1().border_color(rgb(STROKE_FOCUS())))980+ .border_1()
981+ .border_color(match focused {
982+ true => rgb(STROKE_FOCUS()).into(),
983+ false => gpui::transparent_black(),
984+ })
967 .flex_1()985 .flex_1()
968 .min_h(px(0.))986 .min_h(px(0.))
969 .flex()987 .flex()
@@ -1145,19 +1163,6 @@ fn sources_tab(player: &Player, window: &mut Window, cx: &mut Context<Player>) -
1145 }),1163 }),
1146 )),1164 )),
1147 )1165 )
1148- .child({
1149- // Metadata, not a row: DESIGN §3's metadata role, and the quietest
1150- // text in the dock: ink3, tight leading so it never competes with
1151- // the source rows above it.
1152- let style = mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM);
1153- div()
1154- .flex_none()
1155- .line_height(relative(1.25))
1156- .font(style.font)
1157- .text_size(style.size)
1158- .text_color(rgb(INK3()))
1159- .child("drag · ↵ add · double-click plays")
1160- })
1161 }1166 }
1162 1167
1163 /// The transition a clip carries into its immediate successor, if any -- a1168 /// The transition a clip carries into its immediate successor, if any -- a
@@ -1285,7 +1290,11 @@ fn clip_tab(
1285 .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| {1290 .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| {
1286 cycle_on_key_down(Surface::Inspector)(this, event, window, cx)1291 cycle_on_key_down(Surface::Inspector)(this, event, window, cx)
1287 }))1292 }))
1288- .when(focused, |d| d.border_1().border_color(rgb(STROKE_FOCUS())))1293+ .border_1()
1294+ .border_color(match focused {
1295+ true => rgb(STROKE_FOCUS()).into(),
1296+ false => gpui::transparent_black(),
1297+ })
1289 .flex_1()1298 .flex_1()
1290 .min_h(px(0.))1299 .min_h(px(0.))
1291 .flex()1300 .flex()
crates/app/src/ui/library.rsmodified+34 -7
@@ -4,6 +4,18 @@ use crate::ui::type_scale::Typeset;
4 use crate::ui::widgets::*;4 use crate::ui::widgets::*;
5 use crate::*;5 use crate::*;
6 6
7+/// How far below the pointer a library menu hangs so it clears the row it was
8+/// opened on: a source row is two lines (`dock_stance::source_row` -- `py(4.)`
9+/// twice, a `gap(2.)` and two ~20px line boxes), and the pointer may land on
10+/// its very first pixel.
11+///
12+/// corner-cut: a constant rather than the row's measured bottom, which the
13+/// `on_mouse_down` listener that sets `LibraryMenu::at` has no access to. The
14+/// ceiling is a row that grows a third line -- the menu would then start
15+/// inside it. Upgrade path: carry the row's `Bounds` bottom in `LibraryMenu`
16+/// via a `canvas`/`prepaint` probe in `source_row` and hang the menu off that.
17+const ROW_CLEAR: f32 = 52.;
18+
7 impl Player {19 impl Player {
8 /// The menu a right-click on a library row opens: what can be done with the20 /// The menu a right-click on a library row opens: what can be done with the
9 /// *file* rather than with a clip of it, and a turn-over side saying what21 /// *file* rather than with a clip of it, and a turn-over side saying what
@@ -161,14 +173,29 @@ impl Player {
161 );173 );
162 }174 }
163 }175 }
164- // Placed at the pointer, clamped only to the window's own bounds --176+ // Hung BELOW the row it is about, not on the pointer: opened at the
165- // standard context-menu behavior. Unlike the clip menu, this menu177+ // pointer it covered the very row it names (`k-lib-menu.png` -- the
166- // mounts on the root over the dock (no picture behind it to protect),178+ // source row vanished under its own menu), and a menu that hides its
167- // so it does not go through `menu_floor`'s picture-floor clamp; doing179+ // subject is DESIGN §11.6's occlusion rule broken on the other panel.
168- // so pulled a right-click high in the dock down to the picture floor,180+ // `menu_at` then does the rest -- left-aligned to the pointer, pulled
169- // teleporting the menu away from the pointer that opened it.181+ // back inside all four window edges, and flipped up above the row
182+ // where the dock has no room below. Unlike the clip menu it does not
183+ // go through `menu_floor`'s picture-floor clamp: it mounts over the
184+ // dock, which has no picture behind it, and clamping there pulled a
185+ // right-click high in the dock down to the picture floor, teleporting
186+ // the menu away from the pointer that opened it.
170 let list_h = menu_rows_h(rows.len(), viewport);187 let list_h = menu_rows_h(rows.len(), viewport);
171- let (x, y) = menu_at(menu.at, viewport, MENU_PAD * 2. + list_h);188+ let h = MENU_PAD * 2. + list_h;
189+ let below = point(menu.at.x, menu.at.y + px(ROW_CLEAR));
190+ // Above the row instead when the plate would not fit whole below it:
191+ // `menu_at`'s own clamp would otherwise slide it back up *over* the
192+ // row, which is the thing this placement exists to prevent.
193+ let at = if f32::from(below.y) + h + MENU_EDGE > f32::from(viewport.height) {
194+ point(menu.at.x, px((f32::from(menu.at.y) - h).max(0.)))
195+ } else {
196+ below
197+ };
198+ let (x, y) = menu_at(at, viewport, h);
172 let full: SharedString = path.display().to_string().into();199 let full: SharedString = path.display().to_string().into();
173 Some(200 Some(
174 scrim()201 scrim()
crates/app/src/ui/settings_stance.rsmodified+272 -5
@@ -89,6 +89,7 @@ fn row_keyed(
89 value,89 value,
90 hint,90 hint,
91 Some(player.keymap.chord(action).into()),91 Some(player.keymap.chord(action).into()),
92+ None,
92 player,93 player,
93 on_click,94 on_click,
94 INK1(),95 INK1(),
@@ -108,7 +109,7 @@ fn row_ink(
108 value_ink: u32,109 value_ink: u32,
109 ) -> impl IntoElement {110 ) -> impl IntoElement {
110 row_full(111 row_full(
111- id, label_text, value, hint, None, player, on_click, value_ink,112+ id, label_text, value, hint, None, None, player, on_click, value_ink,
112 )113 )
113 }114 }
114 115
@@ -123,6 +124,7 @@ fn row_full(
123 value: impl Into<SharedString>,124 value: impl Into<SharedString>,
124 hint: &'static str,125 hint: &'static str,
125 chord: Option<SharedString>,126 chord: Option<SharedString>,
127+ tail: Option<(SharedString, u32)>,
126 player: &Player,128 player: &Player,
127 on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,129 on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
128 value_ink: u32,130 value_ink: u32,
@@ -162,6 +164,17 @@ fn row_full(
162 .flex()164 .flex()
163 .items_baseline()165 .items_baseline()
164 .gap(px(8.))166 .gap(px(8.))
167+ .children(tail.map(|(tail, ink)| {
168+ let tail_style = type_scale::mono(
169+ type_scale::CHORD_METADATA_MIN_PX,
170+ gpui::FontWeight::MEDIUM,
171+ );
172+ div()
173+ .font(tail_style.font)
174+ .text_size(tail_style.size)
175+ .text_color(rgb(ink))
176+ .child(tail)
177+ }))
165 .children(chord.map(|chord| {178 .children(chord.map(|chord| {
166 let chord_style = type_scale::mono(179 let chord_style = type_scale::mono(
167 type_scale::CHORD_METADATA_MIN_PX,180 type_scale::CHORD_METADATA_MIN_PX,
@@ -195,6 +208,7 @@ fn row_static(
195 label_text: &'static str,208 label_text: &'static str,
196 value: impl Into<SharedString>,209 value: impl Into<SharedString>,
197 hint: &'static str,210 hint: &'static str,
211+ chord: Option<SharedString>,
198 value_ink: u32,212 value_ink: u32,
199 ) -> impl IntoElement {213 ) -> impl IntoElement {
200 let value: SharedString = value.into();214 let value: SharedString = value.into();
@@ -221,10 +235,27 @@ fn row_static(
221 .child(235 .child(
222 div()236 div()
223 .flex_none()237 .flex_none()
224- .font(value_style.font)238+ .flex()
225- .text_size(value_style.size)239+ .items_baseline()
226- .text_color(rgb(value_ink))240+ .gap(px(8.))
227- .child(value),241+ .children(chord.map(|chord| {
242+ let chord_style = type_scale::mono(
243+ type_scale::CHORD_METADATA_MIN_PX,
244+ gpui::FontWeight::MEDIUM,
245+ );
246+ div()
247+ .font(chord_style.font)
248+ .text_size(chord_style.size)
249+ .text_color(rgb(INK3()))
250+ .child(chord)
251+ }))
252+ .child(
253+ div()
254+ .font(value_style.font)
255+ .text_size(value_style.size)
256+ .text_color(rgb(value_ink))
257+ .child(value),
258+ ),
228 )259 )
229 }260 }
230 261
@@ -331,6 +362,7 @@ fn project_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen
331 "HDR reference",362 "HDR reference",
332 master_val,363 master_val,
333 "the mastering display's own peak white, in cd/m^2, as the grade declared it -- what a 'Reference' tonemap targets before it ever looks at this film's own pixels",364 "the mastering display's own peak white, in cd/m^2, as the grade declared it -- what a 'Reference' tonemap targets before it ever looks at this film's own pixels",
365+ None,
334 master_ink,366 master_ink,
335 ))367 ))
336 .child(row_static(368 .child(row_static(
@@ -338,6 +370,7 @@ fn project_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen
338 "Content light",370 "Content light",
339 content_val,371 content_val,
340 "MaxCLL/MaxFALL: the brightest single pixel and the brightest frame average measured in the finished encode -- what a 'Reference' tonemap actually rolls off from when the file declares it, ahead of the mastering peak above",372 "MaxCLL/MaxFALL: the brightest single pixel and the brightest frame average measured in the finished encode -- what a 'Reference' tonemap actually rolls off from when the file declares it, ahead of the mastering peak above",
373+ None,
341 content_ink,374 content_ink,
342 ))375 ))
343 .child(row(376 .child(row(
@@ -408,6 +441,226 @@ fn editor_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement
408 ))441 ))
409 }442 }
410 443
444+/// [`row_keyed`] for a stroke that is the *card's* own rather than a binding:
445+/// the export rows' `c`/`b`/`e` mean nothing outside this page and so are not
446+/// in the keymap, exactly as the colour and transform cards' keys are not.
447+/// The badge is drawn from the slot a bound row's is, so no reader can tell --
448+/// nor needs to -- which table a stroke came out of (DESIGN §4).
449+fn row_chord(
450+ id: &'static str,
451+ label_text: &'static str,
452+ value: impl Into<SharedString>,
453+ hint: &'static str,
454+ chord: &'static str,
455+ tail: Option<(SharedString, u32)>,
456+ player: &Player,
457+ on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
458+) -> impl IntoElement {
459+ row_full(
460+ id,
461+ label_text,
462+ value,
463+ hint,
464+ Some(chord.into()),
465+ tail,
466+ player,
467+ on_click,
468+ INK1(),
469+ )
470+}
471+
472+/// The nine files this editor writes, in the order the Picture row cycles
473+/// them: a codec's two boxes side by side (the container question the export
474+/// card asked in a row of its own, folded into this one), and the sound-only
475+/// formats after the pictures.
476+pub(crate) const PICTURE_CYCLE: [Format; 9] = [
477+ Format::Mp4,
478+ Format::Av1Mp4,
479+ Format::Av1,
480+ Format::Hevc,
481+ Format::HevcMp4,
482+ Format::Wav,
483+ Format::Flac,
484+ Format::Mp3,
485+ Format::Ogg,
486+];
487+
488+/// `H.264 · MP4`: the codec by the name it is picked under ([`format_label`])
489+/// and the box it lands in. An audio-only format names itself once -- `WAV ·
490+/// WAV` would be the one field on the line that says nothing.
491+pub(crate) fn picture_label(format: Format) -> String {
492+ match format.has_video() {
493+ true => format!("{} · {}", format_label(format), format.ext().to_uppercase()),
494+ false => format_label(format).to_string(),
495+ }
496+}
497+
498+/// The next file in [`PICTURE_CYCLE`] this machine can actually write.
499+/// `refused` is the same door [`Player::set_format`] asks, so the stroke never
500+/// stops on a codec the setter would only refuse back -- the refused ones are
501+/// still *said*, on the row's own greyed tail (DESIGN §8: never hidden).
502+/// `current` where every other stop is refused, so `c` cannot cycle to
503+/// nothing.
504+pub(crate) fn next_picture(current: Format, refused: impl Fn(Format) -> bool) -> Format {
505+ let n = PICTURE_CYCLE.len();
506+ let at = PICTURE_CYCLE
507+ .iter()
508+ .position(|&f| f == current)
509+ .unwrap_or_default();
510+ (1..=n)
511+ .map(|step| PICTURE_CYCLE[(at + step) % n])
512+ .find(|&f| !refused(f))
513+ .unwrap_or(current)
514+}
515+
516+/// What the sound of a file in this format is, and whether that codec takes a
517+/// rate: `AAC 256` steps with `b`, `PCM` has no rate to step and so wears no
518+/// chord at all.
519+pub(crate) fn sound_codec(format: Format) -> (&'static str, bool) {
520+ match format {
521+ Format::Wav => ("PCM", false),
522+ Format::Flac => ("FLAC", false),
523+ Format::Ogg => ("Vorbis", false),
524+ Format::Mp3 => ("MP3", true),
525+ _ => ("AAC", true),
526+ }
527+}
528+
529+/// The seat in the words the artboard writes it in -- lowercase `auto` and
530+/// `software` because they are what happens, `GPU` because that is the part
531+/// of this machine a person picked.
532+pub(crate) fn encoder_word(seat: EncoderSeat) -> &'static str {
533+ match seat {
534+ EncoderSeat::Auto => "auto",
535+ EncoderSeat::Hardware => "GPU",
536+ EncoderSeat::Software => "software",
537+ }
538+}
539+
540+/// The one amber line on this page (`NOTICE_LOOK`, DESIGN §8's "worth a
541+/// look"): the plugin's AV1 seat is constant-quality, so the budget the
542+/// export moment now asks for is the one thing this pick does not honour.
543+pub(crate) const AV1_GPU_NOTICE: &str = "ignores the budget \u{2014} constant quality";
544+
545+/// A refusal in six words, which is what fits beside a value on one row --
546+/// the whole sentence is still said where the pick is actually refused
547+/// ([`Player::set_format`]'s own banner).
548+pub(crate) fn short_reason(why: &str) -> String {
549+ why.split_whitespace().take(6).collect::<Vec<_>>().join(" ")
550+}
551+
552+/// EXPORT: the four choices a film is delivered by, off the export card (user:
553+/// it was "too complicated") and into the room where a project's other
554+/// once-a-project answers already live. The export moment keeps the file and
555+/// the budget; the codec, the sound, the encoder and the range are here.
556+fn export_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement {
557+ let format = player.format;
558+ let refusals: Vec<String> = PICTURE_CYCLE
559+ .into_iter()
560+ .filter_map(|f| {
561+ player
562+ .session
563+ .as_ref()
564+ .and_then(|session| format_refusal(session, f))
565+ .map(|why| format!("{} {}", format_label(f), short_reason(&why)))
566+ })
567+ .collect();
568+ // Never hidden (DESIGN §8): a codec this machine has no encoder for stays
569+ // on the row, greyed, with the reason beside it -- the export card's own
570+ // refusal rows, in the one place a codec is picked now.
571+ let refused_tail = (!refusals.is_empty()).then(|| (refusals.join(" \u{b7} ").into(), INK4()));
572+ let (codec, rated) = sound_codec(format);
573+ let seat = player.encoder_seat();
574+ let av1_gpu = seat == EncoderSeat::Hardware && matches!(format, Format::Av1 | Format::Av1Mp4);
575+ let range = match player.range {
576+ Some((start, end)) => format!(
577+ "marks {}\u{2013}{}",
578+ timecode(f64::from(start) / player.fps, player.fps),
579+ timecode(f64::from(end) / player.fps, player.fps),
580+ ),
581+ None => "whole film".to_string(),
582+ };
583+ div()
584+ .flex_none()
585+ .flex()
586+ .flex_col()
587+ .gap(px(2.))
588+ .child(section_head("EXPORT \u{b7} what a delivery is written as"))
589+ .child(row_chord(
590+ "settings-export-picture",
591+ "Picture",
592+ picture_label(format),
593+ "the codec the picture is written with and the box it lands in; the export moment asks only for the file and the budget",
594+ "c",
595+ refused_tail,
596+ player,
597+ cx.listener(|this, _: &ClickEvent, _, cx| {
598+ this.cycle_export_picture();
599+ cx.notify();
600+ }),
601+ ))
602+ .children(rated.then(|| {
603+ row_chord(
604+ "settings-export-sound",
605+ "Sound",
606+ format!("{codec} {}", player.audio_kbps),
607+ "what the sound inside that file is coded at, in kbps",
608+ "b",
609+ None,
610+ player,
611+ cx.listener(|this, _: &ClickEvent, _, cx| {
612+ this.cycle_audio_kbps();
613+ cx.notify();
614+ }),
615+ )
616+ .into_any_element()
617+ }))
618+ // A codec with no rate to pick is a readout, not a button that would
619+ // do nothing when pressed -- and it wears no chord, because there is
620+ // no step for one to take.
621+ .children((!rated).then(|| {
622+ row_static(
623+ "settings-export-sound",
624+ "Sound",
625+ codec,
626+ "this codec carries no rate to pick: it is written as the format itself says",
627+ None,
628+ INK1(),
629+ )
630+ .into_any_element()
631+ }))
632+ .child(row_chord(
633+ "settings-export-encoder",
634+ "Encoder",
635+ encoder_word(seat),
636+ "which encoder writes the picture: the GPU where this machine has a seat, or the CPU",
637+ "e",
638+ av1_gpu.then(|| (AV1_GPU_NOTICE.into(), NOTICE_LOOK())),
639+ player,
640+ cx.listener(|this, _: &ClickEvent, _, cx| {
641+ this.cycle_encoder(cx);
642+ }),
643+ ))
644+ // Read-only: the range is set on the timeline with the marks
645+ // themselves ([`keymap::ActionId::SetIn`]/`SetOut`), which is where a
646+ // person can see what they are marking.
647+ .child(row_static(
648+ "settings-export-range",
649+ "Range",
650+ range,
651+ "the span an export writes: the whole timeline, or whatever the in/out marks hold",
652+ Some(
653+ format!(
654+ "{} {}",
655+ player.keymap.chord(ActionId::SetIn),
656+ player.keymap.chord(ActionId::SetOut)
657+ )
658+ .into(),
659+ ),
660+ INK1(),
661+ ))
662+}
663+
411 /// The page itself: a plate in the room's own below-picture footprint,664 /// The page itself: a plate in the room's own below-picture footprint,
412 /// closed by a click away or `esc` through [`Player::close_card`] like every665 /// closed by a click away or `esc` through [`Player::close_card`] like every
413 /// other card here.666 /// other card here.
@@ -513,6 +766,20 @@ pub(crate) fn render(
513 .border_color(rgb(DARK_HAIRLINE()))766 .border_color(rgb(DARK_HAIRLINE()))
514 .pl(px(12.))767 .pl(px(12.))
515 .child(editor_section(player, cx)),768 .child(editor_section(player, cx)),
769+ )
770+ // The third column: what a delivery is written as, the
771+ // rows the export card used to hold (user: it was "too
772+ // complicated"). Beside the other two rather than under
773+ // them -- a fold with no scrollbar is the defect this
774+ // page's own two columns exist to avoid.
775+ .child(
776+ div()
777+ .flex_1()
778+ .min_w(px(0.))
779+ .border_l_1()
780+ .border_color(rgb(DARK_HAIRLINE()))
781+ .pl(px(12.))
782+ .child(export_section(player, cx)),
516 ),783 ),
517 ),784 ),
518 )785 )
crates/app/src/ui/spine_stance.rsmodified+63 -28
@@ -47,6 +47,44 @@ fn glyph(
47 player: &Player,47 player: &Player,
48 cx: &mut Context<Player>,48 cx: &mut Context<Player>,
49 ) -> impl IntoElement + use<> {49 ) -> impl IntoElement + use<> {
50+ glyph_sized(false, id, glyph, action, active, quiet, player, cx)
51+}
52+
53+/// The paired half of [`glyph`]: same control, one step down the §3 scale
54+/// (13px, the chord size) and 1px of side padding instead of 3. Two
55+/// full-size halves plus their padding measured 66px against a 56px rail
56+/// and laid out at negative x -- `‹10` was cut at the window's own left
57+/// edge (hitmap `action.WalkCutPrev10 x=-5 w=31`). Subtraction, not a wider
58+/// spine: the pair now fits inside the column with room on both sides.
59+fn small(
60+ id: &'static str,
61+ glyph: &'static str,
62+ action: ActionId,
63+ active: bool,
64+ quiet: bool,
65+ player: &Player,
66+ cx: &mut Context<Player>,
67+) -> impl IntoElement + use<> {
68+ glyph_sized(true, id, glyph, action, active, quiet, player, cx)
69+}
70+
71+#[allow(clippy::too_many_arguments)]
72+fn glyph_sized(
73+ paired: bool,
74+ id: &'static str,
75+ glyph: &'static str,
76+ action: ActionId,
77+ active: bool,
78+ quiet: bool,
79+ player: &Player,
80+ cx: &mut Context<Player>,
81+) -> impl IntoElement + use<> {
82+ let size = if paired {
83+ type_scale::CHORD_METADATA_MIN_PX
84+ } else {
85+ type_scale::LABEL_ROW_PX
86+ };
87+ let pad = if paired { 1. } else { 3. };
50 let enabled = player.enable(action, None);88 let enabled = player.enable(action, None);
51 // The badge shows the primary chord only (FAULT 1: a chord badge is a89 // The badge shows the primary chord only (FAULT 1: a chord badge is a
52 // compact token, not a sentence); the tooltip keeps every stroke an90 // compact token, not a sentence); the tooltip keeps every stroke an
@@ -67,7 +105,7 @@ fn glyph(
67 .flex_col()105 .flex_col()
68 .items_center()106 .items_center()
69 .gap(px(1.))107 .gap(px(1.))
70- .px(px(3.))108+ .px(px(pad))
71 .py(px(1.))109 .py(px(1.))
72 .rounded(px(3.))110 .rounded(px(3.))
73 .when(active, |d| d.bg(rgb(DARK_RAISED())))111 .when(active, |d| d.bg(rgb(DARK_RAISED())))
@@ -88,10 +126,7 @@ fn glyph(
88 .line_height(relative(1.05))126 .line_height(relative(1.05))
89 // FAULT 1: the glyph is the loudest thing in its row -- BOLD,127 // FAULT 1: the glyph is the loudest thing in its row -- BOLD,
90 // not the MEDIUM weight the chord beneath it also wears.128 // not the MEDIUM weight the chord beneath it also wears.
91- .type_style(type_scale::label(129+ .type_style(type_scale::label(size, gpui::FontWeight::BOLD))
92- type_scale::LABEL_ROW_PX,
93- gpui::FontWeight::BOLD,
94- ))
95 .text_color(rgb(if active {130 .text_color(rgb(if active {
96 INK1()131 INK1()
97 } else if quiet {132 } else if quiet {
@@ -132,7 +167,7 @@ fn trim_control(active: bool, player: &Player, cx: &mut Context<Player>) -> impl
132 div()167 div()
133 .id(id)168 .id(id)
134 .flex_none()169 .flex_none()
135- .px(px(2.))170+ .px(px(1.))
136 .rounded(px(3.))171 .rounded(px(3.))
137 .tooltip(move |_, cx| cx.new(|_| Tip(say.clone())).into())172 .tooltip(move |_, cx| cx.new(|_| Tip(say.clone())).into())
138 .when(!on, |d| d.opacity(0.4).cursor_not_allowed())173 .when(!on, |d| d.opacity(0.4).cursor_not_allowed())
@@ -147,8 +182,9 @@ fn trim_control(active: bool, player: &Player, cx: &mut Context<Player>) -> impl
147 .child(182 .child(
148 div()183 div()
149 .line_height(relative(1.05))184 .line_height(relative(1.05))
185+ // Paired, so the same step down the scale `small` takes.
150 .type_style(type_scale::label(186 .type_style(type_scale::label(
151- type_scale::LABEL_ROW_PX,187+ type_scale::CHORD_METADATA_MIN_PX,
152 gpui::FontWeight::BOLD,188 gpui::FontWeight::BOLD,
153 ))189 ))
154 .text_color(rgb(if active { INK1() } else { INK2() }))190 .text_color(rgb(if active { INK1() } else { INK2() }))
@@ -213,11 +249,10 @@ fn pair(left: impl IntoElement, right: impl IntoElement) -> impl IntoElement {
213 .w_full()249 .w_full()
214 .items_center()250 .items_center()
215 .justify_center()251 .justify_center()
216- // 4px, not 6: two two-glyph halves plus their own padding used to252+ // 3px, and both halves come from `small` (13px, 1px padding): two
217- // measure wider than the 56px rail and bled past its left edge253+ // full-size halves plus 4px measured 66px against the 56px rail and
218- // (measured at 1280x720: the `AP`/`FS` row started at x=0, outside254+ // laid out at negative x (hitmap `action.AddVideoLane x=-2 w=28`).
219- // the spine's own surface).255+ .gap(px(3.))
220- .gap(px(4.))
221 .child(left)256 .child(left)
222 .child(right)257 .child(right)
223 }258 }
@@ -271,16 +306,16 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
271 cx,306 cx,
272 ))307 ))
273 .child(pair(308 .child(pair(
274- glyph("spine-undo", "↺", ActionId::Undo, false, false, player, cx),309+ small("spine-undo", "↺", ActionId::Undo, false, false, player, cx),
275 // Redo had a legacy toolbar button (`toolbar.rs:347`) but no310 // Redo had a legacy toolbar button (`toolbar.rs:347`) but no
276 // darkroom home -- Undo got a glyph here and Redo did not.311 // darkroom home -- Undo got a glyph here and Redo did not.
277 // Same row, same door (`this.act`), the pair anatomy the312 // Same row, same door (`this.act`), the pair anatomy the
278 // cut-prev/cut-next row below already uses.313 // cut-prev/cut-next row below already uses.
279- glyph("spine-redo", "⟳", ActionId::Redo, false, false, player, cx),314+ small("spine-redo", "⟳", ActionId::Redo, false, false, player, cx),
280 ))315 ))
281 .child(group_head("cut"))316 .child(group_head("cut"))
282 .child(pair(317 .child(pair(
283- glyph(318+ small(
284 "spine-cut-prev",319 "spine-cut-prev",
285 "‹",320 "‹",
286 ActionId::WalkCutPrev,321 ActionId::WalkCutPrev,
@@ -289,7 +324,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
289 player,324 player,
290 cx,325 cx,
291 ),326 ),
292- glyph(327+ small(
293 "spine-cut-next",328 "spine-cut-next",
294 "›",329 "›",
295 ActionId::WalkCutNext,330 ActionId::WalkCutNext,
@@ -312,7 +347,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
312 .items_center()347 .items_center()
313 .gap(px(1.))348 .gap(px(1.))
314 .child(pair(349 .child(pair(
315- glyph(350+ small(
316 "spine-cut-prev-ten",351 "spine-cut-prev-ten",
317 "‹10",352 "‹10",
318 ActionId::WalkCutPrev10,353 ActionId::WalkCutPrev10,
@@ -321,7 +356,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
321 player,356 player,
322 cx,357 cx,
323 ),358 ),
324- glyph(359+ small(
325 "spine-cut-next-ten",360 "spine-cut-next-ten",
326 "10›",361 "10›",
327 ActionId::WalkCutNext10,362 ActionId::WalkCutNext10,
@@ -336,7 +371,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
336 // Trim-to-playhead (debt #42): the keyboard's own version371 // Trim-to-playhead (debt #42): the keyboard's own version
337 // of the pointer's drag-to-a-spot trim, beside the nudge372 // of the pointer's drag-to-a-spot trim, beside the nudge
338 // pair it shares its primitive with.373 // pair it shares its primitive with.
339- glyph(374+ small(
340 "spine-trim-in-playhead",375 "spine-trim-in-playhead",
341 "[▮",376 "[▮",
342 ActionId::TrimInToPlayhead,377 ActionId::TrimInToPlayhead,
@@ -345,7 +380,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
345 player,380 player,
346 cx,381 cx,
347 ),382 ),
348- glyph(383+ small(
349 "spine-trim-out-playhead",384 "spine-trim-out-playhead",
350 "▮]",385 "▮]",
351 ActionId::TrimOutToPlayhead,386 ActionId::TrimOutToPlayhead,
@@ -379,7 +414,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
379 .items_center()414 .items_center()
380 .gap(px(1.))415 .gap(px(1.))
381 .child(pair(416 .child(pair(
382- glyph(417+ small(
383 "spine-zoom-out",418 "spine-zoom-out",
384 "−",419 "−",
385 ActionId::ZoomOut,420 ActionId::ZoomOut,
@@ -388,7 +423,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
388 player,423 player,
389 cx,424 cx,
390 ),425 ),
391- glyph(426+ small(
392 "spine-zoom-in",427 "spine-zoom-in",
393 "+",428 "+",
394 ActionId::ZoomIn,429 ActionId::ZoomIn,
@@ -431,7 +466,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
431 .items_center()466 .items_center()
432 .gap(px(1.))467 .gap(px(1.))
433 .child(pair(468 .child(pair(
434- glyph(469+ small(
435 "spine-add-video",470 "spine-add-video",
436 "+V",471 "+V",
437 ActionId::AddVideoLane,472 ActionId::AddVideoLane,
@@ -440,7 +475,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
440 player,475 player,
441 cx,476 cx,
442 ),477 ),
443- glyph(478+ small(
444 "spine-add-audio",479 "spine-add-audio",
445 "+A",480 "+A",
446 ActionId::AddAudioLane,481 ActionId::AddAudioLane,
@@ -457,7 +492,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
457 // beside "Add files" (`dock_stance`), where an editor492 // beside "Add files" (`dock_stance`), where an editor
458 // already goes to bring a file into the room.493 // already goes to bring a file into the room.
459 .child(pair(494 .child(pair(
460- glyph(495+ small(
461 "spine-add-subtitle",496 "spine-add-subtitle",
462 "+S",497 "+S",
463 ActionId::AddSubtitleLane,498 ActionId::AddSubtitleLane,
@@ -466,7 +501,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
466 player,501 player,
467 cx,502 cx,
468 ),503 ),
469- glyph(504+ small(
470 "spine-remove-subtitle",505 "spine-remove-subtitle",
471 "−S",506 "−S",
472 ActionId::RemoveSubtitleLane,507 ActionId::RemoveSubtitleLane,
@@ -500,7 +535,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
500 .items_center()535 .items_center()
501 .gap(px(1.))536 .gap(px(1.))
502 .child(pair(537 .child(pair(
503- glyph(538+ small(
504 "spine-settings",539 "spine-settings",
505 "St",540 "St",
506 ActionId::Settings,541 ActionId::Settings,
@@ -509,7 +544,7 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
509 player,544 player,
510 cx,545 cx,
511 ),546 ),
512- glyph(547+ small(
513 "spine-screenshot",548 "spine-screenshot",
514 "Sh",549 "Sh",
515 ActionId::Screenshot,550 ActionId::Screenshot,
crates/app/src/ui/stance.rsmodified+109 -39
@@ -224,17 +224,59 @@ mod menu_floor_tests {
224 let floor = below_picture_floor(f32::from(viewport.height), BENCH_H);224 let floor = below_picture_floor(f32::from(viewport.height), BENCH_H);
225 let (at, room) = menu_floor(point(px(300.), px(20.)), viewport, BENCH_H);225 let (at, room) = menu_floor(point(px(300.), px(20.)), viewport, BENCH_H);
226 assert_eq!(f32::from(at.y), floor);226 assert_eq!(f32::from(at.y), floor);
227- // 396px of rows (the charter's measured menu height) does not fit in227+ // 17 rows -- more than the footprint holds -- sized through the real
228- // the 316px footprint room, so it must be capped to it, not the228+ // sizer, so the `MENU_EDGE` margin is in the number the clamp sees.
229- // window's 720.229+ let list_h = crate::oracle::menu_rows_h(17, room);
230- let list_h = (396f32).min(f32::from(room.height));
231 assert!(list_h <= f32::from(room.height));230 assert!(list_h <= f32::from(room.height));
232- let (_, y) = crate::oracle::menu_at(at, viewport, list_h);231+ let h = crate::layout::MENU_PAD * 2. + list_h;
232+ let (_, y) = crate::oracle::menu_at(at, viewport, h);
233 assert_eq!(233 assert_eq!(
234 y, floor,234 y, floor,
235 "the top edge must not be walked back above the floor"235 "the top edge must not be walked back above the floor"
236 );236 );
237 }237 }
238+
239+ /// Defect 1 as the user met it (`f-clip-menu.png`): a menu opened near the
240+ /// right and bottom of a 1280x720 window ran off both edges -- chords cut
241+ /// mid-word at the dock seam, rows past the frame. Pure clamp math, both
242+ /// window sizes the charter names, and both the floored (clip) menu and
243+ /// the unfloored (library) one: whatever the anchor, the whole plate lands
244+ /// inside the frame with [`MENU_EDGE`] to spare, and the floored one never
245+ /// buys that room off the picture.
246+ #[test]
247+ fn a_menu_opened_in_the_bottom_right_corner_lands_whole_inside_the_window() {
248+ use crate::layout::{MENU_EDGE, MENU_PAD, MENU_W};
249+ for viewport in [size(px(1280.), px(720.)), size(px(2560.), px(1440.))] {
250+ let (w, v) = (f32::from(viewport.width), f32::from(viewport.height));
251+ let floor = below_picture_floor(v, BENCH_H);
252+ for rows in [1usize, 5, 16, 40] {
253+ for anchor in [
254+ point(px(w - 1.), px(v - 1.)),
255+ point(px(w - 1.), px(0.)),
256+ point(px(0.), px(v - 1.)),
257+ ] {
258+ // The clip menu's path: floored below the picture, sized
259+ // against the room that leaves, then clamped.
260+ let (at, room) = menu_floor(anchor, viewport, BENCH_H);
261+ let h = MENU_PAD * 2. + crate::oracle::menu_rows_h(rows, room);
262+ let (x, y) = crate::oracle::menu_at(at, viewport, h);
263+ assert!(x >= MENU_EDGE && x + MENU_W <= w - MENU_EDGE, "x {x} rows {rows}");
264+ assert!(y >= MENU_EDGE && y + h <= v - MENU_EDGE, "y {y} h {h} rows {rows}");
265+ assert!(y >= floor, "y {y} walked above the picture floor {floor}");
266+ // The library menu's path: no floor, hung a row below the
267+ // pointer, same clamp.
268+ let h = MENU_PAD * 2. + crate::oracle::menu_rows_h(rows, viewport);
269+ let (x, y) = crate::oracle::menu_at(
270+ point(anchor.x, anchor.y + px(52.)),
271+ viewport,
272+ h,
273+ );
274+ assert!(x >= MENU_EDGE && x + MENU_W <= w - MENU_EDGE, "lib x {x}");
275+ assert!(y >= MENU_EDGE && y + h <= v - MENU_EDGE, "lib y {y} h {h}");
276+ }
277+ }
278+ }
279+ }
238 }280 }
239 281
240 #[cfg(test)]282 #[cfg(test)]
@@ -407,11 +449,11 @@ fn ghost(
407 ))449 ))
408 .text_color(rgb(INK2()))450 .text_color(rgb(INK2()))
409 .child(glyph.to_string())451 .child(glyph.to_string())
410- // The badge is skipped when the stroke IS the glyph: `?` over `?`452+ // Every command wears its chord (DESIGN §4) -- including the one
411- // drew as two identical rows stacked at the foot of the rail and read453+ // whose glyph IS its stroke: `?` reads as `?` over a dimmer `?`,
412- // as a duplicated control rather than as one command wearing its own454+ // the same glyph-over-chord anatomy every other spine ghost draws,
413- // chord.455+ // rather than as the one control on the rail with nothing under it.
414- .children((player.keymap.chord(action) != glyph).then(|| {456+ .child(
415 div()457 div()
416 .type_style(type_scale::mono(458 .type_style(type_scale::mono(
417 type_scale::CHORD_METADATA_MIN_PX,459 type_scale::CHORD_METADATA_MIN_PX,
@@ -420,8 +462,8 @@ fn ghost(
420 .text_color(rgb(INK3()))462 .text_color(rgb(INK3()))
421 // FAULT 1: the badge shows the primary chord, compact --463 // FAULT 1: the badge shows the primary chord, compact --
422 // same rule as every glyph in `spine_stance`.464 // same rule as every glyph in `spine_stance`.
423- .child(player.keymap.chord(action))465+ .child(player.keymap.chord(action)),
424- }))466+ )
425 }467 }
426 468
427 /// The keys overlay (DESIGN §9, §12 step 7): every bound command, sectioned469 /// The keys overlay (DESIGN §9, §12 step 7): every bound command, sectioned
@@ -460,6 +502,13 @@ fn keys_overlay(player: &Player, bench_h: f32, cx: &mut Context<Player>) -> impl
460 .h(px(bench_h + LEDGER_H))502 .h(px(bench_h + LEDGER_H))
461 .bg(rgba(SCRIM()))503 .bg(rgba(SCRIM()))
462 .flex()504 .flex()
505+ // The plate's inset lives on the scrim, not on the plate's own
506+ // margins: a margin under a fixed `h()` left the list flush with the
507+ // window's bottom edge and its last rows cut over the ledger. Padding
508+ // here takes the room off the footprint before the plate is measured.
509+ .pl(px(12.))
510+ .pt(px(8.))
511+ .pb(px(8.))
463 // Bottom-left, not centred: the `?` control that opens this lives at512 // Bottom-left, not centred: the `?` control that opens this lives at
464 // the foot of the spine ([`spine`]'s last child), and this overlay513 // the foot of the spine ([`spine`]'s last child), and this overlay
465 // mounts inside the *centre* column next to it -- anchoring the list514 // mounts inside the *centre* column next to it -- anchoring the list
@@ -482,9 +531,10 @@ fn keys_overlay(player: &Player, bench_h: f32, cx: &mut Context<Player>) -> impl
482 .child(531 .child(
483 div()532 div()
484 .id("stance-keys-list")533 .id("stance-keys-list")
485- .ml(px(12.))534+ // Capped to the bench+ledger footprint less the scrim's own
486- .mb(px(12.))535+ // inset, so the bottom border is on screen and the rows
487- .h(px((bench_h + LEDGER_H - 24.).max(0.)))536+ // scroll inside it (DESIGN §9).
537+ .h(px((bench_h + LEDGER_H - 16.).max(0.)))
488 .w(px(460.))538 .w(px(460.))
489 .overflow_y_scroll()539 .overflow_y_scroll()
490 .p(px(10.))540 .p(px(10.))
@@ -496,7 +546,27 @@ fn keys_overlay(player: &Player, bench_h: f32, cx: &mut Context<Player>) -> impl
496 .flex()546 .flex()
497 .flex_col()547 .flex_col()
498 .gap(px(3.))548 .gap(px(3.))
499- .child(section_head("all commands · hold ? · release to close"))549+ // DESIGN §8, no instructional copy: the heading is the
550+ // single noun, and the way out is a chord on the right like
551+ // every other row here -- not a sentence that lied anyway
552+ // (a click-opened plate does not close on a release).
553+ .child(
554+ div()
555+ .flex_none()
556+ .flex()
557+ .justify_between()
558+ .gap(px(12.))
559+ .child(section_head("keys"))
560+ .child(
561+ div()
562+ .type_style(type_scale::mono(
563+ type_scale::CHORD_METADATA_MIN_PX,
564+ gpui::FontWeight::MEDIUM,
565+ ))
566+ .text_color(rgb(INK3()))
567+ .child("esc"),
568+ ),
569+ )
500 .children(keys_rows().into_iter().map(|row| {570 .children(keys_rows().into_iter().map(|row| {
501 match row {571 match row {
502 KeyRow::Head(category) => div()572 KeyRow::Head(category) => div()
@@ -783,13 +853,18 @@ fn ledger(player: &Player, position: f64) -> impl IntoElement {
783 div()853 div()
784 .flex_1()854 .flex_1()
785 .min_w(px(0.))855 .min_w(px(0.))
786- .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()
787 .type_style(type_scale::mono(862 .type_style(type_scale::mono(
788 type_scale::CHORD_METADATA_MIN_PX,863 type_scale::CHORD_METADATA_MIN_PX,
789 gpui::FontWeight::MEDIUM,864 gpui::FontWeight::MEDIUM,
790 ))865 ))
791 .text_color(rgb(action_ink))866 .text_color(rgb(action_ink))
792- .child(last_action),867+ .child(ledger_line(&last_action)),
793 )868 )
794 .children(export.map(|e| {869 .children(export.map(|e| {
795 div()870 div()
@@ -1102,17 +1177,6 @@ pub(crate) fn render(
1102 .when(player.settings_open, |el| {1177 .when(player.settings_open, |el| {
1103 el.child(settings_stance::render(player, window_size, cx))1178 el.child(settings_stance::render(player, window_size, cx))
1104 })1179 })
1105- // The two menus (DESIGN §9: "verbs of the thing under the
1106- // cursor", plate styling, the same scrim-and-row component
1107- // the legacy tree already uses -- `library.rs`'s own doc
1108- // comment: "Built like `Player::context_card` ... because it
1109- // is the same menu on the other panel") and the open list a
1110- // picker sets: none of the three had a home in the stance,
1111- // so `overlaid()` refused every key over them for nothing
1112- // ever drawn (FAULT 2). `render.rs`'s children order is kept
1113- // -- clip menu, then library menu, then the open list last so
1114- // it floats over whichever row opened it.
1115- .children(player.context_card(window_size, cx))
1116 // The export card and its running-progress sheet, mounted1180 // The export card and its running-progress sheet, mounted
1117 // over the whole room exactly as the legacy tree mounts them1181 // over the whole room exactly as the legacy tree mounts them
1118 // (`render.rs`) -- the fix for the shipped "Export does1182 // (`render.rs`) -- the fix for the shipped "Export does
@@ -1120,7 +1184,6 @@ pub(crate) fn render(
1120 // what draws it once open.1184 // what draws it once open.
1121 .children(player.export_card(window_size, cx))1185 .children(player.export_card(window_size, cx))
1122 .children(player.export_progress_card(cx))1186 .children(player.export_progress_card(cx))
1123- .children(player.picker_card(window_size, cx))
1124 // A maximized clip param card (EQ/Colour/Transform/Speed/1187 // A maximized clip param card (EQ/Colour/Transform/Speed/
1125 // Silence/Mix/Subtitle style) escapes the dock to mount here1188 // Silence/Mix/Subtitle style) escapes the dock to mount here
1126 // instead, the same window-space `stance-centre` context1189 // instead, the same window-space `stance-centre` context
@@ -1145,14 +1208,21 @@ pub(crate) fn render(
1145 )1208 )
1146 .child(divider(Split::Dock, player.split_drag == Some(Split::Dock), cx))1209 .child(divider(Split::Dock, player.split_drag == Some(Split::Dock), cx))
1147 .child(dock(player, dock_w, window_size, window, cx))1210 .child(dock(player, dock_w, window_size, window, cx))
1148- // The library row menu mounts on the ROOT, not inside1211+ // All three hanging menus (DESIGN §9: "verbs of the thing under the
1149- // `stance-centre` like the clip menu beside it: it is opened from a1212+ // cursor") mount on the ROOT, and none of them inside
1150- // dock row, so its anchor is a window x past the centre column's own1213+ // `stance-centre`. Their anchors are *window* coordinates -- a
1151- // right edge, and the dock -- painted after the centre -- covered1214+ // `MouseDownEvent::position` -- while an absolutely placed child of
1152- // every pixel of it. That is the whole of the shipped "can not1215+ // the centre column is laid out from that column's own origin and
1153- // remove a media from library" defect: the plate was built, placed1216+ // ends where it ends: the spine shifted every clip menu right by
1154- // and never visible. Mounted here it paints last, over the dock it1217+ // `SPINE_W`, and the dock, painted after the centre, covered every
1155- // belongs to, and its own `menu_floor` window coordinates finally1218+ // pixel past x = width - dock. That is the shipped "can not remove a
1156- // mean what they say.1219+ // media from library" defect (the library plate was built, placed and
1220+ // never visible) and the clip menu whose chords were cut off mid-word
1221+ // at the dock seam. Mounted here they paint last, over the dock they
1222+ // may overlap, and `menu_floor`/`menu_at`'s window coordinates finally
1223+ // mean what they say. Order is `render.rs`'s -- clip menu, library
1224+ // menu, then the open list last so it floats over whichever row set it.
1225+ .children(player.context_card(window_size, cx))
1157 .children(player.library_card(window_size, cx))1226 .children(player.library_card(window_size, cx))
1227+ .children(player.picker_card(window_size, cx))
1158 }1228 }
crates/app/src/ui/timeband_stance.rsmodified+190 -46
@@ -23,6 +23,92 @@ thread_local! {
23 // fold both into `Player` once `main.rs` is free again.23 // fold both into `Player` once `main.rs` is free again.
24 static STRIP_BOUNDS: Rc<Cell<Bounds<Pixels>>> = Rc::new(Cell::new(Bounds::default()));24 static STRIP_BOUNDS: Rc<Cell<Bounds<Pixels>>> = Rc::new(Cell::new(Bounds::default()));
25 static PAN_ANCHOR: Cell<Option<f32>> = Cell::new(None);25 static PAN_ANCHOR: Cell<Option<f32>> = Cell::new(None);
26+ /// The band row's own measured width, read by the frame after the one
27+ /// that took it (`width_probe` asks for that frame whenever it changes).
28+ /// This is what the degradation ladder below keys off: the band cannot
29+ /// know its column's width any other way without a `Window` this
30+ /// module's `render` is not handed.
31+ static BAND_W: Rc<Cell<Pixels>> = Rc::new(Cell::new(px(0.)));
32+ /// Set once per `render` from the ladder, read by `ghost` (which the
33+ /// band's own helpers call three levels down) -- a render-scoped
34+ /// constant rather than a parameter threaded through every call site.
35+ static SHOW_CHORDS: Cell<bool> = const { Cell::new(true) };
36+}
37+
38+/// The contact strip's floor: the flex_1 element absorbs the band's slack,
39+/// but a minimap narrower than this is not a map.
40+pub(crate) const STRIP_MIN_W: f32 = 120.;
41+
42+/// The band's own width probe, `timeline_math::height_probe`'s shape on the
43+/// other axis: a measurement is read by the frame after the one that took it,
44+/// so a change has to ask for that frame or a resize would leave the ladder
45+/// one layer behind until something else happened to draw.
46+fn width_probe(into: Rc<Cell<Pixels>>) -> impl IntoElement {
47+ canvas(
48+ move |bounds, window, _| {
49+ // Only on a change: an unconditional request is a repaint loop.
50+ if into.replace(bounds.size.width) != bounds.size.width {
51+ window.request_animation_frame();
52+ }
53+ },
54+ |_, _, _, _| (),
55+ )
56+ .absolute()
57+ .size_full()
58+}
59+
60+/// Which layers of the band are still drawn at a given column width
61+/// (DESIGN §7's ladder, one layer per threshold, never all at once).
62+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
63+pub(crate) struct BandLayers {
64+ /// Chord badges under the transport glyphs.
65+ pub(crate) chords: bool,
66+ /// The audio-monitoring cluster (mute, -/+, slider, level readout).
67+ pub(crate) volume: bool,
68+ /// The sync-point pair and the loop toggle.
69+ pub(crate) sync: bool,
70+ /// The export-range marks (I / O / x).
71+ pub(crate) marks: bool,
72+}
73+
74+/// The ladder itself. Every threshold is a MEASURED number: the band drawn
75+/// whole at 2560x1440 (`$EDITH_HITMAP`) reads 1246px of fixed groups beside a
76+/// 974px strip, and the same band at 1280x720 (chords off) reads each glyph's
77+/// door at its `HIT_MIN` floor. Fixed width + `STRIP_MIN_W`, rounded up to the
78+/// next 10px, is what each rung costs:
79+///
80+/// | drawn | fixed | needs |
81+/// |----------------------------------------------|-------|--------|
82+/// | everything, chords under every glyph | 1246 | 1370px |
83+/// | chords dropped (-97px, doors keep `HIT_MIN`) | 1149 | 1270px |
84+/// | + monitoring cluster dropped (-256px) | 893 | 1020px |
85+/// | + sync pair and loop dropped (-102px) | 791 | 920px |
86+/// | + range marks dropped (-92px): the floor | 699 | 820px |
87+///
88+/// The four things the band is *for* -- timecode, cut readout, contact strip
89+/// (>=`STRIP_MIN_W`, the flex_1 that absorbs the slack) and the Export chip --
90+/// are on every rung; below the floor's own 820px there is nothing left to
91+/// shed and `overflow_hidden` is what keeps the rest inside the column.
92+/// There is no zoom group in this band (the charter's rung 2): the monitoring
93+/// cluster is the band's equivalent extra and takes its place.
94+pub(crate) fn band_layers(band_w: f32) -> BandLayers {
95+ BandLayers {
96+ chords: band_w >= 1370.,
97+ volume: band_w >= 1270.,
98+ sync: band_w >= 1020.,
99+ marks: band_w >= 920.,
100+ }
101+}
102+
103+/// The odometer's cut (DESIGN §6, "the cut readout is the odometer"): the cut
104+/// the playhead rests on, or -- when it rests in a gap -- the next one ahead
105+/// of it. `None` only when there is no cut at or after the playhead, which is
106+/// when the caller falls back to the selection.
107+pub(crate) fn odometer_cut(clips: &[Clip], frame: u32) -> Option<usize> {
108+ clips
109+ .iter()
110+ .position(|c| frame >= c.start && frame < c.end())
111+ .or_else(|| clips.iter().position(|c| c.start > frame))
26 }112 }
27 113
28 /// A stacked ghost command (DESIGN §4, MOCK-SPEC "Ghost transport"/"spine"):114 /// A stacked ghost command (DESIGN §4, MOCK-SPEC "Ghost transport"/"spine"):
@@ -66,6 +152,13 @@ fn ghost(
66 .flex()152 .flex()
67 .flex_col()153 .flex_col()
68 .items_center()154 .items_center()
155+ .justify_center()
156+ // WCAG 2.5.8, the same `HIT_MIN` floor `interact.rs` holds clip edges
157+ // to: a glyph may be 8px wide, its door may not. Padding only --
158+ // glyph sizes and the groups' own gaps are untouched.
159+ .min_w(px(HIT_MIN))
160+ .min_h(px(HIT_MIN))
161+ .px(px(2.))
69 .gap(px(1.))162 .gap(px(1.))
70 .cursor_pointer()163 .cursor_pointer()
71 .on_click(cx.listener(move |this, _: &ClickEvent, window, cx| {164 .on_click(cx.listener(move |this, _: &ClickEvent, window, cx| {
@@ -76,13 +169,16 @@ fn ghost(
76 .text_size(glyph_style.size)169 .text_size(glyph_style.size)
77 .text_color(rgb(if active { INK1() } else { INK2() }))170 .text_color(rgb(if active { INK1() } else { INK2() }))
78 .child(glyph.into())171 .child(glyph.into())
79- .child(172+ .when(SHOW_CHORDS.with(Cell::get), |el| {
80- div()173+ el.child(
81- .font(chord_style.font)174+ div()
82- .text_size(chord_style.size)175+ .flex_none()
83- .text_color(rgb(INK3()))176+ .font(chord_style.font)
84- .child(player.keymap.chord(action)),177+ .text_size(chord_style.size)
85- )178+ .text_color(rgb(INK3()))
179+ .child(player.keymap.chord(action)),
180+ )
181+ })
86 }182 }
87 183
88 /// The hero timecode, digits `ink1` and colons `ink3` (DESIGN §3, MOCK-SPEC184 /// The hero timecode, digits `ink1` and colons `ink3` (DESIGN §3, MOCK-SPEC
@@ -114,11 +210,24 @@ fn signed_delta(frames: i64, fps: f64) -> String {
114 /// the subject cut's own trim deltas against where roll armed it (only real210 /// the subject cut's own trim deltas against where roll armed it (only real
115 /// once [`Player::loop_trim`] has a baseline to measure against), and the211 /// once [`Player::loop_trim`] has a baseline to measure against), and the
116 /// roll word itself, on or dim. `·` separators in `ink3`, values in `ink2`.212 /// roll word itself, on or dim. `·` separators in `ink3`, values in `ink2`.
117-fn cut_readout(player: &Player) -> impl IntoElement {213+fn cut_readout(player: &Player, position: f64) -> impl IntoElement {
118 let sep = || div().text_color(rgb(INK3())).child(" · ");214 let sep = || div().text_color(rgb(INK3())).child(" · ");
119 let val = |s: String| div().text_color(rgb(INK2())).child(s);215 let val = |s: String| div().text_color(rgb(INK2())).child(s);
120 let anchor = player.selected.anchor();216 let anchor = player.selected.anchor();
121- let odometer = anchor217+ // The odometer reads the PLAYHEAD, not the selection (DESIGN 6): right
218+ // after a split the two halves are on the bench and nothing is picked,
219+ // and a readout saying `cut -/-` while the playhead sits on the new cut
220+ // is an odometer that stopped turning. The selection only answers when
221+ // the playhead is off every cut on its lane.
222+ let frame = (position * player.active_fps()).max(0.).round() as u32;
223+ let at_playhead = player.session.as_ref().and_then(|s| {
224+ let lane = anchor
225+ .map(|(lane, _)| lane)
226+ .or_else(|| s.lanes().into_iter().find(|l| l.kind == LaneKind::Video))?;
227+ Some((lane, odometer_cut(s.lane_clips(lane), frame)?))
228+ });
229+ let odometer = at_playhead
230+ .or(anchor)
122 .and_then(|(lane, idx)| {231 .and_then(|(lane, idx)| {
123 player232 player
124 .session233 .session
@@ -285,7 +394,10 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context<Player>) -> im
285 .id("stance-contact-strip")394 .id("stance-contact-strip")
286 .relative()395 .relative()
287 .flex_1()396 .flex_1()
288- .min_w(px(0.))397+ // The strip is what absorbs the band's slack, and it measured w=0 at
398+ // 1280 before this: it holds a floor now and the ladder sheds groups
399+ // above it instead of squeezing the map to nothing.
400+ .min_w(px(STRIP_MIN_W))
289 .h(px(28.))401 .h(px(28.))
290 .cursor_pointer()402 .cursor_pointer()
291 .tooltip(|_, cx| {403 .tooltip(|_, cx| {
@@ -570,6 +682,20 @@ fn volume_slider(player: &Player, cx: &mut Context<Player>) -> impl IntoElement
570 )682 )
571 }683 }
572 684
685+/// The level, written once (DESIGN 3: a number about a level is mono). It
686+/// sits beside the slider that sets it -- the slider's fill and this readout
687+/// are one truth in two forms, where the mute button used to wear a third.
688+fn volume_readout(player: &Player) -> impl IntoElement {
689+ let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM);
690+ div()
691+ .flex_none()
692+ .w(px(34.))
693+ .font(style.font)
694+ .text_size(style.size)
695+ .text_color(rgb(if player.volume.muted { INK3() } else { INK2() }))
696+ .child(format!("{}%", player.volume.percent()))
697+}
698+
573 /// The whole band, left to right per MOCK-SPEC: hero timecode, ghost699 /// The whole band, left to right per MOCK-SPEC: hero timecode, ghost
574 /// transport, cut readout, the contact strip filling the rest, the Export700 /// transport, cut readout, the contact strip filling the rest, the Export
575 /// chip at the end.701 /// chip at the end.
@@ -579,6 +705,12 @@ pub(crate) fn render(
579 cx: &mut Context<Player>,705 cx: &mut Context<Player>,
580 ) -> impl IntoElement {706 ) -> impl IntoElement {
581 let tc = timecode(position, player.active_fps());707 let tc = timecode(position, player.active_fps());
708+ let band_w = BAND_W.with(Rc::clone);
709+ // Layer decision for THIS frame, off the width the last frame measured
710+ // (`width_probe` asks for a frame whenever that width changes, so a
711+ // resize settles in one).
712+ let layers = band_layers(f32::from(band_w.get()));
713+ SHOW_CHORDS.with(|c| c.set(layers.chords));
582 div()714 div()
583 .id("stance-time-band-row")715 .id("stance-time-band-row")
584 // FAULT 1 fix: this div used to be `flex_none`, which sized it to its716 // FAULT 1 fix: this div used to be `flex_none`, which sized it to its
@@ -591,8 +723,13 @@ pub(crate) fn render(
591 .h_full()723 .h_full()
592 .flex()724 .flex()
593 .items_center()725 .items_center()
594- .gap(px(16.))726+ // Nothing in this band may ever paint (or be clicked) outside its own
727+ // column again: the Export chip used to land at x=1113 under the
728+ // dock, where a click on blank dock space opened the export card.
729+ .overflow_hidden()
730+ .gap(px(12.))
595 .px(px(12.))731 .px(px(12.))
732+ .child(width_probe(band_w))
596 // The most-read element anchors its region (DESIGN §5): the733 // The most-read element anchors its region (DESIGN §5): the
597 // timecode leads.734 // timecode leads.
598 .child(hero_timecode(&tc))735 .child(hero_timecode(&tc))
@@ -647,7 +784,7 @@ pub(crate) fn render(
647 .child(ghost(784 .child(ghost(
648 "stance-tb-step-back",785 "stance-tb-step-back",
649 player,786 player,
650- "◀",787+ "|◂",
651 ActionId::StepBack,788 ActionId::StepBack,
652 false,789 false,
653 cx,790 cx,
@@ -655,7 +792,7 @@ pub(crate) fn render(
655 .child(ghost(792 .child(ghost(
656 "stance-tb-step-forward",793 "stance-tb-step-forward",
657 player,794 player,
658- "▶",795+ "▸|",
659 ActionId::StepForward,796 ActionId::StepForward,
660 false,797 false,
661 cx,798 cx,
@@ -676,36 +813,40 @@ pub(crate) fn render(
676 false,813 false,
677 cx,814 cx,
678 ))815 ))
679- .child(ghost(816+ .when(layers.sync, |el| {
680- "stance-tb-sync-prev",817+ el.child(ghost(
681- player,818+ "stance-tb-sync-prev",
682- "‹|",819+ player,
683- ActionId::PrevSyncPoint,820+ "‹|",
684- false,821+ ActionId::PrevSyncPoint,
685- cx,822+ false,
686- ))823+ cx,
687- .child(ghost(824+ ))
688- "stance-tb-sync-next",825+ .child(ghost(
689- player,826+ "stance-tb-sync-next",
690- "|›",827+ player,
691- ActionId::NextSyncPoint,828+ "|›",
692- false,829+ ActionId::NextSyncPoint,
693- cx,830+ false,
694- ))831+ cx,
832+ ))
833+ })
695 // Loop (homeless per this task's audit): the playback-loop834 // Loop (homeless per this task's audit): the playback-loop
696 // toggle -- burst-use during editing per the charter's own835 // toggle -- burst-use during editing per the charter's own
697 // classification -- earns the transport cluster it plays836 // classification -- earns the transport cluster it plays
698 // alongside, not the CUT group's `LoopTrim` two files over837 // alongside, not the CUT group's `LoopTrim` two files over
699 // (a different verb already drawn on the spine, "↻" taken).838 // (a different verb already drawn on the spine, "↻" taken).
700 // "∞" reads as "keeps going" without borrowing that glyph.839 // "∞" reads as "keeps going" without borrowing that glyph.
701- .child(ghost(840+ .when(layers.sync, |el| {
702- "stance-tb-loop",841+ el.child(ghost(
703- player,842+ "stance-tb-loop",
704- "∞",843+ player,
705- ActionId::Loop,844+ "∞",
706- player.loop_on,845+ ActionId::Loop,
707- cx,846+ player.loop_on,
708- )),847+ cx,
848+ ))
849+ }),
709 )850 )
710 // The audio-monitoring cluster (homeless per this task's audit):851 // The audio-monitoring cluster (homeless per this task's audit):
711 // ToggleMute/VolumeUp/VolumeDown, burst-use per the charter, placed852 // ToggleMute/VolumeUp/VolumeDown, burst-use per the charter, placed
@@ -717,7 +858,7 @@ pub(crate) fn render(
717 // mute and the two ghosts flanking it nudge the level -- three858 // mute and the two ghosts flanking it nudge the level -- three
718 // homeless actions sharing one cluster rather than three unrelated859 // homeless actions sharing one cluster rather than three unrelated
719 // rows.860 // rows.
720- .child(861+ .when(layers.volume, |el| el.child(
721 div()862 div()
722 .flex_none()863 .flex_none()
723 .flex()864 .flex()
@@ -731,19 +872,22 @@ pub(crate) fn render(
731 false,872 false,
732 cx,873 cx,
733 ))874 ))
875+ // The level is NOT this button's label any more: the slider
876+ // beside it already draws the same number as a fill and
877+ // `volume_readout` writes it once, so wearing it here made
878+ // mute a ghost with no glyph of its own (a percentage is not
879+ // a verb). Speaker, struck when muted -- typographic, the
880+ // same hand-drawn grammar as the glyphs around it.
734 .child(ghost(881 .child(ghost(
735 "stance-tb-mute",882 "stance-tb-mute",
736 player,883 player,
737- if player.volume.muted {884+ if player.volume.muted { "◁×" } else { "◁))" },
738- format!("× {}%", player.volume.percent())
739- } else {
740- format!("{}%", player.volume.percent())
741- },
742 ActionId::ToggleMute,885 ActionId::ToggleMute,
743 player.volume.muted,886 player.volume.muted,
744 cx,887 cx,
745 ))888 ))
746 .child(volume_slider(player, cx))889 .child(volume_slider(player, cx))
890+ .child(volume_readout(player))
747 .child(ghost(891 .child(ghost(
748 "stance-tb-vol-up",892 "stance-tb-vol-up",
749 player,893 player,
@@ -752,9 +896,9 @@ pub(crate) fn render(
752 false,896 false,
753 cx,897 cx,
754 )),898 )),
755- )899+ ))
756- .child(range_marks(player, cx))900+ .when(layers.marks, |el| el.child(range_marks(player, cx)))
757- .child(cut_readout(player))901+ .child(cut_readout(player, position))
758 .child(contact_strip(player, position, cx))902 .child(contact_strip(player, position, cx))
759 .child(save_verb(player, cx))903 .child(save_verb(player, cx))
760 .child(export_chip(player, cx))904 .child(export_chip(player, cx))