forge
Explore
Log in

Don't you dare go Hollow

🔀 merge(refusal): the decoder refusal survives the dock's seat drop

Browse files at this commit

1896852b1ddba13aec9896c158a27cca2387a296Ahmet Kaan GümüşParent: b8aec2947adb87
crates/app/src/library_meta.rsmodified+45 -4
@@ -64,7 +64,7 @@ pub(crate) struct Row {
64 pub(crate) fn library_rows(64 pub(crate) fn library_rows(
65 sources: &[Source],65 sources: &[Source],
66 streams: &HashMap<PathBuf, Vec<StreamInfo>>,66 streams: &HashMap<PathBuf, Vec<StreamInfo>>,
67- decoders: &HashMap<PathBuf, Option<(Option<Codec>, Backend)>>,67+ decoders: &HashMap<PathBuf, Decoder>,
68 timeline_audio: Option<(u32, u16)>,68 timeline_audio: Option<(u32, u16)>,
69 frames: impl Fn(&Path) -> u32,69 frames: impl Fn(&Path) -> u32,
70 ) -> Vec<Row> {70 ) -> Vec<Row> {
@@ -89,9 +89,7 @@ pub(crate) fn library_rows(
89 detail: join_detail(89 detail: join_detail(
90 &decoders90 &decoders
91 .get(&source.path)91 .get(&source.path)
92- .copied()92+ .map_or_else(|| Decoder::Pending.detail(), Decoder::detail),
93- .flatten()
94- .map_or_else(String::new, |(codec, backend)| decode_label(codec, backend)),
95 &info93 &info
96 .filter(|_| of_file.len() > 1)94 .filter(|_| of_file.len() > 1)
97 .map_or_else(String::new, stream_detail),95 .map_or_else(String::new, stream_detail),
@@ -196,6 +194,49 @@ pub(crate) fn decode_label(codec: Option<Codec>, backend: Backend) -> String {
196 }194 }
197 }195 }
198 196
197+/// What the one-shot probe said about a file: the seat it will open on, or --
198+/// when the decoder itself refused -- the refusal, in the decoder's own words.
199+///
200+/// Three answers, not two, because "asked" and "refused" are not the same
201+/// answer. Both used to be a missing entry, and a missing entry drew an empty
202+/// second line -- the same line a song draws -- so a file this machine cannot
203+/// decode was indistinguishable from one that needs no word at all.
204+#[derive(Debug, Clone, PartialEq)]
205+pub(crate) enum Decoder {
206+ /// Asked and not yet answered: the probe is still walking the file. A
207+ /// real wait, and one that claims nothing while it lasts.
208+ Pending,
209+ /// The codec (`None` for a still, which has no coded stream) and the seat
210+ /// the engine picked for it.
211+ Seat(Option<Codec>, Backend),
212+ /// The decoder refused this file, and these are its words. Not a message
213+ /// of this program's own making: the probe is `engine::decode::probe`,
214+ /// and the refusal is the one opening the file would give.
215+ Refused(String),
216+}
217+
218+impl From<engine::Result<(Option<Codec>, Backend)>> for Decoder {
219+ fn from(probed: engine::Result<(Option<Codec>, Backend)>) -> Self {
220+ match probed {
221+ Ok((codec, backend)) => Self::Seat(codec, backend),
222+ Err(why) => Self::Refused(why.to_string()),
223+ }
224+ }
225+}
226+
227+impl Decoder {
228+ /// What the row's second line says about the file's decoder: the seat for
229+ /// a file that opens, the refusal for one that does not, and nothing for a
230+ /// probe still running.
231+ pub(crate) fn detail(&self) -> String {
232+ match self {
233+ Self::Pending => String::new(),
234+ Self::Seat(codec, backend) => decode_label(*codec, *backend),
235+ Self::Refused(why) => why.clone(),
236+ }
237+ }
238+}
239+
199 /// How a row names its file: the file alone when it has one audio stream or240 /// How a row names its file: the file alone when it has one audio stream or
200 /// none, and the file plus which stream this row is when it has several --241 /// none, and the file plus which stream this row is when it has several --
201 /// counted from 1, the way a player numbers tracks.242 /// counted from 1, the way a player numbers tracks.
crates/app/src/main.rsmodified+10 -9
@@ -68,11 +68,11 @@ use engine::transform::TransformParams;
68 use engine::{Clip, Codec, ExportHandle, Frame, MediaBitrate, PlaybackSession};68 use engine::{Clip, Codec, ExportHandle, Frame, MediaBitrate, PlaybackSession};
69 use gpui::{69 use gpui::{
70 AnyElement, App, Application, Bounds, ClickEvent, Context, Corners, CursorStyle, Div,70 AnyElement, App, Application, Bounds, ClickEvent, Context, Corners, CursorStyle, Div,
71- DragMoveEvent, FocusHandle, KeyDownEvent, MouseButton, MouseDownEvent,71+ DragMoveEvent, FocusHandle, KeyDownEvent, MouseButton, MouseDownEvent, MouseExitEvent,
72- MouseExitEvent, MouseMoveEvent, MouseUpEvent, PathBuilder, Pixels, Point, RenderImage,72+ MouseMoveEvent, MouseUpEvent, PathBuilder, Pixels, Point, RenderImage, ScrollDelta,
73- ScrollDelta, ScrollHandle, ScrollWheelEvent, SharedString, Size, Stateful, TextAlign,73+ ScrollHandle, ScrollWheelEvent, SharedString, Size, Stateful, TextAlign, TitlebarOptions,
74- TitlebarOptions, Window, WindowBounds, WindowOptions, canvas, div, point, prelude::*, px,74+ Window, WindowBounds, WindowOptions, canvas, div, point, prelude::*, px, relative, rgb, rgba,
75- relative, rgb, rgba, size,75+ size,
76 };76 };
77 77
78 struct Player {78 struct Player {
@@ -278,13 +278,14 @@ struct Player {
278 /// must stay in the map or every repaint would ask again.278 /// must stay in the map or every repaint would ask again.
279 syncs: HashMap<PathBuf, Vec<u32>>,279 syncs: HashMap<PathBuf, Vec<u32>>,
280 /// Which decoder each source will run on, probed once at import and kept:280 /// Which decoder each source will run on, probed once at import and kept:
281- /// the codec (`None` for a still) and the seat the engine picked for it.281+ /// the codec (`None` for a still) and the seat the engine picked for it --
282+ /// or, where the decoder refused the file, the refusal in its own words.
282 /// What a library row says *before* anything plays; the running answer is283 /// What a library row says *before* anything plays; the running answer is
283 /// the session's own (`PlaybackSession::decode_backend`), which follows a284 /// the session's own (`PlaybackSession::decode_backend`), which follows a
284 /// fallback this cannot. Filled like `sizes`: presence means "asked", and285 /// fallback this cannot. Filled like `sizes`: presence means "asked", and
285- /// `None` is a source with no decoder to name -- a song, or one the probe286+ /// `Decoder::Pending` is that asked-but-unanswered window -- which must
286- /// refused -- which must stay in the map or every repaint would ask again.287+ /// stay in the map or every repaint would ask again.
287- decoders: HashMap<PathBuf, Option<(Option<Codec>, Backend)>>,288+ decoders: HashMap<PathBuf, Decoder>,
288 /// What an export of the picked settings would open -- the picture's seat289 /// What an export of the picked settings would open -- the picture's seat
289 /// or the copy that means it opens none, and the sound's -- and what it was290 /// or the copy that means it opens none, and the sound's -- and what it was
290 /// asked about: the settings, the canvas and the *cuts*, since where they291 /// asked about: the settings, the canvas and the *cuts*, since where they
crates/app/src/player/export.rsmodified+13 -6
@@ -180,13 +180,15 @@ impl Player {
180 // a frame of it plays. Off the render thread like the streams above: a180 // a frame of it plays. Off the render thread like the streams above: a
181 // stream the plugin takes costs one VA-API init (~90 ms) to answer.181 // stream the plugin takes costs one VA-API init (~90 ms) to answer.
182 for path in unseen_paths(session.sources(), &self.decoders) {182 for path in unseen_paths(session.sources(), &self.decoders) {
183- self.decoders.insert(path.clone(), None);183+ self.decoders.insert(path.clone(), Decoder::Pending);
184 let probed = cx.background_executor().spawn({184 let probed = cx.background_executor().spawn({
185 let path = path.clone();185 let path = path.clone();
186- // A song and a source no decoder here takes are both `None`:186+ // A refusal is kept in the decoder's own words, and the row
187- // the row says nothing about them rather than guessing, and187+ // shows them: a file this machine cannot decode is the one
188- // import refused the second at the door anyway.188+ // whose second line has to say so. A song is a different
189- async move { engine::decode::probe(&path).ok() }189+ // answer entirely -- it has no coded stream, and the probe
190+ // says so by naming the still seat.
191+ async move { Decoder::from(engine::decode::probe(&path)) }
190 });192 });
191 cx.spawn(async move |this, cx| {193 cx.spawn(async move |this, cx| {
192 let probed = probed.await;194 let probed = probed.await;
@@ -644,7 +646,12 @@ impl Player {
644 ///646 ///
645 /// Escape retreats one step at a time (DESIGN.md:146): the field first,647 /// Escape retreats one step at a time (DESIGN.md:146): the field first,
646 /// the moment second.648 /// the moment second.
647- pub(crate) fn export_moment_key(&mut self, key: &str, shift: bool, cx: &mut Context<Self>) -> bool {649+ pub(crate) fn export_moment_key(
650+ &mut self,
651+ key: &str,
652+ shift: bool,
653+ cx: &mut Context<Self>,
654+ ) -> bool {
648 if !self.export_open {655 if !self.export_open {
649 return false;656 return false;
650 }657 }
crates/app/src/tests/editing.rsmodified+166 -71
@@ -109,9 +109,11 @@ fn a_song_opens_the_window_by_itself() {
109 // ...and it places, on the audio lane, through the door `insert_source`109 // ...and it places, on the audio lane, through the door `insert_source`
110 // uses: a second copy of the song at the playhead.110 // uses: a second copy of the song at the playhead.
111 session.seek(1.0);111 session.seek(1.0);
112- assert!(session112+ assert!(
113- .place_stream_at(1.0, &path, 0, Some(Lane::A1))113+ session
114- .expect("its own file is on this timeline"));114+ .place_stream_at(1.0, &path, 0, Some(Lane::A1))
115+ .expect("its own file is on this timeline")
116+ );
115 assert_eq!(session.lane_clips(Lane::A1).len(), 2);117 assert_eq!(session.lane_clips(Lane::A1).len(), 2);
116 assert!(session.lane_clips(Lane::V1).is_empty(), "still no picture");118 assert!(session.lane_clips(Lane::V1).is_empty(), "still no picture");
117 119
@@ -256,6 +258,63 @@ fn every_audio_stream_of_a_file_is_a_row_usable_or_not() {
256 assert_eq!(rows[1].tint, 1, "the other file is the other tint");258 assert_eq!(rows[1].tint, 1, "the other file is the other tint");
257 }259 }
258 260
261+/// A file the decoder refuses says so on its own row, in the decoder's own
262+/// words. The refusal is the only thing a person can act on for a file that
263+/// will not play, and before this the row drew an empty second line -- the
264+/// same line a song draws, which claims nothing and means nothing.
265+///
266+/// Dumped through the real [`engine::decode::probe`], not a hand-written
267+/// `Err`: a `.mkv` that is not a container is refused by the demuxer, with no
268+/// plugin and no hardware involved, so the words under test are the ones the
269+/// engine really produces.
270+#[test]
271+fn a_refused_file_names_the_refusal_on_its_row() {
272+ let junk = std::env::temp_dir().join("edith-lane-j-refused.mkv");
273+ std::fs::write(&junk, b"not a container, and never will be").expect("write the junk file");
274+ let words = engine::decode::probe(&junk)
275+ .expect_err("a file that is not a stream is refused")
276+ .to_string();
277+ assert!(
278+ !words.is_empty(),
279+ "a refusal that says nothing says nothing"
280+ );
281+
282+ let mut decoders = HashMap::new();
283+ decoders.insert(junk.clone(), Decoder::from(engine::decode::probe(&junk)));
284+ let rows = library_rows(
285+ &[Source {
286+ path: junk.clone(),
287+ audio_stream: 0,
288+ }],
289+ &HashMap::new(),
290+ &decoders,
291+ None,
292+ |_| 0,
293+ );
294+ assert_eq!(
295+ rows[0].detail, words,
296+ "the row carries the refusal verbatim"
297+ );
298+
299+ // A probe still running says nothing, and must keep saying nothing: an
300+ // empty second line is a real answer here, not a missing one.
301+ let mut pending = HashMap::new();
302+ pending.insert(junk.clone(), Decoder::Pending);
303+ let rows = library_rows(
304+ &[Source {
305+ path: junk.clone(),
306+ audio_stream: 0,
307+ }],
308+ &HashMap::new(),
309+ &pending,
310+ None,
311+ |_| 0,
312+ );
313+ assert_eq!(rows[0].detail, "", "an unasked decoder claims nothing");
314+
315+ std::fs::remove_file(&junk).ok();
316+}
317+
259 /// What the clip menu offers, and where it hangs. The two items that act on318 /// What the clip menu offers, and where it hangs. The two items that act on
260 /// the playhead rather than on the clicked clip are the ones that can be319 /// the playhead rather than on the clicked clip are the ones that can be
261 /// inapplicable, and a menu at the edge of the window has to come back inside320 /// inapplicable, and a menu at the edge of the window has to come back inside
@@ -343,11 +402,13 @@ fn a_caption_is_deleted_by_the_same_row_and_stroke_every_box_is() {
343 );402 );
344 // ...and the same reading with a clip under it is the clip menu, untouched:403 // ...and the same reading with a clip under it is the clip menu, untouched:
345 // the flag is off wherever a `Clip` was clicked.404 // the flag is off wherever a `Clip` was clicked.
346- assert!(menu_items(Ctx {405+ assert!(
347- timeline: true,406+ menu_items(Ctx {
348- ..Ctx::default()407+ timeline: true,
349- })408+ ..Ctx::default()
350- .contains(&ActionId::Cut));409+ })
410+ .contains(&ActionId::Cut)
411+ );
351 }412 }
352 413
353 /// A timeline with a subtitle palette and an empty subtitle lane: what a414 /// A timeline with a subtitle palette and an empty subtitle lane: what a
@@ -949,14 +1010,16 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() {
949 }1010 }
950 assert!(!whole(ActionId::Delete, live).yes());1011 assert!(!whole(ActionId::Delete, live).yes());
951 assert!(!whole(ActionId::Paste, live).yes());1012 assert!(!whole(ActionId::Paste, live).yes());
952- assert!(whole(1013+ assert!(
953- ActionId::Paste,1014+ whole(
954- Ctx {1015+ ActionId::Paste,
955- clipboard: true,1016+ Ctx {
956- ..live1017+ clipboard: true,
957- }1018+ ..live
958- )1019+ }
959- .yes());1020+ )
1021+ .yes()
1022+ );
960 assert!(!whole(ActionId::CancelExport, live).yes());1023 assert!(!whole(ActionId::CancelExport, live).yes());
961 let busy = Ctx {1024 let busy = Ctx {
962 exporting: true,1025 exporting: true,
@@ -1176,14 +1239,16 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() {
1176 assert!(row_enable(RowItem::RemoveWithClips, placed).yes());1239 assert!(row_enable(RowItem::RemoveWithClips, placed).yes());
1177 let unplaced = row_items(live);1240 let unplaced = row_items(live);
1178 assert!(unplaced.contains(&RowItem::Remove) && !unplaced.contains(&RowItem::RemoveWithClips));1241 assert!(unplaced.contains(&RowItem::Remove) && !unplaced.contains(&RowItem::RemoveWithClips));
1179- assert!(!row_enable(1242+ assert!(
1180- RowItem::RemoveWithClips,1243+ !row_enable(
1181- RowCtx {1244+ RowItem::RemoveWithClips,
1182- exporting: true,1245+ RowCtx {
1183- ..placed1246+ exporting: true,
1184- }1247+ ..placed
1185- )1248+ }
1186- .yes());1249+ )
1250+ .yes()
1251+ );
1187 assert!(!row_enable(RowItem::Add, RowCtx::default()).yes());1252 assert!(!row_enable(RowItem::Add, RowCtx::default()).yes());
1188 // Every refusal is short enough to sit in the hint column beside its1253 // Every refusal is short enough to sit in the hint column beside its
1189 // label, the clip menu's rule.1254 // label, the clip menu's rule.
@@ -1617,9 +1682,11 @@ fn adding_a_row_drops_the_whole_source_in_at_the_playhead() {
1617 let frames = session.file_frames(&second);1682 let frames = session.file_frames(&second);
1618 // Through the engine door `insert_source` uses, with the row's own1683 // Through the engine door `insert_source` uses, with the row's own
1619 // stream: the button, the drop and this are one call.1684 // stream: the button, the drop and this are one call.
1620- assert!(session1685+ assert!(
1621- .place_stream_at(2.0, &second, 0, None)1686+ session
1622- .expect("av2 is already on the timeline"));1687+ .place_stream_at(2.0, &second, 0, None)
1688+ .expect("av2 is already on the timeline")
1689+ );
1623 // The whole of source 1 went in and nothing was painted over: the1690 // The whole of source 1 went in and nothing was painted over: the
1624 // timeline is longer by exactly that file.1691 // timeline is longer by exactly that file.
1625 assert_eq!(session.timeline_duration(), 9.0);1692 assert_eq!(session.timeline_duration(), 9.0);
@@ -1646,9 +1713,11 @@ fn adding_a_row_drops_the_whole_source_in_at_the_playhead() {
1646 let path = session.sources()[0].path.clone();1713 let path = session.sources()[0].path.clone();
1647 let frames = session.file_frames(&path);1714 let frames = session.file_frames(&path);
1648 let end = session.timeline_duration();1715 let end = session.timeline_duration();
1649- assert!(session1716+ assert!(
1650- .place_stream_at(end, &path, 1, None)1717+ session
1651- .expect("the French track shares the timeline's parameters"));1718+ .place_stream_at(end, &path, 1, None)
1719+ .expect("the French track shares the timeline's parameters")
1720+ );
1652 assert_eq!(session.sources()[1].audio_stream, 1);1721 assert_eq!(session.sources()[1].audio_stream, 1);
1653 assert_eq!(session.timeline_duration(), end * 2.0);1722 assert_eq!(session.timeline_duration(), end * 2.0);
1654 // Both rows are the same file, so both rows are that file's length --1723 // Both rows are the same file, so both rows are that file's length --
@@ -1698,9 +1767,11 @@ fn a_row_dropped_on_the_open_bed_lands_under_the_pointer() {
1698 1767
1699 // ...and what the release does with it: the frame back through the same1768 // ...and what the release does with it: the frame back through the same
1700 // rate every box is drawn at, into the door the Add button uses too.1769 // rate every box is drawn at, into the door the Add button uses too.
1701- assert!(session1770+ assert!(
1702- .place_stream_at(f64::from(at) / fps, &second, 0, None)1771+ session
1703- .expect("av2 is already on this timeline"));1772+ .place_stream_at(f64::from(at) / fps, &second, 0, None)
1773+ .expect("av2 is already on this timeline")
1774+ );
1704 let head = |lane| {1775 let head = |lane| {
1705 session1776 session
1706 .lane_clips(lane)1777 .lane_clips(lane)
@@ -1734,9 +1805,11 @@ fn removing_a_row_is_refused_while_it_plays_and_takes_the_row_away() {
1734 session.import(&asset("test_av2.mp4")).expect("av2 matches");1805 session.import(&asset("test_av2.mp4")).expect("av2 matches");
1735 let second = session.sources()[1].path.clone();1806 let second = session.sources()[1].path.clone();
1736 let end = session.timeline_duration();1807 let end = session.timeline_duration();
1737- assert!(session1808+ assert!(
1738- .place_stream_at(end, &second, 0, None)1809+ session
1739- .expect("a file just imported is on this timeline"));1810+ .place_stream_at(end, &second, 0, None)
1811+ .expect("a file just imported is on this timeline")
1812+ );
1740 let streams = HashMap::new();1813 let streams = HashMap::new();
1741 let rows = |session: &PlaybackSession| {1814 let rows = |session: &PlaybackSession| {
1742 library_rows(session.sources(), &streams, &HashMap::new(), None, |_| 0).len()1815 library_rows(session.sources(), &streams, &HashMap::new(), None, |_| 0).len()
@@ -1957,7 +2030,7 @@ fn trim_to_playhead_moves_the_selected_clips_edge_and_undoes_in_one_step() {
1957 /// it makes.2030 /// it makes.
1958 #[test]2031 #[test]
1959 fn the_windows_settings_caches_follow_the_session_across_undo_and_redo() {2032 fn the_windows_settings_caches_follow_the_session_across_undo_and_redo() {
1960- use crate::player::actions::{history_step, HistoryBefore, SessionCaches};2033+ use crate::player::actions::{HistoryBefore, SessionCaches, history_step};
1961 2034
1962 let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture");2035 let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture");
1963 session.set_gain(0.0);2036 session.set_gain(0.0);
@@ -2037,7 +2110,7 @@ fn the_windows_settings_caches_follow_the_session_across_undo_and_redo() {
2037 /// keyed by where a cue sits -- but because the step moves the cues under it.2110 /// keyed by where a cue sits -- but because the step moves the cues under it.
2038 #[test]2111 #[test]
2039 fn the_subtitle_pick_follows_its_track_across_an_undo_of_a_removal() {2112 fn the_subtitle_pick_follows_its_track_across_an_undo_of_a_removal() {
2040- use crate::player::actions::{history_step, HistoryBefore, SessionCaches};2113+ use crate::player::actions::{HistoryBefore, SessionCaches, history_step};
2041 2114
2042 let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture");2115 let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture");
2043 session.set_gain(0.0);2116 session.set_gain(0.0);
@@ -2268,9 +2341,11 @@ fn a_track_can_be_added_dropped_on_edited_and_taken_back() {
2268 // A library row let go over that row: the same door the Add button2341 // A library row let go over that row: the same door the Add button
2269 // uses, told which lane it was let go over.2342 // uses, told which lane it was let go over.
2270 let path = session.sources()[0].path.clone();2343 let path = session.sources()[0].path.clone();
2271- assert!(session2344+ assert!(
2272- .place_stream_at(1.0, &path, 0, Some(v2))2345+ session
2273- .expect("its own file is on this timeline"));2346+ .place_stream_at(1.0, &path, 0, Some(v2))
2347+ .expect("its own file is on this timeline")
2348+ );
2274 assert_eq!(session.lane_clips(v2).len(), 1, "the drop landed on V2");2349 assert_eq!(session.lane_clips(v2).len(), 1, "the drop landed on V2");
2275 assert_eq!(session.lane_clips(v2)[0].start, 30, "at the playhead");2350 assert_eq!(session.lane_clips(v2)[0].start, 30, "at the playhead");
2276 // ...with the sound it came with, on the row of its own the drop added:2351 // ...with the sound it came with, on the row of its own the drop added:
@@ -2357,18 +2432,22 @@ fn a_selection_drag_moves_every_pick_by_the_same_delta() {
2357 2432
2358 // clip0 on V1 at the fixture's own start; clip1 on V1 ten seconds in,2433 // clip0 on V1 at the fixture's own start; clip1 on V1 ten seconds in,
2359 // appended to the open bed and rippling nothing.2434 // appended to the open bed and rippling nothing.
2360- assert!(session2435+ assert!(
2361- .place_stream_at(10.0, &second, 0, None)2436+ session
2362- .expect("av2 is on this timeline"));2437+ .place_stream_at(10.0, &second, 0, None)
2438+ .expect("av2 is on this timeline")
2439+ );
2363 let clip0 = session.lane_clips(Lane::V1)[0];2440 let clip0 = session.lane_clips(Lane::V1)[0];
2364 let clip1 = session.lane_clips(Lane::V1)[1];2441 let clip1 = session.lane_clips(Lane::V1)[1];
2365 assert_eq!((clip0.start, clip1.start), (0, 300));2442 assert_eq!((clip0.start, clip1.start), (0, 300));
2366 2443
2367 // clipC on a second video row, well past both of the above.2444 // clipC on a second video row, well past both of the above.
2368 let v2 = session.add_lane(LaneKind::Video);2445 let v2 = session.add_lane(LaneKind::Video);
2369- assert!(session2446+ assert!(
2370- .place_stream_at(20.0, &path, 0, Some(v2))2447+ session
2371- .expect("test_av.mp4 is on this timeline"));2448+ .place_stream_at(20.0, &path, 0, Some(v2))
2449+ .expect("test_av.mp4 is on this timeline")
2450+ );
2372 let clip_c = session.lane_clips(v2)[0];2451 let clip_c = session.lane_clips(v2)[0];
2373 assert_eq!(clip_c.start, 600);2452 assert_eq!(clip_c.start, 600);
2374 2453
@@ -2421,22 +2500,28 @@ fn a_selection_drag_refuses_as_one_set_when_any_pick_cannot_land() {
2421 session.import(&asset("test_av2.mp4")).expect("av2 matches");2500 session.import(&asset("test_av2.mp4")).expect("av2 matches");
2422 let second = session.sources()[1].path.clone();2501 let second = session.sources()[1].path.clone();
2423 2502
2424- assert!(session2503+ assert!(
2425- .place_stream_at(10.0, &second, 0, None)2504+ session
2426- .expect("av2 is on this timeline"));2505+ .place_stream_at(10.0, &second, 0, None)
2506+ .expect("av2 is on this timeline")
2507+ );
2427 let clip0 = session.lane_clips(Lane::V1)[0];2508 let clip0 = session.lane_clips(Lane::V1)[0];
2428 let clip1 = session.lane_clips(Lane::V1)[1];2509 let clip1 = session.lane_clips(Lane::V1)[1];
2429 2510
2430 let v2 = session.add_lane(LaneKind::Video);2511 let v2 = session.add_lane(LaneKind::Video);
2431- assert!(session2512+ assert!(
2432- .place_stream_at(0.0, &path, 0, Some(v2))2513+ session
2433- .expect("test_av.mp4 is on this timeline"));2514+ .place_stream_at(0.0, &path, 0, Some(v2))
2515+ .expect("test_av.mp4 is on this timeline")
2516+ );
2434 let clip_c = session.lane_clips(v2)[0];2517 let clip_c = session.lane_clips(v2)[0];
2435 // A clip clip1 is not picked, blocking the road on V2 the drag is about2518 // A clip clip1 is not picked, blocking the road on V2 the drag is about
2436 // to try: clip1 dragged onto V2 lands its head inside this one.2519 // to try: clip1 dragged onto V2 lands its head inside this one.
2437- assert!(session2520+ assert!(
2438- .place_stream_at(10.0, &second, 0, Some(v2))2521+ session
2439- .expect("av2 is on this timeline"));2522+ .place_stream_at(10.0, &second, 0, Some(v2))
2523+ .expect("av2 is on this timeline")
2524+ );
2440 let blocker = session.lane_clips(v2)[1];2525 let blocker = session.lane_clips(v2)[1];
2441 assert_eq!(blocker.start, 300);2526 assert_eq!(blocker.start, 300);
2442 2527
@@ -2491,16 +2576,20 @@ fn a_three_pick_copy_paste_preserves_gaps_and_lane_assignment() {
2491 session.import(&asset("test_av2.mp4")).expect("av2 matches");2576 session.import(&asset("test_av2.mp4")).expect("av2 matches");
2492 let second = session.sources()[1].path.clone();2577 let second = session.sources()[1].path.clone();
2493 2578
2494- assert!(session2579+ assert!(
2495- .place_stream_at(10.0, &second, 0, None)2580+ session
2496- .expect("av2 is on this timeline"));2581+ .place_stream_at(10.0, &second, 0, None)
2582+ .expect("av2 is on this timeline")
2583+ );
2497 let clip0 = session.lane_clips(Lane::V1)[0];2584 let clip0 = session.lane_clips(Lane::V1)[0];
2498 let clip1 = session.lane_clips(Lane::V1)[1];2585 let clip1 = session.lane_clips(Lane::V1)[1];
2499 2586
2500 let v2 = session.add_lane(LaneKind::Video);2587 let v2 = session.add_lane(LaneKind::Video);
2501- assert!(session2588+ assert!(
2502- .place_stream_at(20.0, &path, 0, Some(v2))2589+ session
2503- .expect("test_av.mp4 is on this timeline"));2590+ .place_stream_at(20.0, &path, 0, Some(v2))
2591+ .expect("test_av.mp4 is on this timeline")
2592+ );
2504 let clip_c = session.lane_clips(v2)[0];2593 let clip_c = session.lane_clips(v2)[0];
2505 2594
2506 // Copied in click order, out of the lanes each was clicked in -- exactly2595 // Copied in click order, out of the lanes each was clicked in -- exactly
@@ -2548,16 +2637,20 @@ fn a_colliding_set_paste_refuses_whole() {
2548 session.import(&asset("test_av2.mp4")).expect("av2 matches");2637 session.import(&asset("test_av2.mp4")).expect("av2 matches");
2549 let second = session.sources()[1].path.clone();2638 let second = session.sources()[1].path.clone();
2550 2639
2551- assert!(session2640+ assert!(
2552- .place_stream_at(10.0, &second, 0, None)2641+ session
2553- .expect("av2 is on this timeline"));2642+ .place_stream_at(10.0, &second, 0, None)
2643+ .expect("av2 is on this timeline")
2644+ );
2554 let clip0 = session.lane_clips(Lane::V1)[0];2645 let clip0 = session.lane_clips(Lane::V1)[0];
2555 let clip1 = session.lane_clips(Lane::V1)[1];2646 let clip1 = session.lane_clips(Lane::V1)[1];
2556 2647
2557 let v2 = session.add_lane(LaneKind::Video);2648 let v2 = session.add_lane(LaneKind::Video);
2558- assert!(session2649+ assert!(
2559- .place_stream_at(20.0, &path, 0, Some(v2))2650+ session
2560- .expect("test_av.mp4 is on this timeline"));2651+ .place_stream_at(20.0, &path, 0, Some(v2))
2652+ .expect("test_av.mp4 is on this timeline")
2653+ );
2561 let clip_c = session.lane_clips(v2)[0];2654 let clip_c = session.lane_clips(v2)[0];
2562 2655
2563 let items = [(Lane::V1, clip0), (Lane::V1, clip1), (v2, clip_c)];2656 let items = [(Lane::V1, clip0), (Lane::V1, clip1), (v2, clip_c)];
@@ -2612,9 +2705,11 @@ fn a_grouped_clip_on_an_added_lane_closes_its_hole_with_its_caption() {
2612 let (mut session, sub_lane) = with_subtitle_lane();2705 let (mut session, sub_lane) = with_subtitle_lane();
2613 let v2 = session.add_lane(LaneKind::Video);2706 let v2 = session.add_lane(LaneKind::Video);
2614 let path = session.sources()[0].path.clone();2707 let path = session.sources()[0].path.clone();
2615- assert!(session2708+ assert!(
2616- .place_stream_at(0.0, &path, 0, Some(v2))2709+ session
2617- .expect("its own file is on this timeline"));2710+ .place_stream_at(0.0, &path, 0, Some(v2))
2711+ .expect("its own file is on this timeline")
2712+ );
2618 session2713 session
2619 .place_sub(sub_lane, 0, one_second(0))2714 .place_sub(sub_lane, 0, one_second(0))
2620 .expect("the caption goes down");2715 .expect("the caption goes down");
crates/app/src/tests/layout.rsmodified+53 -18
@@ -351,7 +351,7 @@ fn a_lane_row_is_a_fixed_header_and_a_bed_that_can_be_hit() {
351 /// strip's row at the zoom boundary without the strip to show for it.351 /// strip's row at the zoom boundary without the strip to show for it.
352 #[test]352 #[test]
353 fn the_scroll_strip_row_comes_and_goes_with_the_zoom() {353 fn the_scroll_strip_row_comes_and_goes_with_the_zoom() {
354- use crate::{lanes_h, split_size, timeline_fixed_h, timeline_h, Split, SCROLL_HIT};354+ use crate::{SCROLL_HIT, Split, lanes_h, split_size, timeline_fixed_h, timeline_h};
355 use gpui::{px, size};355 use gpui::{px, size};
356 356
357 // The strip's row, and only the strip's row, is what the two faces differ357 // The strip's row, and only the strip's row, is what the two faces differ
@@ -398,8 +398,8 @@ fn the_scroll_strip_row_comes_and_goes_with_the_zoom() {
398 /// on the track, the time axis's own thumb turned through a right angle.398 /// on the track, the time axis's own thumb turned through a right angle.
399 #[test]399 #[test]
400 fn the_lane_thumb_is_the_visible_share_of_the_stack() {400 fn the_lane_thumb_is_the_visible_share_of_the_stack() {
401- use crate::lanes_thumb;
402 use crate::SCROLL_THUMB_MIN;401 use crate::SCROLL_THUMB_MIN;
402+ use crate::lanes_thumb;
403 403
404 // Whole stack on screen: the track fills and there is nothing to scroll.404 // Whole stack on screen: the track fills and there is nothing to scroll.
405 assert_eq!(lanes_thumb(200., 104., 200., 0.), (0., 200.));405 assert_eq!(lanes_thumb(200., 104., 200., 0.), (0., 200.));
@@ -1301,7 +1301,7 @@ fn the_darkroom_subtitle_palette_drags_tracks_to_subtitle_lanes() {
1301 /// arrival order, at the end.1301 /// arrival order, at the end.
1302 #[test]1302 #[test]
1303 fn a_file_subtitle_group_follows_its_own_row() {1303 fn a_file_subtitle_group_follows_its_own_row() {
1304- use crate::ui::dock_stance::{source_list_order, Slot};1304+ use crate::ui::dock_stance::{Slot, source_list_order};
1305 let film = PathBuf::from("/films/a.mkv");1305 let film = PathBuf::from("/films/a.mkv");
1306 let other = PathBuf::from("/rec/b.mp4");1306 let other = PathBuf::from("/rec/b.mp4");
1307 let loose = PathBuf::from("/subs/late.srt");1307 let loose = PathBuf::from("/subs/late.srt");
@@ -1798,8 +1798,8 @@ fn darkroom_lane_header_verbs_are_targeted_and_visible() {
1798 fn a_dragged_divider_stops_before_either_panel_disappears() {1798 fn a_dragged_divider_stops_before_either_panel_disappears() {
1799 use crate::ui::theme::INSPECTOR_MIN_W;1799 use crate::ui::theme::INSPECTOR_MIN_W;
1800 use crate::{1800 use crate::{
1801- inspector_w, library_w, split_drag_size, split_size, timeline_fixed_h, timeline_h, Split,1801+ SIDE_MAX_FRAC, SPLIT_W, Split, TIMELINE_MAX_SHARE, TOOLBAR_H, inspector_w, library_w,
1802- SIDE_MAX_FRAC, SPLIT_W, TIMELINE_MAX_SHARE, TOOLBAR_H,1802+ split_drag_size, split_size, timeline_fixed_h, timeline_h,
1803 };1803 };
1804 use gpui::{point, px, size};1804 use gpui::{point, px, size};
1805 1805
@@ -1919,7 +1919,7 @@ fn a_dragged_divider_stops_before_either_panel_disappears() {
1919 fn the_darkroom_seams_stop_before_either_side_disappears() {1919 fn the_darkroom_seams_stop_before_either_side_disappears() {
1920 use crate::ui::theme::INSPECTOR_MIN_W;1920 use crate::ui::theme::INSPECTOR_MIN_W;
1921 use crate::{1921 use crate::{
1922- split_bounds, split_drag_size, split_size, Split, BENCH_MIN_H, SIDE_MAX_FRAC, SPLIT_W,1922+ BENCH_MIN_H, SIDE_MAX_FRAC, SPLIT_W, Split, split_bounds, split_drag_size, split_size,
1923 };1923 };
1924 use gpui::{point, px, size};1924 use gpui::{point, px, size};
1925 1925
@@ -1978,9 +1978,9 @@ fn the_darkroom_seams_stop_before_either_side_disappears() {
1978 /// ~2px at the old `BENCH_MIN_H = 80.`).1978 /// ~2px at the old `BENCH_MIN_H = 80.`).
1979 #[test]1979 #[test]
1980 fn both_default_lanes_fit_the_bench_at_its_floor() {1980 fn both_default_lanes_fit_the_bench_at_its_floor() {
1981- use crate::ui::bench_stance::{row_h, LANE_MIN_H, ROW_GAP, RULER_H};
1982- use crate::ui::stance::BENCH_CHROME_H;
1983 use crate::BENCH_MIN_H;1981 use crate::BENCH_MIN_H;
1982+ use crate::ui::bench_stance::{LANE_MIN_H, ROW_GAP, RULER_H, row_h};
1983+ use crate::ui::stance::BENCH_CHROME_H;
1984 1984
1985 let box_h = BENCH_MIN_H - BENCH_CHROME_H;1985 let box_h = BENCH_MIN_H - BENCH_CHROME_H;
1986 let avail = box_h - RULER_H - ROW_GAP;1986 let avail = box_h - RULER_H - ROW_GAP;
@@ -2020,9 +2020,9 @@ fn both_default_lanes_fit_the_bench_at_its_floor() {
2020 /// painted bounds back, so it stays geometry-only, same as its neighbours.2020 /// painted bounds back, so it stays geometry-only, same as its neighbours.
2021 #[test]2021 #[test]
2022 fn the_whole_bench_stack_fits_its_own_floor_with_the_ledger_seam_clear() {2022 fn the_whole_bench_stack_fits_its_own_floor_with_the_ledger_seam_clear() {
2023+ use crate::BENCH_MIN_H;
2023 use crate::ui::bench_stance::{LANE_MIN_H, ROW_GAP, RULER_H};2024 use crate::ui::bench_stance::{LANE_MIN_H, ROW_GAP, RULER_H};
2024 use crate::ui::stance::BENCH_CHROME_H;2025 use crate::ui::stance::BENCH_CHROME_H;
2025- use crate::BENCH_MIN_H;
2026 2026
2027 const BENCH_BORDER_T: f32 = 1.;2027 const BENCH_BORDER_T: f32 = 1.;
2028 const BENCH_PY_TOP: f32 = 4.;2028 const BENCH_PY_TOP: f32 = 4.;
@@ -2092,9 +2092,9 @@ fn a_lane_row_fits_what_its_own_head_draws() {
2092 #[test]2092 #[test]
2093 fn a_saved_seam_survives_a_reload() {2093 fn a_saved_seam_survives_a_reload() {
2094 use crate::{2094 use crate::{
2095- load_stance_splits_from, save_stance_splits_to, Split, Splits, BENCH_MIN_H, SIDE_MAX_FRAC,2095+ BENCH_MIN_H, SIDE_MAX_FRAC, Split, Splits, load_stance_splits_from, save_stance_splits_to,
2096 };2096 };
2097- use gpui::{px, size, Pixels, Size};2097+ use gpui::{Pixels, Size, px, size};
2098 2098
2099 let dir = engine::scratch::Scratch::dir("edith-stance-splits");2099 let dir = engine::scratch::Scratch::dir("edith-stance-splits");
2100 let path = dir.join("stance-splits");2100 let path = dir.join("stance-splits");
@@ -2137,7 +2137,7 @@ fn a_saved_seam_survives_a_reload() {
2137 /// drag that never started (`None`) owes nothing.2137 /// drag that never started (`None`) owes nothing.
2138 #[test]2138 #[test]
2139 fn only_the_persisted_seams_owe_a_save_when_a_drag_loses_the_window() {2139 fn only_the_persisted_seams_owe_a_save_when_a_drag_loses_the_window() {
2140- use crate::{player::timeline_edit::split_drag_owes_save, Split};2140+ use crate::{Split, player::timeline_edit::split_drag_owes_save};
2141 2141
2142 assert!(split_drag_owes_save(Some(Split::Dock)));2142 assert!(split_drag_owes_save(Some(Split::Dock)));
2143 assert!(split_drag_owes_save(Some(Split::Bench)));2143 assert!(split_drag_owes_save(Some(Split::Bench)));
@@ -2151,8 +2151,8 @@ fn only_the_persisted_seams_owe_a_save_when_a_drag_loses_the_window() {
2151 /// `load_stance_splits`'s doc comment promises.2151 /// `load_stance_splits`'s doc comment promises.
2152 #[test]2152 #[test]
2153 fn a_missing_stance_splits_file_leaves_every_region_at_its_default() {2153 fn a_missing_stance_splits_file_leaves_every_region_at_its_default() {
2154- use crate::{load_stance_splits_from, Split};2154+ use crate::{Split, load_stance_splits_from};
2155- use gpui::{px, size, Pixels, Size};2155+ use gpui::{Pixels, Size, px, size};
2156 2156
2157 let dir = engine::scratch::Scratch::dir("edith-stance-splits-missing");2157 let dir = engine::scratch::Scratch::dir("edith-stance-splits-missing");
2158 let window: Size<Pixels> = size(px(1280.), px(720.));2158 let window: Size<Pixels> = size(px(1280.), px(720.));
@@ -2993,7 +2993,7 @@ fn the_bench_answers_a_wheel_notch_anywhere_over_it() {
2993 /// kept beside the first ([`Splits::clear`]).2993 /// kept beside the first ([`Splits::clear`]).
2994 #[test]2994 #[test]
2995 fn a_double_pressed_divider_forgets_the_size_it_was_dragged_to() {2995 fn a_double_pressed_divider_forgets_the_size_it_was_dragged_to() {
2996- use crate::layout::{split_size, Split, Splits};2996+ use crate::layout::{Split, Splits, split_size};
2997 use gpui::{px, size};2997 use gpui::{px, size};
2998 2998
2999 let window = size(px(1280.), px(720.));2999 let window = size(px(1280.), px(720.));
@@ -3083,7 +3083,7 @@ fn the_bench_seam_reaches_no_further_than_every_other_seam() {
3083 /// `bench=105` at the floor, `bench=1164` at the ceiling.3083 /// `bench=105` at the floor, `bench=1164` at the ceiling.
3084 #[test]3084 #[test]
3085 fn the_bench_seam_stops_at_its_floor_and_its_ceiling() {3085 fn the_bench_seam_stops_at_its_floor_and_its_ceiling() {
3086- use crate::{split_bounds, split_size, Split, BENCH_MIN_H};3086+ use crate::{BENCH_MIN_H, Split, split_bounds, split_size};
3087 use gpui::{px, size};3087 use gpui::{px, size};
3088 3088
3089 let window = size(px(2560.), px(1440.));3089 let window = size(px(2560.), px(1440.));
@@ -3197,6 +3197,41 @@ fn a_source_row_shows_its_name_before_anything_else() {
3197 );3197 );
3198 }3198 }
3199 3199
3200+/// The dock's metadata line drops the decoder *seat* and nothing else. A file
3201+/// the decoder refused has no seat to drop: its detail is the refusal, and it
3202+/// is the only thing the line has to say.
3203+#[test]
3204+fn the_dock_keeps_a_refusal_where_it_drops_a_seat() {
3205+ use crate::ui::dock_stance::without_seats;
3206+ use engine::decode::Backend;
3207+
3208+ let seats = [
3209+ Backend::Opening,
3210+ Backend::Hardware,
3211+ Backend::Software,
3212+ Backend::Still,
3213+ Backend::Gap,
3214+ ]
3215+ .map(Backend::label);
3216+ assert_eq!(
3217+ without_seats("h264 · HW", &seats),
3218+ "h264",
3219+ "the seat is how this machine reads it, and the row says what the file is"
3220+ );
3221+ let refusal = "no Segment element: not a Matroska file";
3222+ assert_eq!(
3223+ without_seats(refusal, &seats),
3224+ refusal,
3225+ "a refusal is not a seat, and reaches the row whole"
3226+ );
3227+ // The halves keep their separator either way: a stream detail beside a
3228+ // refusal is still two things said in order.
3229+ assert_eq!(
3230+ without_seats(&format!("{refusal} · stereo · 48 kHz"), &seats),
3231+ format!("{refusal} · stereo · 48 kHz")
3232+ );
3233+}
3234+
3200 /// A room key pressed while the ring sits in the dock has to reach the room.3235 /// A room key pressed while the ring sits in the dock has to reach the room.
3201 /// Two ways it did not: the dock's own handler could stop a key it does not3236 /// Two ways it did not: the dock's own handler could stop a key it does not
3202 /// answer, and the body the dock mounts could leave the focused3237 /// answer, and the body the dock mounts could leave the focused
@@ -3400,8 +3435,8 @@ fn the_ledger_carries_the_rooms_four_verbs_and_no_rail_remains() {
3400 /// deletion.3435 /// deletion.
3401 #[test]3436 #[test]
3402 fn select_all_left_the_ruler_for_the_rulers_own_menu() {3437 fn select_all_left_the_ruler_for_the_rulers_own_menu() {
3403- use crate::menus::BENCH_ITEMS;
3404 use crate::ActionId;3438 use crate::ActionId;
3439+ use crate::menus::BENCH_ITEMS;
3405 let bench = src_text("ui/bench_stance.rs");3440 let bench = src_text("ui/bench_stance.rs");
3406 for gone in ["bench-select-all", "select_all_band", "SELECT_ALL_PAD"] {3441 for gone in ["bench-select-all", "select_all_band", "SELECT_ALL_PAD"] {
3407 assert!(!bench.contains(gone), "the ruler still carries {gone}");3442 assert!(!bench.contains(gone), "the ruler still carries {gone}");
@@ -3873,7 +3908,7 @@ fn the_export_section_is_four_rows_and_no_fifth() {
3873 /// cannot write, because [`Player::set_format`] would only refuse it back.3908 /// cannot write, because [`Player::set_format`] would only refuse it back.
3874 #[test]3909 #[test]
3875 fn the_picture_row_cycles_codec_and_container_together_and_skips_a_refusal() {3910 fn the_picture_row_cycles_codec_and_container_together_and_skips_a_refusal() {
3876- use crate::ui::settings_stance::{next_picture, picture_label, PICTURE_CYCLE};3911+ use crate::ui::settings_stance::{PICTURE_CYCLE, next_picture, picture_label};
3877 assert_eq!(3912 assert_eq!(
3878 PICTURE_CYCLE,3913 PICTURE_CYCLE,
3879 [3914 [
crates/app/src/tests/mod.rsmodified+30 -29
@@ -10,55 +10,56 @@ mod media;
10 mod view;10 mod view;
11 11
12 use super::{12 use super::{
13- active_lane, auto_bps, band_label, bitrate_detail, clipboard_after_remove, color_snap,13+ ACCENT_PRIMARY, AUDIO_KBPS, BENCH_ITEMS, BG_RAISED, BPS_COARSE, BPS_FINE, BPS_MAX, BPS_MIN,
14- containers, destructive, enable, enable_lane, envelope, eq_card_w, eq_freq, eq_freq_label,14+ COLOR_BANDS, COLOR_BAR_W, COLOR_STEP, COLOR_W, CONTROL_H, Clip, ColorEdit, Ctx,
15- eq_graph_h, eq_spectrum, eq_x, eq_y, estimated_bytes, export_path, export_settings,15+ DEFAULT_AUDIO_KBPS, Decoder, EQ_BANDS_MAX, EQ_CURVE_STEPS, EQ_FFT, EQ_FREQ_HIGH, EQ_FREQ_LOW,
16- format_refusal, fps_choices, fps_label, frac_along, frac_down, frame_at, frame_rate_ladder,16+ EQ_FREQ_STEP, EQ_GAIN_LIMIT, EQ_GRAPH_H, EQ_HANDLE, EQ_Q_HIGH, EQ_Q_LOW, EQ_Q_STEP,
17- histogram, inserted_band, is_project, keymap, keys_rows, keys_rows_matching, lane_items,17+ EQ_SPECTRUM_DB, EQ_TICKS, EQ_W_MAX, ESCAPE, EXPORT_DONE, EXPORT_MOMENT_H, Enable, EncoderSeat,
18- lanes_h, marked, menu_at, menu_items, menu_rows_h, next_container, normalise, nothing_to_play,18+ FORMATS, Format, HEADER_H, HIST_BINS, HIST_H, HIST_SAMPLES, HIT_MIN, KEYS_ROW_H, KEYS_W,
19- notice_tone, panel_h, parse_budget, project_path, proxies_to_start, push_notice, px_below,19+ KeyRow, LABEL_H, LANE_H, LANES_MAX, LATE_RESYNC, LIBRARY_MAX_W, LIBRARY_MIN_W, Lane, MB_FLOOR,
20- range_word, rate_label, retarget, row_enable, row_items, scrub_due, secs_label, should_resync,20+ MENU_ITEMS, MENU_PAD, MENU_ROW_H, MENU_W, NO_FILE, NOTICES_MAX, NumberEdit, OVERLAID, PANEL_H,
21+ RESYNC_GAP, ROW_ITEMS, RULER_HIT_H, RowCtx, RowItem, SCROLL_NOTCH_SHARE, SILENCE_ROWS,
22+ SOURCE_TINTS, SPEED_PRESETS, SPEED_STEP, STATUS_ERROR, STATUS_SUCCESS, STATUS_WARNING,
23+ SUB_PLAN_CHARS, Source, Speed, StreamInfo, SubPickKey, TIMELINE_SHARE, Transport, VOLUME_W,
24+ VizSlot, Volume, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, Wave, ZOOM_MIN_FRAMES, active_lane,
25+ auto_bps, band_label, bitrate_detail, clipboard_after_remove, color_snap, containers,
26+ destructive, enable, enable_lane, envelope, eq_card_w, eq_freq, eq_freq_label, eq_graph_h,
27+ eq_spectrum, eq_x, eq_y, estimated_bytes, export_path, export_settings, format_refusal,
28+ fps_choices, fps_label, frac_along, frac_down, frame_at, frame_rate_ladder, histogram,
29+ inserted_band, is_project, keymap, keys_rows, keys_rows_matching, lane_items, lanes_h, marked,
30+ menu_at, menu_items, menu_rows_h, next_container, normalise, nothing_to_play, notice_tone,
31+ panel_h, parse_budget, project_path, proxies_to_start, push_notice, px_below, range_word,
32+ rate_label, retarget, row_enable, row_items, scrub_due, secs_label, should_resync,
21 silence_rate, size_label, snap_cue, snap_marks, snapped, source_tint, span_partner, speed_at,33 silence_rate, size_label, snap_cue, snap_marks, snapped, source_tint, span_partner, speed_at,
22 sub_pick_after_removal, sub_pick_after_restore, subtitle_plan, timecode, timeline_fixed_h,34 sub_pick_after_removal, sub_pick_after_restore, subtitle_plan, timecode, timeline_fixed_h,
23 tip_may_paint, transport, typed, unseen_paths, unseen_sources, viz_held_paint, whole_take,35 tip_may_paint, transport, typed, unseen_paths, unseen_sources, viz_held_paint, whole_take,
24- window_title, Clip, ColorEdit, Ctx, Enable, EncoderSeat, Format, KeyRow, Lane, NumberEdit,36+ window_title,
25- RowCtx, RowItem, Source, Speed, StreamInfo, SubPickKey, Transport, VizSlot, Volume, Wave,
26- ACCENT_PRIMARY, AUDIO_KBPS, BENCH_ITEMS, BG_RAISED, BPS_COARSE, BPS_FINE, BPS_MAX, BPS_MIN,
27- COLOR_BANDS, COLOR_BAR_W, COLOR_STEP, COLOR_W, CONTROL_H, DEFAULT_AUDIO_KBPS, EQ_BANDS_MAX,
28- EQ_CURVE_STEPS, EQ_FFT, EQ_FREQ_HIGH, EQ_FREQ_LOW, EQ_FREQ_STEP, EQ_GAIN_LIMIT, EQ_GRAPH_H,
29- EQ_HANDLE, EQ_Q_HIGH, EQ_Q_LOW, EQ_Q_STEP, EQ_SPECTRUM_DB, EQ_TICKS, EQ_W_MAX, ESCAPE,
30- EXPORT_DONE, EXPORT_MOMENT_H, FORMATS, HEADER_H, HIST_BINS, HIST_H, HIST_SAMPLES, HIT_MIN,
31- KEYS_ROW_H, KEYS_W, LABEL_H, LANES_MAX, LANE_H, LATE_RESYNC, LIBRARY_MAX_W, LIBRARY_MIN_W,
32- MB_FLOOR, MENU_ITEMS, MENU_PAD, MENU_ROW_H, MENU_W, NOTICES_MAX, NO_FILE, OVERLAID, PANEL_H,
33- RESYNC_GAP, ROW_ITEMS, RULER_HIT_H, SCROLL_NOTCH_SHARE, SILENCE_ROWS, SOURCE_TINTS,
34- SPEED_PRESETS, SPEED_STEP, STATUS_ERROR, STATUS_SUCCESS, STATUS_WARNING, SUB_PLAN_CHARS,
35- TIMELINE_SHARE, VOLUME_W, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, ZOOM_MIN_FRAMES,
36 };37 };
37 38
38 use super::{39 use super::{
39- arrival, audio_rate_choices, av1_hw_warning, clip_width, clock, encoder_choices, encoder_label,40+ ActionId, Choice, EDGE_W, ETA_SPAN, Edge, FITS, FRAME_RATES, IMPORT_STALL, Import, ImportStage,
41+ Landing, LaneKind, PPS_DEFAULT, PPS_MIN, Preset, RESOLUTIONS, Repeat, SAMPLE_RATES, SEEK_STALL,
42+ Scale, ScanKey, ScanPlan, SilenceScan, SubClip, View, ZOOM_OUT_MARGIN, ZOOM_STEP, arrival,
43+ audio_rate_choices, av1_hw_warning, clip_width, clock, encoder_choices, encoder_label,
40 eta_secs, file_name, file_uri, fit_choices, frames_of_us, full_scan_key, import_line, landing,44 eta_secs, file_name, file_uri, fit_choices, frames_of_us, full_scan_key, import_line, landing,
41 lane_refuses, launch_queue, library_rows, live_idx, next_fit, next_resolution, note_progress,45 lane_refuses, launch_queue, library_rows, live_idx, next_fit, next_resolution, note_progress,
42 pending_fps_choices, pending_resolution_choices, px_along, read_ahead, repeats,46 pending_fps_choices, pending_resolution_choices, px_along, read_ahead, repeats,
43 resolution_choices, resolution_ladder, sample_rate_choices, scan_plan, seek_line,47 resolution_choices, resolution_ladder, sample_rate_choices, scan_plan, seek_line,
44 silence_cached, silence_line, slice_whole_levels, source_secs, stash_or_write, tone_choices,48 silence_cached, silence_line, slice_whole_levels, source_secs, stash_or_write, tone_choices,
45- tone_label, trimmed_clip, trimmed_sub, trims, unscannable, unusable, ActionId, Choice, Edge,49+ tone_label, trimmed_clip, trimmed_sub, trims, unscannable, unusable,
46- Import, ImportStage, Landing, LaneKind, Preset, Repeat, Scale, ScanKey, ScanPlan, SilenceScan,
47- SubClip, View, EDGE_W, ETA_SPAN, FITS, FRAME_RATES, IMPORT_STALL, PPS_DEFAULT, PPS_MIN,
48- RESOLUTIONS, SAMPLE_RATES, SEEK_STALL, ZOOM_OUT_MARGIN, ZOOM_STEP,
49 };50 };
50 51
51 use super::{52 use super::{
52- carries_subtitles, cue_box, cues_at, file_tint, is_subtitle, lang_human, sub_bottom,53+ SUB_BOTTOM, SUB_CUE_MIN_W, SUB_LINE_H, SUB_TEXT, Subs, carries_subtitles, cue_box, cues_at,
53- sub_pick_name, subtitle_detail, subtitle_notice, subtitle_rows, subtitle_tail,54+ file_tint, is_subtitle, lang_human, sub_bottom, sub_pick_name, subtitle_detail,
54- subtitle_toggle_notice, walk_subtitles, Subs, SUB_BOTTOM, SUB_CUE_MIN_W, SUB_LINE_H, SUB_TEXT,55+ subtitle_notice, subtitle_rows, subtitle_tail, subtitle_toggle_notice, walk_subtitles,
55 };56 };
56 57
57 use engine::PlaybackSession;58 use engine::PlaybackSession;
58 59
59 use engine::scale::FitPolicy;60 use engine::scale::FitPolicy;
60 61
61-use gpui::{point, px, size, Bounds, Pixels};62+use gpui::{Bounds, Pixels, point, px, size};
62 63
63 use std::collections::HashMap;64 use std::collections::HashMap;
64 65
crates/app/src/ui/dock_stance.rsmodified+244 -134
@@ -185,7 +185,11 @@ fn dock_tab(
185 }185 }
186 cx.notify();186 cx.notify();
187 }))187 }))
188- .tooltip(crate::ui::widgets::tip_hover(&format!("Show {}", label_text.to_lowercase()), "", None))188+ .tooltip(crate::ui::widgets::tip_hover(
189+ &format!("Show {}", label_text.to_lowercase()),
190+ "",
191+ None,
192+ ))
189 .children(hitmap::control(id, label_text, true))193 .children(hitmap::control(id, label_text, true))
190 .child(194 .child(
191 div()195 div()
@@ -232,6 +236,25 @@ fn usage_line(player: &Player, source_idx: usize, placed: usize) -> String {
232 lanes.join(" ")236 lanes.join(" ")
233 }237 }
234 238
239+/// A row's detail line with the decoder seats taken out of it, which is what
240+/// the dock draws: the seat is how this machine happens to read the file and
241+/// the transport line and the Properties side both still say it, so the row
242+/// says what the file *is* instead.
243+///
244+/// Only a whole part is dropped, and a part is a seat only when it is exactly
245+/// a seat's word. That is what keeps a refusal: the row's detail for a file
246+/// the decoder would not take is the refusal itself
247+/// ([`crate::Decoder::Refused`]), and no seat is ever named by a sentence --
248+/// so the one line that has to say why the file will not play reaches the
249+/// dock whole.
250+pub(crate) fn without_seats(detail: &str, seats: &[&str]) -> String {
251+ detail
252+ .split(" · ")
253+ .filter(|part| !seats.contains(part))
254+ .collect::<Vec<_>>()
255+ .join(" · ")
256+}
257+
235 /// The file's name without its extension -- what the editor calls the film,258 /// The file's name without its extension -- what the editor calls the film,
236 /// not what the filesystem calls the bytes (cleanse round 2). A row that259 /// not what the filesystem calls the bytes (cleanse round 2). A row that
237 /// names several streams of one file keeps the stream half it was given260 /// names several streams of one file keeps the stream half it was given
@@ -281,12 +304,7 @@ fn source_row(
281 Backend::Gap,304 Backend::Gap,
282 ]305 ]
283 .map(Backend::label);306 .map(Backend::label);
284- let detail = row307+ let detail = without_seats(&row.detail, &seats);
285- .detail
286- .split(" · ")
287- .filter(|part| !seats.contains(part))
288- .collect::<Vec<_>>()
289- .join(" · ");
290 let under: String = match &row.unusable {308 let under: String = match &row.unusable {
291 Some(why) => why.clone(),309 Some(why) => why.clone(),
292 None => join_detail(310 None => join_detail(
@@ -690,15 +708,15 @@ fn subtitle_tab_rows(
690 .on_drag(SubPick(track), {708 .on_drag(SubPick(track), {
691 let me = cx.entity();709 let me = cx.entity();
692 move |_, _, _, cx| {710 move |_, _, _, cx| {
693- // A fresh gesture inherits nothing: `Player::drag_lane`711+ // A fresh gesture inherits nothing: `Player::drag_lane`
694- // and `Player::drag_x` are the *last live sample* of the712+ // and `Player::drag_x` are the *last live sample* of the
695- // drag being made, and a drag whose first sample lands713+ // drag being made, and a drag whose first sample lands
696- // outside every row would otherwise be let go onto the714+ // outside every row would otherwise be let go onto the
697- // lane the previous one ended over.715+ // lane the previous one ended over.
698- me.update(cx, |this, _| {716+ me.update(cx, |this, _| {
699- this.drag_lane = None;717+ this.drag_lane = None;
700- this.drag_x = None;718+ this.drag_x = None;
701- });719+ });
702 cx.new(|_| Tip(ghost.clone()))720 cx.new(|_| Tip(ghost.clone()))
703 }721 }
704 })722 })
@@ -707,7 +725,11 @@ fn subtitle_tab_rows(
707 cx.notify();725 cx.notify();
708 }))726 }))
709 })727 })
710- .tooltip(crate::ui::widgets::tip_hover("Subtitle track", "drag to a lane", None))728+ .tooltip(crate::ui::widgets::tip_hover(
729+ "Subtitle track",
730+ "drag to a lane",
731+ None,
732+ ))
711 .children(hitmap::dynamic(733 .children(hitmap::dynamic(
712 move || {734 move || {
713 (735 (
@@ -777,7 +799,11 @@ fn subtitle_tab_rows(
777 cx.stop_propagation();799 cx.stop_propagation();
778 this.remove_subtitle_track(track, cx);800 this.remove_subtitle_track(track, cx);
779 }))801 }))
780- .tooltip(crate::ui::widgets::tip_hover("Remove subtitle track", "", None))802+ .tooltip(crate::ui::widgets::tip_hover(
803+ "Remove subtitle track",
804+ "",
805+ None,
806+ ))
781 .children(hitmap::dynamic(807 .children(hitmap::dynamic(
782 move || {808 move || {
783 (809 (
@@ -794,78 +820,79 @@ fn subtitle_tab_rows(
794 let has_header = !nested || track_count > 3;820 let has_header = !nested || track_count > 3;
795 let folded = has_header && (nested != player.sub_folded.contains(&group_path));821 let folded = has_header && (nested != player.sub_folded.contains(&group_path));
796 let header = div()822 let header = div()
797- .id(("dock-subtitle-group", group_ord))823+ .id(("dock-subtitle-group", group_ord))
798- .flex_none()824+ .flex_none()
799- .flex()825+ .flex()
800- .items_center()826+ .items_center()
801- .gap(px(6.))827+ .gap(px(6.))
802- .px(px(8.))828+ .px(px(8.))
803- // Stepped in under its parent when it has one, the829+ // Stepped in under its parent when it has one, the
804- // same outline the track rows below it read as.830+ // same outline the track rows below it read as.
805- .when(nested, |d| d.pl(px(22.)))831+ .when(nested, |d| d.pl(px(22.)))
806- .py(px(4.))832+ .py(px(4.))
807- .rounded(px(3.))833+ .rounded(px(3.))
808- .cursor_pointer()834+ .cursor_pointer()
809- .hover(|s| s.bg(rgb(DARK_RAISED())))835+ .hover(|s| s.bg(rgb(DARK_RAISED())))
810- .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {836+ .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
811- if !this.sub_folded.remove(&fold_path) {837+ if !this.sub_folded.remove(&fold_path) {
812- this.sub_folded.insert(fold_path.clone());838+ this.sub_folded.insert(fold_path.clone());
813- }839+ }
814- cx.notify();840+ cx.notify();
815- }))841+ }))
816- .tooltip(crate::ui::widgets::tip_hover("Fold this source", "click", None))842+ .tooltip(crate::ui::widgets::tip_hover(
817- .children(hitmap::dynamic(843+ "Fold this source",
818- move || {844+ "click",
819- (845+ None,
820- format!("subtitle-group.{group_ord}.fold"),846+ ))
821- "Toggle subtitle group".into(),847+ .children(hitmap::dynamic(
822- )848+ move || {
823- },849+ (
824- true,850+ format!("subtitle-group.{group_ord}.fold"),
825- ))851+ "Toggle subtitle group".into(),
826- // Bare, the glyph inherited the panel's dim ink and
827- // vanished ("the little arrow on left side is hard
828- // to see", user 2026-08-27) -- it reads at the same
829- // ink as the name it folds.
830- .child(
831- div()
832- .flex_none()
833- .w(px(10.))
834- .text_color(rgb(INK1()))
835- .child(if folded { "▸" } else { "▾" }),
836- )
837- .when_some(tint, |d, tint| {
838- d.child(
839- div()
840- .flex_none()
841- .w(px(8.))
842- .h(px(8.))
843- .rounded(px(4.))
844- .bg(rgb(tint)),
845- )
846- })
847- .child(
848- div()
849- .flex_1()
850- .min_w(px(0.))
851- .truncate()
852- .type_style(mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM))
853- .text_color(rgb(INK1()))
854- .child(group.name),
855 )852 )
856- .child(853+ },
857- div()854+ true,
858- .flex_none()855+ ))
859- .type_style(mono(856+ // Bare, the glyph inherited the panel's dim ink and
860- type_scale::CHORD_METADATA_MIN_PX,857+ // vanished ("the little arrow on left side is hard
861- FontWeight::MEDIUM,858+ // to see", user 2026-08-27) -- it reads at the same
862- ))859+ // ink as the name it folds.
863- .text_color(rgb(INK3()))860+ .child(
864- .child(format!(861+ div()
865- "{track_count} track{}",862+ .flex_none()
866- if track_count == 1 { "" } else { "s" }863+ .w(px(10.))
867- )),864+ .text_color(rgb(INK1()))
868- );865+ .child(if folded { "▸" } else { "▾" }),
866+ )
867+ .when_some(tint, |d, tint| {
868+ d.child(
869+ div()
870+ .flex_none()
871+ .w(px(8.))
872+ .h(px(8.))
873+ .rounded(px(4.))
874+ .bg(rgb(tint)),
875+ )
876+ })
877+ .child(
878+ div()
879+ .flex_1()
880+ .min_w(px(0.))
881+ .truncate()
882+ .type_style(mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM))
883+ .text_color(rgb(INK1()))
884+ .child(group.name),
885+ )
886+ .child(
887+ div()
888+ .flex_none()
889+ .type_style(mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM))
890+ .text_color(rgb(INK3()))
891+ .child(format!(
892+ "{track_count} track{}",
893+ if track_count == 1 { "" } else { "s" }
894+ )),
895+ );
869 (896 (
870 group_path,897 group_path,
871 track_count,898 track_count,
@@ -1033,7 +1060,11 @@ fn sources_tab(
1033 this.dock_filter_edit = true;1060 this.dock_filter_edit = true;
1034 cx.notify();1061 cx.notify();
1035 }))1062 }))
1036- .tooltip(crate::ui::widgets::tip_hover("Filter sources", "type to narrow", None))1063+ .tooltip(crate::ui::widgets::tip_hover(
1064+ "Filter sources",
1065+ "type to narrow",
1066+ None,
1067+ ))
1037 .children(hitmap::control("dock.filter", "Filter sources", true))1068 .children(hitmap::control("dock.filter", "Filter sources", true))
1038 // The glass alone at rest: the word "filter" beside it was1069 // The glass alone at rest: the word "filter" beside it was
1039 // the box telling the editor what a filter box is (DESIGN §8).1070 // the box telling the editor what a filter box is (DESIGN §8).
@@ -1160,7 +1191,11 @@ fn transition_row(player: &Player, cx: &mut Context<Player>) -> Option<impl Into
1160 .text_size(label_style.size)1191 .text_size(label_style.size)
1161 .text_color(rgb(INK2()))1192 .text_color(rgb(INK2()))
1162 .cursor_pointer()1193 .cursor_pointer()
1163- .tooltip(crate::ui::widgets::tip_hover("Transition duration", "click to type", None))1194+ .tooltip(crate::ui::widgets::tip_hover(
1195+ "Transition duration",
1196+ "click to type",
1197+ None,
1198+ ))
1164 .children(hitmap::control(1199 .children(hitmap::control(
1165 "transition-duration-field",1200 "transition-duration-field",
1166 "Transition duration, type-in",1201 "Transition duration, type-in",
@@ -1371,7 +1406,12 @@ fn viz_slot_chips(player: &Player, paint: u64, cx: &mut Context<Player>) -> impl
1371 .flex()1406 .flex()
1372 .items_center()1407 .items_center()
1373 .child(chip("dock-viz-colour", "Colour", VizSlot::Main, true))1408 .child(chip("dock-viz-colour", "Colour", VizSlot::Main, true))
1374- .child(chip("dock-viz-strand", "Strand", VizSlot::Strand, strand_live))1409+ .child(chip(
1410+ "dock-viz-strand",
1411+ "Strand",
1412+ VizSlot::Strand,
1413+ strand_live,
1414+ ))
1375 }1415 }
1376 1416
1377 /// The picked slot's colour as text, and the way in: a click opens the type-in1417 /// The picked slot's colour as text, and the way in: a click opens the type-in
@@ -1395,7 +1435,11 @@ fn viz_hex_row(player: &Player, paint: u64, cx: &mut Context<Player>) -> impl In
1395 .text_size(row.size)1435 .text_size(row.size)
1396 .text_color(rgb(INK2()))1436 .text_color(rgb(INK2()))
1397 .cursor_pointer()1437 .cursor_pointer()
1398- .tooltip(crate::ui::widgets::tip_hover("Colour", "click to type", None))1438+ .tooltip(crate::ui::widgets::tip_hover(
1439+ "Colour",
1440+ "click to type",
1441+ None,
1442+ ))
1399 .children(hitmap::control(1443 .children(hitmap::control(
1400 "dock-viz-hex-field",1444 "dock-viz-hex-field",
1401 "Colour hex, type-in",1445 "Colour hex, type-in",
@@ -1424,7 +1468,11 @@ fn viz_color_wheel(player: &Player, paint: u64, cx: &mut Context<Player>) -> imp
1424 .h(px(112.))1468 .h(px(112.))
1425 .relative()1469 .relative()
1426 .cursor_pointer()1470 .cursor_pointer()
1427- .tooltip(crate::ui::widgets::tip_hover("Colour wheel", "drag to pick", None))1471+ .tooltip(crate::ui::widgets::tip_hover(
1472+ "Colour wheel",
1473+ "drag to pick",
1474+ None,
1475+ ))
1428 .children(hitmap::control("dock-viz-hs", "Colour wheel", true))1476 .children(hitmap::control("dock-viz-hs", "Colour wheel", true))
1429 .child(bounds_probe(player.viz_wheel.clone()))1477 .child(bounds_probe(player.viz_wheel.clone()))
1430 .child(1478 .child(
@@ -1448,10 +1496,22 @@ fn viz_color_wheel(player: &Player, paint: u64, cx: &mut Context<Player>) -> imp
1448 let hue = i as f32 / wedges as f32 * 360.;1496 let hue = i as f32 / wedges as f32 * 360.;
1449 let (r, g, b) = engine::decode::viz_hsv_rgb(hue, sat, 0.84);1497 let (r, g, b) = engine::decode::viz_hsv_rgb(hue, sat, 0.84);
1450 let color = (u32::from(r) << 16) | (u32::from(g) << 8) | u32::from(b);1498 let color = (u32::from(r) << 16) | (u32::from(g) << 8) | u32::from(b);
1451- let p00 = point(px(cx + radius * s0 * a0.sin()), px(cy - radius * s0 * a0.cos()));1499+ let p00 = point(
1452- let p01 = point(px(cx + radius * s0 * a1.sin()), px(cy - radius * s0 * a1.cos()));1500+ px(cx + radius * s0 * a0.sin()),
1453- let p11 = point(px(cx + radius * s1 * a1.sin()), px(cy - radius * s1 * a1.cos()));1501+ px(cy - radius * s0 * a0.cos()),
1454- let p10 = point(px(cx + radius * s1 * a0.sin()), px(cy - radius * s1 * a0.cos()));1502+ );
1503+ let p01 = point(
1504+ px(cx + radius * s0 * a1.sin()),
1505+ px(cy - radius * s0 * a1.cos()),
1506+ );
1507+ let p11 = point(
1508+ px(cx + radius * s1 * a1.sin()),
1509+ px(cy - radius * s1 * a1.cos()),
1510+ );
1511+ let p10 = point(
1512+ px(cx + radius * s1 * a0.sin()),
1513+ px(cy - radius * s1 * a0.cos()),
1514+ );
1455 let mut path = PathBuilder::fill();1515 let mut path = PathBuilder::fill();
1456 path.add_polygon(&[p00, p01, p11, p10], false);1516 path.add_polygon(&[p00, p01, p11, p10], false);
1457 if let Ok(path) = path.build() {1517 if let Ok(path) = path.build() {
@@ -1523,9 +1583,20 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context<Player>) -> imp
1523 .text_color(rgb(INK2()))1583 .text_color(rgb(INK2()))
1524 .child("Strands"),1584 .child("Strands"),
1525 )1585 )
1526- .child(viz_step("dock-viz-strands-minus", "Fewer strands", "−", cx, |this, cx| {1586+ .child(viz_step(
1527- this.set_viz_strands(engine::decode::viz_strands_of(this.viz_paint()).saturating_sub(1).max(1), cx);1587+ "dock-viz-strands-minus",
1528- }))1588+ "Fewer strands",
1589+ "−",
1590+ cx,
1591+ |this, cx| {
1592+ this.set_viz_strands(
1593+ engine::decode::viz_strands_of(this.viz_paint())
1594+ .saturating_sub(1)
1595+ .max(1),
1596+ cx,
1597+ );
1598+ },
1599+ ))
1529 .child(1600 .child(
1530 div()1601 div()
1531 .font(style.font.clone())1602 .font(style.font.clone())
@@ -1533,9 +1604,20 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context<Player>) -> imp
1533 .text_color(rgb(INK1()))1604 .text_color(rgb(INK1()))
1534 .child(format!("{strands}")),1605 .child(format!("{strands}")),
1535 )1606 )
1536- .child(viz_step("dock-viz-strands-plus", "More strands", "+", cx, |this, cx| {1607+ .child(viz_step(
1537- this.set_viz_strands(engine::decode::viz_strands_of(this.viz_paint()).saturating_add(1).min(32), cx);1608+ "dock-viz-strands-plus",
1538- })),1609+ "More strands",
1610+ "+",
1611+ cx,
1612+ |this, cx| {
1613+ this.set_viz_strands(
1614+ engine::decode::viz_strands_of(this.viz_paint())
1615+ .saturating_add(1)
1616+ .min(32),
1617+ cx,
1618+ );
1619+ },
1620+ )),
1539 )1621 )
1540 .child(1622 .child(
1541 div()1623 div()
@@ -1550,9 +1632,18 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context<Player>) -> imp
1550 .text_color(rgb(INK2()))1632 .text_color(rgb(INK2()))
1551 .child("Glow"),1633 .child("Glow"),
1552 )1634 )
1553- .child(viz_step("dock-viz-glow-minus", "Less glow", "−", cx, |this, cx| {1635+ .child(viz_step(
1554- this.set_viz_glow(engine::decode::viz_glow_of(this.viz_paint()).saturating_sub(1), cx);1636+ "dock-viz-glow-minus",
1555- }))1637+ "Less glow",
1638+ "−",
1639+ cx,
1640+ |this, cx| {
1641+ this.set_viz_glow(
1642+ engine::decode::viz_glow_of(this.viz_paint()).saturating_sub(1),
1643+ cx,
1644+ );
1645+ },
1646+ ))
1556 .child(1647 .child(
1557 div()1648 div()
1558 .font(style.font.clone())1649 .font(style.font.clone())
@@ -1560,9 +1651,20 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context<Player>) -> imp
1560 .text_color(rgb(INK1()))1651 .text_color(rgb(INK1()))
1561 .child(format!("{glow}")),1652 .child(format!("{glow}")),
1562 )1653 )
1563- .child(viz_step("dock-viz-glow-plus", "More glow", "+", cx, |this, cx| {1654+ .child(viz_step(
1564- this.set_viz_glow(engine::decode::viz_glow_of(this.viz_paint()).saturating_add(1).min(16), cx);1655+ "dock-viz-glow-plus",
1565- })),1656+ "More glow",
1657+ "+",
1658+ cx,
1659+ |this, cx| {
1660+ this.set_viz_glow(
1661+ engine::decode::viz_glow_of(this.viz_paint())
1662+ .saturating_add(1)
1663+ .min(16),
1664+ cx,
1665+ );
1666+ },
1667+ )),
1566 )1668 )
1567 }1669 }
1568 1670
@@ -1806,36 +1908,44 @@ fn keys_tab(player: &Player, cx: &mut Context<Player>) -> impl IntoElement {
1806 .font(style.font.clone())1908 .font(style.font.clone())
1807 .text_size(style.size)1909 .text_size(style.size)
1808 .text_color(rgb(INK1()))1910 .text_color(rgb(INK1()))
1809- .tooltip(crate::ui::widgets::tip_hover("Filter keys", "click to type", None))1911+ .tooltip(crate::ui::widgets::tip_hover(
1912+ "Filter keys",
1913+ "click to type",
1914+ None,
1915+ ))
1810 .children(hitmap::control("dock.keys-filter", "Filter keys", true))1916 .children(hitmap::control("dock.keys-filter", "Filter keys", true))
1811 .child(match player.keys_filter.is_empty() {1917 .child(match player.keys_filter.is_empty() {
1812 true => "⌕".to_string(),1918 true => "⌕".to_string(),
1813 false => format!("⌕ {filter_text}"),1919 false => format!("⌕ {filter_text}"),
1814 })1920 })
1815 })1921 })
1816- .children(keys_rows_matching(&player.keys_filter, &player.keymap).into_iter().map(|row| match row {1922+ .children(
1817- KeyRow::Head(category) => div()1923+ keys_rows_matching(&player.keys_filter, &player.keymap)
1818- .flex_none()1924+ .into_iter()
1819- .pt(px(4.))1925+ .map(|row| match row {
1820- .child(section_head(category.label().to_uppercase()))1926+ KeyRow::Head(category) => div()
1821- .into_any_element(),1927+ .flex_none()
1822- // The full-truth surface: every chord the action answers to1928+ .pt(px(4.))
1823- // (`display`), not the badge's primary-only compact form.1929+ .child(section_head(category.label().to_uppercase()))
1824- KeyRow::Act(action) => pair(1930+ .into_any_element(),
1825- action.label().to_string(),1931+ // The full-truth surface: every chord the action answers to
1826- player.keymap.display(action),1932+ // (`display`), not the badge's primary-only compact form.
1827- match player.enable(action, None) {1933+ KeyRow::Act(action) => pair(
1828- Enable::Yes => INK2(),1934+ action.label().to_string(),
1829- _ => INK4(),1935+ player.keymap.display(action),
1830- },1936+ match player.enable(action, None) {
1831- ),1937+ Enable::Yes => INK2(),
1832- // A fixed stroke is the window's, not an action the room can1938+ _ => INK4(),
1833- // refuse, so it never greys.1939+ },
1834- KeyRow::Fixed(i) => {1940+ ),
1835- let f = &keymap::FIXED[i];1941+ // A fixed stroke is the window's, not an action the room can
1836- pair(f.label.to_string(), f.chord.to_string(), INK2())1942+ // refuse, so it never greys.
1837- }1943+ KeyRow::Fixed(i) => {
1838- }))1944+ let f = &keymap::FIXED[i];
1945+ pair(f.label.to_string(), f.chord.to_string(), INK2())
1946+ }
1947+ }),
1948+ )
1839 }1949 }
1840 1950
1841 /// The dock's content, under `stance.rs::dock()`'s tab-bar-and-body frame:1951 /// The dock's content, under `stance.rs::dock()`'s tab-bar-and-body frame: