Menu styling, source removal with clips, settings chords, spine geography
Browse files at this commit3e04aeb73731b9023b14616a86c3f5cf3cf6d156Parent: 83b80db- feat
- menu styling, source removal with clips, settings chords, spine geography
16 changed files +775 -304
- crates/app/src/interact.rs +31 -0
- crates/app/src/menus.rs +16 -1
- crates/app/src/oracle.rs +13 -3
- crates/app/src/player/actions.rs +4 -0
- crates/app/src/player/library.rs +84 -0
- crates/app/src/player/view.rs +6 -4
- crates/app/src/tests/editing.rs +16 -0
- crates/app/src/tests/layout.rs +61 -1
- crates/app/src/ui/cards.rs +200 -122
- crates/app/src/ui/dock_stance.rs +40 -0
- crates/app/src/ui/library.rs +14 -11
- crates/app/src/ui/overlays.rs +55 -35
- crates/app/src/ui/settings_stance.rs +139 -21
- crates/app/src/ui/spine_stance.rs +59 -96
- crates/app/src/ui/stance.rs +19 -6
- crates/app/src/ui/theme.rs +18 -4
crates/app/src/interact.rsmodified+31 -0
| @@ -185,6 +185,37 @@ pub(crate) fn scrim() -> Div { | |||
| 185 | div().absolute().inset_0().occlude() | 185 | div().absolute().inset_0().occlude() |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | +/// The body every hanging menu is drawn on: the clip menu, the library row | ||
| 189 | +/// menu and the open choice list, one shape for all three. | ||
| 190 | +/// | ||
| 191 | +/// It exists because the three drifted: each carried its own copy of the | ||
| 192 | +/// plate chrome, so styling one (the picker, 2026-08-21) left the other two | ||
| 193 | +/// painting the legacy raised grey -- the user's "right click menu in library | ||
| 194 | +/// is old too". A plate is `panel` with a seam around it and a 6px radius | ||
| 195 | +/// (DESIGN §2/§4); the legacy tree keeps its own raised sheet. One function, | ||
| 196 | +/// so the next change reaches all three or none. | ||
| 197 | +pub(crate) fn menu_plate(id: &'static str, x: f32, y: f32, darkroom: bool) -> Stateful<Div> { | ||
| 198 | + div() | ||
| 199 | + .id(id) | ||
| 200 | + .absolute() | ||
| 201 | + .left(px(x)) | ||
| 202 | + .top(px(y)) | ||
| 203 | + .w(px(crate::layout::MENU_W)) | ||
| 204 | + .flex() | ||
| 205 | + .flex_col() | ||
| 206 | + .p(px(crate::layout::MENU_PAD)) | ||
| 207 | + .rounded(px(6.)) | ||
| 208 | + .bg(rgb(if darkroom { | ||
| 209 | + crate::ui::theme::DARK_PANEL() | ||
| 210 | + } else { | ||
| 211 | + crate::ui::theme::BG_RAISED() | ||
| 212 | + })) | ||
| 213 | + .when(darkroom, |d| { | ||
| 214 | + d.border_1() | ||
| 215 | + .border_color(rgba(crate::ui::theme::DARK_SEAM())) | ||
| 216 | + }) | ||
| 217 | +} | ||
| 218 | + | ||
| 188 | /// The sheet a card with a *slider* in it takes instead: the same scrim, with | 219 | /// The sheet a card with a *slider* in it takes instead: the same scrim, with |
| 189 | /// the window's own drag listeners on it as well. | 220 | /// the window's own drag listeners on it as well. |
| 190 | /// | 221 | /// |
crates/app/src/menus.rsmodified+16 -1
| @@ -116,13 +116,21 @@ pub(crate) type ChoiceRow = (Choice, SharedString, SharedString, bool); | |||
| 116 | pub(crate) enum RowItem { | 116 | pub(crate) enum RowItem { |
| 117 | Add, | 117 | Add, |
| 118 | Remove, | 118 | Remove, |
| 119 | + /// Remove that first deletes every clip playing the row. The plain | ||
| 120 | + /// [`RowItem::Remove`] is refused while any clip plays a source (the | ||
| 121 | + /// engine's own rule), which used to leave a placed source with no way | ||
| 122 | + /// out of the library at all -- this is that way out, and it is | ||
| 123 | + /// destructive, so it is listed only when it is the one that applies and | ||
| 124 | + /// it says how many clips it takes with it. | ||
| 125 | + RemoveWithClips, | ||
| 119 | Reveal, | 126 | Reveal, |
| 120 | Properties, | 127 | Properties, |
| 121 | } | 128 | } |
| 122 | 129 | ||
| 123 | -pub(crate) const ROW_ITEMS: [RowItem; 4] = [ | 130 | +pub(crate) const ROW_ITEMS: [RowItem; 5] = [ |
| 124 | RowItem::Add, | 131 | RowItem::Add, |
| 125 | RowItem::Remove, | 132 | RowItem::Remove, |
| 133 | + RowItem::RemoveWithClips, | ||
| 126 | RowItem::Reveal, | 134 | RowItem::Reveal, |
| 127 | RowItem::Properties, | 135 | RowItem::Properties, |
| 128 | ]; | 136 | ]; |
| @@ -132,6 +140,12 @@ impl RowItem { | |||
| 132 | match self { | 140 | match self { |
| 133 | Self::Add => "Add at playhead", | 141 | Self::Add => "Add at playhead", |
| 134 | Self::Remove => "Remove from library", | 142 | Self::Remove => "Remove from library", |
| 143 | + // Same label as the plain remove: only ever one of the two is on | ||
| 144 | + // the plate (the oracle hides the other), so what differs is the | ||
| 145 | + // consequence, and the consequence belongs in the hint column | ||
| 146 | + // where every other row states its own. The long dashed title | ||
| 147 | + // truncated its own hint at `MENU_W`. | ||
| 148 | + Self::RemoveWithClips => "Remove from library", | ||
| 135 | Self::Reveal => "Reveal in files", | 149 | Self::Reveal => "Reveal in files", |
| 136 | Self::Properties => "Properties", | 150 | Self::Properties => "Properties", |
| 137 | } | 151 | } |
| @@ -146,6 +160,7 @@ impl RowItem { | |||
| 146 | // off mid-word says less than a shorter one. | 160 | // off mid-word says less than a shorter one. |
| 147 | Self::Add => "the whole file", | 161 | Self::Add => "the whole file", |
| 148 | Self::Remove => "nothing plays it", | 162 | Self::Remove => "nothing plays it", |
| 163 | + Self::RemoveWithClips => "clips too", | ||
| 149 | Self::Reveal => "file manager", | 164 | Self::Reveal => "file manager", |
| 150 | Self::Properties => "…", | 165 | Self::Properties => "…", |
| 151 | } | 166 | } |
crates/app/src/oracle.rsmodified+13 -3
| @@ -373,12 +373,22 @@ pub(crate) fn row_enable(item: RowItem, ctx: RowCtx) -> Enable { | |||
| 373 | match item { | 373 | match item { |
| 374 | // The two that change the timeline, so an export reading it stops them | 374 | // The two that change the timeline, so an export reading it stops them |
| 375 | // both -- the key handler's rule, applied to a menu. | 375 | // both -- the key handler's rule, applied to a menu. |
| 376 | - RowItem::Add | RowItem::Remove if ctx.exporting => Enable::No("an export is running"), | 376 | + RowItem::Add | RowItem::Remove | RowItem::RemoveWithClips if ctx.exporting => { |
| 377 | - RowItem::Add | RowItem::Remove if !ctx.timeline => Enable::No("no timeline open"), | 377 | + Enable::No("an export is running") |
| 378 | + } | ||
| 379 | + RowItem::Add | RowItem::Remove | RowItem::RemoveWithClips if !ctx.timeline => { | ||
| 380 | + Enable::No("no timeline open") | ||
| 381 | + } | ||
| 378 | // Dimmed and saying why rather than clicked and refused afterwards: the | 382 | // Dimmed and saying why rather than clicked and refused afterwards: the |
| 379 | // row's own grey already says the file cannot join this timeline. | 383 | // row's own grey already says the file cannot join this timeline. |
| 380 | RowItem::Add if !ctx.usable => Enable::No("it cannot join this one"), | 384 | RowItem::Add if !ctx.usable => Enable::No("it cannot join this one"), |
| 381 | - RowItem::Remove if ctx.placed > 0 => Enable::No("clips play it"), | 385 | + // The two removes are one verb with two shapes, and exactly one of |
| 386 | + // them is ever on the plate: the plain one while nothing plays the | ||
| 387 | + // source, the clips-too one while something does. Hidden rather than | ||
| 388 | + // dimmed, because a dimmed "Remove" sitting above a live "Remove — | ||
| 389 | + // with its clips" is two rows arguing about the same act. | ||
| 390 | + RowItem::Remove if ctx.placed > 0 => Enable::Hidden("clips play it"), | ||
| 391 | + RowItem::RemoveWithClips if ctx.placed == 0 => Enable::Hidden("nothing plays it"), | ||
| 382 | // Neither of these touches the timeline: a file can be found on disk and | 392 | // Neither of these touches the timeline: a file can be found on disk and |
| 383 | // described whatever the editor is doing, with no timeline at all. | 393 | // described whatever the editor is doing, with no timeline at all. |
| 384 | _ => Enable::Yes, | 394 | _ => Enable::Yes, |
crates/app/src/player/actions.rsmodified+4 -0
| @@ -429,6 +429,10 @@ impl Player { | |||
| 429 | self.library_menu = None; | 429 | self.library_menu = None; |
| 430 | self.remove_source(&menu.path, menu.stream, cx); | 430 | self.remove_source(&menu.path, menu.stream, cx); |
| 431 | } | 431 | } |
| 432 | + RowItem::RemoveWithClips => { | ||
| 433 | + self.library_menu = None; | ||
| 434 | + self.remove_source_and_clips(&menu.path, menu.stream, cx); | ||
| 435 | + } | ||
| 432 | RowItem::Reveal => { | 436 | RowItem::Reveal => { |
| 433 | self.library_menu = None; | 437 | self.library_menu = None; |
| 434 | // Another process starting: off the UI thread, exactly as the | 438 | // Another process starting: off the UI thread, exactly as the |
crates/app/src/player/library.rsmodified+84 -0
| @@ -199,6 +199,90 @@ impl Player { | |||
| 199 | cx.notify(); | 199 | cx.notify(); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | + /// Removes a library row *and* every clip playing it, in that order -- | ||
| 203 | + /// the plain [`Player::remove_source`] is refused by the engine while any | ||
| 204 | + /// clip still plays a source, which left a placed file with no reachable | ||
| 205 | + /// way out of the library at all (user 2026-08-21: "can not remove a | ||
| 206 | + /// media from library"). Destructive, and named so on the plate it is | ||
| 207 | + /// picked from; one undo entry per deleted clip, exactly as deleting them | ||
| 208 | + /// by hand would leave, and then the source itself goes the same door | ||
| 209 | + /// every other removal takes. | ||
| 210 | + pub(crate) fn remove_source_and_clips( | ||
| 211 | + &mut self, | ||
| 212 | + path: &Path, | ||
| 213 | + stream: usize, | ||
| 214 | + cx: &mut Context<Self>, | ||
| 215 | + ) { | ||
| 216 | + if self.exporting().is_some() { | ||
| 217 | + return; | ||
| 218 | + } | ||
| 219 | + let Some(session) = self.session.as_mut() else { | ||
| 220 | + self.notify_user("NO TIMELINE — open a file first".into()); | ||
| 221 | + return; | ||
| 222 | + }; | ||
| 223 | + let Some(idx) = session | ||
| 224 | + .sources() | ||
| 225 | + .iter() | ||
| 226 | + .position(|s| s.path == path && s.audio_stream == stream) | ||
| 227 | + else { | ||
| 228 | + return; | ||
| 229 | + }; | ||
| 230 | + // One clip at a time, re-scanning after each: deleting a clip takes | ||
| 231 | + // its group partners (a V1 picture and its A1 sound) with it, so a | ||
| 232 | + // list of indices collected up front goes stale the moment the first | ||
| 233 | + // one lands -- and a stale index deletes some other film's clip. | ||
| 234 | + // Bounded by the count that was there when we started, so a | ||
| 235 | + // `delete_clip` that ever answers false cannot spin here. | ||
| 236 | + let count_of = |session: &engine::PlaybackSession| { | ||
| 237 | + session | ||
| 238 | + .lanes() | ||
| 239 | + .into_iter() | ||
| 240 | + .flat_map(|lane| session.lane_clips(lane)) | ||
| 241 | + .filter(|c| c.source == idx) | ||
| 242 | + .count() | ||
| 243 | + }; | ||
| 244 | + let started_with = count_of(session); | ||
| 245 | + let mut budget = session | ||
| 246 | + .lanes() | ||
| 247 | + .into_iter() | ||
| 248 | + .flat_map(|lane| session.lane_clips(lane)) | ||
| 249 | + .filter(|c| c.source == idx) | ||
| 250 | + .count(); | ||
| 251 | + while budget > 0 { | ||
| 252 | + let Some((lane, at)) = session.lanes().into_iter().find_map(|lane| { | ||
| 253 | + session | ||
| 254 | + .lane_clips(lane) | ||
| 255 | + .iter() | ||
| 256 | + .position(|c| c.source == idx) | ||
| 257 | + .map(|at| (lane, at)) | ||
| 258 | + }) else { | ||
| 259 | + break; | ||
| 260 | + }; | ||
| 261 | + if !session.delete_clip(lane, at) { | ||
| 262 | + break; | ||
| 263 | + } | ||
| 264 | + budget -= 1; | ||
| 265 | + } | ||
| 266 | + // What actually left the bench, not how many calls it took: one | ||
| 267 | + // `delete_clip` on a grouped clip takes its partner with it. | ||
| 268 | + let deleted = started_with.saturating_sub(count_of(session)); | ||
| 269 | + self.reset_after_reseek(); | ||
| 270 | + self.remove_source(path, stream, cx); | ||
| 271 | + // `remove_source` already wrote its own line; this one says what went | ||
| 272 | + // with it, which is the half that line cannot know about. | ||
| 273 | + if deleted > 0 { | ||
| 274 | + self.notify_user( | ||
| 275 | + format!( | ||
| 276 | + "{deleted} clip{} deleted with {}", | ||
| 277 | + if deleted == 1 { "" } else { "s" }, | ||
| 278 | + file_name(path) | ||
| 279 | + ) | ||
| 280 | + .into(), | ||
| 281 | + ); | ||
| 282 | + } | ||
| 283 | + cx.notify(); | ||
| 284 | + } | ||
| 285 | + | ||
| 202 | /// Back to the window the editor launches as: no timeline, no library, no | 286 | /// Back to the window the editor launches as: no timeline, no library, no |
| 203 | /// picture -- and the hint that says to open a file. What removing the last | 287 | /// picture -- and the hint that says to open a file. What removing the last |
| 204 | /// library row leaves, since a session whose library is empty has nothing | 288 | /// library row leaves, since a session whose library is empty has nothing |
crates/app/src/player/view.rsmodified+6 -4
| @@ -405,10 +405,12 @@ impl Player { | |||
| 405 | let anchor = px_along(event.position.x, self.ruler.get()); | 405 | let anchor = px_along(event.position.x, self.ruler.get()); |
| 406 | self.zoom(factor, Some(anchor), cx); | 406 | self.zoom(factor, Some(anchor), cx); |
| 407 | } | 407 | } |
| 408 | - // Up runs forward along the film. A page's wheel-up goes back | 408 | + // Up is back towards the head of the timeline, the way a wheel up |
| 409 | - // toward its top, but a timeline is not a page: the wheel pushes | 409 | + // is back towards the top of a page -- and wheel DOWN runs the |
| 410 | - // the film past the playhead, so up is later. (User, 2026-08-21.) | 410 | + // film forward. Flipped to "up is later" earlier on 2026-08-21 and |
| 411 | - false => self.scroll_view(d.signum(), cx), | 411 | + // reverted the same day: the user drove it and wanted the page |
| 412 | + // reading back. | ||
| 413 | + false => self.scroll_view(-d.signum(), cx), | ||
| 412 | } | 414 | } |
| 413 | } | 415 | } |
| 414 | } | 416 | } |
crates/app/src/tests/editing.rsmodified+16 -0
| @@ -1082,6 +1082,22 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() { | |||
| 1082 | "a file that cannot join this timeline is not an Add anybody can ask for" | 1082 | "a file that cannot join this timeline is not an Add anybody can ask for" |
| 1083 | ); | 1083 | ); |
| 1084 | assert!(!row_enable(RowItem::Remove, RowCtx { placed: 1, ..live }).yes()); | 1084 | assert!(!row_enable(RowItem::Remove, RowCtx { placed: 1, ..live }).yes()); |
| 1085 | + // The two removes are one verb with two shapes and exactly one of them is | ||
| 1086 | + // ever on the plate: a placed source offers "with its clips", an unplaced | ||
| 1087 | + // one the plain remove. Before this pair existed a placed source had no | ||
| 1088 | + // reachable way out of the library at all (user 2026-08-21: "can not | ||
| 1089 | + // remove a media from library"). | ||
| 1090 | + let placed = RowCtx { placed: 2, ..live }; | ||
| 1091 | + let items = row_items(placed); | ||
| 1092 | + assert!(items.contains(&RowItem::RemoveWithClips) && !items.contains(&RowItem::Remove)); | ||
| 1093 | + assert!(row_enable(RowItem::RemoveWithClips, placed).yes()); | ||
| 1094 | + let unplaced = row_items(live); | ||
| 1095 | + assert!(unplaced.contains(&RowItem::Remove) && !unplaced.contains(&RowItem::RemoveWithClips)); | ||
| 1096 | + assert!(!row_enable( | ||
| 1097 | + RowItem::RemoveWithClips, | ||
| 1098 | + RowCtx { exporting: true, ..placed } | ||
| 1099 | + ) | ||
| 1100 | + .yes()); | ||
| 1085 | assert!(!row_enable(RowItem::Add, RowCtx::default()).yes()); | 1101 | assert!(!row_enable(RowItem::Add, RowCtx::default()).yes()); |
| 1086 | // Every refusal is short enough to sit in the hint column beside its | 1102 | // Every refusal is short enough to sit in the hint column beside its |
| 1087 | // label, the clip menu's rule. | 1103 | // label, the clip menu's rule. |
crates/app/src/tests/layout.rsmodified+61 -1
| @@ -44,6 +44,54 @@ fn toolbar_fits_the_smallest_window() { | |||
| 44 | ); | 44 | ); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | +/// The class the user reported twice in one day ("some menus are belongs to | ||
| 48 | +/// old ui ... for example resolution picker", then "right click menu in | ||
| 49 | +/// library is old too"): a surface that paints a *role* token | ||
| 50 | +/// (`BG_HOVER`/`BG_SELECTED`/`BG_RAISED`) rather than a Darkroom token used | ||
| 51 | +/// to get the legacy tree's pale greys, because the Darkroom palette still | ||
| 52 | +/// carried them. Dozens of call sites read those three roles; the fix is the | ||
| 53 | +/// palette, and this pins it: every interaction grey in the Darkroom palette | ||
| 54 | +/// stays inside DESIGN §2's `raised` band (#14171B - #17191D), with only the | ||
| 55 | +/// picked-row fill allowed one step past it, and each stays distinguishable | ||
| 56 | +/// from the one below it so a hover is still visible on a resting row. | ||
| 57 | +#[test] | ||
| 58 | +fn the_darkroom_palettes_interaction_greys_stay_inside_the_raised_band() { | ||
| 59 | + use crate::ui::theme::darkroom; | ||
| 60 | + let grey = |v: u32| (v >> 16 & 0xff, v >> 8 & 0xff, v & 0xff); | ||
| 61 | + let lum = |v: u32| { | ||
| 62 | + let (r, g, b) = grey(v); | ||
| 63 | + u32::from(r) + u32::from(g) + u32::from(b) | ||
| 64 | + }; | ||
| 65 | + let band_low = lum(0x14171b); | ||
| 66 | + let band_high = lum(0x17191d); | ||
| 67 | + for (name, value) in [ | ||
| 68 | + ("BG_RAISED", darkroom::BG_RAISED), | ||
| 69 | + ("BG_HOVER", darkroom::BG_HOVER), | ||
| 70 | + ] { | ||
| 71 | + assert!( | ||
| 72 | + (band_low..=band_high).contains(&lum(value)), | ||
| 73 | + "darkroom::{name} = {value:#08x} is outside DESIGN §2's raised band \ | ||
| 74 | + -- every menu, card and row that paints this role would open a \ | ||
| 75 | + pale plate in a dim room" | ||
| 76 | + ); | ||
| 77 | + } | ||
| 78 | + assert!( | ||
| 79 | + lum(darkroom::BG_SELECTED) > lum(darkroom::BG_HOVER) | ||
| 80 | + && lum(darkroom::BG_SELECTED) <= lum(0x1c1f24), | ||
| 81 | + "the picked-row fill is one step past hover at most; the real mark is \ | ||
| 82 | + the 1px ink1 ring (DESIGN §4)" | ||
| 83 | + ); | ||
| 84 | + assert!( | ||
| 85 | + lum(darkroom::BG_HOVER) > lum(darkroom::BG_RAISED), | ||
| 86 | + "hover must be a step ABOVE the resting raised fill or a hovered row \ | ||
| 87 | + cannot be seen at all" | ||
| 88 | + ); | ||
| 89 | + assert!( | ||
| 90 | + lum(darkroom::BG_HOVER_DIM) < lum(darkroom::BG_RAISED), | ||
| 91 | + "the dim hover is the step below, not above" | ||
| 92 | + ); | ||
| 93 | +} | ||
| 94 | + | ||
| 47 | /// The whole reason `ui/theme.rs` exists: a colour written anywhere else is | 95 | /// The whole reason `ui/theme.rs` exists: a colour written anywhere else is |
| 48 | /// a colour the next palette sweep will miss, which is exactly how 186 grey | 96 | /// a colour the next palette sweep will miss, which is exactly how 186 grey |
| 49 | /// calls survived every previous attempt at this. | 97 | /// calls survived every previous attempt at this. |
| @@ -2222,13 +2270,25 @@ fn settings_project_and_editor_sections_open_disjoint_doors() { | |||
| 2222 | let project_body = &source[project_start..editor_start]; | 2270 | let project_body = &source[project_start..editor_start]; |
| 2223 | let editor_body = &source[editor_start..render_start]; | 2271 | let editor_body = &source[editor_start..render_start]; |
| 2224 | 2272 | ||
| 2273 | + // `Pick::Theme` is the one list that is nobody's project -- the palette | ||
| 2274 | + // lives in ~/.config/edith like the subtitle font beside it (see | ||
| 2275 | + // `menus.rs`'s own note on the variant), so its row is EDITOR's by the | ||
| 2276 | + // same rule every other row here follows. The scan below is on the door | ||
| 2277 | + // *string*, so the palette row is subtracted from the EDITOR body before | ||
| 2278 | + // the project-door check runs rather than the check being loosened for | ||
| 2279 | + // every picker. | ||
| 2280 | + let editor_no_theme = editor_body.replace("open_picker(Pick::Theme", ""); | ||
| 2225 | for door in ["open_picker(", "open_mix("] { | 2281 | for door in ["open_picker(", "open_mix("] { |
| 2226 | assert!(project_body.contains(door), "PROJECT section no longer opens {door} -- update this guard"); | 2282 | assert!(project_body.contains(door), "PROJECT section no longer opens {door} -- update this guard"); |
| 2227 | assert!( | 2283 | assert!( |
| 2228 | - !editor_body.contains(door), | 2284 | + !editor_no_theme.contains(door), |
| 2229 | "EDITOR section opens {door}, a project-file door -- that value belongs in PROJECT, not here" | 2285 | "EDITOR section opens {door}, a project-file door -- that value belongs in PROJECT, not here" |
| 2230 | ); | 2286 | ); |
| 2231 | } | 2287 | } |
| 2288 | + assert!( | ||
| 2289 | + editor_body.contains("open_picker(Pick::Theme"), | ||
| 2290 | + "the palette row left EDITOR -- it is a ~/.config preference, not a project value" | ||
| 2291 | + ); | ||
| 2232 | for door in ["toggle_proxies(", "toggle_auto_proxies(", "open_subtitle_style("] { | 2292 | for door in ["toggle_proxies(", "toggle_auto_proxies(", "open_subtitle_style("] { |
| 2233 | assert!(editor_body.contains(door), "EDITOR section no longer opens {door} -- update this guard"); | 2293 | assert!(editor_body.contains(door), "EDITOR section no longer opens {door} -- update this guard"); |
| 2234 | assert!( | 2294 | assert!( |
crates/app/src/ui/cards.rsmodified+200 -122
| @@ -335,10 +335,30 @@ impl Player { | |||
| 335 | // The small print of a picked row sits on the highlight, where the | 335 | // The small print of a picked row sits on the highlight, where the |
| 336 | // dim ink is only 3.3:1 -- the row it lands on lifts it (WCAG | 336 | // dim ink is only 3.3:1 -- the row it lands on lifts it (WCAG |
| 337 | // 1.4.3, and the fit test pins both numbers). | 337 | // 1.4.3, and the fit test pins both numbers). |
| 338 | - let ink = match picked { | 338 | + // DESIGN §2's ink ladder, applied to a row rather than to a |
| 339 | - true => ink_primary, | 339 | + // whole card (user 2026-08-21: the export card's "colors are not |
| 340 | - false => ink_secondary, | 340 | + // aligning a little so hard to read"). Two faults it fixes: the |
| 341 | + // detail of a picked row was drawn BRIGHTER than the label it | ||
| 342 | + // belongs to -- the loudest thing on the row was its small print | ||
| 343 | + // -- and the resting rows' detail sat at `ink3` on `panel`, the | ||
| 344 | + // metadata step, for text that is the row's actual content and | ||
| 345 | + // has to be read at a glance. Label leads its row (`ink1` | ||
| 346 | + // picked, `ink2` resting), detail follows one step behind | ||
| 347 | + // (`ink2` picked, `ink2` resting -- never `ink3`, which stays | ||
| 348 | + // for the key column and the summary's small print). | ||
| 349 | + let ink = match (dark, picked) { | ||
| 350 | + (true, true) => INK2(), | ||
| 351 | + (true, false) => INK2(), | ||
| 352 | + (false, true) => ink_primary, | ||
| 353 | + (false, false) => ink_secondary, | ||
| 341 | }; | 354 | }; |
| 355 | + let label_ink = match (dark, picked) { | ||
| 356 | + (true, true) => INK1(), | ||
| 357 | + (true, false) => INK2(), | ||
| 358 | + (false, true) => ink_primary, | ||
| 359 | + (false, false) => ink_secondary, | ||
| 360 | + }; | ||
| 361 | + let key_ink = if dark { INK3() } else { ink_secondary }; | ||
| 342 | live(row(id), enabled) | 362 | live(row(id), enabled) |
| 343 | .when(picked, |d| d.bg(rgb(bg_selected))) | 363 | .when(picked, |d| d.bg(rgb(bg_selected))) |
| 344 | .child( | 364 | .child( |
| @@ -355,14 +375,22 @@ impl Player { | |||
| 355 | div() | 375 | div() |
| 356 | .w(px(EXPORT_KEY_W)) | 376 | .w(px(EXPORT_KEY_W)) |
| 357 | .text_size(px(11.)) | 377 | .text_size(px(11.)) |
| 358 | - .text_color(rgb(ink)) | 378 | + .text_color(rgb(key_ink)) |
| 359 | .when_some(mono_style.clone(), |d, style| { | 379 | .when_some(mono_style.clone(), |d, style| { |
| 360 | d.font(style.font).text_size(style.size) | 380 | d.font(style.font).text_size(style.size) |
| 361 | }) | 381 | }) |
| 362 | .child(SharedString::from(key.to_string())), | 382 | .child(SharedString::from(key.to_string())), |
| 363 | ) | 383 | ) |
| 364 | .child( | 384 | .child( |
| 385 | + // A fixed label column in the darkroom: the | ||
| 386 | + // details are the long half and they wrap, so | ||
| 387 | + // without one they start at a different x on | ||
| 388 | + // every row and a wrapped line reads as if it | ||
| 389 | + // began left of the label it belongs to. | ||
| 365 | div() | 390 | div() |
| 391 | + .when(dark, |d| { | ||
| 392 | + d.w(px(92.)).flex_none().text_color(rgb(label_ink)) | ||
| 393 | + }) | ||
| 366 | .when_some(label_style.clone(), |d, style| { | 394 | .when_some(label_style.clone(), |d, style| { |
| 367 | d.font(style.font).text_size(style.size) | 395 | d.font(style.font).text_size(style.size) |
| 368 | }) | 396 | }) |
| @@ -866,13 +894,13 @@ impl Player { | |||
| 866 | // off the front pane with the rows they reshape -- so a shut | 894 | // off the front pane with the rows they reshape -- so a shut |
| 867 | // pane advertises `s` instead of a pair of keys with nothing on | 895 | // pane advertises `s` instead of a pair of keys with nothing on |
| 868 | // screen for them to touch. | 896 | // screen for them to touch. |
| 897 | + // Short enough to read at a glance in the plate's own head row: | ||
| 898 | + // the long four-clause sentence was 11px `ink3` mono across the | ||
| 899 | + // whole sheet and read as noise above the rows it was meant to | ||
| 900 | + // explain (user 2026-08-21: "hard to read"). | ||
| 869 | (None, None) => match self.export_advanced_open { | 901 | (None, None) => match self.export_advanced_open { |
| 870 | - true => "the keys are on the rows · enter exports · \ | 902 | + true => "↵ exports · esc closes · g/r layout".into(), |
| 871 | - a click away or esc closes · g/r change the layout" | 903 | + false => "↵ exports · esc closes · s Advanced".into(), |
| 872 | - .into(), | ||
| 873 | - false => "the keys are on the rows · enter exports · \ | ||
| 874 | - a click away or esc closes · s for Advanced" | ||
| 875 | - .into(), | ||
| 876 | }, | 904 | }, |
| 877 | }; | 905 | }; |
| 878 | if dark { | 906 | if dark { |
| @@ -885,6 +913,33 @@ impl Player { | |||
| 885 | // paints nothing (`SCRIM()` is deliberately not applied here) -- | 913 | // paints nothing (`SCRIM()` is deliberately not applied here) -- |
| 886 | // an invisible catcher changes zero picture pixels while a | 914 | // an invisible catcher changes zero picture pixels while a |
| 887 | // dimming one would still tint the screen it must never cover. | 915 | // dimming one would still tint the screen it must never cover. |
| 916 | + // The plate is the room's below-picture footprint, not a 340px | ||
| 917 | + // corner card (user 2026-08-21: "export section is not aligning | ||
| 918 | + // with our design"). Measured at 1280x720 the corner card's own | ||
| 919 | + // max-height was ~9px taller than the footprint it had to fit | ||
| 920 | + // in, so its scrolling row list collapsed to a single visible | ||
| 921 | + // row: the presets, Advanced and every codec row under them were | ||
| 922 | + // unreachable by pointer, and the long status sentence wrapped to | ||
| 923 | + // three lines over the top of them. Two columns instead -- rows | ||
| 924 | + // left, what-it-adds-up-to and the one bordered chip right -- | ||
| 925 | + // inside the same bench+ledger footprint every menu already | ||
| 926 | + // hangs in, so the picture stays uncovered (§11 check 6) and the | ||
| 927 | + // list gets the whole height rather than a fraction of it. | ||
| 928 | + let floor = crate::ui::stance::below_picture_floor( | ||
| 929 | + f32::from(viewport.height), | ||
| 930 | + self.split_px(Split::Bench, viewport), | ||
| 931 | + ); | ||
| 932 | + let summary = |text: SharedString, ink: u32| { | ||
| 933 | + div() | ||
| 934 | + .flex_none() | ||
| 935 | + .px(px(6.)) | ||
| 936 | + .type_style(type_scale::mono( | ||
| 937 | + type_scale::CHORD_METADATA_MAX_PX, | ||
| 938 | + gpui::FontWeight::MEDIUM, | ||
| 939 | + )) | ||
| 940 | + .text_color(rgb(ink)) | ||
| 941 | + .child(text) | ||
| 942 | + }; | ||
| 888 | return Some( | 943 | return Some( |
| 889 | div() | 944 | div() |
| 890 | .id("export-click-catcher") | 945 | .id("export-click-catcher") |
| @@ -894,9 +949,14 @@ impl Player { | |||
| 894 | .left_0() | 949 | .left_0() |
| 895 | .right_0() | 950 | .right_0() |
| 896 | .flex() | 951 | .flex() |
| 897 | - .items_end() | 952 | + // Below the time band, not merely below the picture: the |
| 898 | - .justify_end() | 953 | + // transport and the Export chip that opened this card are |
| 899 | - .p(px(12.)) | 954 | + // on that band, and a sheet drawn over them hides the |
| 955 | + // control the editor just pressed. The bench and the | ||
| 956 | + // ledger are what this plate is allowed to cover. | ||
| 957 | + .pt(px(floor + crate::ui::stance::TIME_BAND_H + 6.)) | ||
| 958 | + .pb(px(6.)) | ||
| 959 | + .px(px(6.)) | ||
| 900 | .on_mouse_down( | 960 | .on_mouse_down( |
| 901 | MouseButton::Left, | 961 | MouseButton::Left, |
| 902 | cx.listener(|this, _: &MouseDownEvent, _, cx| { | 962 | cx.listener(|this, _: &MouseDownEvent, _, cx| { |
| @@ -908,131 +968,149 @@ impl Player { | |||
| 908 | .child( | 968 | .child( |
| 909 | div() | 969 | div() |
| 910 | .id("export-plate") | 970 | .id("export-plate") |
| 911 | - .w(px(EXPORT_W.min(340.))) | 971 | + .flex_1() |
| 912 | - .max_h(px(4. * KEYS_ROW_H + rows_h + 90.)) | 972 | + .min_w(px(0.)) |
| 913 | .on_mouse_down(MouseButton::Left, swallow) | 973 | .on_mouse_down(MouseButton::Left, swallow) |
| 914 | .flex() | 974 | .flex() |
| 915 | .flex_col() | 975 | .flex_col() |
| 916 | - .gap(px(2.)) | 976 | + .gap(px(4.)) |
| 917 | .p(px(10.)) | 977 | .p(px(10.)) |
| 918 | - .rounded(px(6.)) | 978 | + .rounded(px(4.)) |
| 919 | .bg(rgb(DARK_PANEL())) | 979 | .bg(rgb(DARK_PANEL())) |
| 920 | .border_1() | 980 | .border_1() |
| 921 | .border_color(rgba(DARK_SEAM())) | 981 | .border_color(rgba(DARK_SEAM())) |
| 922 | .child( | 982 | .child( |
| 923 | div() | 983 | div() |
| 924 | .flex_none() | 984 | .flex_none() |
| 925 | - .px(px(6.)) | ||
| 926 | - .type_style(type_scale::head()) | ||
| 927 | - .text_color(rgb(INK3())) | ||
| 928 | - .child("EXPORT"), | ||
| 929 | - ) | ||
| 930 | - .child( | ||
| 931 | - div() | ||
| 932 | - .flex_none() | ||
| 933 | - .px(px(6.)) | ||
| 934 | - .text_color(rgb(INK3())) | ||
| 935 | - .type_style(type_scale::mono( | ||
| 936 | - type_scale::CHORD_METADATA_MAX_PX, | ||
| 937 | - gpui::FontWeight::MEDIUM, | ||
| 938 | - )) | ||
| 939 | - .child(status_line), | ||
| 940 | - ) | ||
| 941 | - .child( | ||
| 942 | - div() | ||
| 943 | - .id("export-rows") | ||
| 944 | .flex() | 985 | .flex() |
| 945 | - .flex_col() | 986 | + .items_baseline() |
| 946 | - .gap(px(2.)) | 987 | + .justify_between() |
| 947 | - .max_h(px(rows_h)) | 988 | + .gap(px(12.)) |
| 948 | - .overflow_y_scroll() | ||
| 949 | - .children(list), | ||
| 950 | - ) | ||
| 951 | - .child( | ||
| 952 | - div() | ||
| 953 | - .flex_none() | ||
| 954 | - .px(px(6.)) | ||
| 955 | - .type_style(type_scale::mono( | ||
| 956 | - type_scale::CHORD_METADATA_MAX_PX, | ||
| 957 | - gpui::FontWeight::MEDIUM, | ||
| 958 | - )) | ||
| 959 | - .text_color(rgb(INK2())) | ||
| 960 | - .child(head), | ||
| 961 | - ) | ||
| 962 | - .children(self.range.map(|(start, end)| { | ||
| 963 | - div() | ||
| 964 | - .flex_none() | ||
| 965 | - .px(px(6.)) | ||
| 966 | - .type_style(type_scale::mono( | ||
| 967 | - type_scale::CHORD_METADATA_MAX_PX, | ||
| 968 | - gpui::FontWeight::MEDIUM, | ||
| 969 | - )) | ||
| 970 | - .text_color(rgb(INK3())) | ||
| 971 | - .child(format!( | ||
| 972 | - "RANGE {}\u{2013}{} ({})", | ||
| 973 | - timecode(f64::from(start) / self.fps, self.fps), | ||
| 974 | - timecode(f64::from(end) / self.fps, self.fps), | ||
| 975 | - frames_timecode(end - start, self.fps), | ||
| 976 | - )) | ||
| 977 | - })) | ||
| 978 | - .child( | ||
| 979 | - div() | ||
| 980 | - .flex_none() | ||
| 981 | .px(px(6.)) | 989 | .px(px(6.)) |
| 982 | - .type_style(type_scale::mono( | 990 | + .child( |
| 983 | - type_scale::CHORD_METADATA_MAX_PX, | 991 | + div() |
| 984 | - gpui::FontWeight::MEDIUM, | 992 | + .type_style(type_scale::head()) |
| 985 | - )) | 993 | + .text_color(rgb(INK3())) |
| 986 | - .text_color(rgb(INK3())) | 994 | + .child("EXPORT"), |
| 987 | - .child(tail), | 995 | + ) |
| 996 | + .child( | ||
| 997 | + div() | ||
| 998 | + .min_w(px(0.)) | ||
| 999 | + .truncate() | ||
| 1000 | + .type_style(type_scale::mono( | ||
| 1001 | + type_scale::CHORD_METADATA_MAX_PX, | ||
| 1002 | + gpui::FontWeight::MEDIUM, | ||
| 1003 | + )) | ||
| 1004 | + .text_color(rgb(INK2())) | ||
| 1005 | + .child(status_line), | ||
| 1006 | + ), | ||
| 988 | ) | 1007 | ) |
| 989 | - // §4: "the single bordered chip in the whole | ||
| 990 | - // room" -- ghosts everywhere else in this card, | ||
| 991 | - // one border here, wearing its chord live off | ||
| 992 | - // the keymap so a rebind cannot leave it stale. | ||
| 993 | .child( | 1008 | .child( |
| 994 | div() | 1009 | div() |
| 995 | - .id("export-confirm") | 1010 | + .flex_1() |
| 996 | - .mt(px(4.)) | 1011 | + .min_h(px(0.)) |
| 997 | .flex() | 1012 | .flex() |
| 998 | - .items_center() | 1013 | + .gap(px(10.)) |
| 999 | - .justify_center() | 1014 | + .child( |
| 1000 | - .gap(px(6.)) | 1015 | + div() |
| 1001 | - .h(px(CONTROL_H)) | 1016 | + .id("export-rows") |
| 1002 | - .px(px(10.)) | 1017 | + .flex_1() |
| 1003 | - .rounded(px(3.)) | 1018 | + .min_w(px(0.)) |
| 1004 | - .border_1() | 1019 | + .h_full() |
| 1005 | - .border_color(rgb(match blocked.is_some() { | 1020 | + .flex() |
| 1006 | - true => INK4(), | 1021 | + .flex_col() |
| 1007 | - false => INK2(), | 1022 | + .gap(px(2.)) |
| 1008 | - })) | 1023 | + .overflow_y_scroll() |
| 1009 | - .when(blocked.is_none(), |d| d.cursor_pointer()) | 1024 | + .children(list), |
| 1010 | - .when(blocked.is_some(), |d| d.cursor_not_allowed()) | 1025 | + ) |
| 1011 | - .hover(|s| s.bg(rgb(DARK_RAISED()))) | 1026 | + .child( |
| 1012 | - .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { | 1027 | + div() |
| 1013 | - this.start_export(cx) | 1028 | + .flex_none() |
| 1014 | - })) | 1029 | + .w(px(300.)) |
| 1015 | - .type_style(type_scale::label( | 1030 | + .h_full() |
| 1016 | - type_scale::LABEL_ROW_PX, | 1031 | + .flex() |
| 1017 | - gpui::FontWeight::MEDIUM, | 1032 | + .flex_col() |
| 1018 | - )) | 1033 | + .justify_end() |
| 1019 | - .text_color(rgb(match blocked.is_some() { | 1034 | + .gap(px(4.)) |
| 1020 | - true => INK4(), | 1035 | + .border_l_1() |
| 1021 | - false => INK1(), | 1036 | + .border_color(rgb(DARK_HAIRLINE())) |
| 1022 | - })) | 1037 | + .pl(px(8.)) |
| 1023 | - .child(action) | 1038 | + .child(summary(head.into(), INK2())) |
| 1024 | - .when(blocked.is_none(), |d| { | 1039 | + .children(self.range.map(|(start, end)| { |
| 1025 | - d.child( | 1040 | + summary( |
| 1026 | - div() | 1041 | + format!( |
| 1027 | - .type_style(type_scale::mono( | 1042 | + "RANGE {}\u{2013}{} ({})", |
| 1028 | - type_scale::CHORD_METADATA_MIN_PX, | 1043 | + timecode( |
| 1029 | - gpui::FontWeight::MEDIUM, | 1044 | + f64::from(start) / self.fps, |
| 1030 | - )) | 1045 | + self.fps |
| 1031 | - .text_color(rgb(INK3())) | 1046 | + ), |
| 1032 | - .child(self.keymap.chord(ActionId::Export)), | 1047 | + timecode(f64::from(end) / self.fps, self.fps), |
| 1033 | - ) | 1048 | + frames_timecode(end - start, self.fps), |
| 1034 | - }), | 1049 | + ) |
| 1035 | - ), | 1050 | + .into(), |
| 1051 | + INK3(), | ||
| 1052 | + ) | ||
| 1053 | + })) | ||
| 1054 | + .child(summary(tail.into(), INK3())) | ||
| 1055 | + // §4: "the single bordered chip in | ||
| 1056 | + // the whole room" -- ghosts | ||
| 1057 | + // everywhere else in this card, one | ||
| 1058 | + // border here, wearing its chord | ||
| 1059 | + // live off the keymap so a rebind | ||
| 1060 | + // cannot leave it stale. | ||
| 1061 | + .child( | ||
| 1062 | + div() | ||
| 1063 | + .id("export-confirm") | ||
| 1064 | + .mt(px(4.)) | ||
| 1065 | + .flex() | ||
| 1066 | + .items_center() | ||
| 1067 | + .justify_center() | ||
| 1068 | + .gap(px(6.)) | ||
| 1069 | + .h(px(CONTROL_H)) | ||
| 1070 | + .px(px(10.)) | ||
| 1071 | + .rounded(px(3.)) | ||
| 1072 | + .border_1() | ||
| 1073 | + .border_color(rgb(match blocked.is_some() { | ||
| 1074 | + true => INK4(), | ||
| 1075 | + false => INK2(), | ||
| 1076 | + })) | ||
| 1077 | + .when(blocked.is_none(), |d| d.cursor_pointer()) | ||
| 1078 | + .when(blocked.is_some(), |d| { | ||
| 1079 | + d.cursor_not_allowed() | ||
| 1080 | + }) | ||
| 1081 | + .hover(|s| s.bg(rgb(DARK_RAISED()))) | ||
| 1082 | + .on_click(cx.listener( | ||
| 1083 | + |this, _: &ClickEvent, _, cx| { | ||
| 1084 | + this.start_export(cx) | ||
| 1085 | + }, | ||
| 1086 | + )) | ||
| 1087 | + .type_style(type_scale::label( | ||
| 1088 | + type_scale::LABEL_ROW_PX, | ||
| 1089 | + gpui::FontWeight::MEDIUM, | ||
| 1090 | + )) | ||
| 1091 | + .text_color(rgb(match blocked.is_some() { | ||
| 1092 | + true => INK4(), | ||
| 1093 | + false => INK1(), | ||
| 1094 | + })) | ||
| 1095 | + .child(action) | ||
| 1096 | + .when(blocked.is_none(), |d| { | ||
| 1097 | + d.child( | ||
| 1098 | + div() | ||
| 1099 | + .type_style(type_scale::mono( | ||
| 1100 | + type_scale::CHORD_METADATA_MIN_PX, | ||
| 1101 | + gpui::FontWeight::MEDIUM, | ||
| 1102 | + )) | ||
| 1103 | + .text_color(rgb(INK3())) | ||
| 1104 | + .child( | ||
| 1105 | + self.keymap | ||
| 1106 | + .chord(ActionId::Export), | ||
| 1107 | + ), | ||
| 1108 | + ) | ||
| 1109 | + }), | ||
| 1110 | + ), | ||
| 1111 | + ), | ||
| 1112 | + ) | ||
| 1113 | + .into_any_element(), | ||
| 1036 | ) | 1114 | ) |
| 1037 | .into_any_element(), | 1115 | .into_any_element(), |
| 1038 | ); | 1116 | ); |
crates/app/src/ui/dock_stance.rsmodified+40 -0
| @@ -260,6 +260,7 @@ fn source_row( | |||
| 260 | let (path, stream) = (row.path.clone(), row.stream); | 260 | let (path, stream) = (row.path.clone(), row.stream); |
| 261 | let dragged = (path.clone(), stream); | 261 | let dragged = (path.clone(), stream); |
| 262 | let dot_path = path.clone(); | 262 | let dot_path = path.clone(); |
| 263 | + let menu_path = path.clone(); | ||
| 263 | let ghost = name.clone(); | 264 | let ghost = name.clone(); |
| 264 | div() | 265 | div() |
| 265 | .id(("dock-source", i)) | 266 | .id(("dock-source", i)) |
| @@ -283,6 +284,28 @@ fn source_row( | |||
| 283 | // line, so the general focus/selection ring applies, the same one | 284 | // line, so the general focus/selection ring applies, the same one |
| 284 | // the bench already uses for the same job. | 285 | // the bench already uses for the same job. |
| 285 | .when(picked, |d| d.border_1().border_color(rgb(INK1()))) | 286 | .when(picked, |d| d.border_1().border_color(rgb(INK1()))) |
| 287 | + // Right-click ANYWHERE on the row opens the row's menu -- Add, | ||
| 288 | + // Remove, Reveal, Properties (DESIGN §9: "verbs of the thing under | ||
| 289 | + // the cursor"). It used to hang off the 8px ink dot alone, and only | ||
| 290 | + // for a usable row, which is how the room shipped with no reachable | ||
| 291 | + // way to take a source out of the library at all (user 2026-08-21: | ||
| 292 | + // "can not remove a media from library") -- and the one row that | ||
| 293 | + // most wants removing, a file the editor cannot use, was the one | ||
| 294 | + // row whose menu was gated off. Unconditional now, dot included. | ||
| 295 | + .on_mouse_down( | ||
| 296 | + MouseButton::Right, | ||
| 297 | + cx.listener(move |this, event: &MouseDownEvent, _, cx| { | ||
| 298 | + cx.stop_propagation(); | ||
| 299 | + this.selected_asset = Some((menu_path.clone(), stream)); | ||
| 300 | + this.library_menu = Some(LibraryMenu { | ||
| 301 | + path: menu_path.clone(), | ||
| 302 | + stream, | ||
| 303 | + at: event.position, | ||
| 304 | + details: false, | ||
| 305 | + }); | ||
| 306 | + cx.notify(); | ||
| 307 | + }), | ||
| 308 | + ) | ||
| 286 | .when(usable, |d| { | 309 | .when(usable, |d| { |
| 287 | d.cursor_pointer() | 310 | d.cursor_pointer() |
| 288 | .hover(|s| s.bg(rgb(DARK_RAISED()))) | 311 | .hover(|s| s.bg(rgb(DARK_RAISED()))) |
| @@ -551,6 +574,23 @@ fn sources_tab(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | |||
| 551 | "imports the file named on the clipboard", | 574 | "imports the file named on the clipboard", |
| 552 | player, | 575 | player, |
| 553 | cx.listener(|this, _: &ClickEvent, _, cx| this.paste_file_path(cx)), | 576 | cx.listener(|this, _: &ClickEvent, _, cx| this.paste_file_path(cx)), |
| 577 | + )) | ||
| 578 | + // Subtitles come in through the same door every other file | ||
| 579 | + // does. This row is `↓S`'s new geographic home: the spine's | ||
| 580 | + // TRACK group carried it as a two-glyph badge on a 56px rail | ||
| 581 | + // that no longer had the height for it (user 2026-08-21: | ||
| 582 | + // "the spine menu is too crowded"), and an import belongs | ||
| 583 | + // beside the other two imports, not beside the lane verbs. | ||
| 584 | + .child(ghost_verb( | ||
| 585 | + "dock-import-subtitles", | ||
| 586 | + "Import subtitles", | ||
| 587 | + ActionId::ImportSubtitles, | ||
| 588 | + false, | ||
| 589 | + "reads an .srt/.ass file onto a subtitle lane", | ||
| 590 | + player, | ||
| 591 | + cx.listener(|this, _: &ClickEvent, window, cx| { | ||
| 592 | + this.act(ActionId::ImportSubtitles, window, cx) | ||
| 593 | + }), | ||
| 554 | )), | 594 | )), |
| 555 | ) | 595 | ) |
| 556 | .child({ | 596 | .child({ |
crates/app/src/ui/library.rsmodified+14 -11
| @@ -657,6 +657,19 @@ impl Player { | |||
| 657 | // right-clicked is not a row, and one this moment refuses is drawn | 657 | // right-clicked is not a row, and one this moment refuses is drawn |
| 658 | // dimmed and says why in place of its hint. | 658 | // dimmed and says why in place of its hint. |
| 659 | for item in row_items(ctx) { | 659 | for item in row_items(ctx) { |
| 660 | + // DESIGN §9: destructive verbs sit below a rule line. One | ||
| 661 | + // hairline, drawn once, above whichever of the two removes | ||
| 662 | + // this row context offers. | ||
| 663 | + if matches!(item, RowItem::Remove | RowItem::RemoveWithClips) && darkroom { | ||
| 664 | + rows.push( | ||
| 665 | + div() | ||
| 666 | + .flex_none() | ||
| 667 | + .my(px(3.)) | ||
| 668 | + .h(px(1.)) | ||
| 669 | + .bg(rgb(DARK_HAIRLINE())) | ||
| 670 | + .into_any_element(), | ||
| 671 | + ); | ||
| 672 | + } | ||
| 660 | let refusal = row_enable(item, ctx); | 673 | let refusal = row_enable(item, ctx); |
| 661 | let enabled = refusal.yes(); | 674 | let enabled = refusal.yes(); |
| 662 | rows.push( | 675 | rows.push( |
| @@ -711,17 +724,7 @@ impl Player { | |||
| 711 | }), | 724 | }), |
| 712 | ) | 725 | ) |
| 713 | .child( | 726 | .child( |
| 714 | - div() | 727 | + menu_plate("library-menu-card", x, y, darkroom) |
| 715 | - .id("library-menu-card") | ||
| 716 | - .absolute() | ||
| 717 | - .left(px(x)) | ||
| 718 | - .top(px(y)) | ||
| 719 | - .w(px(MENU_W)) | ||
| 720 | - .flex() | ||
| 721 | - .flex_col() | ||
| 722 | - .p(px(MENU_PAD)) | ||
| 723 | - .rounded(px(6.)) | ||
| 724 | - .bg(rgb(BG_RAISED())) | ||
| 725 | // Painted after the scrim, so this listener runs first | 728 | // Painted after the scrim, so this listener runs first |
| 726 | // and a press meant for an item never closes the menu | 729 | // and a press meant for an item never closes the menu |
| 727 | // out from under its own click (`context_card`). | 730 | // out from under its own click (`context_card`). |
crates/app/src/ui/overlays.rsmodified+55 -35
| @@ -617,11 +617,28 @@ impl Player { | |||
| 617 | // The one item that is not about this clip says so, and says it | 617 | // The one item that is not about this clip says so, and says it |
| 618 | // here rather than in the registry: the stroke is global too, | 618 | // here rather than in the registry: the stroke is global too, |
| 619 | // but its row in the keys menu is not sitting on a clip. | 619 | // but its row in the keys menu is not sitting on a clip. |
| 620 | + // The registry's label is a sentence -- it has to be, the keys | ||
| 621 | + // overlay reads the same string -- and a sentence in a 260px | ||
| 622 | + // plate row is cut mid-word by the chord column beside it | ||
| 623 | + // ("Ungroup the selection (clips anc", "Group the selection | ||
| 624 | + // (ctrl-c"). DESIGN §7's rule for the bench applies to a menu | ||
| 625 | + // too: labels never truncate into soup. The verb is the head | ||
| 626 | + // of the sentence, up to its first parenthesis or em-dash; | ||
| 627 | + // the tail is what the row's tooltip carries, so nothing is | ||
| 628 | + // lost, it just stops being drawn over the chord. | ||
| 629 | + let full = action.label(); | ||
| 630 | + let verb = full | ||
| 631 | + .split_once(" (") | ||
| 632 | + .map(|(head, _)| head) | ||
| 633 | + .or_else(|| full.split_once(" — ").map(|(head, _)| head)) | ||
| 634 | + .or_else(|| full.split_once(": ").map(|(head, _)| head)) | ||
| 635 | + .unwrap_or(full); | ||
| 620 | let label = if matches!(action, ActionId::ToggleMute | ActionId::Paste) { | 636 | let label = if matches!(action, ActionId::ToggleMute | ActionId::Paste) { |
| 621 | - format!("{} (global)", action.label()) | 637 | + format!("{verb} (global)") |
| 622 | } else { | 638 | } else { |
| 623 | - action.label().to_string() | 639 | + verb.to_string() |
| 624 | }; | 640 | }; |
| 641 | + let say: SharedString = full.to_string().into(); | ||
| 625 | rows.push( | 642 | rows.push( |
| 626 | row(rows.len()) | 643 | row(rows.len()) |
| 627 | // Truncated and shrinkable: a long label ("Transform — | 644 | // Truncated and shrinkable: a long label ("Transform — |
| @@ -630,6 +647,7 @@ impl Player { | |||
| 630 | // of sharing the row with it, which is why Transform | 647 | // of sharing the row with it, which is why Transform |
| 631 | // showed no stroke while a short label like Colour's | 648 | // showed no stroke while a short label like Colour's |
| 632 | // did. | 649 | // did. |
| 650 | + .tooltip(move |_, cx| cx.new(|_| Tip(say.clone())).into()) | ||
| 633 | .child(div().min_w(px(0.)).flex_shrink().truncate().child(label)) | 651 | .child(div().min_w(px(0.)).flex_shrink().truncate().child(label)) |
| 634 | .child(match refusal.why() { | 652 | .child(match refusal.why() { |
| 635 | // One truncated line, like the details side: a | 653 | // One truncated line, like the details side: a |
| @@ -737,19 +755,10 @@ impl Player { | |||
| 737 | }), | 755 | }), |
| 738 | ) | 756 | ) |
| 739 | .child( | 757 | .child( |
| 740 | - div() | 758 | + // One plate shape for all three hanging menus |
| 741 | - // Only so the details side can carry a tooltip, which | 759 | + // ([`menu_plate`]) -- the id is still this menu's own, so |
| 742 | - // gpui gives to identified elements alone. | 760 | + // the details side keeps its tooltip. |
| 743 | - .id("menu-card") | 761 | + menu_plate("menu-card", x, y, darkroom) |
| 744 | - .absolute() | ||
| 745 | - .left(px(x)) | ||
| 746 | - .top(px(y)) | ||
| 747 | - .w(px(MENU_W)) | ||
| 748 | - .flex() | ||
| 749 | - .flex_col() | ||
| 750 | - .p(px(MENU_PAD)) | ||
| 751 | - .rounded(px(6.)) | ||
| 752 | - .bg(rgb(BG_RAISED())) | ||
| 753 | // Painted after the scrim, so this listener runs first | 762 | // Painted after the scrim, so this listener runs first |
| 754 | // (gpui bubbles mouse events in reverse, window.rs:3705) | 763 | // (gpui bubbles mouse events in reverse, window.rs:3705) |
| 755 | // and a press meant for an item never closes the menu | 764 | // and a press meant for an item never closes the menu |
| @@ -819,17 +828,36 @@ impl Player { | |||
| 819 | .text_color(rgb(INK2())) | 828 | .text_color(rgb(INK2())) |
| 820 | }) | 829 | }) |
| 821 | .cursor_pointer() | 830 | .cursor_pointer() |
| 822 | - .hover(|s| s.bg(rgb(BG_HOVER()))) | 831 | + // DEFECT (user 2026-08-21: "some menus are belongs to old |
| 832 | + // ui ... for example resolution picker"): the list painted | ||
| 833 | + // the legacy sheet's greys (`BG_RAISED`/`BG_HOVER`/ | ||
| 834 | + // `BG_SELECTED`, `FG_*`) in the darkroom too, so a room | ||
| 835 | + // whose every other plate is canvas-on-panel opened one | ||
| 836 | + // pale rounded card. The darkroom pass below is the same | ||
| 837 | + // plate grammar `context_card`/`library_card` already | ||
| 838 | + // draw: one `raised` fill step for hover, `ink1` for the | ||
| 839 | + // row in force, no second grey. | ||
| 840 | + .hover(|s| s.bg(rgb(if darkroom { DARK_RAISED() } else { BG_HOVER() }))) | ||
| 823 | // The mark is a glyph as well as a highlight, like the | 841 | // The mark is a glyph as well as a highlight, like the |
| 824 | // export card's rows: a background alone is gone under a | 842 | // export card's rows: a background alone is gone under a |
| 825 | // hover and invisible to anyone who cannot tell the two | 843 | // hover and invisible to anyone who cannot tell the two |
| 826 | // greys apart (WCAG 1.4.1). | 844 | // greys apart (WCAG 1.4.1). |
| 827 | - .when(picked, |d| d.bg(rgb(BG_SELECTED()))) | 845 | + .when(picked, |d| { |
| 846 | + d.bg(rgb(if darkroom { | ||
| 847 | + DARK_RAISED() | ||
| 848 | + } else { | ||
| 849 | + BG_SELECTED() | ||
| 850 | + })) | ||
| 851 | + .when(darkroom, |d| d.text_color(rgb(INK1()))) | ||
| 852 | + }) | ||
| 828 | // Where the keyboard is, said after the mark so the cursor | 853 | // Where the keyboard is, said after the mark so the cursor |
| 829 | - // is visible on the picked row too -- and as a background, | 854 | + // is visible on the picked row too -- and as a border in |
| 830 | - // not a border, because a row that grew a stroke would move | 855 | + // the darkroom (DESIGN §4's 1px `ink1` focus ring) rather |
| 831 | - // every row under it. | 856 | + // than a second grey nobody can tell from the first. |
| 832 | - .when(n == picker.sel, |d| d.bg(rgb(BG_HOVER()))) | 857 | + .when(n == picker.sel, |d| match darkroom { |
| 858 | + true => d.border_1().border_color(rgb(INK1())), | ||
| 859 | + false => d.bg(rgb(BG_HOVER())), | ||
| 860 | + }) | ||
| 833 | .child( | 861 | .child( |
| 834 | div() | 862 | div() |
| 835 | .flex() | 863 | .flex() |
| @@ -849,9 +877,11 @@ impl Player { | |||
| 849 | .text_size(px(11.)) | 877 | .text_size(px(11.)) |
| 850 | // On the picked row the dim ink sits on the | 878 | // On the picked row the dim ink sits on the |
| 851 | // highlight, where it is only 3.3:1 (WCAG 1.4.3). | 879 | // highlight, where it is only 3.3:1 (WCAG 1.4.3). |
| 852 | - .text_color(rgb(match picked { | 880 | + .text_color(rgb(match (darkroom, picked) { |
| 853 | - true => FG_PRIMARY(), | 881 | + (true, true) => INK2(), |
| 854 | - false => FG_SECONDARY(), | 882 | + (true, false) => INK3(), |
| 883 | + (false, true) => FG_PRIMARY(), | ||
| 884 | + (false, false) => FG_SECONDARY(), | ||
| 855 | })) | 885 | })) |
| 856 | .when(darkroom, |d| { | 886 | .when(darkroom, |d| { |
| 857 | d.type_style(type_scale::mono( | 887 | d.type_style(type_scale::mono( |
| @@ -893,17 +923,7 @@ impl Player { | |||
| 893 | }), | 923 | }), |
| 894 | ) | 924 | ) |
| 895 | .child( | 925 | .child( |
| 896 | - div() | 926 | + menu_plate("picker-card", x, y, darkroom) |
| 897 | - .id("picker-card") | ||
| 898 | - .absolute() | ||
| 899 | - .left(px(x)) | ||
| 900 | - .top(px(y)) | ||
| 901 | - .w(px(MENU_W)) | ||
| 902 | - .flex() | ||
| 903 | - .flex_col() | ||
| 904 | - .p(px(MENU_PAD)) | ||
| 905 | - .rounded(px(6.)) | ||
| 906 | - .bg(rgb(BG_RAISED())) | ||
| 907 | // Painted after the scrim, so this listener runs first | 927 | // Painted after the scrim, so this listener runs first |
| 908 | // and a press meant for a row never closes the list out | 928 | // and a press meant for a row never closes the list out |
| 909 | // from under its own click (`context_card`). | 929 | // from under its own click (`context_card`). |
crates/app/src/ui/settings_stance.rsmodified+139 -21
| @@ -66,6 +66,34 @@ fn row( | |||
| 66 | row_ink(id, label_text, value, hint, player, on_click, INK1()) | 66 | row_ink(id, label_text, value, hint, player, on_click, INK1()) |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | +/// [`row`] for a setting a chord also reaches: the stroke rides in the row's | ||
| 70 | +/// own right-hand side, ahead of the value, in the mono chord ink every other | ||
| 71 | +/// darkroom surface wears it in (DESIGN §4 -- "every command wears its chord, | ||
| 72 | +/// everywhere it appears"). Three settings arrived here from the spine when | ||
| 73 | +/// the rail ran out of height (proxies, auto-proxies, the palette); each one | ||
| 74 | +/// had its chord on the rail's badge, and none of them may lose it on the way | ||
| 75 | +/// over. | ||
| 76 | +fn row_keyed( | ||
| 77 | + id: &'static str, | ||
| 78 | + label_text: &'static str, | ||
| 79 | + value: impl Into<SharedString>, | ||
| 80 | + hint: &'static str, | ||
| 81 | + action: ActionId, | ||
| 82 | + player: &Player, | ||
| 83 | + on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, | ||
| 84 | +) -> impl IntoElement { | ||
| 85 | + row_full( | ||
| 86 | + id, | ||
| 87 | + label_text, | ||
| 88 | + value, | ||
| 89 | + hint, | ||
| 90 | + Some(player.keymap.chord(action).into()), | ||
| 91 | + player, | ||
| 92 | + on_click, | ||
| 93 | + INK1(), | ||
| 94 | + ) | ||
| 95 | +} | ||
| 96 | + | ||
| 69 | /// [`row`] with the value's ink chosen by the caller -- [`INK4`] for a value | 97 | /// [`row`] with the value's ink chosen by the caller -- [`INK4`] for a value |
| 70 | /// that is not really a value yet (nothing to show until a project opens), | 98 | /// that is not really a value yet (nothing to show until a project opens), |
| 71 | /// so it reads as absent rather than as a fifth real setting. | 99 | /// so it reads as absent rather than as a fifth real setting. |
| @@ -77,6 +105,24 @@ fn row_ink( | |||
| 77 | player: &Player, | 105 | player: &Player, |
| 78 | on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, | 106 | on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, |
| 79 | value_ink: u32, | 107 | value_ink: u32, |
| 108 | +) -> impl IntoElement { | ||
| 109 | + row_full(id, label_text, value, hint, None, player, on_click, value_ink) | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +/// The one row body all three wrappers share. `chord` is the stroke that also | ||
| 113 | +/// reaches this setting, drawn in mono `ink3` *beside* the value rather than | ||
| 114 | +/// over it -- three settings came here off the spine and each one keeps the | ||
| 115 | +/// badge it wore there (DESIGN §4). | ||
| 116 | +#[allow(clippy::too_many_arguments)] | ||
| 117 | +fn row_full( | ||
| 118 | + id: &'static str, | ||
| 119 | + label_text: &'static str, | ||
| 120 | + value: impl Into<SharedString>, | ||
| 121 | + hint: &'static str, | ||
| 122 | + chord: Option<SharedString>, | ||
| 123 | + player: &Player, | ||
| 124 | + on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, | ||
| 125 | + value_ink: u32, | ||
| 80 | ) -> impl IntoElement { | 126 | ) -> impl IntoElement { |
| 81 | let value: SharedString = value.into(); | 127 | let value: SharedString = value.into(); |
| 82 | let hint: SharedString = hint.into(); | 128 | let hint: SharedString = hint.into(); |
| @@ -107,10 +153,27 @@ fn row_ink( | |||
| 107 | .child( | 153 | .child( |
| 108 | div() | 154 | div() |
| 109 | .flex_none() | 155 | .flex_none() |
| 110 | - .font(value_style.font) | 156 | + .flex() |
| 111 | - .text_size(value_style.size) | 157 | + .items_baseline() |
| 112 | - .text_color(rgb(value_ink)) | 158 | + .gap(px(8.)) |
| 113 | - .child(value), | 159 | + .children(chord.map(|chord| { |
| 160 | + let chord_style = type_scale::mono( | ||
| 161 | + type_scale::CHORD_METADATA_MIN_PX, | ||
| 162 | + gpui::FontWeight::MEDIUM, | ||
| 163 | + ); | ||
| 164 | + div() | ||
| 165 | + .font(chord_style.font) | ||
| 166 | + .text_size(chord_style.size) | ||
| 167 | + .text_color(rgb(INK3())) | ||
| 168 | + .child(chord) | ||
| 169 | + })) | ||
| 170 | + .child( | ||
| 171 | + div() | ||
| 172 | + .font(value_style.font) | ||
| 173 | + .text_size(value_style.size) | ||
| 174 | + .text_color(rgb(value_ink)) | ||
| 175 | + .child(value), | ||
| 176 | + ), | ||
| 114 | ) | 177 | ) |
| 115 | } | 178 | } |
| 116 | 179 | ||
| @@ -286,7 +349,7 @@ fn editor_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement | |||
| 286 | .flex_col() | 349 | .flex_col() |
| 287 | .gap(px(2.)) | 350 | .gap(px(2.)) |
| 288 | .child(section_head("EDITOR · this machine, this window")) | 351 | .child(section_head("EDITOR · this machine, this window")) |
| 289 | - .child(row( | 352 | + .child(row_keyed( |
| 290 | "settings-proxies", | 353 | "settings-proxies", |
| 291 | "Proxies", | 354 | "Proxies", |
| 292 | match player.proxies_on { | 355 | match player.proxies_on { |
| @@ -294,17 +357,34 @@ fn editor_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement | |||
| 294 | false => "Off".to_string(), | 357 | false => "Off".to_string(), |
| 295 | }, | 358 | }, |
| 296 | "cuts on small stand-ins of the big films; the sound and every export stay the film's own -- default kept in ~/.config/edith, the pick for an open project in its own .edith", | 359 | "cuts on small stand-ins of the big films; the sound and every export stay the film's own -- default kept in ~/.config/edith, the pick for an open project in its own .edith", |
| 360 | + ActionId::ToggleProxies, | ||
| 297 | player, | 361 | player, |
| 298 | cx.listener(|this, _: &ClickEvent, _, cx| this.toggle_proxies(cx)), | 362 | cx.listener(|this, _: &ClickEvent, _, cx| this.toggle_proxies(cx)), |
| 299 | )) | 363 | )) |
| 300 | - .child(row( | 364 | + .child(row_keyed( |
| 301 | "settings-auto-proxies", | 365 | "settings-auto-proxies", |
| 302 | "Auto proxies", | 366 | "Auto proxies", |
| 303 | if player.auto_proxies_on { "On" } else { "Off" }, | 367 | if player.auto_proxies_on { "On" } else { "Off" }, |
| 304 | "makes a stand-in for every big film as it is imported -- default kept in ~/.config/edith, the pick for an open project in its own .edith", | 368 | "makes a stand-in for every big film as it is imported -- default kept in ~/.config/edith, the pick for an open project in its own .edith", |
| 369 | + ActionId::ToggleAutoProxies, | ||
| 305 | player, | 370 | player, |
| 306 | cx.listener(|this, _: &ClickEvent, _, cx| this.toggle_auto_proxies(cx)), | 371 | cx.listener(|this, _: &ClickEvent, _, cx| this.toggle_auto_proxies(cx)), |
| 307 | )) | 372 | )) |
| 373 | + // The room's own palette, moved off the spine (user 2026-08-21: the | ||
| 374 | + // rail was too crowded to fit its own rows) -- a preference kept in | ||
| 375 | + // ~/.config/edith, so the EDITOR section is where it belongs; the | ||
| 376 | + // same `Pick::Theme` list `ActionId::Theme` has always opened. | ||
| 377 | + .child(row_keyed( | ||
| 378 | + "settings-theme", | ||
| 379 | + "Palette", | ||
| 380 | + crate::ui::theme::active().label(), | ||
| 381 | + "the room's own greys; the film's inks are extracted, never picked", | ||
| 382 | + ActionId::Theme, | ||
| 383 | + player, | ||
| 384 | + cx.listener(|this, event: &ClickEvent, _, cx| { | ||
| 385 | + this.open_picker(Pick::Theme, event.position(), cx) | ||
| 386 | + }), | ||
| 387 | + )) | ||
| 308 | .child(row( | 388 | .child(row( |
| 309 | "settings-subtitle-style", | 389 | "settings-subtitle-style", |
| 310 | "Subtitle font", | 390 | "Subtitle font", |
| @@ -315,16 +395,38 @@ fn editor_section(player: &Player, cx: &mut Context<Player>) -> impl IntoElement | |||
| 315 | )) | 395 | )) |
| 316 | } | 396 | } |
| 317 | 397 | ||
| 318 | -/// The page itself: a modal card, the same drag-scrim-and-click-away shape | 398 | +/// The page itself: a plate in the room's own below-picture footprint, |
| 319 | -/// every other card in this room takes ([`crate::ui::cards`]'s | 399 | +/// closed by a click away or `esc` through [`Player::close_card`] like every |
| 320 | -/// eq/color/transform/speed cards) -- closed by a click away or `esc`, | 400 | +/// other card here. |
| 321 | -/// through [`Player::close_card`], exactly like them. | 401 | +/// |
| 322 | -pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | 402 | +/// It used to be a centred modal over a dimming scrim, which put the whole |
| 403 | +/// settings sheet -- and every picker opened off one of its rows -- straight | ||
| 404 | +/// over the picture: DESIGN §11 check 6's one hard occlusion rule, and half | ||
| 405 | +/// of the user's 2026-08-21 report about menus "not aligning with our | ||
| 406 | +/// design". Anchored to [`crate::ui::stance::below_picture_floor`] it sits | ||
| 407 | +/// over the bench and ledger exactly as the export plate and the menus | ||
| 408 | +/// already do, and the catcher behind it paints nothing rather than tinting | ||
| 409 | +/// the frame. | ||
| 410 | +pub(crate) fn render( | ||
| 411 | + player: &Player, | ||
| 412 | + window_size: Size<Pixels>, | ||
| 413 | + cx: &mut Context<Player>, | ||
| 414 | +) -> impl IntoElement { | ||
| 415 | + let floor = crate::ui::stance::below_picture_floor( | ||
| 416 | + f32::from(window_size.height), | ||
| 417 | + player.split_px(Split::Bench, window_size), | ||
| 418 | + ); | ||
| 419 | + // Below the time band, not merely below the picture: the transport and | ||
| 420 | + // the Export chip live on that band and a sheet over them hides controls | ||
| 421 | + // the editor is still using. Bench + ledger is this page's footprint. | ||
| 422 | + let top = floor + crate::ui::stance::TIME_BAND_H; | ||
| 423 | + let room = f32::from(window_size.height) - top; | ||
| 323 | drag_scrim(cx) | 424 | drag_scrim(cx) |
| 324 | .flex() | 425 | .flex() |
| 325 | .justify_center() | 426 | .justify_center() |
| 326 | - .items_center() | 427 | + .items_end() |
| 327 | - .bg(rgba(SCRIM())) | 428 | + .pt(px(top + 6.)) |
| 429 | + .pb(px(6.)) | ||
| 328 | .on_mouse_down( | 430 | .on_mouse_down( |
| 329 | MouseButton::Left, | 431 | MouseButton::Left, |
| 330 | cx.listener(|this, _: &MouseDownEvent, _, cx| { | 432 | cx.listener(|this, _: &MouseDownEvent, _, cx| { |
| @@ -336,14 +438,18 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem | |||
| 336 | .child( | 438 | .child( |
| 337 | div() | 439 | div() |
| 338 | .id("settings-card") | 440 | .id("settings-card") |
| 441 | + // The whole footprint's width, two columns inside: at 720p a | ||
| 442 | + // 420px single column put Mix, the palette and the subtitle | ||
| 443 | + // font below a fold with no visible scrollbar -- settings an | ||
| 444 | + // editor cannot see are settings only a chord reaches, which | ||
| 445 | + // is the defect class this page exists to close. | ||
| 339 | .w_full() | 446 | .w_full() |
| 340 | - .max_w(px(360.)) | 447 | + .max_h(px((room - 12.).max(120.))) |
| 341 | - .max_h(relative(0.86)) | ||
| 342 | .on_mouse_down(MouseButton::Left, swallow) | 448 | .on_mouse_down(MouseButton::Left, swallow) |
| 343 | .flex() | 449 | .flex() |
| 344 | .flex_col() | 450 | .flex_col() |
| 345 | - .gap(px(8.)) | 451 | + .gap(px(6.)) |
| 346 | - .p(px(12.)) | 452 | + .p(px(8.)) |
| 347 | .rounded(px(6.)) | 453 | .rounded(px(6.)) |
| 348 | .bg(rgb(DARK_PANEL())) | 454 | .bg(rgb(DARK_PANEL())) |
| 349 | .border_1() | 455 | .border_1() |
| @@ -373,10 +479,22 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem | |||
| 373 | .min_h(px(0.)) | 479 | .min_h(px(0.)) |
| 374 | .overflow_y_scroll() | 480 | .overflow_y_scroll() |
| 375 | .flex() | 481 | .flex() |
| 376 | - .flex_col() | 482 | + .gap(px(16.)) |
| 377 | - .gap(px(10.)) | 483 | + .child( |
| 378 | - .child(project_section(player, cx)) | 484 | + div() |
| 379 | - .child(editor_section(player, cx)), | 485 | + .flex_1() |
| 486 | + .min_w(px(0.)) | ||
| 487 | + .child(project_section(player, cx)), | ||
| 488 | + ) | ||
| 489 | + .child( | ||
| 490 | + div() | ||
| 491 | + .flex_1() | ||
| 492 | + .min_w(px(0.)) | ||
| 493 | + .border_l_1() | ||
| 494 | + .border_color(rgb(DARK_HAIRLINE())) | ||
| 495 | + .pl(px(12.)) | ||
| 496 | + .child(editor_section(player, cx)), | ||
| 497 | + ), | ||
| 380 | ), | 498 | ), |
| 381 | ) | 499 | ) |
| 382 | } | 500 | } |
crates/app/src/ui/spine_stance.rsmodified+59 -96
| @@ -66,7 +66,7 @@ fn glyph( | |||
| 66 | .flex_col() | 66 | .flex_col() |
| 67 | .items_center() | 67 | .items_center() |
| 68 | .gap(px(1.)) | 68 | .gap(px(1.)) |
| 69 | - .px(px(4.)) | 69 | + .px(px(3.)) |
| 70 | .py(px(1.)) | 70 | .py(px(1.)) |
| 71 | .rounded(px(3.)) | 71 | .rounded(px(3.)) |
| 72 | .when(active, |d| d.bg(rgb(DARK_RAISED()))) | 72 | .when(active, |d| d.bg(rgb(DARK_RAISED()))) |
| @@ -158,7 +158,7 @@ fn trim_control(active: bool, player: &Player, cx: &mut Context<Player>) -> impl | |||
| 158 | .flex_col() | 158 | .flex_col() |
| 159 | .items_center() | 159 | .items_center() |
| 160 | .gap(px(1.)) | 160 | .gap(px(1.)) |
| 161 | - .px(px(4.)) | 161 | + .px(px(3.)) |
| 162 | .py(px(1.)) | 162 | .py(px(1.)) |
| 163 | .rounded(px(3.)) | 163 | .rounded(px(3.)) |
| 164 | .when(active, |d| d.bg(rgb(DARK_RAISED()))) | 164 | .when(active, |d| d.bg(rgb(DARK_RAISED()))) |
| @@ -189,9 +189,14 @@ fn pair(left: impl IntoElement, right: impl IntoElement) -> impl IntoElement { | |||
| 189 | div() | 189 | div() |
| 190 | .flex_none() | 190 | .flex_none() |
| 191 | .flex() | 191 | .flex() |
| 192 | + .w_full() | ||
| 192 | .items_center() | 193 | .items_center() |
| 193 | .justify_center() | 194 | .justify_center() |
| 194 | - .gap(px(6.)) | 195 | + // 4px, not 6: two two-glyph halves plus their own padding used to |
| 196 | + // measure wider than the 56px rail and bled past its left edge | ||
| 197 | + // (measured at 1280x720: the `AP`/`FS` row started at x=0, outside | ||
| 198 | + // the spine's own surface). | ||
| 199 | + .gap(px(4.)) | ||
| 195 | .child(left) | 200 | .child(left) |
| 196 | .child(right) | 201 | .child(right) |
| 197 | } | 202 | } |
| @@ -336,60 +341,46 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem | |||
| 336 | cx, | 341 | cx, |
| 337 | )) | 342 | )) |
| 338 | .child(group_head("track")) | 343 | .child(group_head("track")) |
| 339 | - .child(glyph( | 344 | + .child(pair( |
| 340 | - "spine-add-video", | 345 | + glyph( |
| 341 | - "+V", | 346 | + "spine-add-video", |
| 342 | - ActionId::AddVideoLane, | 347 | + "+V", |
| 343 | - false, | 348 | + ActionId::AddVideoLane, |
| 344 | - false, | 349 | + false, |
| 345 | - player, | 350 | + false, |
| 346 | - cx, | 351 | + player, |
| 347 | - )) | 352 | + cx, |
| 348 | - .child(glyph( | 353 | + ), |
| 349 | - "spine-add-audio", | 354 | + glyph( |
| 350 | - "+A", | 355 | + "spine-add-audio", |
| 351 | - ActionId::AddAudioLane, | 356 | + "+A", |
| 352 | - false, | 357 | + ActionId::AddAudioLane, |
| 353 | - false, | 358 | + false, |
| 354 | - player, | 359 | + false, |
| 355 | - cx, | 360 | + player, |
| 356 | - )) | 361 | + cx, |
| 357 | - // The subtitle trio (homeless per this task's audit): AddSubtitleLane | 362 | + ), |
| 358 | - // joins +V/+A on the same "+letter" grammar per this task's own | ||
| 359 | - // instruction ("+S joins +V/+A in TRACK"); remove/import are "the | ||
| 360 | - // subtitle work" the instruction says to place them beside, so they | ||
| 361 | - // share the row underneath rather than each eating a full row (the | ||
| 362 | - // same space-saving `pair` the walk-cuts and zoom in/out already | ||
| 363 | - // use). ToggleSubtitles (whether the cues draw over the picture at | ||
| 364 | - // all) is the fourth subtitle-lane command with no home anywhere in | ||
| 365 | - // the darkroom -- filed here too, "CC" being the glyph every player | ||
| 366 | - // already uses for exactly this toggle, rather than in the quiet | ||
| 367 | - // ROOM cluster below: cue visibility is judged shot to shot, closer | ||
| 368 | - // in frequency to a view toggle used often than to a once-a-session | ||
| 369 | - // preference. | ||
| 370 | - .child(glyph( | ||
| 371 | - "spine-add-subtitle", | ||
| 372 | - "+S", | ||
| 373 | - ActionId::AddSubtitleLane, | ||
| 374 | - false, | ||
| 375 | - false, | ||
| 376 | - player, | ||
| 377 | - cx, | ||
| 378 | )) | 363 | )) |
| 364 | + // The subtitle lane pair: add beside remove, one row, the same | ||
| 365 | + // "+letter"/"−letter" grammar +V/+A above it already reads in. Import | ||
| 366 | + // (`↓S`) left this rail entirely -- it is an import, so it lives in | ||
| 367 | + // the dock's own IMPORT list beside "Add files" (`dock_stance`), | ||
| 368 | + // where an editor already goes to bring a file into the room. That | ||
| 369 | + // move is what takes this group from three crowded rows to two. | ||
| 379 | .child(pair( | 370 | .child(pair( |
| 380 | glyph( | 371 | glyph( |
| 381 | - "spine-remove-subtitle", | 372 | + "spine-add-subtitle", |
| 382 | - "−S", | 373 | + "+S", |
| 383 | - ActionId::RemoveSubtitleLane, | 374 | + ActionId::AddSubtitleLane, |
| 384 | false, | 375 | false, |
| 385 | false, | 376 | false, |
| 386 | player, | 377 | player, |
| 387 | cx, | 378 | cx, |
| 388 | ), | 379 | ), |
| 389 | glyph( | 380 | glyph( |
| 390 | - "spine-import-subtitles", | 381 | + "spine-remove-subtitle", |
| 391 | - "↓S", | 382 | + "−S", |
| 392 | - ActionId::ImportSubtitles, | 383 | + ActionId::RemoveSubtitleLane, |
| 393 | false, | 384 | false, |
| 394 | false, | 385 | false, |
| 395 | player, | 386 | player, |
| @@ -405,45 +396,31 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem | |||
| 405 | player, | 396 | player, |
| 406 | cx, | 397 | cx, |
| 407 | )) | 398 | )) |
| 408 | - // ROOM: the once-a-session/once-a-project acts this task's charter | 399 | + // ROOM, cut to the three acts that are *acts* rather than settings |
| 409 | - // names explicitly (theme, proxies, screenshot, fullscreen) -- ink- | 400 | + // (user 2026-08-21: "the spine menu is too crowded and looks weird |
| 410 | - // demoted (`quiet: true`) and paired two-to-a-row to keep the group | 401 | + // also not fitting" -- measured at 1280x720 the rail overflowed its |
| 411 | - // cheap, the same "rare acts live out of the way" pattern DESIGN §2 | 402 | + // own height and the settings glyph, the last row, could only be |
| 412 | - // names for re-inking, applied here to the spine's own bottom | 403 | + // reached by scrolling the spine). Theme, proxies and auto-proxies |
| 413 | - // instead of a right-click menu (these four are toggled/fired by a | 404 | + // were the three that are *preferences*, not verbs: they are rows on |
| 414 | - // click, not by picking a source dot, so a context menu is not | 405 | + // the settings page now (`settings_stance`), which is where an |
| 415 | - // their shape). Left off this list: Save, which sits beside Export | 406 | + // editor already goes to change what the room is rather than what |
| 416 | - // in the time band instead (see timeband_stance.rs) because the | 407 | + // the film is -- so nothing lost a visible home (DESIGN §9) and the |
| 417 | - // ledger already gives the saved/unsaved state a home there, and | 408 | + // rail lost three rows. |
| 418 | - // keymap.rs's own `Category::File` files Save beside Export and | ||
| 419 | - // Screenshot on the strength of what each one writes. | ||
| 420 | .child(group_head("room")) | 409 | .child(group_head("room")) |
| 421 | .child(pair( | 410 | .child(pair( |
| 422 | - glyph("spine-theme", "H", ActionId::Theme, false, true, player, cx), | ||
| 423 | glyph( | 411 | glyph( |
| 424 | - "spine-proxies", | 412 | + "spine-settings", |
| 425 | - "P", | 413 | + "St", |
| 426 | - ActionId::ToggleProxies, | 414 | + ActionId::Settings, |
| 427 | - player.proxies_on, | 415 | + player.settings_open, |
| 428 | - true, | ||
| 429 | - player, | ||
| 430 | - cx, | ||
| 431 | - ), | ||
| 432 | - )) | ||
| 433 | - .child(pair( | ||
| 434 | - glyph( | ||
| 435 | - "spine-auto-proxies", | ||
| 436 | - "AP", | ||
| 437 | - ActionId::ToggleAutoProxies, | ||
| 438 | - player.auto_proxies_on, | ||
| 439 | true, | 416 | true, |
| 440 | player, | 417 | player, |
| 441 | cx, | 418 | cx, |
| 442 | ), | 419 | ), |
| 443 | glyph( | 420 | glyph( |
| 444 | - "spine-fullscreen", | 421 | + "spine-screenshot", |
| 445 | - "FS", | 422 | + "Sh", |
| 446 | - ActionId::Fullscreen, | 423 | + ActionId::Screenshot, |
| 447 | false, | 424 | false, |
| 448 | true, | 425 | true, |
| 449 | player, | 426 | player, |
| @@ -451,27 +428,13 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem | |||
| 451 | ), | 428 | ), |
| 452 | )) | 429 | )) |
| 453 | .child(glyph( | 430 | .child(glyph( |
| 454 | - "spine-screenshot", | 431 | + "spine-fullscreen", |
| 455 | - "Sh", | 432 | + "FS", |
| 456 | - ActionId::Screenshot, | 433 | + ActionId::Fullscreen, |
| 457 | false, | 434 | false, |
| 458 | true, | 435 | true, |
| 459 | player, | 436 | player, |
| 460 | cx, | 437 | cx, |
| 461 | )) | 438 | )) |
| 462 | - // The settings page's own visible door (user complaint: "some | ||
| 463 | - // options are only reachable via keyboard shortcut") -- a chord | ||
| 464 | - // alone is a defect class this room has hit repeatedly, so this | ||
| 465 | - // glyph sits beside the other once-a-session ROOM acts even though | ||
| 466 | - // its chord (`^,`) is a preference, not a mnemonic. | ||
| 467 | - .child(glyph( | ||
| 468 | - "spine-settings", | ||
| 469 | - "St", | ||
| 470 | - ActionId::Settings, | ||
| 471 | - player.settings_open, | ||
| 472 | - true, | ||
| 473 | - player, | ||
| 474 | - cx, | ||
| 475 | - )) | ||
| 476 | .child(div().flex_1()) | 439 | .child(div().flex_1()) |
| 477 | } | 440 | } |
crates/app/src/ui/stance.rsmodified+19 -6
| @@ -17,7 +17,7 @@ use crate::ui::type_scale::{self, Typeset}; | |||
| 17 | use crate::*; | 17 | use crate::*; |
| 18 | 18 | ||
| 19 | /// Left rail, full height (DESIGN §5). | 19 | /// Left rail, full height (DESIGN §5). |
| 20 | -const SPINE_W: f32 = 56.; | 20 | +pub(crate) const SPINE_W: f32 = 56.; |
| 21 | /// Fixed strip under the screen: timecode, transport, cut readout, contact | 21 | /// Fixed strip under the screen: timecode, transport, cut readout, contact |
| 22 | /// strip, Export -- all placeholder at this step. Kept `pub(crate)` for | 22 | /// strip, Export -- all placeholder at this step. Kept `pub(crate)` for |
| 23 | /// `layout::split_bounds`'s bench ceiling, the same one-door reason | 23 | /// `layout::split_bounds`'s bench ceiling, the same one-door reason |
| @@ -301,7 +301,11 @@ fn ghost(player: &Player, glyph: &str, action: ActionId) -> impl IntoElement { | |||
| 301 | )) | 301 | )) |
| 302 | .text_color(rgb(INK2())) | 302 | .text_color(rgb(INK2())) |
| 303 | .child(glyph.to_string()) | 303 | .child(glyph.to_string()) |
| 304 | - .child( | 304 | + // The badge is skipped when the stroke IS the glyph: `?` over `?` |
| 305 | + // drew as two identical rows stacked at the foot of the rail and read | ||
| 306 | + // as a duplicated control rather than as one command wearing its own | ||
| 307 | + // chord. | ||
| 308 | + .children((player.keymap.chord(action) != glyph).then(|| { | ||
| 305 | div() | 309 | div() |
| 306 | .type_style(type_scale::mono( | 310 | .type_style(type_scale::mono( |
| 307 | type_scale::CHORD_METADATA_MIN_PX, | 311 | type_scale::CHORD_METADATA_MIN_PX, |
| @@ -310,8 +314,8 @@ fn ghost(player: &Player, glyph: &str, action: ActionId) -> impl IntoElement { | |||
| 310 | .text_color(rgb(INK3())) | 314 | .text_color(rgb(INK3())) |
| 311 | // FAULT 1: the badge shows the primary chord, compact -- | 315 | // FAULT 1: the badge shows the primary chord, compact -- |
| 312 | // same rule as every glyph in `spine_stance`. | 316 | // same rule as every glyph in `spine_stance`. |
| 313 | - .child(player.keymap.chord(action)), | 317 | + .child(player.keymap.chord(action)) |
| 314 | - ) | 318 | + })) |
| 315 | } | 319 | } |
| 316 | 320 | ||
| 317 | /// The keys overlay (DESIGN §9, §12 step 7): every bound command, sectioned | 321 | /// The keys overlay (DESIGN §9, §12 step 7): every bound command, sectioned |
| @@ -975,7 +979,7 @@ pub(crate) fn render( | |||
| 975 | }) | 979 | }) |
| 976 | .when(player.keys_open, |el| el.child(keys_overlay(player))) | 980 | .when(player.keys_open, |el| el.child(keys_overlay(player))) |
| 977 | .when(player.settings_open, |el| { | 981 | .when(player.settings_open, |el| { |
| 978 | - el.child(settings_stance::render(player, cx)) | 982 | + el.child(settings_stance::render(player, window_size, cx)) |
| 979 | }) | 983 | }) |
| 980 | // The two menus (DESIGN §9: "verbs of the thing under the | 984 | // The two menus (DESIGN §9: "verbs of the thing under the |
| 981 | // cursor", plate styling, the same scrim-and-row component | 985 | // cursor", plate styling, the same scrim-and-row component |
| @@ -988,7 +992,6 @@ pub(crate) fn render( | |||
| 988 | // -- clip menu, then library menu, then the open list last so | 992 | // -- clip menu, then library menu, then the open list last so |
| 989 | // it floats over whichever row opened it. | 993 | // it floats over whichever row opened it. |
| 990 | .children(player.context_card(window_size, cx)) | 994 | .children(player.context_card(window_size, cx)) |
| 991 | - .children(player.library_card(window_size, cx)) | ||
| 992 | // The export card and its running-progress sheet, mounted | 995 | // The export card and its running-progress sheet, mounted |
| 993 | // over the whole room exactly as the legacy tree mounts them | 996 | // over the whole room exactly as the legacy tree mounts them |
| 994 | // (`render.rs`) -- the fix for the shipped "Export does | 997 | // (`render.rs`) -- the fix for the shipped "Export does |
| @@ -1021,4 +1024,14 @@ pub(crate) fn render( | |||
| 1021 | ) | 1024 | ) |
| 1022 | .child(divider(Split::Dock, cx)) | 1025 | .child(divider(Split::Dock, cx)) |
| 1023 | .child(dock(player, dock_w, window_size, cx)) | 1026 | .child(dock(player, dock_w, window_size, cx)) |
| 1027 | + // The library row menu mounts on the ROOT, not inside | ||
| 1028 | + // `stance-centre` like the clip menu beside it: it is opened from a | ||
| 1029 | + // dock row, so its anchor is a window x past the centre column's own | ||
| 1030 | + // right edge, and the dock -- painted after the centre -- covered | ||
| 1031 | + // every pixel of it. That is the whole of the shipped "can not | ||
| 1032 | + // remove a media from library" defect: the plate was built, placed | ||
| 1033 | + // and never visible. Mounted here it paints last, over the dock it | ||
| 1034 | + // belongs to, and its own `menu_floor` window coordinates finally | ||
| 1035 | + // mean what they say. | ||
| 1036 | + .children(player.library_card(window_size, cx)) | ||
| 1024 | } | 1037 | } |
crates/app/src/ui/theme.rsmodified+18 -4
| @@ -1288,11 +1288,25 @@ pub mod darkroom { | |||
| 1288 | // -- surfaces ----------------------------------------------------------- | 1288 | // -- surfaces ----------------------------------------------------------- |
| 1289 | pub const BG_CANVAS: u32 = 0x050607; | 1289 | pub const BG_CANVAS: u32 = 0x050607; |
| 1290 | pub const BG_PANEL: u32 = 0x0e1013; | 1290 | pub const BG_PANEL: u32 = 0x0e1013; |
| 1291 | - pub const BG_RAISED: u32 = 0x15181c; | 1291 | + // DESIGN §2's `raised` band (#14171B - #17191D) is the WHOLE interaction |
| 1292 | + // ladder in this room: a resting raised fill, one step up for hover, one | ||
| 1293 | + // more for a picked row -- selection's real mark is the 1px `ink1` ring | ||
| 1294 | + // (§4), never a pale flood. | ||
| 1295 | + // | ||
| 1296 | + // These four used to carry the legacy tree's greys (hover #2A2E33, | ||
| 1297 | + // selected #2E3237 -- two and three steps outside the band). Every | ||
| 1298 | + // surface that paints a *role* rather than a Darkroom token -- the clip | ||
| 1299 | + // menu, the library row menu, the keys overlay, the seven param cards -- | ||
| 1300 | + // read them, so each one opened a pale plate in a dim room while the | ||
| 1301 | + // handful of surfaces written against `DARK_*`/`INK*` directly looked | ||
| 1302 | + // right. That is the whole "some menus belong to old ui" class, and it | ||
| 1303 | + // is fixed here, once, rather than by another per-call-site `if | ||
| 1304 | + // darkroom` branch: role tokens ARE the theme's job (§2's guard). | ||
| 1305 | + pub const BG_RAISED: u32 = 0x14171b; | ||
| 1292 | pub const BG_TIMELINE: u32 = 0x08090b; | 1306 | pub const BG_TIMELINE: u32 = 0x08090b; |
| 1293 | - pub const BG_HOVER: u32 = 0x2a2e33; | 1307 | + pub const BG_HOVER: u32 = 0x17191d; |
| 1294 | - pub const BG_HOVER_DIM: u32 = 0x1c1f24; | 1308 | + pub const BG_HOVER_DIM: u32 = 0x121418; |
| 1295 | - pub const BG_SELECTED: u32 = 0x2e3237; | 1309 | + pub const BG_SELECTED: u32 = 0x1c1f24; |
| 1296 | pub const SCRIM: u32 = 0x050607cc; | 1310 | pub const SCRIM: u32 = 0x050607cc; |
| 1297 | pub const SCRIM_LIGHT: u32 = 0x05060755; | 1311 | pub const SCRIM_LIGHT: u32 = 0x05060755; |
| 1298 | 1312 | ||