π₯ remove(app): cleanse the time band β five things and the strip's own mark grips
Browse files at this commit0a1b19d9b91375289bf86a4809618fc5b53dd879Parent: a3a997b6 changed files +294 -481
- DESIGN.md +18 -6
- crates/app/src/layout.rs +5 -1
- crates/app/src/tests/layout.rs +112 -53
- crates/app/src/transport.rs +0 -6
- crates/app/src/ui/stance.rs +6 -100
- crates/app/src/ui/timeband_stance.rs +153 -315
DESIGN.mdmodified+18 -6
| @@ -111,9 +111,10 @@ Fixed geography; nothing moves, nothing occludes the picture: | |||
| 111 | β occluded) β Src/ β | 111 | β occluded) β Src/ β |
| 112 | β β Clip β | 112 | β β Clip β |
| 113 | βββββββββββββββββββββββββββββββββββ€ KEYS β | 113 | βββββββββββββββββββββββββββββββββββ€ KEYS β |
| 114 | -β TIME BAND: timecode β ghost β tabs β | 114 | +β TIME BAND: timecode β |β βΆ βΈ| β tabs β |
| 115 | -β transport β cut readout β β β | 115 | +β β cut 14/37 β contact strip β β |
| 116 | -β contact strip β [Export] β β | 116 | +β (with the in/out grips) β β |
| 117 | +β β [Export] β β | ||
| 117 | βββββββββββββββββββββββββββββββββββ€ β | 118 | βββββββββββββββββββββββββββββββββββ€ β |
| 118 | β BENCH (lanes V/A/S) β β | 119 | β BENCH (lanes V/A/S) β β |
| 119 | βββββββββββββββββββββββββββββββββββ€ β | 120 | βββββββββββββββββββββββββββββββββββ€ β |
| @@ -124,9 +125,20 @@ Fixed geography; nothing moves, nothing occludes the picture: | |||
| 124 | 125 | ||
| 125 | - **Screen**: the picture. Never covered β not by drawers, notices, drags, or menus. Two-up | 126 | - **Screen**: the picture. Never covered β not by drawers, notices, drags, or menus. Two-up |
| 126 | OUT|IN judging renders *in* the screen at rest on a cut. | 127 | OUT|IN judging renders *in* the screen at rest on a cut. |
| 127 | -- **Time band**: timecode leads; ghost transport; cut readout (`14/37`); the **contact strip** | 128 | +- **Time band**: timecode leads; one transport (`|β βΆ βΈ|` β frame back, play/pause, frame |
| 128 | - (whole-film motion-trace minimap, `FILM` label, viewport bracket with grip notches β click | 129 | + forward); the cut odometer (`14/37`, and the word `roll` only while roll is armed); the |
| 129 | - jumps, drag pans); boxed **Export** at the end. | 130 | + **contact strip** (whole-film motion-trace minimap, viewport bracket with grip notches β click |
| 131 | + jumps, drag scrubs, the bracket's notches pan; the export range's **in/out marks are two `ink1` | ||
| 132 | + grips on the strip at their own film positions**, draggable to set the mark, drawn only once a | ||
| 133 | + mark exists and taking the pointer within Β±6px); boxed **Export** at the end. | ||
| 134 | + | ||
| 135 | +**Amendment (2026-09-10), "cleanse round 2"** (user: "seems cool, let's apply"): the band holds | ||
| 136 | +five things and nothing else. The shuttle pair (`ββ βΆβΆ`), home/end, the sync points, the loop | ||
| 137 | +toggle, the monitoring cluster (mute, level slider, percent), the `I O Γ` marks trio and `Save` | ||
| 138 | +all left it β each keeps its chord and its KEYS-tab row, the ruler menu keeps the verbs that act | ||
| 139 | +on the ruler, the marks became the strip's grips, and the ledger already says `saved`/`unsaved Β· | ||
| 140 | +^s`. The picture's `scale 0.59` corner readout is deleted with them: fit is `^0`, and the number | ||
| 141 | +was a state nobody acts on. | ||
| 130 | - **Bench**: lanes. Clip anatomy = ink spine (3px left edge) + real thumbnails/waveform in the | 142 | - **Bench**: lanes. Clip anatomy = ink spine (3px left edge) + real thumbnails/waveform in the |
| 131 | source's ink + name plate + splice gaps in lamp white. | 143 | source's ink + name plate + splice gaps in lamp white. |
| 132 | - **Ledger**: project identity (`name.edith Β· saved`), last action, export progress, and at the | 144 | - **Ledger**: project identity (`name.edith Β· saved`), last action, export progress, and at the |
crates/app/src/layout.rsmodified+5 -1
| @@ -60,7 +60,11 @@ pub(crate) const LIBRARY_MIN_W: f32 = 120.; | |||
| 60 | pub(crate) const LIBRARY_MAX_W: f32 = 220.; | 60 | pub(crate) const LIBRARY_MAX_W: f32 = 220.; |
| 61 | pub(crate) const CONTROL_H: f32 = 28.; | 61 | pub(crate) const CONTROL_H: f32 = 28.; |
| 62 | /// The volume slider beside its button: a hundred steps across it, so a pixel | 62 | /// The volume slider beside its button: a hundred steps across it, so a pixel |
| 63 | -/// is finer than a step and the drag reads as continuous. | 63 | +/// is finer than a step and the drag reads as continuous. Cleanse round 2 |
| 64 | +/// (2026-09-10) took that slider out of the time band, so the width is only | ||
| 65 | +/// the drag-math guard's own bar now -- it sits with the tests, like | ||
| 66 | +/// [`Volume::label`], rather than in the binary. | ||
| 67 | +#[cfg(test)] | ||
| 64 | pub(crate) const VOLUME_W: f32 = 110.; | 68 | pub(crate) const VOLUME_W: f32 = 110.; |
| 65 | pub(crate) const RULER_HIT_H: f32 = HIT_MIN; | 69 | pub(crate) const RULER_HIT_H: f32 = HIT_MIN; |
| 66 | /// The keybindings card: a row per action, a title and a status line, inside a | 70 | /// The keybindings card: a row per action, a title and a status line, inside a |
crates/app/src/tests/layout.rsmodified+112 -53
| @@ -1610,12 +1610,15 @@ fn darkroom_lane_header_verbs_are_targeted_and_visible() { | |||
| 1610 | ] { | 1610 | ] { |
| 1611 | assert!(bench.contains(door), "lane header lost {door}"); | 1611 | assert!(bench.contains(door), "lane header lost {door}"); |
| 1612 | } | 1612 | } |
| 1613 | + // Cleanse round 2 (2026-09-10): the monitoring cluster left the band | ||
| 1614 | + // (chord + KEYS row only). What the band still owes a pointer is the | ||
| 1615 | + // export range's two grips on the contact strip. | ||
| 1613 | let time_band = src_text("ui/timeband_stance.rs"); | 1616 | let time_band = src_text("ui/timeband_stance.rs"); |
| 1614 | for door in [ | 1617 | for door in [ |
| 1615 | - "fn volume_slider(", | 1618 | + "fn mark_grip(", |
| 1616 | - "\"stance-tb-volume-bar\"", | 1619 | + "\"stance-strip-mark-in\"", |
| 1617 | - "this.drag_volume(event.position.x, cx)", | 1620 | + "\"stance-strip-mark-out\"", |
| 1618 | - ".child(volume_slider(player, cx))", | 1621 | + "MARK_DRAG.with(|m| m.set(Some(action)))", |
| 1619 | ] { | 1622 | ] { |
| 1620 | assert!(time_band.contains(door), "time band lost {door}"); | 1623 | assert!(time_band.contains(door), "time band lost {door}"); |
| 1621 | } | 1624 | } |
| @@ -2504,6 +2507,66 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { | |||
| 2504 | // gave every one of them a door on the thing it acts on -- the clip | 2507 | // gave every one of them a door on the thing it acts on -- the clip |
| 2505 | // menu, the ruler's, the lane head's -- and the staleness check below | 2508 | // menu, the ruler's, the lane head's -- and the staleness check below |
| 2506 | // is what deleted their entries as each landed. | 2509 | // is what deleted their entries as each landed. |
| 2510 | + // Cleanse round 2 (2026-09-10, user "seems cool, let's apply"): the | ||
| 2511 | + // time band kept the timecode, one three-glyph transport, the | ||
| 2512 | + // odometer, the contact strip and Export. Everything below left it. | ||
| 2513 | + // Each keeps its chord and its KEYS-tab row; the ruler menu already | ||
| 2514 | + // owns the ones that act on the ruler (zoom/fit/snap). Named here | ||
| 2515 | + // rather than re-mounted, per DESIGN Β§5's amendment: the geography of | ||
| 2516 | + // a verb is the thing it acts on, and playback has no thing. | ||
| 2517 | + ( | ||
| 2518 | + ActionId::JumpBack, | ||
| 2519 | + "KEYS tab + key: the shuttle pair left the band in cleanse round 2", | ||
| 2520 | + ), | ||
| 2521 | + ( | ||
| 2522 | + ActionId::JumpForward, | ||
| 2523 | + "KEYS tab + key: the shuttle pair left the band in cleanse round 2", | ||
| 2524 | + ), | ||
| 2525 | + ( | ||
| 2526 | + ActionId::GoStart, | ||
| 2527 | + "KEYS tab + key: home/end left the band in cleanse round 2 -- the \ | ||
| 2528 | + contact strip's own ends are the pointer's version", | ||
| 2529 | + ), | ||
| 2530 | + ( | ||
| 2531 | + ActionId::GoEnd, | ||
| 2532 | + "KEYS tab + key: home/end left the band in cleanse round 2 -- the \ | ||
| 2533 | + contact strip's own ends are the pointer's version", | ||
| 2534 | + ), | ||
| 2535 | + ( | ||
| 2536 | + ActionId::PrevSyncPoint, | ||
| 2537 | + "KEYS tab + key: the sync pair left the band in cleanse round 2", | ||
| 2538 | + ), | ||
| 2539 | + ( | ||
| 2540 | + ActionId::NextSyncPoint, | ||
| 2541 | + "KEYS tab + key: the sync pair left the band in cleanse round 2", | ||
| 2542 | + ), | ||
| 2543 | + ( | ||
| 2544 | + ActionId::Loop, | ||
| 2545 | + "KEYS tab + key: the loop toggle left the band in cleanse round 2", | ||
| 2546 | + ), | ||
| 2547 | + ( | ||
| 2548 | + ActionId::ToggleMute, | ||
| 2549 | + "KEYS tab + key: the monitoring cluster left the band in cleanse round 2", | ||
| 2550 | + ), | ||
| 2551 | + ( | ||
| 2552 | + ActionId::VolumeUp, | ||
| 2553 | + "KEYS tab + key: the monitoring cluster left the band in cleanse round 2", | ||
| 2554 | + ), | ||
| 2555 | + ( | ||
| 2556 | + ActionId::VolumeDown, | ||
| 2557 | + "KEYS tab + key: the monitoring cluster left the band in cleanse round 2", | ||
| 2558 | + ), | ||
| 2559 | + ( | ||
| 2560 | + ActionId::ClearRange, | ||
| 2561 | + "KEYS tab + key: `I O Γ` left the band in cleanse round 2 -- in and out \ | ||
| 2562 | + became the contact strip's own grips, and clearing both at once is \ | ||
| 2563 | + not a thing on the film to point at", | ||
| 2564 | + ), | ||
| 2565 | + ( | ||
| 2566 | + ActionId::Save, | ||
| 2567 | + "KEYS tab + key: the ledger says `saved`/`unsaved Β· ^s`, which is the \ | ||
| 2568 | + state this verb is about (cleanse round 2)", | ||
| 2569 | + ), | ||
| 2507 | ( | 2570 | ( |
| 2508 | ActionId::Screenshot, | 2571 | ActionId::Screenshot, |
| 2509 | "the picture the frame is written from is the *watched* frame and \ | 2572 | "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() { | |||
| 2511 | and the KEYS card, like the selection accelerators above", | 2574 | and the KEYS card, like the selection accelerators above", |
| 2512 | ), | 2575 | ), |
| 2513 | ]; | 2576 | ]; |
| 2577 | + /// `ActionId::Loop` is a prefix of `ActionId::LoopTrim`, and the keys | ||
| 2578 | + /// menu's own label arm (`ActionId::ToggleMute | ActionId::Paste => | ||
| 2579 | + /// format!("{verb} (global)")`) shapes a string rather than opening a | ||
| 2580 | + /// door -- neither is a widget home, so neither counts as a mention. | ||
| 2581 | + fn mentions(text: &str, name: &str) -> bool { | ||
| 2582 | + text.lines() | ||
| 2583 | + .filter(|l| !l.contains("=> format!(\"{verb} (global)\")")) | ||
| 2584 | + .any(|line| { | ||
| 2585 | + line.match_indices(&format!("ActionId::{name}")).any(|(i, m)| { | ||
| 2586 | + !line[i + m.len()..] | ||
| 2587 | + .chars() | ||
| 2588 | + .next() | ||
| 2589 | + .is_some_and(|c| c.is_alphanumeric() || c == '_') | ||
| 2590 | + }) | ||
| 2591 | + }) | ||
| 2592 | + } | ||
| 2514 | let darkroom = [ | 2593 | let darkroom = [ |
| 2515 | "ui/bench_stance.rs", | 2594 | "ui/bench_stance.rs", |
| 2516 | "ui/cards.rs", | 2595 | "ui/cards.rs", |
| @@ -2533,14 +2612,14 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { | |||
| 2533 | // has mounted the action, the entry has to go, or the sweep | 2612 | // has mounted the action, the entry has to go, or the sweep |
| 2534 | // goes blind on an action that is covered. | 2613 | // goes blind on an action that is covered. |
| 2535 | assert!( | 2614 | assert!( |
| 2536 | - !darkroom.contains(&format!("ActionId::{action:?}")), | 2615 | + !mentions(&darkroom, &format!("{action:?}")), |
| 2537 | "ActionId::{action:?} has a darkroom home now -- delete its \ | 2616 | "ActionId::{action:?} has a darkroom home now -- delete its \ |
| 2538 | EXPLICITLY_OWNED_ELSEWHERE entry ({owner})" | 2617 | EXPLICITLY_OWNED_ELSEWHERE entry ({owner})" |
| 2539 | ); | 2618 | ); |
| 2540 | continue; | 2619 | continue; |
| 2541 | } | 2620 | } |
| 2542 | let name = format!("{action:?}"); | 2621 | let name = format!("{action:?}"); |
| 2543 | - let mentioned = darkroom.contains(&format!("ActionId::{name}")) | 2622 | + let mentioned = mentions(&darkroom, &name) |
| 2544 | || (action == ActionId::Resolution && darkroom.contains("Pick::Resolution")) | 2623 | || (action == ActionId::Resolution && darkroom.contains("Pick::Resolution")) |
| 2545 | || (action == ActionId::SubtitleStyle && darkroom.contains("open_subtitle_style(cx)")); | 2624 | || (action == ActionId::SubtitleStyle && darkroom.contains("open_subtitle_style(cx)")); |
| 2546 | let hitmap_id = crate::ui::hitmap::action_id(action); | 2625 | let hitmap_id = crate::ui::hitmap::action_id(action); |
| @@ -2661,6 +2740,8 @@ fn hitmap_names_every_darkroom_pointer_entry_surface() { | |||
| 2661 | "timeline.contact-strip", | 2740 | "timeline.contact-strip", |
| 2662 | "stance-strip-grip-lt", | 2741 | "stance-strip-grip-lt", |
| 2663 | "stance-strip-grip-rb", | 2742 | "stance-strip-grip-rb", |
| 2743 | + "stance-strip-mark-in", | ||
| 2744 | + "stance-strip-mark-out", | ||
| 2664 | ][..], | 2745 | ][..], |
| 2665 | ), | 2746 | ), |
| 2666 | ("ui/preview.rs", &["preview.stop", "preview.scrub"][..]), | 2747 | ("ui/preview.rs", &["preview.stop", "preview.scrub"][..]), |
| @@ -3259,46 +3340,26 @@ fn the_time_band_never_paints_outside_its_own_column() { | |||
| 3259 | assert!(crate::ui::timeband_stance::STRIP_MIN_W >= 120.); | 3340 | assert!(crate::ui::timeband_stance::STRIP_MIN_W >= 120.); |
| 3260 | } | 3341 | } |
| 3261 | 3342 | ||
| 3262 | -/// DESIGN Β§7's ladder, one layer per threshold: the four things the band is | 3343 | +/// DESIGN Β§7's ladder, cleanse round 2 (2026-09-10): the band is five |
| 3263 | -/// *for* -- timecode, cut readout, contact strip, Export -- survive every | 3344 | +/// things -- timecode, the three transport glyphs, the odometer, the contact |
| 3264 | -/// rung, and the sheddable groups go in a fixed order (chords, then the | 3345 | +/// strip and Export -- and the only sheddable layer left is the chord row |
| 3265 | -/// monitoring cluster, then sync/loop, then the range marks), never all at | 3346 | +/// under the glyphs. This pins the one threshold (measured in the harness: |
| 3266 | -/// once. Thresholds are the measured group widths; this pins their order and | 3347 | +/// 454px of fixed groups + `STRIP_MIN_W`, rounded up -- a 640x600 window |
| 3267 | -/// the 1280x720 column (939px measured when a 56px rail still stood left of | 3348 | +/// reads 539px of band and draws no chords, a 1280x720 one reads 982px and |
| 3268 | -/// it; the rail is gone since 2026-09-09, so the same window measures ~989px) | 3349 | +/// draws them) and that it never comes back off. |
| 3269 | -/// landing on the | ||
| 3270 | -/// marks-only rung, which is what makes Export fit there (it ended at x=991 | ||
| 3271 | -/// inside a column ending at 995, against x=1113 under the dock before). | ||
| 3272 | #[test] | 3350 | #[test] |
| 3273 | -fn the_band_sheds_one_layer_per_threshold_in_a_fixed_order() { | 3351 | +fn the_band_sheds_its_chords_and_nothing_else() { |
| 3274 | use crate::ui::timeband_stance::band_layers; | 3352 | use crate::ui::timeband_stance::band_layers; |
| 3275 | - let ladder = [2000., 1300., 1100., 939., 800., 0.] | ||
| 3276 | - .map(|w| band_layers(w)) | ||
| 3277 | - .map(|l| (l.chords, l.volume, l.sync, l.marks)); | ||
| 3278 | assert_eq!( | 3353 | assert_eq!( |
| 3279 | - ladder, | 3354 | + [2000., 982., 580., 579., 539., 0.].map(|w| band_layers(w).chords), |
| 3280 | - [ | 3355 | + [true, true, true, false, false, false], |
| 3281 | - (true, true, true, true), | 3356 | + "the band's one rung is the chord row at 580px" |
| 3282 | - (false, true, true, true), | ||
| 3283 | - (false, false, true, true), | ||
| 3284 | - (false, false, false, true), | ||
| 3285 | - (false, false, false, false), | ||
| 3286 | - (false, false, false, false), | ||
| 3287 | - ], | ||
| 3288 | - "the band must drop chords, then the monitoring cluster, then sync/loop, then the marks" | ||
| 3289 | ); | 3357 | ); |
| 3290 | // Monotone: a wider band never shows less than a narrower one. | 3358 | // Monotone: a wider band never shows less than a narrower one. |
| 3291 | let mut prev = band_layers(0.); | 3359 | let mut prev = band_layers(0.); |
| 3292 | for w in (0..2400).step_by(10).map(|w| w as f32) { | 3360 | for w in (0..2400).step_by(10).map(|w| w as f32) { |
| 3293 | let now = band_layers(w); | 3361 | let now = band_layers(w); |
| 3294 | - for (a, b) in [ | 3362 | + assert!(now.chords || !prev.chords, "layer came back off at {w}px"); |
| 3295 | - (prev.chords, now.chords), | ||
| 3296 | - (prev.volume, now.volume), | ||
| 3297 | - (prev.sync, now.sync), | ||
| 3298 | - (prev.marks, now.marks), | ||
| 3299 | - ] { | ||
| 3300 | - assert!(b || !a, "layer came back off at {w}px"); | ||
| 3301 | - } | ||
| 3302 | prev = now; | 3363 | prev = now; |
| 3303 | } | 3364 | } |
| 3304 | } | 3365 | } |
| @@ -3306,7 +3367,9 @@ fn the_band_sheds_one_layer_per_threshold_in_a_fixed_order() { | |||
| 3306 | /// Every door in this band is at least `HIT_MIN` wide and tall (WCAG 2.5.8). | 3367 | /// Every door in this band is at least `HIT_MIN` wide and tall (WCAG 2.5.8). |
| 3307 | /// The hitmap read `SetIn w=8`, `VolumeDown w=12`, `Loop w=13`, `SetOut w=15`, | 3368 | /// The hitmap read `SetIn w=8`, `VolumeDown w=12`, `Loop w=13`, `SetOut w=15`, |
| 3308 | /// `Prev/NextSyncPoint w=16` before this: padding on the shared `ghost`, not a | 3369 | /// `Prev/NextSyncPoint w=16` before this: padding on the shared `ghost`, not a |
| 3309 | -/// bigger glyph. | 3370 | +/// bigger glyph. Those five glyphs left the band in cleanse round 2; the |
| 3371 | +/// three that stayed are drawn by the same `ghost`, so the floor is still | ||
| 3372 | +/// checked where it is spent. | ||
| 3310 | #[test] | 3373 | #[test] |
| 3311 | fn every_ghost_in_the_time_band_carries_a_full_hit_area() { | 3374 | fn every_ghost_in_the_time_band_carries_a_full_hit_area() { |
| 3312 | let src = src_text("ui/timeband_stance.rs"); | 3375 | let src = src_text("ui/timeband_stance.rs"); |
| @@ -3319,21 +3382,15 @@ fn every_ghost_in_the_time_band_carries_a_full_hit_area() { | |||
| 3319 | } | 3382 | } |
| 3320 | 3383 | ||
| 3321 | /// Mute wore `"{volume}%"` as its glyph while the slider beside it drew the | 3384 | /// Mute wore `"{volume}%"` as its glyph while the slider beside it drew the |
| 3322 | -/// same value: one number, two places, and a toggle with no verb of its own. | 3385 | +/// same value: one number, two places. Cleanse round 2 (2026-09-10) settled |
| 3323 | -/// The level is a mono readout beside the slider now, once. | 3386 | +/// it the other way -- the whole monitoring cluster left the band (mute is |
| 3387 | +/// `m`, the level is the `-`/`=` pair), so the band writes no level at all. | ||
| 3324 | #[test] | 3388 | #[test] |
| 3325 | -fn the_level_is_written_once_and_mute_wears_a_glyph() { | 3389 | +fn the_band_writes_no_monitoring_level() { |
| 3326 | let src = src_text("ui/timeband_stance.rs"); | 3390 | let src = src_text("ui/timeband_stance.rs"); |
| 3327 | - assert_eq!( | 3391 | + for gone in ["player.volume.percent()", "fn volume_readout(", "fn volume_slider("] { |
| 3328 | - src.matches(r#"player.volume.percent()"#).count(), | 3392 | + assert!(!src.contains(gone), "the monitoring cluster is back in the band: {gone}"); |
| 3329 | - 1, | 3393 | + } |
| 3330 | - "the volume level must be written in exactly one place in the band" | ||
| 3331 | - ); | ||
| 3332 | - assert!( | ||
| 3333 | - src.contains(r#"if player.volume.muted { "βΓ" } else { "β))" }"#), | ||
| 3334 | - "mute must wear a speaker glyph, struck when muted" | ||
| 3335 | - ); | ||
| 3336 | - assert!(src.contains("fn volume_readout("), "the level readout is the one place it is written"); | ||
| 3337 | } | 3394 | } |
| 3338 | 3395 | ||
| 3339 | /// `Play` and `StepForward` drew the same solid right-triangle: two verbs one | 3396 | /// `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() { | |||
| 3345 | let at = src.find(&format!("ActionId::{action},")).expect("the call"); | 3402 | let at = src.find(&format!("ActionId::{action},")).expect("the call"); |
| 3346 | src[..at].rsplit('"').nth(1).expect("its glyph").to_string() | 3403 | src[..at].rsplit('"').nth(1).expect("its glyph").to_string() |
| 3347 | }; | 3404 | }; |
| 3348 | - let shapes = ["Play", "StepBack", "StepForward", "JumpBack", "JumpForward"].map(glyph); | 3405 | + // Cleanse round 2: the shuttle pair left the band, so the three that |
| 3406 | + // stayed are what must still differ by shape. | ||
| 3407 | + let shapes = ["Play", "StepBack", "StepForward"].map(glyph); | ||
| 3349 | let mut seen = shapes.to_vec(); | 3408 | let mut seen = shapes.to_vec(); |
| 3350 | seen.sort(); | 3409 | seen.sort(); |
| 3351 | seen.dedup(); | 3410 | seen.dedup(); |
crates/app/src/transport.rsmodified+0 -6
| @@ -77,12 +77,6 @@ impl Volume { | |||
| 77 | f32::from(self.steps) / f32::from(Self::MAX_STEPS) | 77 | f32::from(self.steps) / f32::from(Self::MAX_STEPS) |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | - /// The level as a whole number, for the button's fixed rect: muting swaps | ||
| 81 | - /// the glyph beside it, never the width of the box. | ||
| 82 | - pub(crate) fn percent(self) -> u32 { | ||
| 83 | - u32::from(self.steps) * 100 / u32::from(Self::MAX_STEPS) | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | /// What the button read before the mute state became a glyph and a colour | 80 | /// What the button read before the mute state became a glyph and a colour |
| 87 | /// ([`Player::toolbar`]): the guards still hold the wording to it, so it | 81 | /// ([`Player::toolbar`]): the guards still hold the wording to it, so it |
| 88 | /// sits with them rather than in the binary. | 82 | /// sits with them rather than in the binary. |
crates/app/src/ui/stance.rsmodified+6 -100
| @@ -402,30 +402,15 @@ mod maximized_card_top_tests { | |||
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | thread_local! { | 404 | thread_local! { |
| 405 | - // FAULT 3: the picture region's own laid-out box, measured each frame by | 405 | + // The picture region's own laid-out box, measured each frame by a |
| 406 | - // a [`bounds_probe`] the same shape `timeband_stance`'s contact strip | 406 | + // [`bounds_probe`] the same shape `timeband_stance`'s contact strip keeps |
| 407 | - // keeps (`STRIP_BOUNDS`) -- the scale plate needs the box the picture was | 407 | + // (`STRIP_BOUNDS`) -- [`picture_bottom`] needs the box the picture was |
| 408 | - // fitted into, which nothing upstream of paint knows. | 408 | + // fitted into, which nothing upstream of paint knows. (Cleanse round 2, |
| 409 | + // 2026-09-10: the `scale 0.59` readout this also fed is deleted -- fit is | ||
| 410 | + // `^0` and the number was a state nobody acts on.) | ||
| 409 | static PICTURE_BOUNDS: Rc<Cell<Bounds<Pixels>>> = Rc::new(Cell::new(Bounds::default())); | 411 | static PICTURE_BOUNDS: Rc<Cell<Bounds<Pixels>>> = Rc::new(Cell::new(Bounds::default())); |
| 410 | } | 412 | } |
| 411 | 413 | ||
| 412 | -/// The pure half of [`picture_scale`]: given a box and the image's native | ||
| 413 | -/// size, its `Contain` fit factor -- gpui's own tested `get_bounds` math | ||
| 414 | -/// ([`letterboxed_image`] fits the picture the same way), not a ratio | ||
| 415 | -/// reimplemented here. Split out from `picture_scale` so this arithmetic has | ||
| 416 | -/// a runnable check with no `Player`/window to stand up. | ||
| 417 | -fn fit_scale(bounds: Bounds<Pixels>, native: gpui::Size<gpui::DevicePixels>) -> Option<f32> { | ||
| 418 | - if bounds.size.width <= px(0.) | ||
| 419 | - || bounds.size.height <= px(0.) | ||
| 420 | - || native.width.0 <= 0 | ||
| 421 | - || native.height.0 <= 0 | ||
| 422 | - { | ||
| 423 | - return None; | ||
| 424 | - } | ||
| 425 | - let fitted = gpui::ObjectFit::Contain.get_bounds(bounds, native); | ||
| 426 | - Some(f32::from(fitted.size.width) / native.width.0 as f32) | ||
| 427 | -} | ||
| 428 | - | ||
| 429 | /// The pure half of [`picture_bottom`]: the bottom edge of the `Contain` | 414 | /// The pure half of [`picture_bottom`]: the bottom edge of the `Contain` |
| 430 | /// fit of `native` into `bounds` -- gpui's own `get_bounds`, the same call | 415 | /// fit of `native` into `bounds` -- gpui's own `get_bounds`, the same call |
| 431 | /// [`letterboxed_image`] paints through, so this is the frame's real edge | 416 | /// [`letterboxed_image`] paints through, so this is the frame's real edge |
| @@ -451,72 +436,6 @@ pub(crate) fn picture_bottom(player: &Player) -> Option<f32> { | |||
| 451 | fitted_bottom(PICTURE_BOUNDS.with(Rc::clone).get(), image.size(0)) | 436 | fitted_bottom(PICTURE_BOUNDS.with(Rc::clone).get(), image.size(0)) |
| 452 | } | 437 | } |
| 453 | 438 | ||
| 454 | -/// The picture's own fit factor against its native size, read off the last | ||
| 455 | -/// frame's measured box (see [`PICTURE_BOUNDS`]). `None` with nothing open | ||
| 456 | -/// or before the first paint has measured anything. | ||
| 457 | -fn picture_scale(player: &Player) -> Option<f32> { | ||
| 458 | - let image = player.image.clone()?; | ||
| 459 | - fit_scale(PICTURE_BOUNDS.with(Rc::clone).get(), image.size(0)) | ||
| 460 | -} | ||
| 461 | - | ||
| 462 | -#[cfg(test)] | ||
| 463 | -mod tests { | ||
| 464 | - use super::*; | ||
| 465 | - | ||
| 466 | - /// A 400x100 source fit into a 200x100 box: width-bound (bounds_ratio | ||
| 467 | - /// 2 < image_ratio 4), so the picture lands at half its native width -- | ||
| 468 | - /// the number the scale plate would read as `scale 0.50`. | ||
| 469 | - #[test] | ||
| 470 | - fn the_scale_plate_reads_contains_own_fit_factor() { | ||
| 471 | - let bounds = Bounds { | ||
| 472 | - origin: point(px(0.), px(0.)), | ||
| 473 | - size: size(px(200.), px(100.)), | ||
| 474 | - }; | ||
| 475 | - let native = size(gpui::DevicePixels(400), gpui::DevicePixels(100)); | ||
| 476 | - assert!((fit_scale(bounds, native).unwrap() - 0.5).abs() < 0.001); | ||
| 477 | - } | ||
| 478 | - | ||
| 479 | - /// A degenerate (zero-size) box never divides by zero -- it says "no | ||
| 480 | - /// reading yet" instead of NaN or a panic, the same guard every other | ||
| 481 | - /// `bounds_probe`-fed measurement in this file makes before its first | ||
| 482 | - /// paint. | ||
| 483 | - #[test] | ||
| 484 | - fn an_unmeasured_box_reads_no_scale_rather_than_nan() { | ||
| 485 | - let bounds = Bounds { | ||
| 486 | - origin: point(px(0.), px(0.)), | ||
| 487 | - size: size(px(0.), px(0.)), | ||
| 488 | - }; | ||
| 489 | - let native = size(gpui::DevicePixels(400), gpui::DevicePixels(100)); | ||
| 490 | - assert_eq!(fit_scale(bounds, native), None); | ||
| 491 | - } | ||
| 492 | -} | ||
| 493 | - | ||
| 494 | -/// The scale plate (MOCK-SPEC.md "Screen": `scale 1.12`, label `ink3`, value | ||
| 495 | -/// in ink): a readout, so a plate (DESIGN Β§4), never a chip. Lives in the | ||
| 496 | -/// screen region's own margin row above the picture -- a flex sibling, not | ||
| 497 | -/// an overlay, so it can never cover a picture pixel (Β§11 check 6) whatever | ||
| 498 | -/// the source's aspect ratio does to the letterbox. | ||
| 499 | -fn scale_plate(player: &Player) -> impl IntoElement { | ||
| 500 | - let value = picture_scale(player) | ||
| 501 | - .map(|s| format!("{s:.2}")) | ||
| 502 | - .unwrap_or_else(|| "--".to_string()); | ||
| 503 | - let style = type_scale::mono(type_scale::CHORD_METADATA_MIN_PX, gpui::FontWeight::MEDIUM); | ||
| 504 | - div() | ||
| 505 | - .id("stance-scale-plate") | ||
| 506 | - .flex_none() | ||
| 507 | - .flex() | ||
| 508 | - .items_center() | ||
| 509 | - .gap(px(6.)) | ||
| 510 | - .px(px(10.)) | ||
| 511 | - .py(px(6.)) | ||
| 512 | - .rounded(px(2.)) | ||
| 513 | - .bg(rgb(DARK_CANVAS())) | ||
| 514 | - .font(style.font) | ||
| 515 | - .text_size(style.size) | ||
| 516 | - .child(div().text_color(rgb(INK3())).child("scale")) | ||
| 517 | - .child(div().text_color(rgb(INK1())).child(value)) | ||
| 518 | -} | ||
| 519 | - | ||
| 520 | /// A section head, uppercase, `ink3` -- DESIGN Β§3's scale for the label | 439 | /// A section head, uppercase, `ink3` -- DESIGN Β§3's scale for the label |
| 521 | /// that names a region before anything else lives in it. | 440 | /// that names a region before anything else lives in it. |
| 522 | fn section_head(label: &str) -> impl IntoElement { | 441 | fn section_head(label: &str) -> impl IntoElement { |
| @@ -616,19 +535,6 @@ fn screen( | |||
| 616 | // Β§4: room chrome takes 0 radius. | 535 | // Β§4: room chrome takes 0 radius. |
| 617 | .rounded(px(0.)) | 536 | .rounded(px(0.)) |
| 618 | .bg(rgb(DARK_CANVAS())) | 537 | .bg(rgb(DARK_CANVAS())) |
| 619 | - // FAULT 3: the scale plate's own margin row, above the picture -- | ||
| 620 | - // a flex sibling shrinks the picture's `flex_1` to make room for it | ||
| 621 | - // exactly as `two_up` already does below, so it is never drawn over | ||
| 622 | - // real picture pixels. | ||
| 623 | - .child( | ||
| 624 | - div() | ||
| 625 | - .flex_none() | ||
| 626 | - .flex() | ||
| 627 | - .justify_end() | ||
| 628 | - .px(px(6.)) | ||
| 629 | - .pt(px(4.)) | ||
| 630 | - .child(scale_plate(player)), | ||
| 631 | - ) | ||
| 632 | .child( | 538 | .child( |
| 633 | div() | 539 | div() |
| 634 | .id("stance-picture") | 540 | .id("stance-picture") |
crates/app/src/ui/timeband_stance.rsmodified+153 -315
| @@ -1,6 +1,7 @@ | |||
| 1 | //! The time band's own content (MOCK-SPEC.md "Time band", DESIGN.md Β§5): | 1 | //! The time band's own content (MOCK-SPEC.md "Time band", DESIGN.md Β§5): |
| 2 | -//! hero timecode, ghost transport, cut readout, the contact strip (whole-film | 2 | +//! hero timecode, one three-glyph transport, the cut odometer, the contact |
| 3 | -//! minimap) and the boxed Export chip. `stance.rs::time_band()`'s frame draws | 3 | +//! strip (whole-film minimap, carrying the export range's two mark grips) |
| 4 | +//! and the boxed Export chip. `stance.rs::time_band()`'s frame draws | ||
| 4 | //! the strip; this module owns what fills it, the same split | 5 | //! the strip; this module owns what fills it, the same split |
| 5 | //! `dock_stance.rs`/`bench_stance.rs` already make for their regions. | 6 | //! `dock_stance.rs`/`bench_stance.rs` already make for their regions. |
| 6 | //! | 7 | //! |
| @@ -23,6 +24,10 @@ thread_local! { | |||
| 23 | // fold both into `Player` once `main.rs` is free again. | 24 | // fold both into `Player` once `main.rs` is free again. |
| 24 | static STRIP_BOUNDS: Rc<Cell<Bounds<Pixels>>> = Rc::new(Cell::new(Bounds::default())); | 25 | static STRIP_BOUNDS: Rc<Cell<Bounds<Pixels>>> = Rc::new(Cell::new(Bounds::default())); |
| 25 | static PAN_ANCHOR: Cell<Option<f32>> = Cell::new(None); | 26 | static PAN_ANCHOR: Cell<Option<f32>> = Cell::new(None); |
| 27 | + /// Which export mark a live drag on the strip is moving (the grips of | ||
| 28 | + /// `mark_grip` below), `None` when no mark drag is up. Same transient | ||
| 29 | + /// shape as `PAN_ANCHOR` above, and the same ceiling. | ||
| 30 | + static MARK_DRAG: Cell<Option<ActionId>> = const { Cell::new(None) }; | ||
| 26 | /// The band row's own measured width, read by the frame after the one | 31 | /// The band row's own measured width, read by the frame after the one |
| 27 | /// that took it (`width_probe` asks for that frame whenever it changes). | 32 | /// that took it (`width_probe` asks for that frame whenever it changes). |
| 28 | /// This is what the degradation ladder below keys off: the band cannot | 33 | /// This is what the degradation ladder below keys off: the band cannot |
| @@ -58,45 +63,38 @@ fn width_probe(into: Rc<Cell<Pixels>>) -> impl IntoElement { | |||
| 58 | } | 63 | } |
| 59 | 64 | ||
| 60 | /// Which layers of the band are still drawn at a given column width | 65 | /// Which layers of the band are still drawn at a given column width |
| 61 | -/// (DESIGN Β§7's ladder, one layer per threshold, never all at once). | 66 | +/// (DESIGN Β§7's ladder). Cleanse round 2 (2026-09-10) left the band five |
| 67 | +/// things -- timecode, the three transport glyphs, the odometer, the strip | ||
| 68 | +/// and the Export chip -- and only one of them has anything left to shed. | ||
| 62 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] | 69 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
| 63 | pub(crate) struct BandLayers { | 70 | pub(crate) struct BandLayers { |
| 64 | /// Chord badges under the transport glyphs. | 71 | /// Chord badges under the transport glyphs. |
| 65 | pub(crate) chords: bool, | 72 | pub(crate) chords: bool, |
| 66 | - /// The audio-monitoring cluster (mute, -/+, slider, level readout). | ||
| 67 | - pub(crate) volume: bool, | ||
| 68 | - /// The sync-point pair and the loop toggle. | ||
| 69 | - pub(crate) sync: bool, | ||
| 70 | - /// The export-range marks (I / O / x). | ||
| 71 | - pub(crate) marks: bool, | ||
| 72 | } | 73 | } |
| 73 | 74 | ||
| 74 | -/// The ladder itself. Every threshold is a MEASURED number: the band drawn | 75 | +/// The ladder itself, now two rungs. Every threshold is a MEASURED number, |
| 75 | -/// whole at 2560x1440 (`$EDITH_HITMAP`) reads 1246px of fixed groups beside a | 76 | +/// taken off `$EDITH_HITMAP` in the harness: the row's own content box (what |
| 76 | -/// 974px strip, and the same band at 1280x720 (chords off) reads each glyph's | 77 | +/// `width_probe` reads -- the band's column less its 12px padding either |
| 77 | -/// door at its `HIT_MIN` floor. Fixed width + `STRIP_MIN_W`, rounded up to the | 78 | +/// side) holds 454px of fixed groups beside the strip that absorbs the rest, |
| 78 | -/// next 10px, is what each rung costs: | 79 | +/// and the same band with the chords dropped holds 419px (each glyph's door |
| 80 | +/// falls back to its `HIT_MIN` floor, so the chord row costs 35px of width | ||
| 81 | +/// and 22px of height). Fixed width + `STRIP_MIN_W`, rounded up to the next | ||
| 82 | +/// 10px, is what each rung costs: | ||
| 79 | /// | 83 | /// |
| 80 | /// | drawn | fixed | needs | | 84 | /// | drawn | fixed | needs | |
| 81 | /// |----------------------------------------------|-------|--------| | 85 | /// |----------------------------------------------|-------|--------| |
| 82 | -/// | everything, chords under every glyph | 1246 | 1370px | | 86 | +/// | chords under every glyph | 454 | 580px | |
| 83 | -/// | chords dropped (-97px, doors keep `HIT_MIN`) | 1149 | 1270px | | 87 | +/// | chords dropped (-35px, doors keep `HIT_MIN`) | 419 | 540px | |
| 84 | -/// | + monitoring cluster dropped (-256px) | 893 | 1020px | | ||
| 85 | -/// | + sync pair and loop dropped (-102px) | 791 | 920px | | ||
| 86 | -/// | + range marks dropped (-92px): the floor | 699 | 820px | | ||
| 87 | /// | 88 | /// |
| 88 | -/// The four things the band is *for* -- timecode, cut readout, contact strip | 89 | +/// The five things the band is *for* are on every rung; below the floor's |
| 89 | -/// (>=`STRIP_MIN_W`, the flex_1 that absorbs the slack) and the Export chip -- | 90 | +/// own 540px there is nothing left to shed and `overflow_hidden` is what |
| 90 | -/// are on every rung; below the floor's own 820px there is nothing left to | 91 | +/// keeps the rest inside the column. Everything the older four-rung ladder |
| 91 | -/// shed and `overflow_hidden` is what keeps the rest inside the column. | 92 | +/// used to drop -- the monitoring cluster, the sync pair and loop, the |
| 92 | -/// There is no zoom group in this band (the charter's rung 2): the monitoring | 93 | +/// `I O Γ` marks -- left the band entirely in cleanse round 2, so the rungs |
| 93 | -/// cluster is the band's equivalent extra and takes its place. | 94 | +/// that shed them went with them. |
| 94 | pub(crate) fn band_layers(band_w: f32) -> BandLayers { | 95 | pub(crate) fn band_layers(band_w: f32) -> BandLayers { |
| 95 | BandLayers { | 96 | BandLayers { |
| 96 | - chords: band_w >= 1370., | 97 | + chords: band_w >= 580., |
| 97 | - volume: band_w >= 1270., | ||
| 98 | - sync: band_w >= 1020., | ||
| 99 | - marks: band_w >= 920., | ||
| 100 | } | 98 | } |
| 101 | } | 99 | } |
| 102 | 100 | ||
| @@ -277,48 +275,15 @@ fn cut_readout(player: &Player, position: f64) -> impl IntoElement { | |||
| 277 | .child(sep()) | 275 | .child(sep()) |
| 278 | .child(val(format!("in {in_d}"))) | 276 | .child(val(format!("in {in_d}"))) |
| 279 | }) | 277 | }) |
| 280 | - .child(sep()) | 278 | + // Cleanse round 2: the word `roll` sat in the band dim at all times, |
| 281 | - .child( | 279 | + // naming a mode that is off. The STATE stays -- when roll is armed |
| 282 | - div() | 280 | + // the word is there in `ink1` -- but at rest the odometer reads |
| 283 | - .text_color(rgb(if roll_on { INK1() } else { INK4() })) | 281 | + // `cut 14/37` and nothing else. |
| 284 | - .child("roll"), | 282 | + .when(roll_on, |el| { |
| 285 | - ) | 283 | + el.child(sep()) |
| 286 | -} | 284 | + .child(div().text_color(rgb(INK1())).child("roll")) |
| 287 | -/// Export-range marks belong beside the cut readout they constrain (DESIGN Β§9): | 285 | + }) |
| 288 | -/// each is a direct mouse door to the same action its chord asks for. | ||
| 289 | -fn range_marks(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | ||
| 290 | - div() | ||
| 291 | - .id("stance-range-marks") | ||
| 292 | - .flex_none() | ||
| 293 | - .flex() | ||
| 294 | - .items_center() | ||
| 295 | - .gap(px(4.)) | ||
| 296 | - .child(ghost( | ||
| 297 | - "stance-mark-in", | ||
| 298 | - player, | ||
| 299 | - "I", | ||
| 300 | - ActionId::SetIn, | ||
| 301 | - false, | ||
| 302 | - cx, | ||
| 303 | - )) | ||
| 304 | - .child(ghost( | ||
| 305 | - "stance-mark-out", | ||
| 306 | - player, | ||
| 307 | - "O", | ||
| 308 | - ActionId::SetOut, | ||
| 309 | - false, | ||
| 310 | - cx, | ||
| 311 | - )) | ||
| 312 | - .child(ghost( | ||
| 313 | - "stance-clear-range", | ||
| 314 | - player, | ||
| 315 | - "Γ", | ||
| 316 | - ActionId::ClearRange, | ||
| 317 | - false, | ||
| 318 | - cx, | ||
| 319 | - )) | ||
| 320 | } | 286 | } |
| 321 | - | ||
| 322 | /// The contact strip (MOCK-SPEC "Contact strip"): the whole-film minimap | 287 | /// The contact strip (MOCK-SPEC "Contact strip"): the whole-film minimap |
| 323 | /// filling the band's remaining width, with a 1px viewport bracket marking | 288 | /// filling the band's remaining width, with a 1px viewport bracket marking |
| 324 | /// where the bench's own window sits. Click jumps the playhead; drag pans | 289 | /// 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<Player>) -> im | |||
| 404 | .min_w(px(STRIP_MIN_W)) | 369 | .min_w(px(STRIP_MIN_W)) |
| 405 | .h(px(28.)) | 370 | .h(px(28.)) |
| 406 | .cursor_pointer() | 371 | .cursor_pointer() |
| 407 | - .tooltip(|_, cx| { | ||
| 408 | - cx.new(|_| Tip("Contact strip β drag scrubs the playhead, click jumps; drag the bracket's grips to pan the bench".into())) | ||
| 409 | - .into() | ||
| 410 | - }) | ||
| 411 | // Division of the plain drag (MOCK-SPEC "Contact strip", task's own | 372 | // Division of the plain drag (MOCK-SPEC "Contact strip", task's own |
| 412 | // instruction to decide honestly): a person reaches for this strip to | 373 | // instruction to decide honestly): a person reaches for this strip to |
| 413 | // move through the FILM far more often than to slide the bench's own | 374 | // 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<Player>) -> im | |||
| 434 | move |this, event: &MouseMoveEvent, _, cx| { | 395 | move |this, event: &MouseMoveEvent, _, cx| { |
| 435 | if event.pressed_button != Some(MouseButton::Left) { | 396 | if event.pressed_button != Some(MouseButton::Left) { |
| 436 | PAN_ANCHOR.with(|a| a.set(None)); | 397 | PAN_ANCHOR.with(|a| a.set(None)); |
| 398 | + MARK_DRAG.with(|m| m.set(None)); | ||
| 399 | + return; | ||
| 400 | + } | ||
| 401 | + // A mark grip is under the hand: the drag sets that mark | ||
| 402 | + // instead of scrubbing or panning (the grip's own press | ||
| 403 | + // armed this and stopped propagation, so this branch is the | ||
| 404 | + // only thing a mark drag does). | ||
| 405 | + if let Some(action) = MARK_DRAG.with(Cell::get) { | ||
| 406 | + let duration = this.drawn_duration(); | ||
| 407 | + if duration > 0. { | ||
| 408 | + let frac = frac_along(event.position.x, bounds.get()); | ||
| 409 | + let at = (f64::from(frac) * duration * this.active_fps()).max(0.).round() | ||
| 410 | + as u32; | ||
| 411 | + let (lo, hi) = this.range.unwrap_or((at, at)); | ||
| 412 | + let (a, b) = if action == ActionId::SetIn { | ||
| 413 | + (at, hi) | ||
| 414 | + } else { | ||
| 415 | + (lo, at) | ||
| 416 | + }; | ||
| 417 | + // Dragged past its partner, the mark under the hand | ||
| 418 | + // becomes the OTHER mark (`ordered_range` is what | ||
| 419 | + // keeps the pair legal, and `i`/`o` swap the same | ||
| 420 | + // way). Without this flip a live drag re-orders on | ||
| 421 | + // every move event and both ticks walk along with | ||
| 422 | + // the pointer, which is what the first harness run | ||
| 423 | + // caught. | ||
| 424 | + if crate::player::actions::ordered_range(a, b) != (a, b) { | ||
| 425 | + MARK_DRAG.with(|m| { | ||
| 426 | + m.set(Some(if action == ActionId::SetIn { | ||
| 427 | + ActionId::SetOut | ||
| 428 | + } else { | ||
| 429 | + ActionId::SetIn | ||
| 430 | + })) | ||
| 431 | + }); | ||
| 432 | + } | ||
| 433 | + this.range = Some(crate::player::actions::ordered_range(a, b)); | ||
| 434 | + } | ||
| 435 | + cx.notify(); | ||
| 437 | return; | 436 | return; |
| 438 | } | 437 | } |
| 439 | match PAN_ANCHOR.with(Cell::get) { | 438 | match PAN_ANCHOR.with(Cell::get) { |
| @@ -467,8 +466,18 @@ fn contact_strip(player: &Player, position: f64, cx: &mut Context<Player>) -> im | |||
| 467 | })) | 466 | })) |
| 468 | .on_mouse_up( | 467 | .on_mouse_up( |
| 469 | MouseButton::Left, | 468 | MouseButton::Left, |
| 470 | - cx.listener(|_, _, _, _| PAN_ANCHOR.with(|a| a.set(None))), | 469 | + cx.listener(|_, _, _, _| { |
| 470 | + PAN_ANCHOR.with(|a| a.set(None)); | ||
| 471 | + MARK_DRAG.with(|m| m.set(None)); | ||
| 472 | + }), | ||
| 471 | ) | 473 | ) |
| 474 | + // The plate sits beside the id it names: the mark-drag branch above | ||
| 475 | + // pushed the two more than `every_hitmap_control_wears_a_hover_line` | ||
| 476 | + // reaches when this hung at the top of the chain. | ||
| 477 | + .tooltip(|_, cx| { | ||
| 478 | + cx.new(|_| Tip("Contact strip β drag scrubs the playhead, click jumps; drag the bracket's grips to pan the bench".into())) | ||
| 479 | + .into() | ||
| 480 | + }) | ||
| 472 | .children(hitmap::control("timeline.contact-strip", "Timeline contact strip", true)) | 481 | .children(hitmap::control("timeline.contact-strip", "Timeline contact strip", true)) |
| 473 | .child(bounds_probe(strip_bounds)) | 482 | .child(bounds_probe(strip_bounds)) |
| 474 | // Baseline: a quiet hairline under the real traces below it, so an | 483 | // 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<Player>) -> im | |||
| 525 | .child(grip("stance-strip-grip-rt", false, true)) | 534 | .child(grip("stance-strip-grip-rt", false, true)) |
| 526 | .child(grip("stance-strip-grip-rb", false, false)), | 535 | .child(grip("stance-strip-grip-rb", false, false)), |
| 527 | ) | 536 | ) |
| 537 | + // The export range's own two grips (DESIGN Β§5 as amended | ||
| 538 | + // 2026-09-10): the `I O Γ` trio left the band, so the marks live on | ||
| 539 | + // the film itself. Nothing is drawn until a mark exists. | ||
| 540 | + .when_some( | ||
| 541 | + player.range.filter(|_| duration > 0.), | ||
| 542 | + |el, (in_f, out_f)| { | ||
| 543 | + el.child(mark_grip( | ||
| 544 | + player, | ||
| 545 | + "stance-strip-mark-in", | ||
| 546 | + frac(in_f), | ||
| 547 | + "Mark in", | ||
| 548 | + ActionId::SetIn, | ||
| 549 | + )) | ||
| 550 | + .child(mark_grip( | ||
| 551 | + player, | ||
| 552 | + "stance-strip-mark-out", | ||
| 553 | + frac(out_f), | ||
| 554 | + "Mark out", | ||
| 555 | + ActionId::SetOut, | ||
| 556 | + )) | ||
| 557 | + }, | ||
| 558 | + ) | ||
| 528 | // The lamp-white playhead marker: this is what turns the strip from | 559 | // The lamp-white playhead marker: this is what turns the strip from |
| 529 | // a trace into a slider with a handle (task's own wording) -- the | 560 | // a trace into a slider with a handle (task's own wording) -- the |
| 530 | // one 1px line on the whole band that names *this* film moment, | 561 | // 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<Player>) -> im | |||
| 544 | }) | 575 | }) |
| 545 | } | 576 | } |
| 546 | 577 | ||
| 578 | +/// One export-range mark, drawn on the contact strip at its own film | ||
| 579 | +/// position: an `ink1` tick beside the bracket's lamp-white playhead, with a | ||
| 580 | +/// Β±6px door around it that takes precedence over the strip's own | ||
| 581 | +/// click-jump/drag-scrub (`stop_propagation` on its press, the same split | ||
| 582 | +/// [`grip`] below makes for the bench-window pan). Dragging it sets that | ||
| 583 | +/// mark; `i`, `o` and `^u` are unchanged. | ||
| 584 | +fn mark_grip( | ||
| 585 | + player: &Player, | ||
| 586 | + id: &'static str, | ||
| 587 | + frac: f32, | ||
| 588 | + name: &'static str, | ||
| 589 | + action: ActionId, | ||
| 590 | +) -> impl IntoElement { | ||
| 591 | + let chord = player.keymap.chord(action); | ||
| 592 | + div() | ||
| 593 | + .id(id) | ||
| 594 | + .absolute() | ||
| 595 | + .left(relative(frac)) | ||
| 596 | + .top_0() | ||
| 597 | + .h_full() | ||
| 598 | + .ml(px(-MARK_GRAB)) | ||
| 599 | + .w(px(MARK_GRAB * 2. + 1.)) | ||
| 600 | + .flex() | ||
| 601 | + .justify_center() | ||
| 602 | + .cursor_col_resize() | ||
| 603 | + .on_mouse_down(MouseButton::Left, move |_: &MouseDownEvent, _, cx| { | ||
| 604 | + MARK_DRAG.with(|m| m.set(Some(action))); | ||
| 605 | + cx.stop_propagation(); | ||
| 606 | + }) | ||
| 607 | + .tooltip(crate::ui::widgets::tip_hover(name, &chord, None)) | ||
| 608 | + .children(hitmap::action(action, player.enable(action, None).yes())) | ||
| 609 | + .child(div().w(px(1.)).h_full().bg(rgb(INK1()))) | ||
| 610 | +} | ||
| 611 | + | ||
| 612 | +/// How far either side of a mark tick the hand still grabs it. | ||
| 613 | +const MARK_GRAB: f32 = 6.; | ||
| 614 | + | ||
| 547 | /// One grip notch on the viewport bracket (MOCK-SPEC "grip notches"): the | 615 | /// One grip notch on the viewport bracket (MOCK-SPEC "grip notches"): the |
| 548 | /// only part of the contact strip that pans the bench window rather than | 616 | /// only part of the contact strip that pans the bench window rather than |
| 549 | /// scrubbing the playhead (see [`contact_strip`]'s own doc on that split). | 617 | /// scrubbing the playhead (see [`contact_strip`]'s own doc on that split). |
| @@ -641,67 +709,6 @@ fn export_chip(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | |||
| 641 | ) | 709 | ) |
| 642 | } | 710 | } |
| 643 | 711 | ||
| 644 | -/// The monitoring level's continuous pointer door. It shares the Player's | ||
| 645 | -/// measured bar and root drag plumbing with the legacy slider, but keeps the | ||
| 646 | -/// Darkroom's achromatic track and ink ladder. | ||
| 647 | -fn volume_slider(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | ||
| 648 | - let volume = player.volume; | ||
| 649 | - let enabled = player.enable(ActionId::ToggleMute, None).yes(); | ||
| 650 | - div() | ||
| 651 | - .id("stance-tb-volume-bar") | ||
| 652 | - .relative() | ||
| 653 | - .flex_none() | ||
| 654 | - .w(px(VOLUME_W)) | ||
| 655 | - .h(px(CONTROL_H)) | ||
| 656 | - .flex() | ||
| 657 | - .items_center() | ||
| 658 | - .tooltip(|_, cx| { | ||
| 659 | - cx.new(|_| Tip("Volume β drag to set the level; the button mutes".into())) | ||
| 660 | - .into() | ||
| 661 | - }) | ||
| 662 | - .when(!enabled, |d| d.opacity(0.4).cursor_not_allowed()) | ||
| 663 | - .when(enabled, |d| { | ||
| 664 | - d.cursor_pointer() | ||
| 665 | - .on_mouse_down( | ||
| 666 | - MouseButton::Left, | ||
| 667 | - cx.listener(|this, event: &MouseDownEvent, _, cx| { | ||
| 668 | - this.volume_dragging = true; | ||
| 669 | - this.drag_volume(event.position.x, cx); | ||
| 670 | - }), | ||
| 671 | - ) | ||
| 672 | - .child(bounds_probe(player.volume_bar.clone())) | ||
| 673 | - }) | ||
| 674 | - .children(hitmap::control("timeline.volume", "Volume", enabled)) | ||
| 675 | - .child( | ||
| 676 | - div() | ||
| 677 | - .w_full() | ||
| 678 | - .h(px(4.)) | ||
| 679 | - .rounded(px(2.)) | ||
| 680 | - .bg(rgb(DARK_RAISED())) | ||
| 681 | - .child( | ||
| 682 | - div() | ||
| 683 | - .h_full() | ||
| 684 | - .w(relative(volume.along())) | ||
| 685 | - .rounded(px(2.)) | ||
| 686 | - .bg(rgb(if volume.muted { INK3() } else { INK2() })), | ||
| 687 | - ), | ||
| 688 | - ) | ||
| 689 | -} | ||
| 690 | - | ||
| 691 | -/// The level, written once (DESIGN 3: a number about a level is mono). It | ||
| 692 | -/// sits beside the slider that sets it -- the slider's fill and this readout | ||
| 693 | -/// are one truth in two forms, where the mute button used to wear a third. | ||
| 694 | -fn volume_readout(player: &Player) -> impl IntoElement { | ||
| 695 | - let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM); | ||
| 696 | - div() | ||
| 697 | - .flex_none() | ||
| 698 | - .w(px(34.)) | ||
| 699 | - .font(style.font) | ||
| 700 | - .text_size(style.size) | ||
| 701 | - .text_color(rgb(if player.volume.muted { INK3() } else { INK2() })) | ||
| 702 | - .child(format!("{}%", player.volume.percent())) | ||
| 703 | -} | ||
| 704 | - | ||
| 705 | /// The whole band, left to right per MOCK-SPEC: hero timecode, ghost | 712 | /// The whole band, left to right per MOCK-SPEC: hero timecode, ghost |
| 706 | /// transport, cut readout, the contact strip filling the rest, the Export | 713 | /// transport, cut readout, the contact strip filling the rest, the Export |
| 707 | /// chip at the end. | 714 | /// chip at the end. |
| @@ -739,20 +746,12 @@ pub(crate) fn render( | |||
| 739 | // The most-read element anchors its region (DESIGN Β§5): the | 746 | // The most-read element anchors its region (DESIGN Β§5): the |
| 740 | // timecode leads. | 747 | // timecode leads. |
| 741 | .child(hero_timecode(&tc)) | 748 | .child(hero_timecode(&tc)) |
| 742 | - // FAULT 2, the J/K/L question: MOCK-SPEC reads this row's chords as | 749 | + // Cleanse round 2 (2026-09-10): one transport, three glyphs. The |
| 743 | - // `J`/`spc`/`L`, which DESIGN Β§6 names as the shuttle. No shuttle | 750 | + // shuttle pair (`ββ βΆβΆ`), the home/end pair, the sync points, the |
| 744 | - // action exists anywhere in this codebase (grepped -- `keymap.rs`, | 751 | + // loop toggle, the monitoring cluster, the `I O Γ` marks and Save |
| 745 | - // `player/actions.rs`, the engine: nothing), and `j`/`k`/`l` are | 752 | + // all left the band -- each keeps its chord, its KEYS-tab row and |
| 746 | - // already bound to Speed/Color/Lift (`keymap.rs`'s Clip-verb group), | 753 | + // (where it has one) its right-click home, and the marks became the |
| 747 | - // not to this row -- rebinding them here would silently steal those, | 754 | + // contact strip's own two grips. |
| 748 | - // and `keymap.rs` is not this task's file to make that call in. So | ||
| 749 | - // the glyphs below stay wired to what actually exists and already | ||
| 750 | - // fires correctly (`JumpBack`/`Play`/`JumpForward`, real one-second | ||
| 751 | - // stepping): each badge now reads that action's own compact chord | ||
| 752 | - // (`^β`/`spc`/`^β`) instead of the mismatched mock label, which is | ||
| 753 | - // what keeps glyph, badge and action honestly in agreement per this | ||
| 754 | - // task's own rule -- the mock's `J`/`L` reading stays unimplemented | ||
| 755 | - // and is named here rather than faked. | ||
| 756 | .child( | 755 | .child( |
| 757 | div() | 756 | div() |
| 758 | .flex_none() | 757 | .flex_none() |
| @@ -760,10 +759,10 @@ pub(crate) fn render( | |||
| 760 | .items_center() | 759 | .items_center() |
| 761 | .gap(px(10.)) | 760 | .gap(px(10.)) |
| 762 | .child(ghost( | 761 | .child(ghost( |
| 763 | - "stance-tb-jumpback", | 762 | + "stance-tb-step-back", |
| 764 | player, | 763 | player, |
| 765 | - "ββ", | 764 | + "|β", |
| 766 | - ActionId::JumpBack, | 765 | + ActionId::StepBack, |
| 767 | false, | 766 | false, |
| 768 | cx, | 767 | cx, |
| 769 | )) | 768 | )) |
| @@ -779,22 +778,6 @@ pub(crate) fn render( | |||
| 779 | false, | 778 | false, |
| 780 | cx, | 779 | cx, |
| 781 | )) | 780 | )) |
| 782 | - .child(ghost( | ||
| 783 | - "stance-tb-jumpforward", | ||
| 784 | - player, | ||
| 785 | - "βΆβΆ", | ||
| 786 | - ActionId::JumpForward, | ||
| 787 | - false, | ||
| 788 | - cx, | ||
| 789 | - )) | ||
| 790 | - .child(ghost( | ||
| 791 | - "stance-tb-step-back", | ||
| 792 | - player, | ||
| 793 | - "|β", | ||
| 794 | - ActionId::StepBack, | ||
| 795 | - false, | ||
| 796 | - cx, | ||
| 797 | - )) | ||
| 798 | .child(ghost( | 781 | .child(ghost( |
| 799 | "stance-tb-step-forward", | 782 | "stance-tb-step-forward", |
| 800 | player, | 783 | player, |
| @@ -802,154 +785,9 @@ pub(crate) fn render( | |||
| 802 | ActionId::StepForward, | 785 | ActionId::StepForward, |
| 803 | false, | 786 | false, |
| 804 | cx, | 787 | cx, |
| 805 | - )) | ||
| 806 | - .child(ghost( | ||
| 807 | - "stance-tb-start", | ||
| 808 | - player, | ||
| 809 | - "β€", | ||
| 810 | - ActionId::GoStart, | ||
| 811 | - false, | ||
| 812 | - cx, | ||
| 813 | - )) | ||
| 814 | - .child(ghost( | ||
| 815 | - "stance-tb-end", | ||
| 816 | - player, | ||
| 817 | - "β¦", | ||
| 818 | - ActionId::GoEnd, | ||
| 819 | - false, | ||
| 820 | - cx, | ||
| 821 | - )) | ||
| 822 | - .when(layers.sync, |el| { | ||
| 823 | - el.child(ghost( | ||
| 824 | - "stance-tb-sync-prev", | ||
| 825 | - player, | ||
| 826 | - "βΉ|", | ||
| 827 | - ActionId::PrevSyncPoint, | ||
| 828 | - false, | ||
| 829 | - cx, | ||
| 830 | - )) | ||
| 831 | - .child(ghost( | ||
| 832 | - "stance-tb-sync-next", | ||
| 833 | - player, | ||
| 834 | - "|βΊ", | ||
| 835 | - ActionId::NextSyncPoint, | ||
| 836 | - false, | ||
| 837 | - cx, | ||
| 838 | - )) | ||
| 839 | - }) | ||
| 840 | - // Loop (homeless per this task's audit): the playback-loop | ||
| 841 | - // toggle -- burst-use during editing per the charter's own | ||
| 842 | - // classification -- earns the transport cluster it plays | ||
| 843 | - // alongside, not the CUT group's `LoopTrim` two files over | ||
| 844 | - // (a different verb already drawn on the spine, "β»" taken). | ||
| 845 | - // "β" reads as "keeps going" without borrowing that glyph. | ||
| 846 | - .when(layers.sync, |el| { | ||
| 847 | - el.child(ghost( | ||
| 848 | - "stance-tb-loop", | ||
| 849 | - player, | ||
| 850 | - "β", | ||
| 851 | - ActionId::Loop, | ||
| 852 | - player.loop_on, | ||
| 853 | - cx, | ||
| 854 | - )) | ||
| 855 | - }), | ||
| 856 | - ) | ||
| 857 | - // The audio-monitoring cluster (homeless per this task's audit): | ||
| 858 | - // ToggleMute/VolumeUp/VolumeDown, burst-use per the charter, placed | ||
| 859 | - // beside the transport it plays with rather than the spine (the | ||
| 860 | - // rail is already tightened, and this is a play-time concern, same | ||
| 861 | - // land as J/spc/L above it). The level itself is the mute button's | ||
| 862 | - // own label (legacy `toolbar.rs`'s own convention: an "Γ" prefix | ||
| 863 | - // marks muted rather than a second colour), so one click toggles | ||
| 864 | - // mute and the two ghosts flanking it nudge the level -- three | ||
| 865 | - // homeless actions sharing one cluster rather than three unrelated | ||
| 866 | - // rows. | ||
| 867 | - .when(layers.volume, |el| el.child( | ||
| 868 | - div() | ||
| 869 | - .flex_none() | ||
| 870 | - .flex() | ||
| 871 | - .items_center() | ||
| 872 | - .gap(px(6.)) | ||
| 873 | - .child(ghost( | ||
| 874 | - "stance-tb-vol-down", | ||
| 875 | - player, | ||
| 876 | - "β", | ||
| 877 | - ActionId::VolumeDown, | ||
| 878 | - false, | ||
| 879 | - cx, | ||
| 880 | - )) | ||
| 881 | - // The level is NOT this button's label any more: the slider | ||
| 882 | - // beside it already draws the same number as a fill and | ||
| 883 | - // `volume_readout` writes it once, so wearing it here made | ||
| 884 | - // mute a ghost with no glyph of its own (a percentage is not | ||
| 885 | - // a verb). Speaker, struck when muted -- typographic, the | ||
| 886 | - // same hand-drawn grammar as the glyphs around it. | ||
| 887 | - .child(ghost( | ||
| 888 | - "stance-tb-mute", | ||
| 889 | - player, | ||
| 890 | - if player.volume.muted { "βΓ" } else { "β))" }, | ||
| 891 | - ActionId::ToggleMute, | ||
| 892 | - player.volume.muted, | ||
| 893 | - cx, | ||
| 894 | - )) | ||
| 895 | - .child(volume_slider(player, cx)) | ||
| 896 | - .child(volume_readout(player)) | ||
| 897 | - .child(ghost( | ||
| 898 | - "stance-tb-vol-up", | ||
| 899 | - player, | ||
| 900 | - "+", | ||
| 901 | - ActionId::VolumeUp, | ||
| 902 | - false, | ||
| 903 | - cx, | ||
| 904 | )), | 788 | )), |
| 905 | - )) | 789 | + ) |
| 906 | - .when(layers.marks, |el| el.child(range_marks(player, cx))) | ||
| 907 | .child(cut_readout(player, position)) | 790 | .child(cut_readout(player, position)) |
| 908 | .child(contact_strip(player, position, cx)) | 791 | .child(contact_strip(player, position, cx)) |
| 909 | - .child(save_verb(player, cx)) | ||
| 910 | .child(export_chip(player, cx)) | 792 | .child(export_chip(player, cx)) |
| 911 | } | 793 | } |
| 912 | - | ||
| 913 | -/// `Save` (homeless per this task's audit): not boxed -- DESIGN Β§4 reserves | ||
| 914 | -/// the room's one border for the commit-class Export beside it -- but filed | ||
| 915 | -/// right next to it anyway. `keymap.rs`'s own `Category::File` already | ||
| 916 | -/// files Save beside Export and Screenshot on the strength of what each one | ||
| 917 | -/// writes, and the ledger this task named as Save's natural home | ||
| 918 | -/// (`name.edith Β· saved`/`unsaved`) lives in `stance.rs`, a concurrent | ||
| 919 | -/// builder's file this task does not touch -- so the verb lands here | ||
| 920 | -/// instead, a ghost sharing the export chip's own end-of-band land rather | ||
| 921 | -/// than competing with the ledger strip below it for the same state. | ||
| 922 | -fn save_verb(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | ||
| 923 | - let label_style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); | ||
| 924 | - let chord_style = mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM); | ||
| 925 | - div() | ||
| 926 | - .id("stance-tb-save") | ||
| 927 | - .flex_none() | ||
| 928 | - .flex() | ||
| 929 | - .items_center() | ||
| 930 | - .gap(px(4.)) | ||
| 931 | - .cursor_pointer() | ||
| 932 | - .hover(|s| s.text_color(rgb(INK1()))) | ||
| 933 | - .text_color(rgb(INK2())) | ||
| 934 | - .on_click(cx.listener(|this, _: &ClickEvent, window, cx| { | ||
| 935 | - this.act(ActionId::Save, window, cx); | ||
| 936 | - })) | ||
| 937 | - .tooltip(crate::ui::widgets::action_hover(player, ActionId::Save)) | ||
| 938 | - .children(hitmap::action( | ||
| 939 | - ActionId::Save, | ||
| 940 | - player.enable(ActionId::Save, None).yes(), | ||
| 941 | - )) | ||
| 942 | - .child( | ||
| 943 | - div() | ||
| 944 | - .font(label_style.font) | ||
| 945 | - .text_size(label_style.size) | ||
| 946 | - .child("Save"), | ||
| 947 | - ) | ||
| 948 | - .child( | ||
| 949 | - div() | ||
| 950 | - .font(chord_style.font) | ||
| 951 | - .text_size(chord_style.size) | ||
| 952 | - .text_color(rgb(INK3())) | ||
| 953 | - .child(player.keymap.chord(ActionId::Save)), | ||
| 954 | - ) | ||
| 955 | -} | ||