🔥 remove(app): cleanse the dock — one list, one filter, one door in
Browse files at this commit000f4a46008e13b374e712878b3eb637951a22b2Parent: a3a997b10 changed files +346 -497
- DESIGN.md +13 -2
- crates/app/src/importing.rs +6 -48
- crates/app/src/main.rs +0 -4
- crates/app/src/menus.rs +35 -2
- crates/app/src/oracle.rs +4 -0
- crates/app/src/player/actions.rs +14 -0
- crates/app/src/tests/cards.rs +30 -14
- crates/app/src/tests/layout.rs +81 -47
- crates/app/src/ui/dock_stance.rs +161 -379
- crates/app/src/ui/overlays.rs +2 -1
DESIGN.mdmodified+13 -2
| @@ -135,8 +135,19 @@ Fixed geography; nothing moves, nothing occludes the picture: | |||
| 135 | cursor to be right-clicked on. `ink3` + chord, hover raises to `ink2` with the room's own | 135 | cursor to be right-clicked on. `ink3` + chord, hover raises to `ink2` with the room's own |
| 136 | plate, `CC` reads `ink1` + fill while subtitles are shown. State lives here, notices rise | 136 | plate, `CC` reads `ink1` + fill while subtitles are shown. State lives here, notices rise |
| 137 | from here. | 137 | from here. |
| 138 | -- **Dock** (right, the only side panel): Sources tab (assembly: filter, usage chips, import), | 138 | +- **Dock** (right, the only side panel): SOURCES tab, CLIP tab, KEYS tab. |
| 139 | - Clip tab (verbs: Speed / Colour / Transform / EQ as ghost verbs over param rows) and KEYS tab. | 139 | + **Cleanse round 2 (2026-09-10):** SOURCES is a filter and *one* list. The filter is the glass |
| 140 | + alone (`⌕`, no placeholder word); the list holds every source together — picture, sound and | ||
| 141 | + subtitle tracks — in arrival order, with no `Media / Audio / Text` sub-tabs, no sort row, no | ||
| 142 | + `MEDIA` or `IMPORT` head. A row is: dot · name **without its extension** (ellipsized, ≥60% of | ||
| 143 | + the width) · one right-edge ghost `+↵`; under it one metadata line, `H.264 · 01:39:18 · V1 A1` | ||
| 144 | + — codec, length, the lanes that play it (no decoder seat, no use count), which is also where a | ||
| 145 | + row says what kind it is. Preview is a double-click or the row menu's `Preview`; the stand-in | ||
| 146 | + is that menu's `Proxy` plus Settings. The foot is one row, `Add ^o`, and it takes a `.srt`/ | ||
| 147 | + `.vtt` as readily as an `.mkv`; `Paste path ^l` and `Import subtitles ^i` keep their strokes, | ||
| 148 | + their KEYS rows and the dock's own right-click menu. Empty list: the one noun `none`. | ||
| 149 | + CLIP tab: the per-clip verbs (Speed / Colour / Transform / EQ / Silence / Mix / Fit) as plain | ||
| 150 | + ghost rows — label + chord, no head styling — over the param rows they open. | ||
| 140 | 151 | ||
| 141 | **Amendment (2026-09-09), user decision "option C":** there is no rail. The 56px spine — every | 152 | **Amendment (2026-09-09), user decision "option C":** there is no rail. The 56px spine — every |
| 142 | command as a ghost glyph + chord down the left edge — is deleted, and the picture, time band, | 153 | command as a ghost glyph + chord down the left edge — is deleted, and the picture, time band, |
crates/app/src/importing.rsmodified+6 -48
| @@ -2,54 +2,12 @@ | |||
| 2 | 2 | ||
| 3 | use crate::*; | 3 | use crate::*; |
| 4 | 4 | ||
| 5 | -/// The library's three categories, in the order the giants list them: the | 5 | +// The library's three categories -- `LibraryTab::Media/Audio/Text`, their |
| 6 | -/// pictures, the sound, and the words. A file is in exactly one of them, so a | 6 | +// `holds` filter and their three empty nouns -- went with cleanse round 2 |
| 7 | -/// tab is a question with an answer rather than a filter with a guess. | 7 | +// (2026-09-10): the dock shows one list of everything and a row says its own |
| 8 | -#[derive(Clone, Copy, PartialEq, Eq, Debug)] | 8 | +// kind on its metadata line, so there is no tab to answer and no third empty |
| 9 | -pub(crate) enum LibraryTab { | 9 | +// word to keep in step. `is_subtitle` (subs.rs) is still the kind check the |
| 10 | - Media, | 10 | +// import fork reads. |
| 11 | - Audio, | ||
| 12 | - Text, | ||
| 13 | -} | ||
| 14 | - | ||
| 15 | -pub(crate) const LIBRARY_TABS: [LibraryTab; 3] = | ||
| 16 | - [LibraryTab::Media, LibraryTab::Audio, LibraryTab::Text]; | ||
| 17 | - | ||
| 18 | -impl LibraryTab { | ||
| 19 | - pub(crate) fn label(self) -> &'static str { | ||
| 20 | - match self { | ||
| 21 | - LibraryTab::Media => "Media", | ||
| 22 | - LibraryTab::Audio => "Audio", | ||
| 23 | - LibraryTab::Text => "Text", | ||
| 24 | - } | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - /// Whether a source belongs on this tab. Text mirrors Media/Audio's own | ||
| 28 | - /// rule -- an extension-only kind check, [`is_subtitle`] -- rather than | ||
| 29 | - /// the `false` it used to hardcode: a standalone `.srt`/`.vtt`/`.ass` is | ||
| 30 | - /// a Text source in the same sense an `.mp3` is an Audio one. A track | ||
| 31 | - /// *inside* a container (a Matroska's embedded track) never reaches this | ||
| 32 | - /// check at all -- the Text tab's rows are built from | ||
| 33 | - /// [`crate::subs::subtitle_rows`] grouped by source, not filtered off | ||
| 34 | - /// [`crate::library_meta::library_rows`] the way Media/Audio's are -- so | ||
| 35 | - /// this only ever gates a standalone subtitle file. | ||
| 36 | - pub(crate) fn holds(self, path: &Path) -> bool { | ||
| 37 | - match self { | ||
| 38 | - LibraryTab::Media => !engine::is_audio(path), | ||
| 39 | - LibraryTab::Audio => engine::is_audio(path), | ||
| 40 | - LibraryTab::Text => is_subtitle(path), | ||
| 41 | - } | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - /// What an empty tab says instead of being a blank column. | ||
| 45 | - pub(crate) fn empty(self) -> &'static str { | ||
| 46 | - match self { | ||
| 47 | - LibraryTab::Media => "No video", | ||
| 48 | - LibraryTab::Audio => "none", | ||
| 49 | - LibraryTab::Text => "No subtitles", | ||
| 50 | - } | ||
| 51 | - } | ||
| 52 | -} | ||
| 53 | 11 | ||
| 54 | /// What is known about a source's audio. Three states and not two, because a | 12 | /// What is known about a source's audio. Three states and not two, because a |
| 55 | /// file whose peaks have not come back yet must not be drawn as one that has no | 13 | /// file whose peaks have not come back yet must not be drawn as one that has no |
crates/app/src/main.rsmodified+0 -4
| @@ -207,7 +207,6 @@ struct Player { | |||
| 207 | /// Which category of the library is being looked at. A tab and not a | 207 | /// Which category of the library is being looked at. A tab and not a |
| 208 | /// filter box: the categories are what the media *is*, and every editor | 208 | /// filter box: the categories are what the media *is*, and every editor |
| 209 | /// this one is measured against splits its pool the same way. | 209 | /// this one is measured against splits its pool the same way. |
| 210 | - library_tab: LibraryTab, | ||
| 211 | /// Which of the darkroom dock's Src/Clip tabs is showing (DESIGN §5). | 210 | /// Which of the darkroom dock's Src/Clip tabs is showing (DESIGN §5). |
| 212 | /// `Player`-owned rather than the process-global static it used to be | 211 | /// `Player`-owned rather than the process-global static it used to be |
| 213 | /// (VIOLATION 3), and persisted the way `ui::theme`'s pick is | 212 | /// (VIOLATION 3), and persisted the way `ui::theme`'s pick is |
| @@ -222,7 +221,6 @@ struct Player { | |||
| 222 | pub(crate) dock_filter: String, | 221 | pub(crate) dock_filter: String, |
| 223 | pub(crate) dock_filter_edit: bool, | 222 | pub(crate) dock_filter_edit: bool, |
| 224 | /// Which of the four sort chips is showing (MOCK-SPEC "Dock" §3). | 223 | /// Which of the four sort chips is showing (MOCK-SPEC "Dock" §3). |
| 225 | - pub(crate) dock_sort: ui::dock_stance::DockSort, | ||
| 226 | /// What is known about each source's audio, taken once and kept. Keyed on | 224 | /// What is known about each source's audio, taken once and kept. Keyed on |
| 227 | /// the path *and stream* -- two streams of one file are two envelopes -- and | 225 | /// the path *and stream* -- two streams of one file are two envelopes -- and |
| 228 | /// the key is inserted the moment the decode is *started*: presence means | 226 | /// the key is inserted the moment the decode is *started*: presence means |
| @@ -908,11 +906,9 @@ fn main() { | |||
| 908 | picker: None, | 906 | picker: None, |
| 909 | library_menu: None, | 907 | library_menu: None, |
| 910 | selected_asset: None, | 908 | selected_asset: None, |
| 911 | - library_tab: LibraryTab::Media, | ||
| 912 | dock_src_active: ui::dock_stance::load(), | 909 | dock_src_active: ui::dock_stance::load(), |
| 913 | dock_filter: String::new(), | 910 | dock_filter: String::new(), |
| 914 | dock_filter_edit: false, | 911 | dock_filter_edit: false, |
| 915 | - dock_sort: ui::dock_stance::DockSort::Recent, | ||
| 916 | waves: HashMap::new(), | 912 | waves: HashMap::new(), |
| 917 | thumbs: HashMap::new(), | 913 | thumbs: HashMap::new(), |
| 918 | proxies: HashMap::new(), | 914 | proxies: HashMap::new(), |
crates/app/src/menus.rsmodified+35 -2
| @@ -22,6 +22,12 @@ pub(crate) enum MenuOn { | |||
| 22 | /// A lane head: the verbs of the track itself, on the lane the menu | 22 | /// A lane head: the verbs of the track itself, on the lane the menu |
| 23 | /// already names ([`oracle::lane_items`]). | 23 | /// already names ([`oracle::lane_items`]). |
| 24 | Head, | 24 | Head, |
| 25 | + /// The dock's Sources body, anywhere its rows are not: the ways *in* | ||
| 26 | + /// ([`DOCK_ITEMS`]). Cleanse round 2 took `Paste path` and `Import | ||
| 27 | + /// subtitles` out of the footer, and this is the door they kept -- an | ||
| 28 | + /// empty library included, which is exactly when a pasted path is worth | ||
| 29 | + /// most. The lane field means nothing here and no row reads it. | ||
| 30 | + Dock, | ||
| 25 | } | 31 | } |
| 26 | 32 | ||
| 27 | /// An open clip menu: what it was opened on, where it hangs, and whether it | 33 | /// An open clip menu: what it was opened on, where it hangs, and whether it |
| @@ -127,6 +133,14 @@ pub(crate) type ChoiceRow = (Choice, SharedString, SharedString, bool); | |||
| 127 | #[derive(Clone, Copy, PartialEq)] | 133 | #[derive(Clone, Copy, PartialEq)] |
| 128 | pub(crate) enum RowItem { | 134 | pub(crate) enum RowItem { |
| 129 | Add, | 135 | Add, |
| 136 | + /// Play the source outside the timeline ([`Player::open_preview`]). The | ||
| 137 | + /// row's `▷` ghost until cleanse round 2 (2026-09-10); a double-click on | ||
| 138 | + /// the row is the other door. | ||
| 139 | + Preview, | ||
| 140 | + /// Make or delete the source's stand-in ([`Player::toggle_proxy`]) -- the | ||
| 141 | + /// row's `○` ghost until the same cleanse. Settings carries the policy; | ||
| 142 | + /// this is the one file. | ||
| 143 | + Proxy, | ||
| 130 | Remove, | 144 | Remove, |
| 131 | /// Remove that first deletes every clip playing the row. The plain | 145 | /// Remove that first deletes every clip playing the row. The plain |
| 132 | /// [`RowItem::Remove`] is refused while any clip plays a source (the | 146 | /// [`RowItem::Remove`] is refused while any clip plays a source (the |
| @@ -139,8 +153,10 @@ pub(crate) enum RowItem { | |||
| 139 | Properties, | 153 | Properties, |
| 140 | } | 154 | } |
| 141 | 155 | ||
| 142 | -pub(crate) const ROW_ITEMS: [RowItem; 5] = [ | 156 | +pub(crate) const ROW_ITEMS: [RowItem; 7] = [ |
| 143 | RowItem::Add, | 157 | RowItem::Add, |
| 158 | + RowItem::Preview, | ||
| 159 | + RowItem::Proxy, | ||
| 144 | RowItem::Remove, | 160 | RowItem::Remove, |
| 145 | RowItem::RemoveWithClips, | 161 | RowItem::RemoveWithClips, |
| 146 | RowItem::Reveal, | 162 | RowItem::Reveal, |
| @@ -151,6 +167,8 @@ impl RowItem { | |||
| 151 | pub(crate) fn label(self) -> &'static str { | 167 | pub(crate) fn label(self) -> &'static str { |
| 152 | match self { | 168 | match self { |
| 153 | Self::Add => "Add at playhead", | 169 | Self::Add => "Add at playhead", |
| 170 | + Self::Preview => "Preview", | ||
| 171 | + Self::Proxy => "Proxy", | ||
| 154 | Self::Remove => "Remove from library", | 172 | Self::Remove => "Remove from library", |
| 155 | // The consequence is in the label now rather than in the hint | 173 | // The consequence is in the label now rather than in the hint |
| 156 | // column beside a label identical to the plain remove's: that | 174 | // column beside a label identical to the plain remove's: that |
| @@ -179,7 +197,12 @@ impl RowItem { | |||
| 179 | pub(crate) fn hint(self) -> &'static str { | 197 | pub(crate) fn hint(self) -> &'static str { |
| 180 | match self { | 198 | match self { |
| 181 | Self::Add => "↵", | 199 | Self::Add => "↵", |
| 182 | - Self::Remove | Self::RemoveWithClips | Self::Reveal | Self::Properties => "", | 200 | + Self::Preview |
| 201 | + | Self::Proxy | ||
| 202 | + | Self::Remove | ||
| 203 | + | Self::RemoveWithClips | ||
| 204 | + | Self::Reveal | ||
| 205 | + | Self::Properties => "", | ||
| 183 | } | 206 | } |
| 184 | } | 207 | } |
| 185 | } | 208 | } |
| @@ -250,6 +273,16 @@ pub(crate) const BENCH_ITEMS: [ActionId; 10] = [ | |||
| 250 | ActionId::Redo, | 273 | ActionId::Redo, |
| 251 | ]; | 274 | ]; |
| 252 | 275 | ||
| 276 | +/// What a right-click on the dock's Sources body offers: the three ways a | ||
| 277 | +/// file gets in. Every one is an [`ActionId`] the keyboard already reaches, | ||
| 278 | +/// so the row's label and its chord come out of the registry -- the dock | ||
| 279 | +/// itself only draws one of them (`Add`) as a row of its own now. | ||
| 280 | +pub(crate) const DOCK_ITEMS: [ActionId; 3] = [ | ||
| 281 | + ActionId::AddFiles, | ||
| 282 | + ActionId::PasteFilePath, | ||
| 283 | + ActionId::ImportSubtitles, | ||
| 284 | +]; | ||
| 285 | + | ||
| 253 | /// The tracks a lane head's menu can add, in the order it lists them. Its | 286 | /// The tracks a lane head's menu can add, in the order it lists them. Its |
| 254 | /// remove is the one of the clicked lane's own kind and comes from | 287 | /// remove is the one of the clicked lane's own kind and comes from |
| 255 | /// [`oracle::lane_items`], which is what puts it under the rule line. | 288 | /// [`oracle::lane_items`], which is what puts it under the rule line. |
crates/app/src/oracle.rsmodified+4 -0
| @@ -449,6 +449,10 @@ pub(crate) fn row_enable(item: RowItem, ctx: RowCtx) -> Enable { | |||
| 449 | // Dimmed and saying why rather than clicked and refused afterwards: the | 449 | // Dimmed and saying why rather than clicked and refused afterwards: the |
| 450 | // row's own grey already says the file cannot join this timeline. | 450 | // row's own grey already says the file cannot join this timeline. |
| 451 | RowItem::Add if !ctx.usable => Enable::No("it cannot join this one"), | 451 | RowItem::Add if !ctx.usable => Enable::No("it cannot join this one"), |
| 452 | + // A file the engine cannot read has nothing to play and nothing to | ||
| 453 | + // make a stand-in from: hidden rather than dimmed, the way the two | ||
| 454 | + // removes are, because neither verb has a state that would light it. | ||
| 455 | + RowItem::Preview | RowItem::Proxy if !ctx.usable => Enable::Hidden("it cannot be read"), | ||
| 452 | // The two removes are one verb with two shapes, and exactly one of | 456 | // The two removes are one verb with two shapes, and exactly one of |
| 453 | // them is ever on the plate: the plain one while nothing plays the | 457 | // them is ever on the plate: the plain one while nothing plays the |
| 454 | // source, the clips-too one while something does. Hidden rather than | 458 | // source, the clips-too one while something does. Hidden rather than |
crates/app/src/player/actions.rsmodified+14 -0
| @@ -486,6 +486,20 @@ impl Player { | |||
| 486 | self.library_menu = None; | 486 | self.library_menu = None; |
| 487 | self.remove_source_and_clips(&menu.path, menu.stream, cx); | 487 | self.remove_source_and_clips(&menu.path, menu.stream, cx); |
| 488 | } | 488 | } |
| 489 | + // The row's two former ghosts (`▷`, `○`), each still the one | ||
| 490 | + // implementation it always called (cleanse round 2). | ||
| 491 | + RowItem::Preview => { | ||
| 492 | + self.library_menu = None; | ||
| 493 | + self.open_preview(&menu.path, menu.stream, cx); | ||
| 494 | + } | ||
| 495 | + RowItem::Proxy => { | ||
| 496 | + self.library_menu = None; | ||
| 497 | + let stops = matches!( | ||
| 498 | + self.proxies.get(&menu.path), | ||
| 499 | + Some(Proxy::Making(_) | Proxy::Cancelling(_)) | ||
| 500 | + ); | ||
| 501 | + self.toggle_proxy(&menu.path, stops, cx); | ||
| 502 | + } | ||
| 489 | RowItem::Reveal => { | 503 | RowItem::Reveal => { |
| 490 | self.library_menu = None; | 504 | self.library_menu = None; |
| 491 | // Another process starting: off the UI thread, exactly as the | 505 | // Another process starting: off the UI thread, exactly as the |
crates/app/src/tests/cards.rsmodified+30 -14
| @@ -2041,39 +2041,55 @@ fn darkroom_preview_mounts_stop_and_drag_scrub() { | |||
| 2041 | ); | 2041 | ); |
| 2042 | } | 2042 | } |
| 2043 | 2043 | ||
| 2044 | -/// Source management must stay reachable in the Darkroom itself: per-row | 2044 | +/// Source management must stay reachable in the Darkroom itself: pointer |
| 2045 | -/// stand-in control/progress, pointer Add-at-playhead alongside its `↵` chord, | 2045 | +/// Add-at-playhead alongside its `↵` chord on the row, and -- since cleanse |
| 2046 | -/// and the three legacy source questions as dock filters. The test reads the | 2046 | +/// round 2 (2026-09-10) took the `▷` and `○` ghosts off the row -- preview |
| 2047 | +/// and the per-file stand-in in the row's own right-click menu, each still | ||
| 2048 | +/// calling the one implementation it always called. The test reads the | ||
| 2047 | /// mounted dock source because this binary has no `TestAppContext` to inspect | 2049 | /// mounted dock source because this binary has no `TestAppContext` to inspect |
| 2048 | /// GPUI's painted controls. | 2050 | /// GPUI's painted controls. |
| 2049 | #[test] | 2051 | #[test] |
| 2050 | -fn darkroom_source_rows_keep_proxy_add_and_media_audio_text_paths() { | 2052 | +fn darkroom_source_rows_keep_proxy_add_and_preview_doors() { |
| 2051 | let dock = src_text("ui/dock_stance.rs"); | 2053 | let dock = src_text("ui/dock_stance.rs"); |
| 2052 | let row_at = dock.find("fn source_row(").expect("Darkroom source row"); | 2054 | let row_at = dock.find("fn source_row(").expect("Darkroom source row"); |
| 2053 | let row = &dock[row_at..]; | 2055 | let row = &dock[row_at..]; |
| 2054 | for needle in [ | 2056 | for needle in [ |
| 2055 | - "dock-proxy-toggle", | ||
| 2056 | - "toggle_proxy(&proxy_path, proxy_stops, cx)", | ||
| 2057 | - "proxy_progress.map", | ||
| 2058 | "dock-add-at-playhead", | 2057 | "dock-add-at-playhead", |
| 2059 | "Add at playhead — ↵ does the same", | 2058 | "Add at playhead — ↵ does the same", |
| 2060 | "this.insert_source(", | 2059 | "this.insert_source(", |
| 2061 | ] { | 2060 | ] { |
| 2062 | assert!( | 2061 | assert!( |
| 2063 | row.contains(needle), | 2062 | row.contains(needle), |
| 2064 | - "Darkroom source row lost `{needle}`: a source must keep its proxy control/progress \ | 2063 | + "Darkroom source row lost `{needle}`: a source must keep its \ |
| 2065 | - and mouse-reachable Add-at-playhead path" | 2064 | + mouse-reachable Add-at-playhead path" |
| 2066 | ); | 2065 | ); |
| 2067 | } | 2066 | } |
| 2067 | + // The two former ghosts, in the menu the same row opens. | ||
| 2068 | + assert!( | ||
| 2069 | + crate::ROW_ITEMS.contains(&crate::RowItem::Preview) | ||
| 2070 | + && crate::ROW_ITEMS.contains(&crate::RowItem::Proxy), | ||
| 2071 | + "the row menu lost Preview or Proxy" | ||
| 2072 | + ); | ||
| 2073 | + let actions = src_text("player/actions.rs"); | ||
| 2068 | for needle in [ | 2074 | for needle in [ |
| 2069 | - "LIBRARY_TABS.map", | 2075 | + "self.open_preview(&menu.path, menu.stream, cx);", |
| 2076 | + "self.toggle_proxy(&menu.path, stops, cx);", | ||
| 2077 | + ] { | ||
| 2078 | + assert!( | ||
| 2079 | + actions.contains(needle), | ||
| 2080 | + "the row menu's `{needle}` is a second implementation, not the door" | ||
| 2081 | + ); | ||
| 2082 | + } | ||
| 2083 | + // One list, no sub-tabs: a row says its kind on its own metadata line. | ||
| 2084 | + for gone in [ | ||
| 2085 | + "LIBRARY_TABS", | ||
| 2086 | + "library_tab", | ||
| 2070 | "dock-source-filter", | 2087 | "dock-source-filter", |
| 2071 | - "player.library_tab.holds(&row.path)", | 2088 | + "dock.sort.cycle", |
| 2072 | - "true => player.library_tab.empty().to_string(),", | ||
| 2073 | ] { | 2089 | ] { |
| 2074 | assert!( | 2090 | assert!( |
| 2075 | - dock.contains(needle), | 2091 | + !dock.contains(gone), |
| 2076 | - "Darkroom Sources lost `{needle}`: Media, Audio, and Text must remain distinct paths" | 2092 | + "the dock still carries `{gone}`: Sources is one list now" |
| 2077 | ); | 2093 | ); |
| 2078 | } | 2094 | } |
| 2079 | } | 2095 | } |
crates/app/src/tests/layout.rsmodified+81 -47
| @@ -1210,46 +1210,54 @@ fn the_subtitles_toggle_says_what_is_placed_and_never_the_picked_row() { | |||
| 1210 | ); | 1210 | ); |
| 1211 | } | 1211 | } |
| 1212 | 1212 | ||
| 1213 | -/// The door this editor answers "don't make me import the film again" with, | 1213 | +/// The door this editor answers "don't make me import the film again" with: |
| 1214 | -/// and it is in the dock's IMPORT section beside the other two imports | 1214 | +/// it reads a file's subtitle tracks onto the open timeline -- a release's |
| 1215 | -/// (`ui/dock_stance.rs`'s own doc comment: it moved off the old rail's crowded | 1215 | +/// `.mkv`, an `.srt` beside it -- while the file itself joins nothing. |
| 1216 | -/// TRACK group here): reads a file's subtitle tracks onto the open timeline | 1216 | +/// |
| 1217 | -/// -- a release's `.mkv`, an `.srt` beside it -- while the file itself | 1217 | +/// Cleanse round 2 (2026-09-10) took its ghost row out of the dock's footer |
| 1218 | -/// joins nothing. It is the *action* and not a second implementation of it, | 1218 | +/// along with the `IMPORT` head: one `Add` row is the dock's one door, and |
| 1219 | -/// so the button, the stroke and the actions card cannot drift apart, and | 1219 | +/// `Add` itself forks a subtitle file to the same place. The verb keeps its |
| 1220 | -/// it is oracle-gated like every other verb in the dock, so with no timeline | 1220 | +/// stroke, its KEYS row, and a pointer door of its own -- the dock's |
| 1221 | -/// open it dims and says why instead of opening a chooser for nothing. | 1221 | +/// right-click menu ([`DOCK_ITEMS`]), which an *empty* library carries too. |
| 1222 | -#[test] | 1222 | +/// It is the action and not a second implementation of it, so the row, the |
| 1223 | -fn the_text_tab_carries_the_add_subtitles_door() { | 1223 | +/// stroke and the actions card cannot drift apart, and the menu row is |
| 1224 | +/// oracle-gated like every other, so with no timeline open it dims and says | ||
| 1225 | +/// why instead of opening a chooser for nothing. | ||
| 1226 | +#[test] | ||
| 1227 | +fn the_dock_menu_carries_the_add_subtitles_door() { | ||
| 1228 | + use crate::{ActionId, DOCK_ITEMS}; | ||
| 1229 | + assert!( | ||
| 1230 | + DOCK_ITEMS.contains(&ActionId::ImportSubtitles) | ||
| 1231 | + && DOCK_ITEMS.contains(&ActionId::PasteFilePath) | ||
| 1232 | + && DOCK_ITEMS.contains(&ActionId::AddFiles), | ||
| 1233 | + "the dock's right-click menu lost one of the three ways in" | ||
| 1234 | + ); | ||
| 1235 | + // ...and that menu is actually opened from the Sources body. | ||
| 1224 | let dock = src_text("ui/dock_stance.rs"); | 1236 | let dock = src_text("ui/dock_stance.rs"); |
| 1225 | - let at = dock | ||
| 1226 | - .find("\"dock-import-subtitles\"") | ||
| 1227 | - .expect("no import-subtitles control in the dock"); | ||
| 1228 | - let block = &dock[at..(at + 500).min(dock.len())]; | ||
| 1229 | assert!( | 1237 | assert!( |
| 1230 | - block.contains("ActionId::ImportSubtitles"), | 1238 | + dock.contains("on: MenuOn::Dock,"), |
| 1231 | - "the button is a door of its own rather than the action: {block}" | 1239 | + "nothing in the dock opens the menu that now carries the two imports" |
| 1232 | ); | 1240 | ); |
| 1241 | + // The rows are drawn from `DOCK_ITEMS` by the one menu render. | ||
| 1242 | + let overlays = src_text("ui/overlays.rs"); | ||
| 1233 | assert!( | 1243 | assert!( |
| 1234 | - block.contains("this.act(ActionId::ImportSubtitles"), | 1244 | + overlays.contains("MenuOn::Dock => DOCK_ITEMS.to_vec(),"), |
| 1235 | - "the button does not dispatch through the action oracle: {block}" | 1245 | + "the dock menu draws something other than the three import actions" |
| 1236 | ); | 1246 | ); |
| 1237 | // `act(ActionId::ImportSubtitles, ...)` routes to `pick_and_add_subtitles` | 1247 | // `act(ActionId::ImportSubtitles, ...)` routes to `pick_and_add_subtitles` |
| 1238 | - // -- the button names the action, not a second implementation of it. | 1248 | + // -- the row names the action, not a second implementation of it. |
| 1239 | let actions = src_text("player/actions.rs"); | 1249 | let actions = src_text("player/actions.rs"); |
| 1240 | assert!( | 1250 | assert!( |
| 1241 | actions.contains("ActionId::ImportSubtitles => self.pick_and_add_subtitles(cx)"), | 1251 | actions.contains("ActionId::ImportSubtitles => self.pick_and_add_subtitles(cx)"), |
| 1242 | "ImportSubtitles no longer opens the subtitle chooser" | 1252 | "ImportSubtitles no longer opens the subtitle chooser" |
| 1243 | ); | 1253 | ); |
| 1244 | - // `ghost_verb` is the oracle-gated one: dimmed with the refusal in the | 1254 | + // A subtitle file taken through the plain `Add files` door lands as |
| 1245 | - // oracle's own words (`player.enable(action, None)` in its own body). | 1255 | + // subtitles rather than as a source that cannot be read. |
| 1256 | + let library = src_text("player/library.rs"); | ||
| 1246 | assert!( | 1257 | assert!( |
| 1247 | - dock[..at].ends_with("ghost_verb(\n "), | 1258 | + library.contains("if is_subtitle(path) {"), |
| 1248 | - "the add-subtitles button is not built from the oracle-gated ghost_verb" | 1259 | + "Add files no longer forks a .srt/.vtt to the subtitle list" |
| 1249 | ); | 1260 | ); |
| 1250 | - // ...and the empty tab stays a noun, not a sentence pointing at the | ||
| 1251 | - // button (DESIGN §8, 2026-08-27: no instructional copy). | ||
| 1252 | - assert_eq!(crate::LibraryTab::Text.empty(), "No subtitles"); | ||
| 1253 | } | 1261 | } |
| 1254 | 1262 | ||
| 1255 | /// The Darkroom keeps imported subtitle tracks in the Text tab itself (moved | 1263 | /// The Darkroom keeps imported subtitle tracks in the Text tab itself (moved |
| @@ -2644,9 +2652,9 @@ fn hitmap_names_every_darkroom_pointer_entry_surface() { | |||
| 2644 | for needle in [ | 2652 | for needle in [ |
| 2645 | "subtitle.{group_ord}.{track}.row", | 2653 | "subtitle.{group_ord}.{track}.row", |
| 2646 | "subtitle.{group_ord}.{track}.select", | 2654 | "subtitle.{group_ord}.{track}.select", |
| 2647 | - "source.{i}.preview", | 2655 | + "source.{i}.row", |
| 2648 | - "source.{i}.proxy", | 2656 | + "source.{i}.add", |
| 2649 | - "Proxy making", | 2657 | + "dock.filter", |
| 2650 | ] { | 2658 | ] { |
| 2651 | assert!( | 2659 | assert!( |
| 2652 | dock.contains(needle), | 2660 | dock.contains(needle), |
| @@ -2939,32 +2947,54 @@ fn a_source_row_shows_its_name_before_anything_else() { | |||
| 2939 | !row.contains(".min_w(px(0.))"), | 2947 | !row.contains(".min_w(px(0.))"), |
| 2940 | "the row name is still allowed to measure nothing" | 2948 | "the row name is still allowed to measure nothing" |
| 2941 | ); | 2949 | ); |
| 2942 | - // The usage moved to the second line, beside codec/length, in ink3. | 2950 | + // Cleanse round 2: the name is what the editor calls the film, not what |
| 2951 | + // the filesystem calls the bytes. | ||
| 2943 | assert!( | 2952 | assert!( |
| 2944 | - row.contains(r#".child(format!("{usage} · {under}"))"#), | 2953 | + row.contains("let name: SharedString = stem(&row.name).into();"), |
| 2945 | - "usage is not folded into the metadata line" | 2954 | + "the row name still wears its extension" |
| 2946 | ); | 2955 | ); |
| 2947 | - // Preview / Add / proxy are glyph+chord ghosts now, not word buttons: | 2956 | + assert_eq!( |
| 2948 | - // ~66px for the three together, inside the 96px the name can spare. | 2957 | + crate::ui::dock_stance::stem("he_is_not_the_only_one.mp4"), |
| 2949 | - for glyph in [r#".child("▷")"#, r#".child("+")"#, r#".child("↵")"#] { | 2958 | + "he_is_not_the_only_one" |
| 2950 | - assert!(row.contains(glyph), "the right-edge verbs lost {glyph}"); | 2959 | + ); |
| 2951 | - } | 2960 | + // A file with several audio streams keeps the stream half of its name and |
| 2952 | - for word in [r#".child("Preview")"#, r#".child("Add")"#] { | 2961 | + // loses only the extension; a name that is all extension keeps it. |
| 2953 | - assert!(!row.contains(word), "{word} still spends the name's width"); | 2962 | + assert_eq!( |
| 2963 | + crate::ui::dock_stance::stem("A Film.mkv [audio 2]"), | ||
| 2964 | + "A Film [audio 2]" | ||
| 2965 | + ); | ||
| 2966 | + assert_eq!(crate::ui::dock_stance::stem(".srt"), ".srt"); | ||
| 2967 | + // One ghost on the right edge, and one only: preview and the stand-in | ||
| 2968 | + // moved into the row's own menu (`RowItem::Preview`/`Proxy`). | ||
| 2969 | + for glyph in [r#".child("+")"#, r#".child("↵")"#] { | ||
| 2970 | + assert!(row.contains(glyph), "the right-edge verb lost {glyph}"); | ||
| 2954 | } | 2971 | } |
| 2955 | - // Every verb keeps its own hitmap name and its chord. | 2972 | + for gone in [r#".child("▷")"#, "dock-proxy-toggle", "dock-preview"] { |
| 2956 | - for id in ["source.{i}.preview", "source.{i}.add", "source.{i}.proxy"] { | 2973 | + assert!(!row.contains(gone), "the row still carries `{gone}`"); |
| 2957 | - assert!(row.contains(id), "{id} lost its hitmap entry"); | ||
| 2958 | } | 2974 | } |
| 2975 | + assert!( | ||
| 2976 | + row.contains("source.{i}.add"), | ||
| 2977 | + "the add ghost lost its hitmap entry" | ||
| 2978 | + ); | ||
| 2979 | + // The metadata line is codec · length · lanes: no decoder seat, no use | ||
| 2980 | + // count (`usage_line` and the `seats` filter above it). | ||
| 2981 | + assert!( | ||
| 2982 | + row.contains(".map(Backend::label);") && row.contains(".child(under)"), | ||
| 2983 | + "the metadata line no longer drops the decoder seat" | ||
| 2984 | + ); | ||
| 2985 | + let usage = &dock[dock.find("fn usage_line(").expect("the usage line")..start]; | ||
| 2986 | + assert!(!usage.contains("use{}"), "the metadata line still counts uses"); | ||
| 2959 | // DESIGN §8: the permanent footer telling the editor how to use a list | 2987 | // DESIGN §8: the permanent footer telling the editor how to use a list |
| 2960 | // ("drag · ↵ add · double-click plays") is instructional copy and is gone. | 2988 | // ("drag · ↵ add · double-click plays") is instructional copy and is gone. |
| 2961 | assert!( | 2989 | assert!( |
| 2962 | !dock.contains("double-click plays"), | 2990 | !dock.contains("double-click plays"), |
| 2963 | "the dock still carries an instruction footer" | 2991 | "the dock still carries an instruction footer" |
| 2964 | ); | 2992 | ); |
| 2965 | - // ...and an Audio tab with no audio-only file in it is a single noun, not | 2993 | + // ...and an empty list is a single noun, whatever emptied it. |
| 2966 | - // the claim `No sound` over a source whose A1 stream is on the bench. | 2994 | + assert!( |
| 2967 | - assert_eq!(crate::LibraryTab::Audio.empty(), "none"); | 2995 | + dock.contains(r#".child("none"),"#), |
| 2996 | + "the empty dock says something other than the one noun" | ||
| 2997 | + ); | ||
| 2968 | } | 2998 | } |
| 2969 | 2999 | ||
| 2970 | /// A room key pressed while the ring sits in the dock has to reach the room. | 3000 | /// A room key pressed while the ring sits in the dock has to reach the room. |
| @@ -3744,8 +3774,12 @@ fn every_hitmap_control_wears_a_hover_line() { | |||
| 3744 | } | 3774 | } |
| 3745 | } | 3775 | } |
| 3746 | } | 3776 | } |
| 3777 | + // The floor moved 40 -> 35 with cleanse round 2 (2026-09-10): the dock | ||
| 3778 | + // gave up five named controls in one diff (the three sub-tabs, the sort | ||
| 3779 | + // cycle, the row's preview and stand-in ghosts, against one Add row kept) | ||
| 3780 | + // and a floor above the true count is a red gate, not a blindness check. | ||
| 3747 | assert!( | 3781 | assert!( |
| 3748 | - controls >= 40, | 3782 | + controls >= 35, |
| 3749 | "the hover sweep found only {controls} controls -- it has gone blind" | 3783 | "the hover sweep found only {controls} controls -- it has gone blind" |
| 3750 | ); | 3784 | ); |
| 3751 | assert!( | 3785 | assert!( |
crates/app/src/ui/dock_stance.rsmodified+161 -379
| @@ -68,44 +68,6 @@ pub(crate) fn save_maximized(maximized: bool) { | |||
| 68 | let _ = std::fs::write(path, if maximized { "1\n" } else { "0\n" }); | 68 | let _ = std::fs::write(path, if maximized { "1\n" } else { "0\n" }); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | -/// The Sources tab's four sort chips (MOCK-SPEC "Dock" §3). `Recent` is the | ||
| 72 | -/// library's own arrival order -- the only order this editor tracks without | ||
| 73 | -/// a fourth field to keep it in. | ||
| 74 | -#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)] | ||
| 75 | -pub(crate) enum DockSort { | ||
| 76 | - #[default] | ||
| 77 | - Recent, | ||
| 78 | - Name, | ||
| 79 | - Usage, | ||
| 80 | - Unused, | ||
| 81 | -} | ||
| 82 | - | ||
| 83 | -impl DockSort { | ||
| 84 | - const ALL: [DockSort; 4] = [ | ||
| 85 | - DockSort::Recent, | ||
| 86 | - DockSort::Name, | ||
| 87 | - DockSort::Usage, | ||
| 88 | - DockSort::Unused, | ||
| 89 | - ]; | ||
| 90 | - fn label(self) -> &'static str { | ||
| 91 | - match self { | ||
| 92 | - DockSort::Recent => "Recent", | ||
| 93 | - DockSort::Name => "Name", | ||
| 94 | - DockSort::Usage => "Usage", | ||
| 95 | - DockSort::Unused => "Unused", | ||
| 96 | - } | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - /// The next chip in the cycle, wrapping back to `Recent` -- the whole | ||
| 100 | - /// row collapsed to one ghost control that cycles on click instead of | ||
| 101 | - /// four chips fighting for the same line (user 2026-08-27: "too much | ||
| 102 | - /// chrome"). | ||
| 103 | - fn next(self) -> DockSort { | ||
| 104 | - let idx = Self::ALL.iter().position(|s| *s == self).unwrap_or(0); | ||
| 105 | - Self::ALL[(idx + 1) % Self::ALL.len()] | ||
| 106 | - } | ||
| 107 | -} | ||
| 108 | - | ||
| 109 | /// A ghost verb (DESIGN §4): borderless glyph/label in `ink2`, its chord in | 71 | /// A ghost verb (DESIGN §4): borderless glyph/label in `ink2`, its chord in |
| 110 | /// `ink3` beside it, read live off the keymap so it can never drift from the | 72 | /// `ink3` beside it, read live off the keymap so it can never drift from the |
| 111 | /// key that does the same thing. Hover is one fill step and an ink brighten; | 73 | /// key that does the same thing. Hover is one fill step and an ink brighten; |
| @@ -246,9 +208,10 @@ fn section_head(text: impl Into<SharedString>) -> impl IntoElement { | |||
| 246 | } | 208 | } |
| 247 | 209 | ||
| 248 | /// Every lane a source plays on right now, as its own `V1`/`A1` labels | 210 | /// Every lane a source plays on right now, as its own `V1`/`A1` labels |
| 249 | -/// (MOCK-SPEC "Dock" §4's usage line), plus how many clips altogether -- | 211 | +/// (MOCK-SPEC "Dock" §4's usage line). The clip *count* that used to trail it |
| 250 | -/// [`Player::row_ctx`]'s `placed` count, the same number the library card's | 212 | +/// ("2 uses") is gone with cleanse round 2 (2026-09-10): the lanes are the |
| 251 | -/// Remove refusal reads. | 213 | +/// answer to "is it in the film?", the number is a statistic, and the |
| 214 | +/// Properties side of the row menu still prints it whole. | ||
| 252 | fn usage_line(player: &Player, source_idx: usize, placed: usize) -> String { | 215 | fn usage_line(player: &Player, source_idx: usize, placed: usize) -> String { |
| 253 | if placed == 0 { | 216 | if placed == 0 { |
| 254 | return "unused".to_string(); | 217 | return "unused".to_string(); |
| @@ -266,11 +229,26 @@ fn usage_line(player: &Player, source_idx: usize, placed: usize) -> String { | |||
| 266 | .map(Lane::label) | 229 | .map(Lane::label) |
| 267 | .collect() | 230 | .collect() |
| 268 | }); | 231 | }); |
| 269 | - format!( | 232 | + lanes.join(" ") |
| 270 | - "{} · {placed} use{}", | 233 | +} |
| 271 | - lanes.join(" "), | 234 | + |
| 272 | - if placed == 1 { "" } else { "s" } | 235 | +/// The file's name without its extension -- what the editor calls the film, |
| 273 | - ) | 236 | +/// 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 given | ||
| 238 | +/// ([`library_meta::row_name`] appends it after the file name). | ||
| 239 | +/// | ||
| 240 | +/// corner-cut: private to the dock while U2's shared `stem()` is unlanded; | ||
| 241 | +/// the lead reconciles the two into `ui/widgets.rs` or `files.rs`. | ||
| 242 | +pub(crate) fn stem(name: &str) -> String { | ||
| 243 | + let (file, tail) = match name.split_once(" [") { | ||
| 244 | + Some((file, tail)) => (file, format!(" [{tail}")), | ||
| 245 | + None => (name, String::new()), | ||
| 246 | + }; | ||
| 247 | + match file.rsplit_once('.') { | ||
| 248 | + // A name that is *all* extension (".srt") keeps it: it is the name. | ||
| 249 | + Some(("", _)) | None => format!("{file}{tail}"), | ||
| 250 | + Some((base, _)) => format!("{base}{tail}"), | ||
| 251 | + } | ||
| 274 | } | 252 | } |
| 275 | 253 | ||
| 276 | /// One source row, two lines (MOCK-SPEC "Dock" §4): an ink dot, the name in | 254 | /// One source row, two lines (MOCK-SPEC "Dock" §4): an ink dot, the name in |
| @@ -289,70 +267,43 @@ fn source_row( | |||
| 289 | cx: &mut Context<Player>, | 267 | cx: &mut Context<Player>, |
| 290 | ) -> impl IntoElement { | 268 | ) -> impl IntoElement { |
| 291 | let usable = row.unusable.is_none(); | 269 | let usable = row.unusable.is_none(); |
| 292 | - let name: SharedString = row.name.clone().into(); | 270 | + let name: SharedString = stem(&row.name).into(); |
| 271 | + // The decoder seat (`HW`/`SW`) is off the row with cleanse round 2: the | ||
| 272 | + // codec is what the file *is*, the seat is how this machine happens to | ||
| 273 | + // read it today, and the transport line and the Properties side both | ||
| 274 | + // still say it. Read off `Backend::label` rather than a copy of those | ||
| 275 | + // words, so a renamed seat cannot leave a stale filter behind. | ||
| 276 | + let seats = [ | ||
| 277 | + Backend::Opening, | ||
| 278 | + Backend::Hardware, | ||
| 279 | + Backend::Software, | ||
| 280 | + Backend::Still, | ||
| 281 | + Backend::Gap, | ||
| 282 | + ] | ||
| 283 | + .map(Backend::label); | ||
| 284 | + let detail = row | ||
| 285 | + .detail | ||
| 286 | + .split(" · ") | ||
| 287 | + .filter(|part| !seats.contains(part)) | ||
| 288 | + .collect::<Vec<_>>() | ||
| 289 | + .join(" · "); | ||
| 293 | let under: String = match &row.unusable { | 290 | let under: String = match &row.unusable { |
| 294 | Some(why) => why.clone(), | 291 | Some(why) => why.clone(), |
| 295 | None => join_detail( | 292 | None => join_detail( |
| 296 | - &row.detail, | 293 | + &join_detail( |
| 297 | - &timecode(f64::from(row.frames) / player.fps, player.fps), | 294 | + &detail, |
| 295 | + &timecode(f64::from(row.frames) / player.fps, player.fps), | ||
| 296 | + ), | ||
| 297 | + &usage_line(player, row.tint, placed), | ||
| 298 | ), | 298 | ), |
| 299 | }; | 299 | }; |
| 300 | - let usage = usage_line(player, row.tint, placed); | ||
| 301 | let (path, stream) = (row.path.clone(), row.stream); | 300 | let (path, stream) = (row.path.clone(), row.stream); |
| 302 | let dragged = (path.clone(), stream); | 301 | let dragged = (path.clone(), stream); |
| 303 | - let preview_path = path.clone(); | ||
| 304 | let dot_path = path.clone(); | 302 | let dot_path = path.clone(); |
| 305 | let menu_path = path.clone(); | 303 | let menu_path = path.clone(); |
| 306 | let add_path = path.clone(); | 304 | let add_path = path.clone(); |
| 307 | - let proxy_path = path.clone(); | ||
| 308 | let ghost = name.clone(); | 305 | let ghost = name.clone(); |
| 309 | let can_insert = usable && player.session.is_some() && player.exporting().is_none(); | 306 | let can_insert = usable && player.session.is_some() && player.exporting().is_none(); |
| 310 | - let (proxy_glyph, proxy_on, proxy_progress, proxy_waiting, proxy_tip) = | ||
| 311 | - match player.proxies.get(&row.path) { | ||
| 312 | - Some(Proxy::Ready) => ( | ||
| 313 | - "●", | ||
| 314 | - true, | ||
| 315 | - None, | ||
| 316 | - false, | ||
| 317 | - format!("Stand-in ON for {} — click to delete it", row.name), | ||
| 318 | - ), | ||
| 319 | - Some(Proxy::Making(job)) => ( | ||
| 320 | - "■", | ||
| 321 | - true, | ||
| 322 | - Some(job.progress()), | ||
| 323 | - false, | ||
| 324 | - format!("Stop making the stand-in for {}", row.name), | ||
| 325 | - ), | ||
| 326 | - Some(Proxy::Cancelling(_)) => ( | ||
| 327 | - "■", | ||
| 328 | - true, | ||
| 329 | - None, | ||
| 330 | - true, | ||
| 331 | - format!("Stopping the stand-in for {}…", row.name), | ||
| 332 | - ), | ||
| 333 | - Some(Proxy::Asked(_)) => ( | ||
| 334 | - "○", | ||
| 335 | - false, | ||
| 336 | - None, | ||
| 337 | - true, | ||
| 338 | - format!("Preparing the stand-in for {}…", row.name), | ||
| 339 | - ), | ||
| 340 | - _ => ( | ||
| 341 | - "○", | ||
| 342 | - false, | ||
| 343 | - None, | ||
| 344 | - false, | ||
| 345 | - format!("Stand-in OFF for {} — click to make one", row.name), | ||
| 346 | - ), | ||
| 347 | - }; | ||
| 348 | - let proxy_stops = proxy_glyph == "■"; | ||
| 349 | - let proxy_label = match (proxy_on, proxy_waiting, proxy_progress) { | ||
| 350 | - (_, true, _) => "Proxy cancelling".to_string(), | ||
| 351 | - (true, false, Some(progress)) => format!("Proxy making {:.0}%", progress * 100.), | ||
| 352 | - (true, false, None) => "Proxy ready".to_string(), | ||
| 353 | - (false, false, _) => "Proxy off".to_string(), | ||
| 354 | - }; | ||
| 355 | - let proxy_tip: SharedString = proxy_tip.into(); | ||
| 356 | div() | 307 | div() |
| 357 | .id(("dock-source", i)) | 308 | .id(("dock-source", i)) |
| 358 | .flex_none() | 309 | .flex_none() |
| @@ -491,38 +442,11 @@ fn source_row( | |||
| 491 | .text_color(rgb(INK1())) | 442 | .text_color(rgb(INK1())) |
| 492 | .child(name) | 443 | .child(name) |
| 493 | }) | 444 | }) |
| 494 | - .when(usable, |d| { | 445 | + // Preview (`▷`) and the stand-in toggle (`○`) are off the |
| 495 | - d.child({ | 446 | + // row with cleanse round 2: a double-click starts the source playing |
| 496 | - let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | 447 | + // and the row menu carries `Preview`, the stand-in lives in |
| 497 | - div() | 448 | + // that same menu's `Proxy` row and in Settings. What is left |
| 498 | - .id(("dock-preview", i)) | 449 | + // on the right edge is the one verb a source row is *for*. |
| 499 | - .flex_none() | ||
| 500 | - .px(px(4.)) | ||
| 501 | - .py(px(2.)) | ||
| 502 | - .rounded(px(3.)) | ||
| 503 | - .cursor_pointer() | ||
| 504 | - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) | ||
| 505 | - .tooltip(move |_, cx| { | ||
| 506 | - cx.new(|_| Tip("Preview — play this source outside the timeline".into())) | ||
| 507 | - .into() | ||
| 508 | - }) | ||
| 509 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | ||
| 510 | - cx.stop_propagation(); | ||
| 511 | - this.open_preview(&preview_path, stream, cx); | ||
| 512 | - })) | ||
| 513 | - .children(hitmap::dynamic( | ||
| 514 | - move || (format!("source.{i}.preview"), "Preview source".into()), | ||
| 515 | - true, | ||
| 516 | - )) | ||
| 517 | - .child( | ||
| 518 | - div() | ||
| 519 | - .font(style.font) | ||
| 520 | - .text_size(style.size) | ||
| 521 | - .text_color(rgb(INK2())) | ||
| 522 | - .child("▷"), | ||
| 523 | - ) | ||
| 524 | - }) | ||
| 525 | - }) | ||
| 526 | .when(usable, |d| { | 450 | .when(usable, |d| { |
| 527 | d.child({ | 451 | d.child({ |
| 528 | let label_style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | 452 | let label_style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); |
| @@ -583,54 +507,6 @@ fn source_row( | |||
| 583 | .child("↵"), | 507 | .child("↵"), |
| 584 | ) | 508 | ) |
| 585 | }) | 509 | }) |
| 586 | - .child({ | ||
| 587 | - let style = mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); | ||
| 588 | - div() | ||
| 589 | - .id(("dock-proxy-toggle", i)) | ||
| 590 | - .flex_none() | ||
| 591 | - .flex() | ||
| 592 | - .flex_col() | ||
| 593 | - .items_center() | ||
| 594 | - .gap(px(2.)) | ||
| 595 | - .px(px(4.)) | ||
| 596 | - .py(px(2.)) | ||
| 597 | - .rounded(px(3.)) | ||
| 598 | - .when(proxy_on, |d| d.bg(rgb(DARK_RAISED()))) | ||
| 599 | - .when(proxy_waiting, |d| d.opacity(0.55)) | ||
| 600 | - .cursor_pointer() | ||
| 601 | - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) | ||
| 602 | - .tooltip(move |_, cx| cx.new(|_| Tip(proxy_tip.clone())).into()) | ||
| 603 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | ||
| 604 | - cx.stop_propagation(); | ||
| 605 | - this.toggle_proxy(&proxy_path, proxy_stops, cx); | ||
| 606 | - })) | ||
| 607 | - .children(hitmap::dynamic( | ||
| 608 | - move || (format!("source.{i}.proxy"), proxy_label), | ||
| 609 | - !proxy_waiting, | ||
| 610 | - )) | ||
| 611 | - .child( | ||
| 612 | - div() | ||
| 613 | - .font(style.font) | ||
| 614 | - .text_size(style.size) | ||
| 615 | - .text_color(rgb(if proxy_on { INK1() } else { INK3() })) | ||
| 616 | - .child(proxy_glyph), | ||
| 617 | - ) | ||
| 618 | - .children(proxy_progress.map(|progress| { | ||
| 619 | - div() | ||
| 620 | - .flex_none() | ||
| 621 | - .w(px(20.)) | ||
| 622 | - .h(px(2.)) | ||
| 623 | - .rounded(px(1.)) | ||
| 624 | - .bg(rgb(DARK_HAIRLINE())) | ||
| 625 | - .child( | ||
| 626 | - div() | ||
| 627 | - .h_full() | ||
| 628 | - .w(px(20. * progress.clamp(0., 1.))) | ||
| 629 | - .rounded(px(1.)) | ||
| 630 | - .bg(rgb(INK2())), | ||
| 631 | - ) | ||
| 632 | - })) | ||
| 633 | - }) | ||
| 634 | }), | 510 | }), |
| 635 | ) | 511 | ) |
| 636 | .child({ | 512 | .child({ |
| @@ -641,7 +517,7 @@ fn source_row( | |||
| 641 | .font(style.font) | 517 | .font(style.font) |
| 642 | .text_size(style.size) | 518 | .text_size(style.size) |
| 643 | .text_color(rgb(INK3())) | 519 | .text_color(rgb(INK3())) |
| 644 | - .child(format!("{usage} · {under}")) | 520 | + .child(under) |
| 645 | }) | 521 | }) |
| 646 | } | 522 | } |
| 647 | 523 | ||
| @@ -924,80 +800,88 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A | |||
| 924 | (count, rows) | 800 | (count, rows) |
| 925 | } | 801 | } |
| 926 | 802 | ||
| 927 | -/// The Sources tab, built off MOCK-SPEC.md's "Dock" section: count line, | 803 | +/// The dock's own menu ([`DOCK_ITEMS`]): the three ways a file gets in, on a |
| 928 | -/// filter, sort chips, rows, IMPORT, hint -- none of it the legacy | 804 | +/// right-click anywhere in the Sources body a row does not claim first. It is |
| 929 | -/// Media/Audio/Text panel `library.rs` draws. That panel's row facts | 805 | +/// where `Paste path` and `Import subtitles` went when cleanse round 2 took |
| 930 | -/// ([`library_rows`]) are still what every row here is built from. | 806 | +/// their footer rows, so both keep a pointer door -- including on an empty |
| 807 | +/// library, which is when a pasted path is worth most. | ||
| 808 | +fn opens_dock_menu( | ||
| 809 | + cx: &mut Context<Player>, | ||
| 810 | +) -> impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static { | ||
| 811 | + cx.listener(|this, event: &MouseDownEvent, _, cx| { | ||
| 812 | + if this.modal() || this.session.is_none() { | ||
| 813 | + return; | ||
| 814 | + } | ||
| 815 | + cx.stop_propagation(); | ||
| 816 | + this.context_menu = Some(ContextMenu { | ||
| 817 | + lane: Lane::V1, | ||
| 818 | + on: MenuOn::Dock, | ||
| 819 | + at: event.position, | ||
| 820 | + details: false, | ||
| 821 | + }); | ||
| 822 | + cx.notify(); | ||
| 823 | + }) | ||
| 824 | +} | ||
| 825 | + | ||
| 826 | +/// The Sources tab, cleanse round 2 (2026-09-10, user "seems cool, let's | ||
| 827 | +/// apply"): one filter and one list of everything this project holds -- | ||
| 828 | +/// picture, sound, and the subtitle tracks beside them -- with what a row | ||
| 829 | +/// *is* read off its own metadata line instead of off a sub-tab the editor | ||
| 830 | +/// had to pick first. The `MEDIA` head, the `Media / Audio / Text` strip, the | ||
| 831 | +/// `↕ Recent` sort cycle and the `IMPORT` head are all gone with it; the row | ||
| 832 | +/// facts are still [`library_rows`]' and [`subtitle_tab_rows`]'. | ||
| 931 | fn sources_tab( | 833 | fn sources_tab( |
| 932 | player: &Player, | 834 | player: &Player, |
| 933 | _window: &mut Window, | 835 | _window: &mut Window, |
| 934 | cx: &mut Context<Player>, | 836 | cx: &mut Context<Player>, |
| 935 | ) -> impl IntoElement { | 837 | ) -> impl IntoElement { |
| 936 | - let text_tab = player.library_tab == LibraryTab::Text; | 838 | + let sources = player |
| 937 | - // Text has no per-stream `Row` to fill -- its rows are subtitle tracks | 839 | + .session |
| 938 | - // grouped by source ([`subtitle_tab_rows`]), not `library_rows`' files -- | 840 | + .as_ref() |
| 939 | - // so it takes its own branch instead of a `Row` shape that would not fit | 841 | + .map_or(&[][..], PlaybackSession::sources); |
| 940 | - // it. `dock_filter`/`dock_sort` stay Media/Audio's own: a subtitle track | 842 | + let all_rows: Vec<Row> = library_rows( |
| 941 | - // has no "unused" count and its own row order is the file's own order, | 843 | + sources, |
| 942 | - // the same reason the old palette never carried either control. | 844 | + &player.streams, |
| 943 | - let (total, unused_count, row_elements): (usize, usize, Vec<AnyElement>) = if text_tab { | 845 | + &player.decoders, |
| 944 | - let (count, elements) = subtitle_tab_rows(player, cx); | 846 | + player.timeline_audio(), |
| 945 | - (count, 0, elements) | 847 | + |path| { |
| 946 | - } else { | 848 | + player |
| 947 | - let sources = player | 849 | + .session |
| 948 | - .session | 850 | + .as_ref() |
| 949 | - .as_ref() | 851 | + .map_or(0, |session| session.file_frames(path)) |
| 950 | - .map_or(&[][..], PlaybackSession::sources); | 852 | + }, |
| 951 | - let all_rows: Vec<Row> = library_rows( | 853 | + ); |
| 952 | - sources, | 854 | + let filter = player.dock_filter.to_lowercase(); |
| 953 | - &player.streams, | 855 | + let rows: Vec<(Row, usize)> = all_rows |
| 954 | - &player.decoders, | 856 | + .into_iter() |
| 955 | - player.timeline_audio(), | 857 | + .map(|row| { |
| 956 | - |path| { | 858 | + let placed = player.row_ctx(&row.path, row.stream).placed; |
| 957 | - player | 859 | + (row, placed) |
| 958 | - .session | 860 | + }) |
| 959 | - .as_ref() | 861 | + .filter(|(row, placed)| { |
| 960 | - .map_or(0, |session| session.file_frames(path)) | 862 | + filter.is_empty() |
| 961 | - }, | 863 | + || row.name.to_lowercase().contains(&filter) |
| 962 | - ); | 864 | + || row.detail.to_lowercase().contains(&filter) |
| 963 | - let filter = player.dock_filter.to_lowercase(); | 865 | + || ("unused".contains(&filter) && *placed == 0) |
| 964 | - let mut rows: Vec<(Row, usize)> = all_rows | 866 | + }) |
| 965 | - .into_iter() | 867 | + .collect(); |
| 966 | - .filter(|row| player.library_tab.holds(&row.path)) | 868 | + let mut row_elements: Vec<AnyElement> = rows |
| 967 | - .map(|row| { | 869 | + .iter() |
| 968 | - let placed = player.row_ctx(&row.path, row.stream).placed; | 870 | + .enumerate() |
| 969 | - (row, placed) | 871 | + .map(|(i, (row, placed))| { |
| 970 | - }) | 872 | + let picked = player |
| 971 | - .filter(|(row, placed)| { | 873 | + .selected_asset |
| 972 | - filter.is_empty() | 874 | + .as_ref() |
| 973 | - || row.name.to_lowercase().contains(&filter) | 875 | + .is_some_and(|p| *p == (row.path.clone(), row.stream)); |
| 974 | - || row.detail.to_lowercase().contains(&filter) | 876 | + source_row(player, i, row, *placed, picked, cx).into_any_element() |
| 975 | - || ("unused".contains(&filter) && *placed == 0) | 877 | + }) |
| 976 | - }) | 878 | + .collect(); |
| 977 | - .collect(); | 879 | + // The subtitle tracks join the same list rather than hiding behind a tab |
| 978 | - let unused_count = rows.iter().filter(|(_, placed)| *placed == 0).count(); | 880 | + // of their own: a standalone `.srt` is a source in the sense that matters |
| 979 | - match player.dock_sort { | 881 | + // here -- something that came in and can go on a lane -- and the tracks |
| 980 | - DockSort::Recent => {} | 882 | + // inside a container stay grouped under the file that carries them. |
| 981 | - DockSort::Name => { | 883 | + let (_, subtitles) = subtitle_tab_rows(player, cx); |
| 982 | - rows.sort_by(|(a, _), (b, _)| a.name.to_lowercase().cmp(&b.name.to_lowercase())) | 884 | + row_elements.extend(subtitles); |
| 983 | - } | ||
| 984 | - DockSort::Usage => rows.sort_by(|(_, a), (_, b)| b.cmp(a)), | ||
| 985 | - DockSort::Unused => rows.sort_by_key(|(_, placed)| *placed > 0), | ||
| 986 | - } | ||
| 987 | - let total = rows.len(); | ||
| 988 | - let elements: Vec<AnyElement> = rows | ||
| 989 | - .iter() | ||
| 990 | - .enumerate() | ||
| 991 | - .map(|(i, (row, placed))| { | ||
| 992 | - let picked = player | ||
| 993 | - .selected_asset | ||
| 994 | - .as_ref() | ||
| 995 | - .is_some_and(|p| *p == (row.path.clone(), row.stream)); | ||
| 996 | - source_row(player, i, row, *placed, picked, cx).into_any_element() | ||
| 997 | - }) | ||
| 998 | - .collect(); | ||
| 999 | - (total, unused_count, elements) | ||
| 1000 | - }; | ||
| 1001 | let filter_text: SharedString = player.dock_filter.clone().into(); | 885 | let filter_text: SharedString = player.dock_filter.clone().into(); |
| 1002 | div() | 886 | div() |
| 1003 | .id("dock-sources") | 887 | .id("dock-sources") |
| @@ -1005,6 +889,11 @@ fn sources_tab( | |||
| 1005 | .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| { | 889 | .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| { |
| 1006 | cycle_on_key_down(Surface::Dock)(this, event, window, cx) | 890 | cycle_on_key_down(Surface::Dock)(this, event, window, cx) |
| 1007 | })) | 891 | })) |
| 892 | + // Right-click anywhere the rows are not: the ways *in* (Add files, | ||
| 893 | + // Paste path, Import subtitles), which is what the dock itself can be | ||
| 894 | + // told -- and the door those last two kept when their rows left the | ||
| 895 | + // footer. A row's own right-click stops here first (`source_row`). | ||
| 896 | + .on_mouse_down(MouseButton::Right, opens_dock_menu(cx)) | ||
| 1008 | // The focus ring is not painted (user 2026-09-09: "clicking through | 897 | // The focus ring is not painted (user 2026-09-09: "clicking through |
| 1009 | // timeline draws a white overlay around the timeline, same happens | 898 | // timeline draws a white overlay around the timeline, same happens |
| 1010 | // for library section too"). The border stays in flow, transparent in | 899 | // for library section too"). The border stays in flow, transparent in |
| @@ -1018,22 +907,6 @@ fn sources_tab( | |||
| 1018 | .gap(px(6.)) | 907 | .gap(px(6.)) |
| 1019 | .p(px(8.)) | 908 | .p(px(8.)) |
| 1020 | .overflow_y_scroll() | 909 | .overflow_y_scroll() |
| 1021 | - .child({ | ||
| 1022 | - let style = head(); | ||
| 1023 | - let hint: SharedString = match text_tab { | ||
| 1024 | - true => format!("{total} total"), | ||
| 1025 | - false => format!("{total} total · {unused_count} unused"), | ||
| 1026 | - } | ||
| 1027 | - .into(); | ||
| 1028 | - div() | ||
| 1029 | - .id("dock-header") | ||
| 1030 | - .flex_none() | ||
| 1031 | - .font(style.font) | ||
| 1032 | - .text_size(style.size) | ||
| 1033 | - .text_color(rgb(INK3())) | ||
| 1034 | - .tooltip(move |_, cx| cx.new(|_| Tip(hint.clone())).into()) | ||
| 1035 | - .child(player.library_tab.label().to_uppercase()) | ||
| 1036 | - }) | ||
| 1037 | .child({ | 910 | .child({ |
| 1038 | let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM); | 911 | let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM); |
| 1039 | div() | 912 | div() |
| @@ -1053,82 +926,13 @@ fn sources_tab( | |||
| 1053 | })) | 926 | })) |
| 1054 | .tooltip(crate::ui::widgets::tip_hover("Filter sources", "type to narrow", None)) | 927 | .tooltip(crate::ui::widgets::tip_hover("Filter sources", "type to narrow", None)) |
| 1055 | .children(hitmap::control("dock.filter", "Filter sources", true)) | 928 | .children(hitmap::control("dock.filter", "Filter sources", true)) |
| 929 | + // The glass alone at rest: the word "filter" beside it was | ||
| 930 | + // the box telling the editor what a filter box is (DESIGN §8). | ||
| 1056 | .child(match player.dock_filter.is_empty() { | 931 | .child(match player.dock_filter.is_empty() { |
| 1057 | - true => "⌕ filter".to_string(), | 932 | + true => "⌕".to_string(), |
| 1058 | false => format!("⌕ {filter_text}"), | 933 | false => format!("⌕ {filter_text}"), |
| 1059 | }) | 934 | }) |
| 1060 | }) | 935 | }) |
| 1061 | - .child( | ||
| 1062 | - div() | ||
| 1063 | - .flex_none() | ||
| 1064 | - .flex() | ||
| 1065 | - .gap(px(4.)) | ||
| 1066 | - .children(LIBRARY_TABS.map(|tab| { | ||
| 1067 | - let on = tab == player.library_tab; | ||
| 1068 | - let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | ||
| 1069 | - div() | ||
| 1070 | - .id(("dock-source-filter", tab as usize)) | ||
| 1071 | - .flex_none() | ||
| 1072 | - .px(px(6.)) | ||
| 1073 | - .py(px(2.)) | ||
| 1074 | - .rounded(px(3.)) | ||
| 1075 | - .font(style.font) | ||
| 1076 | - .text_size(style.size) | ||
| 1077 | - .when(on, |d| d.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) | ||
| 1078 | - .when(!on, |d| d.text_color(rgb(INK3()))) | ||
| 1079 | - .cursor_pointer() | ||
| 1080 | - .hover(|s| s.bg(rgb(DARK_RAISED()))) | ||
| 1081 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | ||
| 1082 | - this.library_tab = tab; | ||
| 1083 | - cx.notify(); | ||
| 1084 | - })) | ||
| 1085 | - .tooltip(crate::ui::widgets::tip_hover(&format!("Show {} only", tab.label().to_lowercase()), "", None)) | ||
| 1086 | - .children(hitmap::dynamic( | ||
| 1087 | - move || { | ||
| 1088 | - ( | ||
| 1089 | - format!("dock.filter.{}", tab.label()), | ||
| 1090 | - format!("Filter {}", tab.label()), | ||
| 1091 | - ) | ||
| 1092 | - }, | ||
| 1093 | - true, | ||
| 1094 | - )) | ||
| 1095 | - .child(tab.label()) | ||
| 1096 | - })), | ||
| 1097 | - ) | ||
| 1098 | - // The sort cycle is Media/Audio's own: a subtitle track's order is | ||
| 1099 | - // its file's own order, not a pick among Recent/Name/Usage/Unused. | ||
| 1100 | - .when(!text_tab, |d| { | ||
| 1101 | - d.child({ | ||
| 1102 | - let current = player.dock_sort; | ||
| 1103 | - let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | ||
| 1104 | - div() | ||
| 1105 | - .id("dock-sort-cycle") | ||
| 1106 | - .flex_none() | ||
| 1107 | - .px(px(6.)) | ||
| 1108 | - .py(px(2.)) | ||
| 1109 | - .rounded(px(3.)) | ||
| 1110 | - .font(style.font) | ||
| 1111 | - .text_size(style.size) | ||
| 1112 | - .text_color(rgb(INK2())) | ||
| 1113 | - .cursor_pointer() | ||
| 1114 | - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) | ||
| 1115 | - .tooltip(crate::ui::widgets::tip_hover("Sort sources", "click to cycle", None)) | ||
| 1116 | - .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { | ||
| 1117 | - this.dock_sort = this.dock_sort.next(); | ||
| 1118 | - cx.notify(); | ||
| 1119 | - })) | ||
| 1120 | - .children(hitmap::dynamic( | ||
| 1121 | - move || { | ||
| 1122 | - ( | ||
| 1123 | - "dock.sort.cycle".to_string(), | ||
| 1124 | - format!("Sort: {} — click to cycle", current.label()), | ||
| 1125 | - ) | ||
| 1126 | - }, | ||
| 1127 | - true, | ||
| 1128 | - )) | ||
| 1129 | - .child(format!("↕ {}", current.label())) | ||
| 1130 | - }) | ||
| 1131 | - }) | ||
| 1132 | .child( | 936 | .child( |
| 1133 | div() | 937 | div() |
| 1134 | .id("dock-source-rows") | 938 | .id("dock-source-rows") |
| @@ -1138,6 +942,10 @@ fn sources_tab( | |||
| 1138 | .flex_col() | 942 | .flex_col() |
| 1139 | .gap(px(2.)) | 943 | .gap(px(2.)) |
| 1140 | .overflow_y_scroll() | 944 | .overflow_y_scroll() |
| 945 | + // The list fills the dock, so the empty stretch under the last | ||
| 946 | + // row is *this* element and not its parent: the menu opens off | ||
| 947 | + // both, or a right-click below the rows finds nothing. | ||
| 948 | + .on_mouse_down(MouseButton::Right, opens_dock_menu(cx)) | ||
| 1141 | .when(row_elements.is_empty(), |d| { | 949 | .when(row_elements.is_empty(), |d| { |
| 1142 | let style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); | 950 | let style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); |
| 1143 | d.child( | 951 | d.child( |
| @@ -1145,53 +953,27 @@ fn sources_tab( | |||
| 1145 | .font(style.font) | 953 | .font(style.font) |
| 1146 | .text_size(style.size) | 954 | .text_size(style.size) |
| 1147 | .text_color(rgb(INK3())) | 955 | .text_color(rgb(INK3())) |
| 1148 | - .child(match text_tab || player.dock_filter.is_empty() { | 956 | + // One noun for both empties -- nothing imported and |
| 1149 | - true => player.library_tab.empty().to_string(), | 957 | + // nothing matching are the same sight, and neither |
| 1150 | - false => "nothing matches the filter".to_string(), | 958 | + // is a sentence (DESIGN §8). |
| 1151 | - }), | 959 | + .child("none"), |
| 1152 | ) | 960 | ) |
| 1153 | }) | 961 | }) |
| 1154 | .children(row_elements), | 962 | .children(row_elements), |
| 1155 | ) | 963 | ) |
| 1156 | - .child(section_head("IMPORT")) | 964 | + // One door in, at the bottom. `Paste path` (`^l`) and `Import |
| 1157 | - .child( | 965 | + // subtitles` (`^i`) keep their strokes, their KEYS rows and the |
| 1158 | - div() | 966 | + // dock's own right-click menu; `Add files` takes a `.srt`/`.vtt` as |
| 1159 | - .flex_none() | 967 | + // happily as an `.mkv` (`Player::import` forks on `is_subtitle`), so |
| 1160 | - .flex() | 968 | + // subtitles arrive through this row too. |
| 1161 | - .flex_col() | 969 | + .children(ghost_verb( |
| 1162 | - .children(ghost_verb( | 970 | + "dock-import-files", |
| 1163 | - "dock-import-files", | 971 | + "Add", |
| 1164 | - "Add files", | 972 | + ActionId::AddFiles, |
| 1165 | - ActionId::AddFiles, | 973 | + false, |
| 1166 | - false, | 974 | + player, |
| 1167 | - player, | 975 | + cx.listener(|this, _: &ClickEvent, _, cx| this.pick_and_import(cx)), |
| 1168 | - cx.listener(|this, _: &ClickEvent, _, cx| this.pick_and_import(cx)), | 976 | + )) |
| 1169 | - )) | ||
| 1170 | - .children(ghost_verb( | ||
| 1171 | - "dock-paste-path", | ||
| 1172 | - "Paste path", | ||
| 1173 | - ActionId::PasteFilePath, | ||
| 1174 | - false, | ||
| 1175 | - player, | ||
| 1176 | - cx.listener(|this, _: &ClickEvent, _, cx| this.paste_file_path(cx)), | ||
| 1177 | - )) | ||
| 1178 | - // Subtitles come in through the same door every other file | ||
| 1179 | - // does. This row is `↓S`'s new geographic home: the spine's | ||
| 1180 | - // TRACK group carried it as a two-glyph badge on a 56px rail | ||
| 1181 | - // that no longer had the height for it (user 2026-08-21: | ||
| 1182 | - // "the spine menu is too crowded"), and an import belongs | ||
| 1183 | - // beside the other two imports, not beside the lane verbs. | ||
| 1184 | - .children(ghost_verb( | ||
| 1185 | - "dock-import-subtitles", | ||
| 1186 | - "Import subtitles", | ||
| 1187 | - ActionId::ImportSubtitles, | ||
| 1188 | - false, | ||
| 1189 | - player, | ||
| 1190 | - cx.listener(|this, _: &ClickEvent, window, cx| { | ||
| 1191 | - this.act(ActionId::ImportSubtitles, window, cx) | ||
| 1192 | - }), | ||
| 1193 | - )), | ||
| 1194 | - ) | ||
| 1195 | } | 977 | } |
| 1196 | 978 | ||
| 1197 | /// The transition a clip carries into its immediate successor, if any -- a | 979 | /// The transition a clip carries into its immediate successor, if any -- a |
crates/app/src/ui/overlays.rsmodified+2 -1
| @@ -131,7 +131,7 @@ impl Player { | |||
| 131 | // would be a right-click that opens nothing. | 131 | // would be a right-click that opens nothing. |
| 132 | let idx = match menu.on { | 132 | let idx = match menu.on { |
| 133 | MenuOn::Clip(idx) => Some(idx), | 133 | MenuOn::Clip(idx) => Some(idx), |
| 134 | - MenuOn::Gap(..) | MenuOn::Bench | MenuOn::Head => None, | 134 | + MenuOn::Gap(..) | MenuOn::Bench | MenuOn::Head | MenuOn::Dock => None, |
| 135 | }; | 135 | }; |
| 136 | let clip = idx.and_then(|idx| session.lane_clips(menu.lane).get(idx).copied()); | 136 | let clip = idx.and_then(|idx| session.lane_clips(menu.lane).get(idx).copied()); |
| 137 | let source = clip.and_then(|clip| session.sources().get(clip.source).cloned()); | 137 | let source = clip.and_then(|clip| session.sources().get(clip.source).cloned()); |
| @@ -272,6 +272,7 @@ impl Player { | |||
| 272 | // the label and the chord still come out of the registry. | 272 | // the label and the chord still come out of the registry. |
| 273 | let actions = match menu.on { | 273 | let actions = match menu.on { |
| 274 | MenuOn::Bench => BENCH_ITEMS.to_vec(), | 274 | MenuOn::Bench => BENCH_ITEMS.to_vec(), |
| 275 | + MenuOn::Dock => DOCK_ITEMS.to_vec(), | ||
| 275 | MenuOn::Head => lane_items(menu.lane), | 276 | MenuOn::Head => lane_items(menu.lane), |
| 276 | _ => menu_items(ctx), | 277 | _ => menu_items(ctx), |
| 277 | }; | 278 | }; |