From 0a1b19d9b91375289bf86a4809618fc5b53dd879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 10 Sep 2026 00:07:11 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20remove(app):=20cleanse=20the=20t?= =?UTF-8?q?ime=20band=20=E2=80=94=20five=20things=20and=20the=20strip's=20?= =?UTF-8?q?own=20mark=20grips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The band kept the hero timecode, one transport (`|◂ ▶ ▸|`), the cut odometer, the contact strip and the boxed Export. The shuttle pair, home/end, the sync points, the loop toggle, the whole monitoring cluster, the `I O ×` marks trio and `Save` left it — each keeps its chord and its KEYS-tab row, and the odometer's `roll` word only shows while roll is armed. The export range's in/out marks became two `ink1` grips on the contact strip at their own film positions: drawn only once a mark exists, ±6px of door, drag sets the mark (and the mark under the hand becomes the other one when it crosses its partner, the way `ordered_range` orders the pair). The picture's `scale 0.59` corner readout goes with them — fit is `^0`. §7's ladder shrinks to two rungs (chords at 580px, measured), and the removed actions are named with their owner in the darkroom-home sweep. --- DESIGN.md | 24 +- crates/app/src/layout.rs | 6 +- crates/app/src/tests/layout.rs | 165 +++++++--- crates/app/src/transport.rs | 6 - crates/app/src/ui/stance.rs | 106 +----- crates/app/src/ui/timeband_stance.rs | 468 +++++++++------------------ 6 files changed, 294 insertions(+), 481 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index 81f5735..19003fb 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -111,9 +111,10 @@ Fixed geography; nothing moves, nothing occludes the picture: │ occluded) │ Src/ │ │ │ Clip │ ├─────────────────────────────────┤ KEYS │ -│ TIME BAND: timecode → ghost │ tabs │ -│ transport → cut readout → │ │ -│ contact strip → [Export] │ │ +│ TIME BAND: timecode → |◂ ▶ ▸| │ tabs │ +│ → cut 14/37 → contact strip │ │ +│ (with the in/out grips) │ │ +│ → [Export] │ │ ├─────────────────────────────────┤ │ │ BENCH (lanes V/A/S) │ │ ├─────────────────────────────────┤ │ @@ -124,9 +125,20 @@ Fixed geography; nothing moves, nothing occludes the picture: - **Screen**: the picture. Never covered — not by drawers, notices, drags, or menus. Two-up OUT|IN judging renders *in* the screen at rest on a cut. -- **Time band**: timecode leads; ghost transport; cut readout (`14/37`); the **contact strip** - (whole-film motion-trace minimap, `FILM` label, viewport bracket with grip notches — click - jumps, drag pans); boxed **Export** at the end. +- **Time band**: timecode leads; one transport (`|◂ ▶ ▸|` — frame back, play/pause, frame + forward); the cut odometer (`14/37`, and the word `roll` only while roll is armed); the + **contact strip** (whole-film motion-trace minimap, viewport bracket with grip notches — click + jumps, drag scrubs, the bracket's notches pan; the export range's **in/out marks are two `ink1` + grips on the strip at their own film positions**, draggable to set the mark, drawn only once a + mark exists and taking the pointer within ±6px); boxed **Export** at the end. + +**Amendment (2026-09-10), "cleanse round 2"** (user: "seems cool, let's apply"): the band holds +five things and nothing else. The shuttle pair (`◀◀ ▶▶`), home/end, the sync points, the loop +toggle, the monitoring cluster (mute, level slider, percent), the `I O ×` marks trio and `Save` +all left it — each keeps its chord and its KEYS-tab row, the ruler menu keeps the verbs that act +on the ruler, the marks became the strip's grips, and the ledger already says `saved`/`unsaved · +^s`. The picture's `scale 0.59` corner readout is deleted with them: fit is `^0`, and the number +was a state nobody acts on. - **Bench**: lanes. Clip anatomy = ink spine (3px left edge) + real thumbnails/waveform in the source's ink + name plate + splice gaps in lamp white. - **Ledger**: project identity (`name.edith · saved`), last action, export progress, and at the diff --git a/crates/app/src/layout.rs b/crates/app/src/layout.rs index 4d74226..d8f19f3 100644 --- a/crates/app/src/layout.rs +++ b/crates/app/src/layout.rs @@ -60,7 +60,11 @@ pub(crate) const LIBRARY_MIN_W: f32 = 120.; pub(crate) const LIBRARY_MAX_W: f32 = 220.; pub(crate) const CONTROL_H: f32 = 28.; /// The volume slider beside its button: a hundred steps across it, so a pixel -/// is finer than a step and the drag reads as continuous. +/// is finer than a step and the drag reads as continuous. Cleanse round 2 +/// (2026-09-10) took that slider out of the time band, so the width is only +/// the drag-math guard's own bar now -- it sits with the tests, like +/// [`Volume::label`], rather than in the binary. +#[cfg(test)] pub(crate) const VOLUME_W: f32 = 110.; pub(crate) const RULER_HIT_H: f32 = HIT_MIN; /// The keybindings card: a row per action, a title and a status line, inside a diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 9726d5f..d869ff2 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -1610,12 +1610,15 @@ fn darkroom_lane_header_verbs_are_targeted_and_visible() { ] { assert!(bench.contains(door), "lane header lost {door}"); } + // Cleanse round 2 (2026-09-10): the monitoring cluster left the band + // (chord + KEYS row only). What the band still owes a pointer is the + // export range's two grips on the contact strip. let time_band = src_text("ui/timeband_stance.rs"); for door in [ - "fn volume_slider(", - "\"stance-tb-volume-bar\"", - "this.drag_volume(event.position.x, cx)", - ".child(volume_slider(player, cx))", + "fn mark_grip(", + "\"stance-strip-mark-in\"", + "\"stance-strip-mark-out\"", + "MARK_DRAG.with(|m| m.set(Some(action)))", ] { assert!(time_band.contains(door), "time band lost {door}"); } @@ -2504,6 +2507,66 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { // gave every one of them a door on the thing it acts on -- the clip // menu, the ruler's, the lane head's -- and the staleness check below // is what deleted their entries as each landed. + // Cleanse round 2 (2026-09-10, user "seems cool, let's apply"): the + // time band kept the timecode, one three-glyph transport, the + // odometer, the contact strip and Export. Everything below left it. + // Each keeps its chord and its KEYS-tab row; the ruler menu already + // owns the ones that act on the ruler (zoom/fit/snap). Named here + // rather than re-mounted, per DESIGN §5's amendment: the geography of + // a verb is the thing it acts on, and playback has no thing. + ( + ActionId::JumpBack, + "KEYS tab + key: the shuttle pair left the band in cleanse round 2", + ), + ( + ActionId::JumpForward, + "KEYS tab + key: the shuttle pair left the band in cleanse round 2", + ), + ( + ActionId::GoStart, + "KEYS tab + key: home/end left the band in cleanse round 2 -- the \ + contact strip's own ends are the pointer's version", + ), + ( + ActionId::GoEnd, + "KEYS tab + key: home/end left the band in cleanse round 2 -- the \ + contact strip's own ends are the pointer's version", + ), + ( + ActionId::PrevSyncPoint, + "KEYS tab + key: the sync pair left the band in cleanse round 2", + ), + ( + ActionId::NextSyncPoint, + "KEYS tab + key: the sync pair left the band in cleanse round 2", + ), + ( + ActionId::Loop, + "KEYS tab + key: the loop toggle left the band in cleanse round 2", + ), + ( + ActionId::ToggleMute, + "KEYS tab + key: the monitoring cluster left the band in cleanse round 2", + ), + ( + ActionId::VolumeUp, + "KEYS tab + key: the monitoring cluster left the band in cleanse round 2", + ), + ( + ActionId::VolumeDown, + "KEYS tab + key: the monitoring cluster left the band in cleanse round 2", + ), + ( + ActionId::ClearRange, + "KEYS tab + key: `I O ×` left the band in cleanse round 2 -- in and out \ + became the contact strip's own grips, and clearing both at once is \ + not a thing on the film to point at", + ), + ( + ActionId::Save, + "KEYS tab + key: the ledger says `saved`/`unsaved · ^s`, which is the \ + state this verb is about (cleanse round 2)", + ), ( ActionId::Screenshot, "the picture the frame is written from is the *watched* frame and \ @@ -2511,6 +2574,22 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { and the KEYS card, like the selection accelerators above", ), ]; + /// `ActionId::Loop` is a prefix of `ActionId::LoopTrim`, and the keys + /// menu's own label arm (`ActionId::ToggleMute | ActionId::Paste => + /// format!("{verb} (global)")`) shapes a string rather than opening a + /// door -- neither is a widget home, so neither counts as a mention. + fn mentions(text: &str, name: &str) -> bool { + text.lines() + .filter(|l| !l.contains("=> format!(\"{verb} (global)\")")) + .any(|line| { + line.match_indices(&format!("ActionId::{name}")).any(|(i, m)| { + !line[i + m.len()..] + .chars() + .next() + .is_some_and(|c| c.is_alphanumeric() || c == '_') + }) + }) + } let darkroom = [ "ui/bench_stance.rs", "ui/cards.rs", @@ -2533,14 +2612,14 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { // has mounted the action, the entry has to go, or the sweep // goes blind on an action that is covered. assert!( - !darkroom.contains(&format!("ActionId::{action:?}")), + !mentions(&darkroom, &format!("{action:?}")), "ActionId::{action:?} has a darkroom home now -- delete its \ EXPLICITLY_OWNED_ELSEWHERE entry ({owner})" ); continue; } let name = format!("{action:?}"); - let mentioned = darkroom.contains(&format!("ActionId::{name}")) + let mentioned = mentions(&darkroom, &name) || (action == ActionId::Resolution && darkroom.contains("Pick::Resolution")) || (action == ActionId::SubtitleStyle && darkroom.contains("open_subtitle_style(cx)")); let hitmap_id = crate::ui::hitmap::action_id(action); @@ -2661,6 +2740,8 @@ fn hitmap_names_every_darkroom_pointer_entry_surface() { "timeline.contact-strip", "stance-strip-grip-lt", "stance-strip-grip-rb", + "stance-strip-mark-in", + "stance-strip-mark-out", ][..], ), ("ui/preview.rs", &["preview.stop", "preview.scrub"][..]), @@ -3259,46 +3340,26 @@ fn the_time_band_never_paints_outside_its_own_column() { assert!(crate::ui::timeband_stance::STRIP_MIN_W >= 120.); } -/// DESIGN §7's ladder, one layer per threshold: the four things the band is -/// *for* -- timecode, cut readout, contact strip, Export -- survive every -/// rung, and the sheddable groups go in a fixed order (chords, then the -/// monitoring cluster, then sync/loop, then the range marks), never all at -/// once. Thresholds are the measured group widths; this pins their order and -/// the 1280x720 column (939px measured when a 56px rail still stood left of -/// it; the rail is gone since 2026-09-09, so the same window measures ~989px) -/// landing on the -/// marks-only rung, which is what makes Export fit there (it ended at x=991 -/// inside a column ending at 995, against x=1113 under the dock before). +/// DESIGN §7's ladder, cleanse round 2 (2026-09-10): the band is five +/// things -- timecode, the three transport glyphs, the odometer, the contact +/// strip and Export -- and the only sheddable layer left is the chord row +/// under the glyphs. This pins the one threshold (measured in the harness: +/// 454px of fixed groups + `STRIP_MIN_W`, rounded up -- a 640x600 window +/// reads 539px of band and draws no chords, a 1280x720 one reads 982px and +/// draws them) and that it never comes back off. #[test] -fn the_band_sheds_one_layer_per_threshold_in_a_fixed_order() { +fn the_band_sheds_its_chords_and_nothing_else() { use crate::ui::timeband_stance::band_layers; - let ladder = [2000., 1300., 1100., 939., 800., 0.] - .map(|w| band_layers(w)) - .map(|l| (l.chords, l.volume, l.sync, l.marks)); assert_eq!( - ladder, - [ - (true, true, true, true), - (false, true, true, true), - (false, false, true, true), - (false, false, false, true), - (false, false, false, false), - (false, false, false, false), - ], - "the band must drop chords, then the monitoring cluster, then sync/loop, then the marks" + [2000., 982., 580., 579., 539., 0.].map(|w| band_layers(w).chords), + [true, true, true, false, false, false], + "the band's one rung is the chord row at 580px" ); // Monotone: a wider band never shows less than a narrower one. let mut prev = band_layers(0.); for w in (0..2400).step_by(10).map(|w| w as f32) { let now = band_layers(w); - for (a, b) in [ - (prev.chords, now.chords), - (prev.volume, now.volume), - (prev.sync, now.sync), - (prev.marks, now.marks), - ] { - assert!(b || !a, "layer came back off at {w}px"); - } + assert!(now.chords || !prev.chords, "layer came back off at {w}px"); prev = now; } } @@ -3306,7 +3367,9 @@ fn the_band_sheds_one_layer_per_threshold_in_a_fixed_order() { /// Every door in this band is at least `HIT_MIN` wide and tall (WCAG 2.5.8). /// The hitmap read `SetIn w=8`, `VolumeDown w=12`, `Loop w=13`, `SetOut w=15`, /// `Prev/NextSyncPoint w=16` before this: padding on the shared `ghost`, not a -/// bigger glyph. +/// bigger glyph. Those five glyphs left the band in cleanse round 2; the +/// three that stayed are drawn by the same `ghost`, so the floor is still +/// checked where it is spent. #[test] fn every_ghost_in_the_time_band_carries_a_full_hit_area() { let src = src_text("ui/timeband_stance.rs"); @@ -3319,21 +3382,15 @@ fn every_ghost_in_the_time_band_carries_a_full_hit_area() { } /// Mute wore `"{volume}%"` as its glyph while the slider beside it drew the -/// same value: one number, two places, and a toggle with no verb of its own. -/// The level is a mono readout beside the slider now, once. +/// same value: one number, two places. Cleanse round 2 (2026-09-10) settled +/// it the other way -- the whole monitoring cluster left the band (mute is +/// `m`, the level is the `-`/`=` pair), so the band writes no level at all. #[test] -fn the_level_is_written_once_and_mute_wears_a_glyph() { +fn the_band_writes_no_monitoring_level() { let src = src_text("ui/timeband_stance.rs"); - assert_eq!( - src.matches(r#"player.volume.percent()"#).count(), - 1, - "the volume level must be written in exactly one place in the band" - ); - assert!( - src.contains(r#"if player.volume.muted { "◁×" } else { "◁))" }"#), - "mute must wear a speaker glyph, struck when muted" - ); - assert!(src.contains("fn volume_readout("), "the level readout is the one place it is written"); + for gone in ["player.volume.percent()", "fn volume_readout(", "fn volume_slider("] { + assert!(!src.contains(gone), "the monitoring cluster is back in the band: {gone}"); + } } /// `Play` and `StepForward` drew the same solid right-triangle: two verbs one @@ -3345,7 +3402,9 @@ fn transport_verbs_differ_by_shape_not_only_by_chord() { let at = src.find(&format!("ActionId::{action},")).expect("the call"); src[..at].rsplit('"').nth(1).expect("its glyph").to_string() }; - let shapes = ["Play", "StepBack", "StepForward", "JumpBack", "JumpForward"].map(glyph); + // Cleanse round 2: the shuttle pair left the band, so the three that + // stayed are what must still differ by shape. + let shapes = ["Play", "StepBack", "StepForward"].map(glyph); let mut seen = shapes.to_vec(); seen.sort(); seen.dedup(); diff --git a/crates/app/src/transport.rs b/crates/app/src/transport.rs index 7acb3c0..1a327d5 100644 --- a/crates/app/src/transport.rs +++ b/crates/app/src/transport.rs @@ -77,12 +77,6 @@ impl Volume { f32::from(self.steps) / f32::from(Self::MAX_STEPS) } - /// The level as a whole number, for the button's fixed rect: muting swaps - /// the glyph beside it, never the width of the box. - pub(crate) fn percent(self) -> u32 { - u32::from(self.steps) * 100 / u32::from(Self::MAX_STEPS) - } - /// What the button read before the mute state became a glyph and a colour /// ([`Player::toolbar`]): the guards still hold the wording to it, so it /// sits with them rather than in the binary. diff --git a/crates/app/src/ui/stance.rs b/crates/app/src/ui/stance.rs index 547f92f..435df54 100644 --- a/crates/app/src/ui/stance.rs +++ b/crates/app/src/ui/stance.rs @@ -402,30 +402,15 @@ mod maximized_card_top_tests { } thread_local! { - // FAULT 3: the picture region's own laid-out box, measured each frame by - // a [`bounds_probe`] the same shape `timeband_stance`'s contact strip - // keeps (`STRIP_BOUNDS`) -- the scale plate needs the box the picture was - // fitted into, which nothing upstream of paint knows. + // The picture region's own laid-out box, measured each frame by a + // [`bounds_probe`] the same shape `timeband_stance`'s contact strip keeps + // (`STRIP_BOUNDS`) -- [`picture_bottom`] needs the box the picture was + // fitted into, which nothing upstream of paint knows. (Cleanse round 2, + // 2026-09-10: the `scale 0.59` readout this also fed is deleted -- fit is + // `^0` and the number was a state nobody acts on.) static PICTURE_BOUNDS: Rc>> = Rc::new(Cell::new(Bounds::default())); } -/// The pure half of [`picture_scale`]: given a box and the image's native -/// size, its `Contain` fit factor -- gpui's own tested `get_bounds` math -/// ([`letterboxed_image`] fits the picture the same way), not a ratio -/// reimplemented here. Split out from `picture_scale` so this arithmetic has -/// a runnable check with no `Player`/window to stand up. -fn fit_scale(bounds: Bounds, native: gpui::Size) -> Option { - if bounds.size.width <= px(0.) - || bounds.size.height <= px(0.) - || native.width.0 <= 0 - || native.height.0 <= 0 - { - return None; - } - let fitted = gpui::ObjectFit::Contain.get_bounds(bounds, native); - Some(f32::from(fitted.size.width) / native.width.0 as f32) -} - /// The pure half of [`picture_bottom`]: the bottom edge of the `Contain` /// fit of `native` into `bounds` -- gpui's own `get_bounds`, the same call /// [`letterboxed_image`] paints through, so this is the frame's real edge @@ -451,72 +436,6 @@ pub(crate) fn picture_bottom(player: &Player) -> Option { fitted_bottom(PICTURE_BOUNDS.with(Rc::clone).get(), image.size(0)) } -/// The picture's own fit factor against its native size, read off the last -/// frame's measured box (see [`PICTURE_BOUNDS`]). `None` with nothing open -/// or before the first paint has measured anything. -fn picture_scale(player: &Player) -> Option { - let image = player.image.clone()?; - fit_scale(PICTURE_BOUNDS.with(Rc::clone).get(), image.size(0)) -} - -#[cfg(test)] -mod tests { - use super::*; - - /// A 400x100 source fit into a 200x100 box: width-bound (bounds_ratio - /// 2 < image_ratio 4), so the picture lands at half its native width -- - /// the number the scale plate would read as `scale 0.50`. - #[test] - fn the_scale_plate_reads_contains_own_fit_factor() { - let bounds = Bounds { - origin: point(px(0.), px(0.)), - size: size(px(200.), px(100.)), - }; - let native = size(gpui::DevicePixels(400), gpui::DevicePixels(100)); - assert!((fit_scale(bounds, native).unwrap() - 0.5).abs() < 0.001); - } - - /// A degenerate (zero-size) box never divides by zero -- it says "no - /// reading yet" instead of NaN or a panic, the same guard every other - /// `bounds_probe`-fed measurement in this file makes before its first - /// paint. - #[test] - fn an_unmeasured_box_reads_no_scale_rather_than_nan() { - let bounds = Bounds { - origin: point(px(0.), px(0.)), - size: size(px(0.), px(0.)), - }; - let native = size(gpui::DevicePixels(400), gpui::DevicePixels(100)); - assert_eq!(fit_scale(bounds, native), None); - } -} - -/// The scale plate (MOCK-SPEC.md "Screen": `scale 1.12`, label `ink3`, value -/// in ink): a readout, so a plate (DESIGN §4), never a chip. Lives in the -/// screen region's own margin row above the picture -- a flex sibling, not -/// an overlay, so it can never cover a picture pixel (§11 check 6) whatever -/// the source's aspect ratio does to the letterbox. -fn scale_plate(player: &Player) -> impl IntoElement { - let value = picture_scale(player) - .map(|s| format!("{s:.2}")) - .unwrap_or_else(|| "--".to_string()); - let style = type_scale::mono(type_scale::CHORD_METADATA_MIN_PX, gpui::FontWeight::MEDIUM); - div() - .id("stance-scale-plate") - .flex_none() - .flex() - .items_center() - .gap(px(6.)) - .px(px(10.)) - .py(px(6.)) - .rounded(px(2.)) - .bg(rgb(DARK_CANVAS())) - .font(style.font) - .text_size(style.size) - .child(div().text_color(rgb(INK3())).child("scale")) - .child(div().text_color(rgb(INK1())).child(value)) -} - /// A section head, uppercase, `ink3` -- DESIGN §3's scale for the label /// that names a region before anything else lives in it. fn section_head(label: &str) -> impl IntoElement { @@ -616,19 +535,6 @@ fn screen( // §4: room chrome takes 0 radius. .rounded(px(0.)) .bg(rgb(DARK_CANVAS())) - // FAULT 3: the scale plate's own margin row, above the picture -- - // a flex sibling shrinks the picture's `flex_1` to make room for it - // exactly as `two_up` already does below, so it is never drawn over - // real picture pixels. - .child( - div() - .flex_none() - .flex() - .justify_end() - .px(px(6.)) - .pt(px(4.)) - .child(scale_plate(player)), - ) .child( div() .id("stance-picture") diff --git a/crates/app/src/ui/timeband_stance.rs b/crates/app/src/ui/timeband_stance.rs index d8d9595..290f7f1 100644 --- a/crates/app/src/ui/timeband_stance.rs +++ b/crates/app/src/ui/timeband_stance.rs @@ -1,6 +1,7 @@ //! The time band's own content (MOCK-SPEC.md "Time band", DESIGN.md §5): -//! hero timecode, ghost transport, cut readout, the contact strip (whole-film -//! minimap) and the boxed Export chip. `stance.rs::time_band()`'s frame draws +//! hero timecode, one three-glyph transport, the cut odometer, the contact +//! strip (whole-film minimap, carrying the export range's two mark grips) +//! and the boxed Export chip. `stance.rs::time_band()`'s frame draws //! the strip; this module owns what fills it, the same split //! `dock_stance.rs`/`bench_stance.rs` already make for their regions. //! @@ -23,6 +24,10 @@ thread_local! { // fold both into `Player` once `main.rs` is free again. static STRIP_BOUNDS: Rc>> = Rc::new(Cell::new(Bounds::default())); static PAN_ANCHOR: Cell> = Cell::new(None); + /// Which export mark a live drag on the strip is moving (the grips of + /// `mark_grip` below), `None` when no mark drag is up. Same transient + /// shape as `PAN_ANCHOR` above, and the same ceiling. + static MARK_DRAG: Cell> = const { Cell::new(None) }; /// The band row's own measured width, read by the frame after the one /// that took it (`width_probe` asks for that frame whenever it changes). /// This is what the degradation ladder below keys off: the band cannot @@ -58,45 +63,38 @@ fn width_probe(into: Rc>) -> impl IntoElement { } /// Which layers of the band are still drawn at a given column width -/// (DESIGN §7's ladder, one layer per threshold, never all at once). +/// (DESIGN §7's ladder). Cleanse round 2 (2026-09-10) left the band five +/// things -- timecode, the three transport glyphs, the odometer, the strip +/// and the Export chip -- and only one of them has anything left to shed. #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub(crate) struct BandLayers { /// Chord badges under the transport glyphs. pub(crate) chords: bool, - /// The audio-monitoring cluster (mute, -/+, slider, level readout). - pub(crate) volume: bool, - /// The sync-point pair and the loop toggle. - pub(crate) sync: bool, - /// The export-range marks (I / O / x). - pub(crate) marks: bool, } -/// The ladder itself. Every threshold is a MEASURED number: the band drawn -/// whole at 2560x1440 (`$EDITH_HITMAP`) reads 1246px of fixed groups beside a -/// 974px strip, and the same band at 1280x720 (chords off) reads each glyph's -/// door at its `HIT_MIN` floor. Fixed width + `STRIP_MIN_W`, rounded up to the -/// next 10px, is what each rung costs: +/// The ladder itself, now two rungs. Every threshold is a MEASURED number, +/// taken off `$EDITH_HITMAP` in the harness: the row's own content box (what +/// `width_probe` reads -- the band's column less its 12px padding either +/// side) holds 454px of fixed groups beside the strip that absorbs the rest, +/// and the same band with the chords dropped holds 419px (each glyph's door +/// falls back to its `HIT_MIN` floor, so the chord row costs 35px of width +/// and 22px of height). Fixed width + `STRIP_MIN_W`, rounded up to the next +/// 10px, is what each rung costs: /// /// | drawn | fixed | needs | /// |----------------------------------------------|-------|--------| -/// | everything, chords under every glyph | 1246 | 1370px | -/// | chords dropped (-97px, doors keep `HIT_MIN`) | 1149 | 1270px | -/// | + monitoring cluster dropped (-256px) | 893 | 1020px | -/// | + sync pair and loop dropped (-102px) | 791 | 920px | -/// | + range marks dropped (-92px): the floor | 699 | 820px | +/// | chords under every glyph | 454 | 580px | +/// | chords dropped (-35px, doors keep `HIT_MIN`) | 419 | 540px | /// -/// The four things the band is *for* -- timecode, cut readout, contact strip -/// (>=`STRIP_MIN_W`, the flex_1 that absorbs the slack) and the Export chip -- -/// are on every rung; below the floor's own 820px there is nothing left to -/// shed and `overflow_hidden` is what keeps the rest inside the column. -/// There is no zoom group in this band (the charter's rung 2): the monitoring -/// cluster is the band's equivalent extra and takes its place. +/// The five things the band is *for* are on every rung; below the floor's +/// own 540px there is nothing left to shed and `overflow_hidden` is what +/// keeps the rest inside the column. Everything the older four-rung ladder +/// used to drop -- the monitoring cluster, the sync pair and loop, the +/// `I O ×` marks -- left the band entirely in cleanse round 2, so the rungs +/// that shed them went with them. pub(crate) fn band_layers(band_w: f32) -> BandLayers { BandLayers { - chords: band_w >= 1370., - volume: band_w >= 1270., - sync: band_w >= 1020., - marks: band_w >= 920., + chords: band_w >= 580., } } @@ -277,48 +275,15 @@ fn cut_readout(player: &Player, position: f64) -> impl IntoElement { .child(sep()) .child(val(format!("in {in_d}"))) }) - .child(sep()) - .child( - div() - .text_color(rgb(if roll_on { INK1() } else { INK4() })) - .child("roll"), - ) -} -/// Export-range marks belong beside the cut readout they constrain (DESIGN §9): -/// each is a direct mouse door to the same action its chord asks for. -fn range_marks(player: &Player, cx: &mut Context) -> impl IntoElement { - div() - .id("stance-range-marks") - .flex_none() - .flex() - .items_center() - .gap(px(4.)) - .child(ghost( - "stance-mark-in", - player, - "I", - ActionId::SetIn, - false, - cx, - )) - .child(ghost( - "stance-mark-out", - player, - "O", - ActionId::SetOut, - false, - cx, - )) - .child(ghost( - "stance-clear-range", - player, - "×", - ActionId::ClearRange, - false, - cx, - )) + // Cleanse round 2: the word `roll` sat in the band dim at all times, + // naming a mode that is off. The STATE stays -- when roll is armed + // the word is there in `ink1` -- but at rest the odometer reads + // `cut 14/37` and nothing else. + .when(roll_on, |el| { + el.child(sep()) + .child(div().text_color(rgb(INK1())).child("roll")) + }) } - /// The contact strip (MOCK-SPEC "Contact strip"): the whole-film minimap /// filling the band's remaining width, with a 1px viewport bracket marking /// where the bench's own window sits. Click jumps the playhead; drag pans @@ -404,10 +369,6 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context) -> im .min_w(px(STRIP_MIN_W)) .h(px(28.)) .cursor_pointer() - .tooltip(|_, cx| { - cx.new(|_| Tip("Contact strip — drag scrubs the playhead, click jumps; drag the bracket's grips to pan the bench".into())) - .into() - }) // Division of the plain drag (MOCK-SPEC "Contact strip", task's own // instruction to decide honestly): a person reaches for this strip to // move through the FILM far more often than to slide the bench's own @@ -434,6 +395,44 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context) -> im move |this, event: &MouseMoveEvent, _, cx| { if event.pressed_button != Some(MouseButton::Left) { PAN_ANCHOR.with(|a| a.set(None)); + MARK_DRAG.with(|m| m.set(None)); + return; + } + // A mark grip is under the hand: the drag sets that mark + // instead of scrubbing or panning (the grip's own press + // armed this and stopped propagation, so this branch is the + // only thing a mark drag does). + if let Some(action) = MARK_DRAG.with(Cell::get) { + let duration = this.drawn_duration(); + if duration > 0. { + let frac = frac_along(event.position.x, bounds.get()); + let at = (f64::from(frac) * duration * this.active_fps()).max(0.).round() + as u32; + let (lo, hi) = this.range.unwrap_or((at, at)); + let (a, b) = if action == ActionId::SetIn { + (at, hi) + } else { + (lo, at) + }; + // Dragged past its partner, the mark under the hand + // becomes the OTHER mark (`ordered_range` is what + // keeps the pair legal, and `i`/`o` swap the same + // way). Without this flip a live drag re-orders on + // every move event and both ticks walk along with + // the pointer, which is what the first harness run + // caught. + if crate::player::actions::ordered_range(a, b) != (a, b) { + MARK_DRAG.with(|m| { + m.set(Some(if action == ActionId::SetIn { + ActionId::SetOut + } else { + ActionId::SetIn + })) + }); + } + this.range = Some(crate::player::actions::ordered_range(a, b)); + } + cx.notify(); return; } match PAN_ANCHOR.with(Cell::get) { @@ -467,8 +466,18 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context) -> im })) .on_mouse_up( MouseButton::Left, - cx.listener(|_, _, _, _| PAN_ANCHOR.with(|a| a.set(None))), + cx.listener(|_, _, _, _| { + PAN_ANCHOR.with(|a| a.set(None)); + MARK_DRAG.with(|m| m.set(None)); + }), ) + // The plate sits beside the id it names: the mark-drag branch above + // pushed the two more than `every_hitmap_control_wears_a_hover_line` + // reaches when this hung at the top of the chain. + .tooltip(|_, cx| { + cx.new(|_| Tip("Contact strip — drag scrubs the playhead, click jumps; drag the bracket's grips to pan the bench".into())) + .into() + }) .children(hitmap::control("timeline.contact-strip", "Timeline contact strip", true)) .child(bounds_probe(strip_bounds)) // Baseline: a quiet hairline under the real traces below it, so an @@ -525,6 +534,28 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context) -> im .child(grip("stance-strip-grip-rt", false, true)) .child(grip("stance-strip-grip-rb", false, false)), ) + // The export range's own two grips (DESIGN §5 as amended + // 2026-09-10): the `I O ×` trio left the band, so the marks live on + // the film itself. Nothing is drawn until a mark exists. + .when_some( + player.range.filter(|_| duration > 0.), + |el, (in_f, out_f)| { + el.child(mark_grip( + player, + "stance-strip-mark-in", + frac(in_f), + "Mark in", + ActionId::SetIn, + )) + .child(mark_grip( + player, + "stance-strip-mark-out", + frac(out_f), + "Mark out", + ActionId::SetOut, + )) + }, + ) // The lamp-white playhead marker: this is what turns the strip from // a trace into a slider with a handle (task's own wording) -- the // one 1px line on the whole band that names *this* film moment, @@ -544,6 +575,43 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context) -> im }) } +/// One export-range mark, drawn on the contact strip at its own film +/// position: an `ink1` tick beside the bracket's lamp-white playhead, with a +/// ±6px door around it that takes precedence over the strip's own +/// click-jump/drag-scrub (`stop_propagation` on its press, the same split +/// [`grip`] below makes for the bench-window pan). Dragging it sets that +/// mark; `i`, `o` and `^u` are unchanged. +fn mark_grip( + player: &Player, + id: &'static str, + frac: f32, + name: &'static str, + action: ActionId, +) -> impl IntoElement { + let chord = player.keymap.chord(action); + div() + .id(id) + .absolute() + .left(relative(frac)) + .top_0() + .h_full() + .ml(px(-MARK_GRAB)) + .w(px(MARK_GRAB * 2. + 1.)) + .flex() + .justify_center() + .cursor_col_resize() + .on_mouse_down(MouseButton::Left, move |_: &MouseDownEvent, _, cx| { + MARK_DRAG.with(|m| m.set(Some(action))); + cx.stop_propagation(); + }) + .tooltip(crate::ui::widgets::tip_hover(name, &chord, None)) + .children(hitmap::action(action, player.enable(action, None).yes())) + .child(div().w(px(1.)).h_full().bg(rgb(INK1()))) +} + +/// How far either side of a mark tick the hand still grabs it. +const MARK_GRAB: f32 = 6.; + /// One grip notch on the viewport bracket (MOCK-SPEC "grip notches"): the /// only part of the contact strip that pans the bench window rather than /// scrubbing the playhead (see [`contact_strip`]'s own doc on that split). @@ -641,67 +709,6 @@ fn export_chip(player: &Player, cx: &mut Context) -> impl IntoElement { ) } -/// The monitoring level's continuous pointer door. It shares the Player's -/// measured bar and root drag plumbing with the legacy slider, but keeps the -/// Darkroom's achromatic track and ink ladder. -fn volume_slider(player: &Player, cx: &mut Context) -> impl IntoElement { - let volume = player.volume; - let enabled = player.enable(ActionId::ToggleMute, None).yes(); - div() - .id("stance-tb-volume-bar") - .relative() - .flex_none() - .w(px(VOLUME_W)) - .h(px(CONTROL_H)) - .flex() - .items_center() - .tooltip(|_, cx| { - cx.new(|_| Tip("Volume — drag to set the level; the button mutes".into())) - .into() - }) - .when(!enabled, |d| d.opacity(0.4).cursor_not_allowed()) - .when(enabled, |d| { - d.cursor_pointer() - .on_mouse_down( - MouseButton::Left, - cx.listener(|this, event: &MouseDownEvent, _, cx| { - this.volume_dragging = true; - this.drag_volume(event.position.x, cx); - }), - ) - .child(bounds_probe(player.volume_bar.clone())) - }) - .children(hitmap::control("timeline.volume", "Volume", enabled)) - .child( - div() - .w_full() - .h(px(4.)) - .rounded(px(2.)) - .bg(rgb(DARK_RAISED())) - .child( - div() - .h_full() - .w(relative(volume.along())) - .rounded(px(2.)) - .bg(rgb(if volume.muted { INK3() } else { INK2() })), - ), - ) -} - -/// The level, written once (DESIGN 3: a number about a level is mono). It -/// sits beside the slider that sets it -- the slider's fill and this readout -/// are one truth in two forms, where the mute button used to wear a third. -fn volume_readout(player: &Player) -> impl IntoElement { - let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM); - div() - .flex_none() - .w(px(34.)) - .font(style.font) - .text_size(style.size) - .text_color(rgb(if player.volume.muted { INK3() } else { INK2() })) - .child(format!("{}%", player.volume.percent())) -} - /// The whole band, left to right per MOCK-SPEC: hero timecode, ghost /// transport, cut readout, the contact strip filling the rest, the Export /// chip at the end. @@ -739,20 +746,12 @@ pub(crate) fn render( // The most-read element anchors its region (DESIGN §5): the // timecode leads. .child(hero_timecode(&tc)) - // FAULT 2, the J/K/L question: MOCK-SPEC reads this row's chords as - // `J`/`spc`/`L`, which DESIGN §6 names as the shuttle. No shuttle - // action exists anywhere in this codebase (grepped -- `keymap.rs`, - // `player/actions.rs`, the engine: nothing), and `j`/`k`/`l` are - // already bound to Speed/Color/Lift (`keymap.rs`'s Clip-verb group), - // not to this row -- rebinding them here would silently steal those, - // and `keymap.rs` is not this task's file to make that call in. So - // the glyphs below stay wired to what actually exists and already - // fires correctly (`JumpBack`/`Play`/`JumpForward`, real one-second - // stepping): each badge now reads that action's own compact chord - // (`^←`/`spc`/`^→`) instead of the mismatched mock label, which is - // what keeps glyph, badge and action honestly in agreement per this - // task's own rule -- the mock's `J`/`L` reading stays unimplemented - // and is named here rather than faked. + // Cleanse round 2 (2026-09-10): one transport, three glyphs. The + // shuttle pair (`◀◀ ▶▶`), the home/end pair, the sync points, the + // loop toggle, the monitoring cluster, the `I O ×` marks and Save + // all left the band -- each keeps its chord, its KEYS-tab row and + // (where it has one) its right-click home, and the marks became the + // contact strip's own two grips. .child( div() .flex_none() @@ -760,10 +759,10 @@ pub(crate) fn render( .items_center() .gap(px(10.)) .child(ghost( - "stance-tb-jumpback", + "stance-tb-step-back", player, - "◀◀", - ActionId::JumpBack, + "|◂", + ActionId::StepBack, false, cx, )) @@ -779,22 +778,6 @@ pub(crate) fn render( false, cx, )) - .child(ghost( - "stance-tb-jumpforward", - player, - "▶▶", - ActionId::JumpForward, - false, - cx, - )) - .child(ghost( - "stance-tb-step-back", - player, - "|◂", - ActionId::StepBack, - false, - cx, - )) .child(ghost( "stance-tb-step-forward", player, @@ -802,154 +785,9 @@ pub(crate) fn render( ActionId::StepForward, false, cx, - )) - .child(ghost( - "stance-tb-start", - player, - "↤", - ActionId::GoStart, - false, - cx, - )) - .child(ghost( - "stance-tb-end", - player, - "↦", - ActionId::GoEnd, - false, - cx, - )) - .when(layers.sync, |el| { - el.child(ghost( - "stance-tb-sync-prev", - player, - "‹|", - ActionId::PrevSyncPoint, - false, - cx, - )) - .child(ghost( - "stance-tb-sync-next", - player, - "|›", - ActionId::NextSyncPoint, - false, - cx, - )) - }) - // Loop (homeless per this task's audit): the playback-loop - // toggle -- burst-use during editing per the charter's own - // classification -- earns the transport cluster it plays - // alongside, not the CUT group's `LoopTrim` two files over - // (a different verb already drawn on the spine, "↻" taken). - // "∞" reads as "keeps going" without borrowing that glyph. - .when(layers.sync, |el| { - el.child(ghost( - "stance-tb-loop", - player, - "∞", - ActionId::Loop, - player.loop_on, - cx, - )) - }), - ) - // The audio-monitoring cluster (homeless per this task's audit): - // ToggleMute/VolumeUp/VolumeDown, burst-use per the charter, placed - // beside the transport it plays with rather than the spine (the - // rail is already tightened, and this is a play-time concern, same - // land as J/spc/L above it). The level itself is the mute button's - // own label (legacy `toolbar.rs`'s own convention: an "×" prefix - // marks muted rather than a second colour), so one click toggles - // mute and the two ghosts flanking it nudge the level -- three - // homeless actions sharing one cluster rather than three unrelated - // rows. - .when(layers.volume, |el| el.child( - div() - .flex_none() - .flex() - .items_center() - .gap(px(6.)) - .child(ghost( - "stance-tb-vol-down", - player, - "−", - ActionId::VolumeDown, - false, - cx, - )) - // The level is NOT this button's label any more: the slider - // beside it already draws the same number as a fill and - // `volume_readout` writes it once, so wearing it here made - // mute a ghost with no glyph of its own (a percentage is not - // a verb). Speaker, struck when muted -- typographic, the - // same hand-drawn grammar as the glyphs around it. - .child(ghost( - "stance-tb-mute", - player, - if player.volume.muted { "◁×" } else { "◁))" }, - ActionId::ToggleMute, - player.volume.muted, - cx, - )) - .child(volume_slider(player, cx)) - .child(volume_readout(player)) - .child(ghost( - "stance-tb-vol-up", - player, - "+", - ActionId::VolumeUp, - false, - cx, )), - )) - .when(layers.marks, |el| el.child(range_marks(player, cx))) + ) .child(cut_readout(player, position)) .child(contact_strip(player, position, cx)) - .child(save_verb(player, cx)) .child(export_chip(player, cx)) } - -/// `Save` (homeless per this task's audit): not boxed -- DESIGN §4 reserves -/// the room's one border for the commit-class Export beside it -- but filed -/// right next to it anyway. `keymap.rs`'s own `Category::File` already -/// files Save beside Export and Screenshot on the strength of what each one -/// writes, and the ledger this task named as Save's natural home -/// (`name.edith · saved`/`unsaved`) lives in `stance.rs`, a concurrent -/// builder's file this task does not touch -- so the verb lands here -/// instead, a ghost sharing the export chip's own end-of-band land rather -/// than competing with the ledger strip below it for the same state. -fn save_verb(player: &Player, cx: &mut Context) -> impl IntoElement { - let label_style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); - let chord_style = mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM); - div() - .id("stance-tb-save") - .flex_none() - .flex() - .items_center() - .gap(px(4.)) - .cursor_pointer() - .hover(|s| s.text_color(rgb(INK1()))) - .text_color(rgb(INK2())) - .on_click(cx.listener(|this, _: &ClickEvent, window, cx| { - this.act(ActionId::Save, window, cx); - })) - .tooltip(crate::ui::widgets::action_hover(player, ActionId::Save)) - .children(hitmap::action( - ActionId::Save, - player.enable(ActionId::Save, None).yes(), - )) - .child( - div() - .font(label_style.font) - .text_size(label_style.size) - .child("Save"), - ) - .child( - div() - .font(chord_style.font) - .text_size(chord_style.size) - .text_color(rgb(INK3())) - .child(player.keymap.chord(ActionId::Save)), - ) -}