merge main
Browse files at this commit5 changed files +367 -57
- DESIGN.md +2 -0
- crates/app/src/library_meta.rs +47 -0
- crates/app/src/tests/layout.rs +155 -0
- crates/app/src/ui/dock_stance.rs +113 -28
- crates/app/src/ui/settings_stance.rs +50 -29
DESIGN.mdmodified+2 -0
| @@ -78,6 +78,8 @@ Two faces, fixed roles (bundled, no runtime deps): | ||
| 78 | 78 | |
| 79 | 79 | Scale: 18px hero timecode (700, colons in `ink3`) · 15px labels/rows (500) · 13–14px chords |
| 80 | 80 | and metadata (500) · 12px section heads (Archivo 700, uppercase, +0.14em letter-spacing, `ink3`). |
| 81 | +Room/column heads (Settings) are 15px Archivo 700 `ink1`; in-list section heads stay 12px `ink3` | |
| 82 | +(2026-09-10 -- the settings columns read as body text and a person could not find them). | |
| 81 | 83 | Nothing below 10px. Every size is a whole pixel (no half-pixel sizes -- they put glyph baselines |
| 82 | 84 | off the pixel grid and blurred cosmic-text's AA). No italics. Tabular figures wherever digits |
| 83 | 85 | align. |
crates/app/src/library_meta.rsmodified+47 -0
| @@ -125,9 +125,56 @@ pub(crate) fn library_rows( | ||
| 125 | 125 | }); |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | + disambiguate(&mut rows); | |
| 128 | 129 | rows |
| 129 | 130 | } |
| 130 | 131 | |
| 132 | +/// Two files whose rows read the same word ("2026-09-09 18-05-50" twice, user | |
| 133 | +/// 2026-09-10 -- two screen recordings) are told apart on the metadata line | |
| 134 | +/// rather than left as a pair of identical rows: the folder they came out of | |
| 135 | +/// when that differs, and a `#n` in arrival order when even the folder is | |
| 136 | +/// shared. Compared on the stem, because the stem is what the row draws. | |
| 137 | +fn disambiguate(rows: &mut [Row]) { | |
| 138 | + let named: Vec<(String, PathBuf)> = rows | |
| 139 | + .iter() | |
| 140 | + .map(|row| (crate::files::stem(&row.path), row.path.clone())) | |
| 141 | + .collect(); | |
| 142 | + for i in 0..rows.len() { | |
| 143 | + let mut twins: Vec<&PathBuf> = Vec::new(); | |
| 144 | + for (name, path) in &named { | |
| 145 | + if *name == named[i].0 && !twins.contains(&path) { | |
| 146 | + twins.push(path); | |
| 147 | + } | |
| 148 | + } | |
| 149 | + if twins.len() < 2 { | |
| 150 | + continue; | |
| 151 | + } | |
| 152 | + let folder = rows[i] | |
| 153 | + .path | |
| 154 | + .parent() | |
| 155 | + .and_then(Path::file_name) | |
| 156 | + .map(|f| f.to_string_lossy().to_string()) | |
| 157 | + .unwrap_or_default(); | |
| 158 | + let alone_in_it = twins | |
| 159 | + .iter() | |
| 160 | + .filter(|p| p.parent() == rows[i].path.parent()) | |
| 161 | + .count() | |
| 162 | + == 1; | |
| 163 | + let mark = match alone_in_it && !folder.is_empty() { | |
| 164 | + true => folder, | |
| 165 | + false => format!( | |
| 166 | + "#{}", | |
| 167 | + twins | |
| 168 | + .iter() | |
| 169 | + .position(|p| **p == rows[i].path) | |
| 170 | + .expect("a row finds itself") | |
| 171 | + + 1 | |
| 172 | + ), | |
| 173 | + }; | |
| 174 | + rows[i].detail = join_detail(&rows[i].detail, &mark); | |
| 175 | + } | |
| 176 | +} | |
| 177 | + | |
| 131 | 178 | /// The row's second line: what the stream is and then either how long it is or |
| 132 | 179 | /// why it cannot be used, with the separator only where both halves exist (a |
| 133 | 180 | /// single-stream file says nothing about its stream). |
crates/app/src/tests/layout.rsmodified+155 -0
| @@ -1292,6 +1292,97 @@ fn the_darkroom_subtitle_palette_drags_tracks_to_subtitle_lanes() { | ||
| 1292 | 1292 | ); |
| 1293 | 1293 | } |
| 1294 | 1294 | |
| 1295 | +/// A file's subtitle tracks are that file's subset and are listed as one: | |
| 1296 | +/// directly under the row that names it, never after every unrelated file | |
| 1297 | +/// (user 2026-09-10, screenshot -- two screen recordings sat between a film | |
| 1298 | +/// and its own subtitle group). A `.srt` nobody carries stays top-level, in | |
| 1299 | +/// arrival order, at the end. | |
| 1300 | +#[test] | |
| 1301 | +fn a_file_subtitle_group_follows_its_own_row() { | |
| 1302 | + use crate::ui::dock_stance::{Slot, source_list_order}; | |
| 1303 | + let film = PathBuf::from("/films/a.mkv"); | |
| 1304 | + let other = PathBuf::from("/rec/b.mp4"); | |
| 1305 | + let loose = PathBuf::from("/subs/late.srt"); | |
| 1306 | + assert_eq!( | |
| 1307 | + source_list_order( | |
| 1308 | + &[film.clone(), other.clone()], | |
| 1309 | + &[film.clone(), loose.clone()] | |
| 1310 | + ), | |
| 1311 | + [Slot::Media(0), Slot::Subs(0), Slot::Media(1), Slot::Subs(1)], | |
| 1312 | + "the film's own tracks must sit between it and the next file" | |
| 1313 | + ); | |
| 1314 | + // A file with several audio streams has several rows; the tracks follow | |
| 1315 | + // the last of them, so the file's own rows stay together. | |
| 1316 | + assert_eq!( | |
| 1317 | + source_list_order( | |
| 1318 | + &[film.clone(), other.clone(), film.clone()], | |
| 1319 | + &[film.clone()] | |
| 1320 | + ), | |
| 1321 | + [Slot::Media(0), Slot::Media(1), Slot::Media(2), Slot::Subs(0)], | |
| 1322 | + ); | |
| 1323 | + // Nobody's `.srt`: still a top-level row, still last. | |
| 1324 | + assert_eq!( | |
| 1325 | + source_list_order(&[other], &[loose]), | |
| 1326 | + [Slot::Media(0), Slot::Subs(0)], | |
| 1327 | + ); | |
| 1328 | +} | |
| 1329 | + | |
| 1330 | +/// ...and the Sources list is *built* through that ordering rather than by | |
| 1331 | +/// appending the subtitle groups after the media rows, which is what put a | |
| 1332 | +/// film's own tracks at the end of the list. | |
| 1333 | +#[test] | |
| 1334 | +fn the_sources_list_is_built_through_the_ordering() { | |
| 1335 | + let dock = src_text("ui/dock_stance.rs"); | |
| 1336 | + let tab = &dock[dock.find("fn sources_tab").expect("no sources tab")..]; | |
| 1337 | + assert!( | |
| 1338 | + tab.contains("source_list_order(&media, &subs)"), | |
| 1339 | + "the Sources list no longer goes through source_list_order" | |
| 1340 | + ); | |
| 1341 | + assert!( | |
| 1342 | + !tab.contains("row_elements.extend(subtitles)"), | |
| 1343 | + "the subtitle groups are appended after every source again" | |
| 1344 | + ); | |
| 1345 | + // A parent already in the list gets the tracks bare, under it. | |
| 1346 | + let palette = &dock[dock.find("fn subtitle_tab_rows").expect("no subtitle rows")..]; | |
| 1347 | + assert!( | |
| 1348 | + palette.contains("let nested = parents.contains(&group.path)") | |
| 1349 | + && palette.contains("let has_header = !nested || track_count > 3"), | |
| 1350 | + "a group under its own parent still draws a group row" | |
| 1351 | + ); | |
| 1352 | +} | |
| 1353 | + | |
| 1354 | +/// Two files whose rows read the same word are told apart on the metadata | |
| 1355 | +/// line -- the folder, or `#n` when the folder is shared too. | |
| 1356 | +#[test] | |
| 1357 | +fn same_named_files_are_told_apart_on_the_metadata_line() { | |
| 1358 | + let three: Vec<Source> = ["/a/rec.mp4", "/b/rec.mp4", "/a/solo.mp4"] | |
| 1359 | + .into_iter() | |
| 1360 | + .map(|path| Source { | |
| 1361 | + path: PathBuf::from(path), | |
| 1362 | + audio_stream: 0, | |
| 1363 | + }) | |
| 1364 | + .collect(); | |
| 1365 | + let rows = library_rows(&three, &HashMap::new(), &HashMap::new(), None, |_| 90); | |
| 1366 | + assert_eq!( | |
| 1367 | + rows.iter().map(|row| row.detail.as_str()).collect::<Vec<_>>(), | |
| 1368 | + ["a", "b", ""], | |
| 1369 | + "twins say which folder they came out of" | |
| 1370 | + ); | |
| 1371 | + let twins: Vec<Source> = ["/a/rec.mp4", "/a/rec.mkv"] | |
| 1372 | + .into_iter() | |
| 1373 | + .map(|path| Source { | |
| 1374 | + path: PathBuf::from(path), | |
| 1375 | + audio_stream: 0, | |
| 1376 | + }) | |
| 1377 | + .collect(); | |
| 1378 | + let rows = library_rows(&twins, &HashMap::new(), &HashMap::new(), None, |_| 90); | |
| 1379 | + assert_eq!( | |
| 1380 | + rows.iter().map(|row| row.detail.as_str()).collect::<Vec<_>>(), | |
| 1381 | + ["#1", "#2"], | |
| 1382 | + "one folder, one stem: arrival order tells them apart" | |
| 1383 | + ); | |
| 1384 | +} | |
| 1385 | + | |
| 1295 | 1386 | /// A subtitle group's header in the Text tab must not vanish on a short |
| 1296 | 1387 | /// window: `subtitle_tab_rows` draws one per group unconditionally -- there |
| 1297 | 1388 | /// is no viewport-height gate on it at all any more, so the list under it |
| @@ -3904,6 +3995,70 @@ fn no_region_root_wears_a_focus_ring() { | ||
| 3904 | 3995 | } |
| 3905 | 3996 | |
| 3906 | 3997 | |
| 3998 | +/// The user could not find the three columns (2026-09-10: "I couldn't realize | |
| 3999 | +/// them when I look at"), because their heads were 12px `ink3` -- the room's | |
| 4000 | +/// quietest type -- with a prose tail running on after each one. DESIGN §3's | |
| 4001 | +/// new line: a room/column head is 15px Archivo 700 `ink1`, and the prose is a | |
| 4002 | +/// hover plate (DESIGN §8), never ambient text on the head itself. | |
| 4003 | +#[test] | |
| 4004 | +fn the_settings_columns_wear_room_heads_not_section_heads() { | |
| 4005 | + let source = src_text("ui/settings_stance.rs"); | |
| 4006 | + let start = source.find("fn room_head(").expect("the room head"); | |
| 4007 | + let body = &source[start..source[start..].find("\n}\n").unwrap() + start]; | |
| 4008 | + for needle in [ | |
| 4009 | + "type_scale::LABEL_ROW_PX", | |
| 4010 | + "FontWeight::BOLD", | |
| 4011 | + "rgb(INK1())", | |
| 4012 | + ".tooltip(", | |
| 4013 | + ".pb(px(12.))", | |
| 4014 | + ] { | |
| 4015 | + assert!(body.contains(needle), "a room head lost {needle}"); | |
| 4016 | + } | |
| 4017 | + assert!( | |
| 4018 | + !body.contains("INK3()") && !body.contains("type_scale::head()"), | |
| 4019 | + "the room heads fell back to the 12px in-list section head" | |
| 4020 | + ); | |
| 4021 | + // Each column head is one word, and its prose lives on the plate. | |
| 4022 | + for head in ["\"PROJECT\"", "\"EDITOR\"", "\"EXPORT\""] { | |
| 4023 | + assert!(source.contains(head), "the settings room lost its {head} head"); | |
| 4024 | + } | |
| 4025 | + for run_on in ["PROJECT \u{b7}", "EDITOR \u{b7}", "EXPORT \u{b7}"] { | |
| 4026 | + assert!( | |
| 4027 | + !source.contains(run_on), | |
| 4028 | + "a settings head grew its prose tail back: {run_on}" | |
| 4029 | + ); | |
| 4030 | + } | |
| 4031 | +} | |
| 4032 | + | |
| 4033 | +/// The Picture row said every refused format's reason after its value | |
| 4034 | +/// (`H.264 no picture -- an mp4 would \u{b7} AV1 no picture -- ...`; the user | |
| 4035 | +/// called it "funny"). A row says its own pick: one value, and a refusal only | |
| 4036 | +/// when *that* pick is the refused one. | |
| 4037 | +#[test] | |
| 4038 | +fn the_picture_row_tail_is_the_current_format_alone() { | |
| 4039 | + let source = src_text("ui/settings_stance.rs"); | |
| 4040 | + let start = source.find("fn export_section(").expect("the export section"); | |
| 4041 | + let body = &source[start..]; | |
| 4042 | + let body = &body[..body.find("\n/// The page itself").expect("the page's render fn")]; | |
| 4043 | + assert!( | |
| 4044 | + !body.contains("PICTURE_CYCLE"), | |
| 4045 | + "the Picture row walks the whole cycle to build its tail again" | |
| 4046 | + ); | |
| 4047 | + assert!( | |
| 4048 | + !body.contains(".join("), | |
| 4049 | + "an EXPORT row concatenates a list into one row's tail again" | |
| 4050 | + ); | |
| 4051 | + assert!( | |
| 4052 | + body.contains("format_refusal(session, format)"), | |
| 4053 | + "the Picture row's refusal is no longer asked about the current format" | |
| 4054 | + ); | |
| 4055 | + // Six words at most, and the value greys with the refusal it carries. | |
| 4056 | + assert!( | |
| 4057 | + body.contains("short_reason(&why)") && body.contains("picture_ink"), | |
| 4058 | + "the Picture row lost its short reason or its greyed value" | |
| 4059 | + ); | |
| 4060 | +} | |
| 4061 | + | |
| 3907 | 4062 | /// The monitoring level's home. Cleanse round 2 took the mute button, the |
| 3908 | 4063 | /// `- +` pair and the slider off the time band on the promise that the level |
| 3909 | 4064 | /// "lives in Settings" (DESIGN 5) -- a promise nothing kept until this row, |
crates/app/src/ui/dock_stance.rsmodified+113 -28
| @@ -521,6 +521,47 @@ fn source_row( | ||
| 521 | 521 | }) |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | +/// One entry of the Sources list, planned before anything is drawn: either a | |
| 525 | +/// media row or the subtitle group of some file. Plain data so the *order* -- | |
| 526 | +/// the branchy part -- can be tested without a window. | |
| 527 | +#[derive(Debug, PartialEq)] | |
| 528 | +pub(crate) enum Slot { | |
| 529 | + /// Index into the media rows. | |
| 530 | + Media(usize), | |
| 531 | + /// Index into the subtitle groups. | |
| 532 | + Subs(usize), | |
| 533 | +} | |
| 534 | + | |
| 535 | +/// Where each subtitle group belongs in the one Sources list: directly under | |
| 536 | +/// the source that carries it, never at the end of the list (user 2026-09-10, | |
| 537 | +/// "you put a video related subtitle to the end") -- a track that belongs to a | |
| 538 | +/// file is that file's subset and reads as one, so it follows the *last* row | |
| 539 | +/// naming that file, the way `library_rows` keeps a file's audio streams | |
| 540 | +/// together. A standalone `.srt` belongs to nobody and stays a top-level row | |
| 541 | +/// in arrival order, after the sources. | |
| 542 | +pub(crate) fn source_list_order(media: &[PathBuf], subs: &[PathBuf]) -> Vec<Slot> { | |
| 543 | + let mut slots = Vec::new(); | |
| 544 | + for (i, path) in media.iter().enumerate() { | |
| 545 | + slots.push(Slot::Media(i)); | |
| 546 | + if media[i + 1..].contains(path) { | |
| 547 | + continue; // a later row still names this file; its subs go under that one | |
| 548 | + } | |
| 549 | + slots.extend( | |
| 550 | + subs.iter() | |
| 551 | + .enumerate() | |
| 552 | + .filter(|(_, sub)| *sub == path) | |
| 553 | + .map(|(j, _)| Slot::Subs(j)), | |
| 554 | + ); | |
| 555 | + } | |
| 556 | + slots.extend( | |
| 557 | + subs.iter() | |
| 558 | + .enumerate() | |
| 559 | + .filter(|(_, sub)| !media.contains(sub)) | |
| 560 | + .map(|(j, _)| Slot::Subs(j)), | |
| 561 | + ); | |
| 562 | + slots | |
| 563 | +} | |
| 564 | + | |
| 524 | 565 | /// Imported subtitle tracks, grouped by their source -- the Text tab's own |
| 525 | 566 | /// rows (DESIGN.md's "text section ... not serving to anything", user |
| 526 | 567 | /// 2026-08-27: relocated off the unconditional spot under the source list |
| @@ -530,7 +571,11 @@ fn source_row( | ||
| 530 | 571 | /// hover fill and selection ring -- so Text stops reading as a second |
| 531 | 572 | /// dialect from Media/Audio. Hands back the track count for the tab header's |
| 532 | 573 | /// own count line, same as `rows.len()` does for the other two tabs. |
| 533 | -fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<AnyElement>) { | |
| 574 | +fn subtitle_tab_rows( | |
| 575 | + player: &Player, | |
| 576 | + parents: &[PathBuf], | |
| 577 | + cx: &mut Context<Player>, | |
| 578 | +) -> (usize, Vec<(PathBuf, usize, AnyElement)>) { | |
| 534 | 579 | let mut groups = match player.session.as_ref() { |
| 535 | 580 | Some(session) => subtitle_rows(session.subtitles()), |
| 536 | 581 | None => Vec::new(), |
| @@ -574,7 +619,13 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A | ||
| 574 | 619 | .into_iter() |
| 575 | 620 | .enumerate() |
| 576 | 621 | .map(|(group_ord, group)| { |
| 577 | - let folded = player.sub_folded.contains(&group.path); | |
| 622 | + // A source already in the list is this group's parent row: its | |
| 623 | + // tracks hang under it bare, with no `⸠name 1 track` row of their | |
| 624 | + // own to separate them from it. Past three, the disclosure comes | |
| 625 | + // back -- and arrives shut, so membership of `sub_folded` means | |
| 626 | + // the editor *opened* it there. | |
| 627 | + let nested = parents.contains(&group.path); | |
| 628 | + let group_path = group.path.clone(); | |
| 578 | 629 | let fold_path = group.path.clone(); |
| 579 | 630 | let tint = file_tint(player.sources(), &group.path); |
| 580 | 631 | let track_count = group.rows.len(); |
| @@ -716,19 +767,18 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A | ||
| 716 | 767 | ) |
| 717 | 768 | }) |
| 718 | 769 | .collect(); |
| 719 | - div() | |
| 720 | - .flex_none() | |
| 721 | - .flex() | |
| 722 | - .flex_col() | |
| 723 | - .gap(px(2.)) | |
| 724 | - .child( | |
| 725 | - div() | |
| 770 | + let has_header = !nested || track_count > 3; | |
| 771 | + let folded = has_header && (nested != player.sub_folded.contains(&group_path)); | |
| 772 | + let header = div() | |
| 726 | 773 | .id(("dock-subtitle-group", group_ord)) |
| 727 | 774 | .flex_none() |
| 728 | 775 | .flex() |
| 729 | 776 | .items_center() |
| 730 | 777 | .gap(px(6.)) |
| 731 | 778 | .px(px(8.)) |
| 779 | + // Stepped in under its parent when it has one, the | |
| 780 | + // same outline the track rows below it read as. | |
| 781 | + .when(nested, |d| d.pl(px(22.))) | |
| 732 | 782 | .py(px(4.)) |
| 733 | 783 | .rounded(px(3.)) |
| 734 | 784 | .cursor_pointer() |
| @@ -791,10 +841,19 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A | ||
| 791 | 841 | "{track_count} track{}", |
| 792 | 842 | if track_count == 1 { "" } else { "s" } |
| 793 | 843 | )), |
| 794 | - ), | |
| 795 | - ) | |
| 796 | - .when(!folded, |d| d.children(tracks)) | |
| 797 | - .into_any_element() | |
| 844 | + ); | |
| 845 | + ( | |
| 846 | + group_path, | |
| 847 | + track_count, | |
| 848 | + div() | |
| 849 | + .flex_none() | |
| 850 | + .flex() | |
| 851 | + .flex_col() | |
| 852 | + .gap(px(2.)) | |
| 853 | + .when(has_header, |d| d.child(header)) | |
| 854 | + .when(!folded, |d| d.children(tracks)) | |
| 855 | + .into_any_element(), | |
| 856 | + ) | |
| 798 | 857 | }) |
| 799 | 858 | .collect(); |
| 800 | 859 | (count, rows) |
| @@ -852,7 +911,7 @@ fn sources_tab( | ||
| 852 | 911 | }, |
| 853 | 912 | ); |
| 854 | 913 | let filter = player.dock_filter.to_lowercase(); |
| 855 | - let rows: Vec<(Row, usize)> = all_rows | |
| 914 | + let mut rows: Vec<(Row, usize)> = all_rows | |
| 856 | 915 | .into_iter() |
| 857 | 916 | .map(|row| { |
| 858 | 917 | let placed = player.row_ctx(&row.path, row.stream).placed; |
| @@ -865,23 +924,49 @@ fn sources_tab( | ||
| 865 | 924 | || ("unused".contains(&filter) && *placed == 0) |
| 866 | 925 | }) |
| 867 | 926 | .collect(); |
| 868 | - let mut row_elements: Vec<AnyElement> = rows | |
| 869 | - .iter() | |
| 870 | - .enumerate() | |
| 871 | - .map(|(i, (row, placed))| { | |
| 872 | - let picked = player | |
| 873 | - .selected_asset | |
| 874 | - .as_ref() | |
| 875 | - .is_some_and(|p| *p == (row.path.clone(), row.stream)); | |
| 876 | - source_row(player, i, row, *placed, picked, cx).into_any_element() | |
| 877 | - }) | |
| 878 | - .collect(); | |
| 879 | 927 | // The subtitle tracks join the same list rather than hiding behind a tab |
| 880 | 928 | // of their own: a standalone `.srt` is a source in the sense that matters |
| 881 | 929 | // here -- something that came in and can go on a lane -- and the tracks |
| 882 | - // inside a container stay grouped under the file that carries them. | |
| 883 | - let (_, subtitles) = subtitle_tab_rows(player, cx); | |
| 884 | - row_elements.extend(subtitles); | |
| 930 | + // inside a container are drawn *under* that file's own row | |
| 931 | + // ([`source_list_order`]), not after every other source. | |
| 932 | + let media: Vec<PathBuf> = rows.iter().map(|(row, _)| row.path.clone()).collect(); | |
| 933 | + let (_, subtitles) = subtitle_tab_rows(player, &media, cx); | |
| 934 | + let subs: Vec<PathBuf> = subtitles.iter().map(|(path, ..)| path.clone()).collect(); | |
| 935 | + // Past three tracks the group under a parent arrives shut, so the count | |
| 936 | + // goes on the parent's own metadata line -- the number stays readable | |
| 937 | + // while the rows it counts are folded away. | |
| 938 | + for (i, (row, _)) in rows.iter_mut().enumerate() { | |
| 939 | + if media[i + 1..].contains(&row.path) { | |
| 940 | + continue; | |
| 941 | + } | |
| 942 | + if let Some((_, n, _)) = subtitles | |
| 943 | + .iter() | |
| 944 | + .find(|(path, n, _)| *path == row.path && *n > 3) | |
| 945 | + { | |
| 946 | + row.detail = join_detail(&row.detail, &format!("{n} subs")); | |
| 947 | + } | |
| 948 | + } | |
| 949 | + let mut subtitles: Vec<Option<AnyElement>> = | |
| 950 | + subtitles.into_iter().map(|(.., el)| Some(el)).collect(); | |
| 951 | + let mut row_elements: Vec<AnyElement> = Vec::new(); | |
| 952 | + for slot in source_list_order(&media, &subs) { | |
| 953 | + match slot { | |
| 954 | + Slot::Media(i) => { | |
| 955 | + let (row, placed) = &rows[i]; | |
| 956 | + let picked = player | |
| 957 | + .selected_asset | |
| 958 | + .as_ref() | |
| 959 | + .is_some_and(|p| *p == (row.path.clone(), row.stream)); | |
| 960 | + row_elements | |
| 961 | + .push(source_row(player, i, row, *placed, picked, cx).into_any_element()); | |
| 962 | + } | |
| 963 | + Slot::Subs(j) => { | |
| 964 | + if let Some(el) = subtitles[j].take() { | |
| 965 | + row_elements.push(el); | |
| 966 | + } | |
| 967 | + } | |
| 968 | + } | |
| 969 | + } | |
| 885 | 970 | let filter_text: SharedString = player.dock_filter.clone().into(); |
| 886 | 971 | div() |
| 887 | 972 | .id("dock-sources") |
crates/app/src/ui/settings_stance.rsmodified+50 -29
| @@ -37,18 +37,27 @@ use crate::ui::type_scale; | ||
| 37 | 37 | use crate::*; |
| 38 | 38 | use engine::colorspace::ContentLight; |
| 39 | 39 | |
| 40 | -/// A 9px uppercase Archivo section head, `ink3` -- [`dock_stance::section_head`]'s | |
| 41 | -/// exact shape, repeated rather than imported across a `pub(crate)` seam for | |
| 42 | -/// one nine-line function. | |
| 43 | -fn section_head(text: impl Into<SharedString>) -> impl IntoElement { | |
| 44 | - let style = type_scale::head(); | |
| 40 | +/// The room's three anchors (user 2026-09-10: "I couldn't realize them when I | |
| 41 | +/// look at"): 15px Archivo 700 `ink1`, uppercase, with a row's own height of | |
| 42 | +/// air below (+12px past a row's gap) so a head reads as the start of a | |
| 43 | +/// column and not as one more line in it. The prose that used to trail each | |
| 44 | +/// head (`· stored in the .edith file`) is a hover plate on the head now, | |
| 45 | +/// ≤6 words -- DESIGN §8: a distinction that matters is a plate, not ambient | |
| 46 | +/// text. In-list section heads (the dock's own KEYS head) stay 12px | |
| 47 | +/// `ink3`. | |
| 48 | +fn room_head(id: &'static str, text: &'static str, tail: &'static str) -> impl IntoElement { | |
| 49 | + let style = type_scale::label(type_scale::LABEL_ROW_PX, gpui::FontWeight::BOLD); | |
| 50 | + let tail: SharedString = tail.into(); | |
| 45 | 51 | div() |
| 52 | + .id(id) | |
| 46 | 53 | .flex_none() |
| 47 | 54 | .pt(px(4.)) |
| 55 | + .pb(px(12.)) | |
| 48 | 56 | .font(style.font) |
| 49 | 57 | .text_size(style.size) |
| 50 | - .text_color(rgb(INK3())) | |
| 51 | - .child(text.into()) | |
| 58 | + .text_color(rgb(INK1())) | |
| 59 | + .tooltip(move |_, cx| cx.new(|_| Tip(tail.clone())).into()) | |
| 60 | + .child(text) | |
| 52 | 61 | } |
| 53 | 62 | |
| 54 | 63 | /// One row: a ≤16-char label, its current value in mono (units carried, |
| @@ -318,7 +327,11 @@ fn project_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen | ||
| 318 | 327 | .flex() |
| 319 | 328 | .flex_col() |
| 320 | 329 | .gap(px(2.)) |
| 321 | - .child(section_head("PROJECT · stored in the .edith file")) | |
| 330 | + .child(room_head( | |
| 331 | + "settings-head-project", | |
| 332 | + "PROJECT", | |
| 333 | + "stored in the .edith file", | |
| 334 | + )) | |
| 322 | 335 | .child(row_ink( |
| 323 | 336 | "settings-resolution", |
| 324 | 337 | "Resolution", |
| @@ -405,7 +418,11 @@ fn editor_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement | ||
| 405 | 418 | .flex() |
| 406 | 419 | .flex_col() |
| 407 | 420 | .gap(px(2.)) |
| 408 | - .child(section_head("EDITOR · this machine, this window")) | |
| 421 | + .child(room_head( | |
| 422 | + "settings-head-editor", | |
| 423 | + "EDITOR", | |
| 424 | + "this machine, this window", | |
| 425 | + )) | |
| 409 | 426 | // The monitoring level, which lost its slider when the time band was |
| 410 | 427 | // cleansed (DESIGN §5 -- "the level lives in Settings"). A readout and |
| 411 | 428 | // not a widget: the number is spent rarely, so the wheel over the row |
| @@ -567,8 +584,9 @@ pub(crate) fn picture_label(format: Format) -> String { | ||
| 567 | 584 | |
| 568 | 585 | /// The next file in [`PICTURE_CYCLE`] this machine can actually write. |
| 569 | 586 | /// `refused` is the same door [`Player::set_format`] asks, so the stroke never |
| 570 | -/// stops on a codec the setter would only refuse back -- the refused ones are | |
| 571 | -/// still *said*, on the row's own greyed tail (DESIGN §8: never hidden). | |
| 587 | +/// stops on a codec the setter would only refuse back -- a refusal is said on | |
| 588 | +/// the row only when the *current* pick is the refused one (DESIGN §8: never | |
| 589 | +/// hidden, never a list of the reasons for formats nobody picked). | |
| 572 | 590 | /// `current` where every other stop is refused, so `c` cannot cycle to |
| 573 | 591 | /// nothing. |
| 574 | 592 | pub(crate) fn next_picture(current: Format, refused: impl Fn(Format) -> bool) -> Format { |
| @@ -625,20 +643,18 @@ pub(crate) fn short_reason(why: &str) -> String { | ||
| 625 | 643 | /// the budget; the codec, the sound, the encoder and the range are here. |
| 626 | 644 | fn export_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { |
| 627 | 645 | let format = player.format; |
| 628 | - let refusals: Vec<String> = PICTURE_CYCLE | |
| 629 | - .into_iter() | |
| 630 | - .filter_map(|f| { | |
| 631 | - player | |
| 632 | - .session | |
| 633 | - .as_ref() | |
| 634 | - .and_then(|session| format_refusal(session, f)) | |
| 635 | - .map(|why| format!("{} {}", format_label(f), short_reason(&why))) | |
| 636 | - }) | |
| 637 | - .collect(); | |
| 638 | - // Never hidden (DESIGN §8): a codec this machine has no encoder for stays | |
| 639 | - // on the row, greyed, with the reason beside it -- the export card's own | |
| 640 | - // refusal rows, in the one place a codec is picked now. | |
| 641 | - let refused_tail = (!refusals.is_empty()).then(|| (refusals.join(" \u{b7} ").into(), INK4())); | |
| 646 | + // The row says *this* pick, and a refusal only where this pick is the one | |
| 647 | + // refused (user 2026-09-10: every other format's reason ran on after the | |
| 648 | + // value -- "funny"). Never hidden (DESIGN §8): when the current format is | |
| 649 | + // one this machine cannot write, the value greys and the reason stands | |
| 650 | + // beside it in six words; the formats a person is not on say nothing, | |
| 651 | + // because `c` never stops on them anyway ([`next_picture`]). | |
| 652 | + let refused_now: Option<(SharedString, u32)> = player | |
| 653 | + .session | |
| 654 | + .as_ref() | |
| 655 | + .and_then(|session| format_refusal(session, format)) | |
| 656 | + .map(|why| (short_reason(&why).into(), INK4())); | |
| 657 | + let picture_ink = if refused_now.is_some() { INK4() } else { INK1() }; | |
| 642 | 658 | let (codec, rated) = sound_codec(format); |
| 643 | 659 | let seat = player.encoder_seat(); |
| 644 | 660 | let av1_gpu = seat == EncoderSeat::Hardware && matches!(format, Format::Av1 | Format::Av1Mp4); |
| @@ -655,19 +671,24 @@ fn export_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement | ||
| 655 | 671 | .flex() |
| 656 | 672 | .flex_col() |
| 657 | 673 | .gap(px(2.)) |
| 658 | - .child(section_head("EXPORT \u{b7} what a delivery is written as")) | |
| 659 | - .child(row_chord( | |
| 674 | + .child(room_head( | |
| 675 | + "settings-head-export", | |
| 676 | + "EXPORT", | |
| 677 | + "what a delivery is written as", | |
| 678 | + )) | |
| 679 | + .child(row_full( | |
| 660 | 680 | "settings-export-picture", |
| 661 | 681 | "Picture", |
| 662 | 682 | picture_label(format), |
| 663 | 683 | "the codec the picture is written with and the box it lands in; the export moment asks only for the file and the budget", |
| 664 | - "c", | |
| 665 | - refused_tail, | |
| 684 | + Some("c".into()), | |
| 685 | + refused_now, | |
| 666 | 686 | player, |
| 667 | 687 | cx.listener(|this, _: &ClickEvent, _, cx| { |
| 668 | 688 | this.cycle_export_picture(); |
| 669 | 689 | cx.notify(); |
| 670 | 690 | }), |
| 691 | + picture_ink, | |
| 671 | 692 | )) |
| 672 | 693 | .children(rated.then(|| { |
| 673 | 694 | row_chord( |