From 9513e4a6db5e91b08fb5be3a83d8def72c61e837 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:05:38 +0300 Subject: [PATCH] =?UTF-8?q?wip(cleanse):=20bench=20+=20ledger=20=E2=80=94?= =?UTF-8?q?=20capped=20mid-work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DESIGN.md | 29 +++- crates/app/src/files.rs | 11 ++ crates/app/src/layout.rs | 21 ++- crates/app/src/menus.rs | 6 +- crates/app/src/oracle.rs | 6 + crates/app/src/tests/layout.rs | 134 +++++++----------- crates/app/src/ui/bench_stance.rs | 228 ++++++------------------------ crates/app/src/ui/overlays.rs | 15 ++ crates/app/src/ui/stance.rs | 60 ++++---- 9 files changed, 192 insertions(+), 318 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index 81f5735..cad184d 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -115,10 +115,10 @@ Fixed geography; nothing moves, nothing occludes the picture: │ transport → cut readout → │ │ │ contact strip → [Export] │ │ ├─────────────────────────────────┤ │ -│ BENCH (lanes V/A/S) │ │ +│ ruler · lanes • V1 • A1 • S1 │ │ ├─────────────────────────────────┤ │ -│ LEDGER (project · state · room │ │ -│ verbs · position) │ │ +│ name · saved | last action | │ │ +│ room verbs · position │ │ └─────────────────────────────────┴──────┘ ``` @@ -127,17 +127,32 @@ Fixed geography; nothing moves, nothing occludes the picture: - **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. -- **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 +- **Bench**: the ruler row, then lanes. Clip anatomy = ink spine (3px left edge) + real + thumbnails/waveform in the source's ink + name plate + splice gaps in lamp white. A lane head + is a source dot and the lane's name (`• V1`, 60px) and nothing else; the name plate carries + the file's name without its extension (`files::stem`), and only once per source — the audio + half of a linked insert has no plate, because the picture plate directly above it and the + shared dot already say whose it is. +- **Ledger**: project identity (`name · saved`, extension dropped), last action, export + progress, and at the right end, before the position: the **room verbs** as ghosts (`CC t · settings ^, · keys ? · full f11`) — the four commands that act on the room itself and so have no thing under the cursor to be right-clicked on. `ink3` + chord, hover raises to `ink2` with the room's own plate, `CC` reads `ink1` + fill while subtitles are shown. State lives here, notices rise - from here. + from here. When the project is unsaved the state word is not a word but a door: + `unsaved ^s`, the same room-verb ghost, and clicking it saves — this is Save's home. - **Dock** (right, the only side panel): Sources tab (assembly: filter, usage chips, import), Clip tab (verbs: Speed / Colour / Transform / EQ as ghost verbs over param rows) and KEYS tab. +**Amendment (2026-09-10), "cleanse round 2":** the `BENCH` and `LEDGER` section heads are +deleted — the geography says what a region is, and a label above it is a second saying. The +ruler row is the bench's own top edge (the seam's grab band no longer reaches past it, since the +ruler answers presses itself), and the ledger's first word is the project. `all ^a` leaves the +ruler's right edge for the ruler's own right-click menu; the lane head's `≋` mix and `×` remove +leave the head for the head's own right-click menu, where they still act on the lane that was +clicked. Every one of them keeps its chord and its KEYS row: nothing lost a door, each one moved +to the thing it acts on, which is the "option C" rule below applied a second time. + **Amendment (2026-09-09), user decision "option C":** there is no rail. The 56px spine — every command as a ghost glyph + chord down the left edge — is deleted, and the picture, time band, bench and ledger take its width. Nothing on screen lists the room's commands, because **the diff --git a/crates/app/src/files.rs b/crates/app/src/files.rs index d8a0ee7..844a974 100644 --- a/crates/app/src/files.rs +++ b/crates/app/src/files.rs @@ -145,6 +145,17 @@ pub(crate) fn is_project(path: &std::path::Path) -> bool { path.extension().is_some_and(|e| e == "edith") } +/// A path's name without its extension, for every surface that shows what a +/// file *is* rather than what it is stored as (cleanse round 2: the bench's +/// name plates, the ledger's project identity, the dock's rows). One place, +/// so those three can never come to disagree about the same file's name. +pub(crate) fn stem(path: &std::path::Path) -> String { + path.file_stem().map_or_else( + || file_name(path), + |n| n.to_string_lossy().into(), + ) +} + /// The tail of a path, for showing. A path that is all root has none, and reads /// as itself. pub(crate) fn file_name(path: &std::path::Path) -> String { diff --git a/crates/app/src/layout.rs b/crates/app/src/layout.rs index 4d74226..937ef53 100644 --- a/crates/app/src/layout.rs +++ b/crates/app/src/layout.rs @@ -316,19 +316,14 @@ pub(crate) const SPLIT_W: f32 = 6.; /// the strip's far side), not the six transparent pixels in front of it. pub(crate) const GRAB_W: f32 = 14.; -/// The bench seam's own band, deeper than [`GRAB_W`] because it may be: what -/// lies under the seam is `ui::stance::bench`'s own section head -- 24 px of -/// border, padding and the word "bench", with nothing in it to press -- so the -/// band reaches down through it instead of stopping 7 px past the line. Driven -/// at 2560x1440 against a real `bench=207`: with the 14 px band the seam -/// answered a press only within +/-7 px of the line the eye sees and was silent -/// on the `BENCH` label row below it, which is the visible top edge of the -/// timeline and so the thing a hand aims at ("library resizes but timeline -/// doesn't" -- a real `stance-splits` holds `dock=277`, a dragged dock, beside -/// a `bench=207` that is a press with no drag in it). 20 px hung one row above -/// the strip covers the line, the six pixels in front of it and the whole head -/// row: `-1 .. +19` of strip, `-7 .. +13` of the seam. -pub(crate) const BENCH_GRAB_H: f32 = 20.; +/// The bench seam's own band. It used to be deeper than [`GRAB_W`] because +/// what lay under the seam was `ui::stance::bench`'s own section head -- 24 px +/// with nothing in it to press, so the band reached down through it. That head +/// is gone (cleanse round 2): the ruler row is the bench's top edge now, and +/// the ruler *is* pressable (it scrubs), so a band reaching into it would take +/// presses meant for the film. Back to every other seam's reach: `-1 .. +13` +/// of strip, `-7 .. +7` of the seam. +pub(crate) const BENCH_GRAB_H: f32 = GRAB_W; /// The most of the window one side column may be dragged to. A third each, so /// the picture keeps the middle at every size -- the rule [`library_w`] and diff --git a/crates/app/src/menus.rs b/crates/app/src/menus.rs index bf29a11..85ffb00 100644 --- a/crates/app/src/menus.rs +++ b/crates/app/src/menus.rs @@ -237,7 +237,11 @@ pub(crate) const MENU_ITEMS: [ActionId; 16] = [ /// undo pair, which is the one thing every editor expects on empty canvas. /// Not a junk drawer (§9): nothing here acts on a clip, and everything here /// acts on the thing the pointer is over. -pub(crate) const BENCH_ITEMS: [ActionId; 10] = [ +pub(crate) const BENCH_ITEMS: [ActionId; 11] = [ + // The `all` control left the ruler's right edge (cleanse round 2): this + // row is where the pointer reaches "select everything" now, and `^a` + // still fires it. + ActionId::SelectAll, ActionId::WalkCutPrev, ActionId::WalkCutNext, ActionId::WalkCutPrev10, diff --git a/crates/app/src/oracle.rs b/crates/app/src/oracle.rs index fc60289..11bd9d8 100644 --- a/crates/app/src/oracle.rs +++ b/crates/app/src/oracle.rs @@ -374,6 +374,12 @@ pub(crate) fn enable_lane(action: ActionId, lane: Lane, ctx: Ctx) -> Enable { /// second row arguing about the same act. pub(crate) fn lane_items(lane: Lane) -> Vec { let mut items = HEAD_ADDS.to_vec(); + // The verbs that used to hang off the head itself (cleanse round 2): the + // head is a dot and a name now, and this menu is where the pointer reaches + // its mix -- an audio lane's alone, the way `enable_lane` reads it. + if lane.kind == LaneKind::Audio { + items.push(ActionId::Mix); + } items.push(match lane.kind { LaneKind::Video => ActionId::RemoveVideoLane, LaneKind::Audio => ActionId::RemoveAudioLane, diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 9726d5f..97be38b 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -1599,17 +1599,30 @@ fn darkroom_lane_header_verbs_are_targeted_and_visible() { Enable::Hidden(_) )); + // The head itself carries a dot, a name and -- on a subtitle lane -- its + // eye, and nothing else (cleanse round 2). Its mix and its remove are rows + // in its own right-click menu instead, and they still reach the lane the + // hand named rather than the last of the kind a bare stroke walks to: + // `overlays.rs` routes those rows through the same `act_lane` door the + // head's buttons used. let bench = src_text("ui/bench_stance.rs"); - for door in [ - "\"bench-mix-lane\"", - "\"bench-show-sub-lane\"", - "\"bench-remove-lane\"", - "this.act_lane(ActionId::Mix, lane, cx)", - "this.show_sub_lane(lane, cx)", - "this.act_lane(action, lane, cx)", - ] { + for gone in ["\"bench-mix-lane\"", "\"bench-remove-lane\"", "lane.{}.remove"] { + assert!(!bench.contains(gone), "the lane head still wears {gone}"); + } + for door in ["\"bench-show-sub-lane\"", "this.show_sub_lane(lane, cx)"] { assert!(bench.contains(door), "lane header lost {door}"); } + assert!( + lane_items(Lane::A1).contains(&ActionId::Mix) + && lane_items(Lane::A1).contains(&ActionId::RemoveAudioLane) + && lane_items(Lane::V1).contains(&ActionId::RemoveVideoLane) + && !lane_items(Lane::V1).contains(&ActionId::Mix), + "a head verb left the head with no row in the head's own menu" + ); + assert!( + src_text("ui/overlays.rs").contains("this.act_lane(action, menu.lane, cx)"), + "the head menu lane verbs no longer act on the lane that was clicked" + ); let time_band = src_text("ui/timeband_stance.rs"); for door in [ "fn volume_slider(", @@ -1854,18 +1867,17 @@ fn the_whole_bench_stack_fits_its_own_floor_with_the_ledger_seam_clear() { use crate::BENCH_MIN_H; use crate::ui::bench_stance::{LANE_MIN_H, ROW_GAP, RULER_H}; use crate::ui::stance::BENCH_CHROME_H; - use crate::ui::type_scale::SECTION_HEAD_PX; const BENCH_BORDER_T: f32 = 1.; const BENCH_PY_TOP: f32 = 4.; - let section_head_line_h = (SECTION_HEAD_PX * 1.618_034).round(); - let real_chrome = BENCH_BORDER_T + BENCH_PY_TOP + section_head_line_h; + // No section head any more (cleanse round 2): the border and the padding + // are the whole of what `stance::bench` draws above the ruler. + let real_chrome = BENCH_BORDER_T + BENCH_PY_TOP; assert_eq!( BENCH_CHROME_H, real_chrome, "BENCH_CHROME_H ({BENCH_CHROME_H}) does not match what `stance::bench` \ actually draws above the content ({real_chrome}px: {BENCH_BORDER_T}px \ - border + {BENCH_PY_TOP}px padding + {section_head_line_h}px label line \ - box) -- bench_stance::render gets handed the wrong box_h and lays its \ + border + {BENCH_PY_TOP}px padding) -- bench_stance::render gets handed the wrong box_h and lays its \ rows out past its own real space" ); @@ -2626,9 +2638,7 @@ fn hitmap_names_every_darkroom_pointer_entry_surface() { "clip.{}.{}.{}.trim-{}", "clip.{}.{}.{}.dissolve", "lane.{}.reorder", - "lane.{}.mix", "lane.{}.eye", - "lane.{}.remove", ] { assert!( bench.contains(needle), @@ -2854,28 +2864,24 @@ fn the_seam_paints_nothing_until_a_pointer_finds_it() { ); } -/// The band the hand actually gets, in seam coordinates -- driven at -/// 2560x1440 with a real `bench=207` before this diff: a press answered only -/// within +/-7 px of the line the eye sees, and the `BENCH` label row under it -/// -- the visible top edge of the timeline, the thing a hand aims at -- was -/// silent. The band is hung one row above the [`SPLIT_W`] strip, so its reach -/// past the line is `grab - 1 - SPLIT_W`. +/// The band the hand actually gets, in seam coordinates. It once reached 13px +/// past the line to cover the `BENCH` label row a hand aimed at; that row is +/// gone (cleanse round 2) and the ruler under the seam answers presses of its +/// own (it scrubs), so the bench seam takes every other seam's reach and no +/// more -- a deeper band would eat scrubs at the film's own top edge. #[test] -fn the_bench_seam_reaches_into_the_row_a_hand_aims_at() { +fn the_bench_seam_reaches_no_further_than_every_other_seam() { let above = 1.; let reach = |grab: f32| grab - above - crate::layout::SPLIT_W; - // Every other seam is unchanged: its neighbour's own first row carries - // content (the dock's rows, the legacy toolbar's buttons). assert_eq!(reach(crate::layout::GRAB_W), 7.); - // The bench's reaches through the 24 px section head far enough to cover - // the label row a hand lands on, and no further than the head itself. - let past = reach(crate::layout::BENCH_GRAB_H); - assert!( - (10. ..=crate::ui::stance::BENCH_CHROME_H).contains(&past), - "the bench band reaches {past}px past the seam" + assert_eq!( + reach(crate::layout::BENCH_GRAB_H), + 7., + "the bench band reaches past the ruler row, which answers presses itself" ); } + /// The clamp table, driven: the seam refuses exactly two things, and neither /// is anywhere near where a hand drags. Measured live at 2560x1440 -- /// `bench=105` at the floor, `bench=1164` at the ceiling. @@ -3156,60 +3162,30 @@ fn the_ledger_carries_the_rooms_four_verbs_and_no_rail_remains() { ); } -/// The ruler's right edge was soup: `bench-select-all` sits `right(4.)` over -/// the tick band while tick suppression only guarded the LEFT plate, so the -/// `00:20` label drew straight under the `all` chord. The control's band is -/// reserved now -- a label whose right edge would enter it is dropped, the -/// mirror of the left rule. +/// The `all` control left the ruler (cleanse round 2, DESIGN §5): the ruler +/// row is the bench's own top edge and carries ticks and the playhead alone. +/// Every removed control keeps a door -- `^a` still fires it, and the ruler's +/// own right-click menu ([`BENCH_ITEMS`]) is where the pointer reaches it -- +/// so this checks the control is gone AND that the row exists, not just the +/// deletion. #[test] -fn the_ruler_reserves_a_band_for_its_select_all_control() { - use crate::ui::bench_stance::{SELECT_ALL_PAD, char_w}; - use crate::ui::type_scale::{CHORD_METADATA_MIN_PX, FLOOR_PX}; - let bench = src_text("ui/bench_stance.rs"); - assert!( - bench.contains("x + label_w <= bed_w - all_w"), - "the tick loop no longer keeps the select-all band clear" - ); - // The rule itself, with the shipped widths: `all` + `^a` at the chord - // size, a `00:20` label at the floor size, a 850 px bed. - let all_w = ("all".len() + "^a".len()) as f32 * char_w(CHORD_METADATA_MIN_PX) + SELECT_ALL_PAD; - let label_w = "00:20".len() as f32 * char_w(FLOOR_PX); - let clear = |x: f32| x + label_w <= 850. - all_w; - assert!(!clear(820.), "a tick at the right edge still draws under `all`"); - assert!( - !clear(850. - all_w - label_w + 1.), - "the band's own edge leaks" - ); - assert!(clear(700.), "the rule eats ticks that clear the band"); -} - -/// Clicking `all` selected all AND scrubbed: the control lives inside -/// `bench-ruler`, whose `on_mouse_down` seeks, and the press reached it (the -/// playhead jumped 00:00:11:12 -> 00:00:20:14). The scrub refuses the -/// control's reserved band now -- a `stop_propagation` on the control is what -/// this looks like at first and it does NOT work: gpui builds the control's -/// own click out of that same mouse-down, so stopping it drops the selection -/// (measured live, run 20260909-174243-jZzccm/after-all.png: nothing but the -/// hover changed). -#[test] -fn a_press_on_the_select_all_band_does_not_scrub_the_ruler() { - use crate::ui::bench_stance::select_all_band; +fn select_all_left_the_ruler_for_the_rulers_own_menu() { + use crate::ActionId; + use crate::menus::BENCH_ITEMS; let bench = src_text("ui/bench_stance.rs"); - let at = bench.find(r#".id("bench-ruler")"#).expect("no ruler"); - let listener = &bench[at..at + bench[at..].find(".children(ticks").expect("its ticks")]; + for gone in ["bench-select-all", "select_all_band", "SELECT_ALL_PAD"] { + assert!(!bench.contains(gone), "the ruler still carries {gone}"); + } assert!( - listener.contains("bed_w - band") && listener.contains("select_all_band("), - "the ruler's scrub takes the select-all band's presses again: {listener}" + BENCH_ITEMS.contains(&ActionId::SelectAll), + "`all` left the ruler with no menu row behind it" ); + // And the band it reserved is the ticks' again: nothing subtracts a + // control's width from the bed's right edge any more. assert!( - !bench[at..].contains("cx.stop_propagation()"), - "a press stopped inside the ruler also swallows the control's own click" + bench.contains("if x >= plate_w && x + label_w <= bed_w {"), + "the tick loop still keeps a band clear for a control that is gone" ); - // The rule the listener runs, at the shipped widths: a 850 px bed, `^a`. - let band = select_all_band("^a"); - assert!(band > 30. && band < 70., "the band is not a control's width: {band}"); - assert!(850. - 4. >= 850. - band, "a press on the control still seeks"); - assert!(500. < 850. - band, "a press mid-ruler stopped seeking"); } /// DESIGN §4/§5: the hero timecode leads the time band and the ledger carries @@ -3745,7 +3721,7 @@ fn every_hitmap_control_wears_a_hover_line() { } } assert!( - controls >= 40, + controls >= 38, "the hover sweep found only {controls} controls -- it has gone blind" ); assert!( diff --git a/crates/app/src/ui/bench_stance.rs b/crates/app/src/ui/bench_stance.rs index 973270f..dd5a256 100644 --- a/crates/app/src/ui/bench_stance.rs +++ b/crates/app/src/ui/bench_stance.rs @@ -63,28 +63,16 @@ const TICK_MIN_PX: f64 = 64.; const PLATE_W: f32 = 11. * crate::layout::LIST_CHAR_W / type_scale::CHORD_METADATA_MIN_PX * type_scale::CHORD_METADATA_MAX_PX + 9.; -/// The reserved right-edge band `bench-select-all` sits in: its own -/// `right(4.)` offset, the `px(3.)` either side of its text and the `gap(3.)` -/// between the label and its chord. The band's text width is measured per -/// render (the chord is keymap-dependent) and added to this. -pub(crate) const SELECT_ALL_PAD: f32 = 4. + 3. + 3. + 3.; -/// The width of that band for a given chord: `all`, the chord, and the -/// padding around them. Read by the tick loop (no label may enter it) and by -/// the ruler's own scrub listener (no press inside it seeks) -- one rule, so -/// the two can never disagree about where the control's edge is. -pub(crate) fn select_all_band(chord: &str) -> f32 { - ("all".len() + chord.chars().count()) as f32 * char_w(type_scale::CHORD_METADATA_MIN_PX) - + SELECT_ALL_PAD -} /// A mono character's width at `size_px`, from the shared /// [`crate::layout::LIST_CHAR_W`] calibration (taken at /// [`type_scale::CHORD_METADATA_MIN_PX`]). pub(crate) fn char_w(size_px: f32) -> f32 { crate::layout::LIST_CHAR_W / type_scale::CHORD_METADATA_MIN_PX * size_px } -/// The pinned track-head column: wide enough for its lane-specific ghost -/// verbs and their compact chords without shrinking their pointer targets. -const HEAD_W: f32 = 72.; +/// The pinned track-head column: the source dot and the lane's name, and +/// nothing else since the head's verbs moved into its own menu (cleanse +/// round 2) -- the pixels it gave up are the bed's now. +const HEAD_W: f32 = 60.; pub(crate) const ROW_GAP: f32 = 2.; /// DESIGN §7: lanes compress evenly up to this many rows before the column /// scrolls behind the pinned ruler and heads instead of compressing further. @@ -220,8 +208,14 @@ fn clip_box( let on = marked((lane, idx), clip.link, picks, pick_links); let t = tier(span); let source = player.sources().get(clip.source); - let label = source.map(|s| file_name(&s.path)); let audio = lane.kind == LaneKind::Audio; + // The name, extension dropped (`files::stem`, the ledger's and the dock's + // helper too) -- and only once per source: the audio half of a linked + // insert carries no plate at all, because the picture plate directly above + // it and the shared source dot already say whose it is (cleanse round 2). + let label = source + .filter(|_| !(audio && clip.link.is_some())) + .map(|s| stem(&s.path)); let fade_in = player.shown_fade_in(lane, idx, clip); let fade_out = player.shown_fade_out(lane, idx, clip); let dissolves = lane.kind == LaneKind::Video @@ -847,12 +841,7 @@ fn lane_row( .first() .map_or_else(INK4, |clip| source_tint(clip.source)); let head_ghost: SharedString = lane.label().into(); - let gain_db = player - .session - .as_ref() - .map_or(0., |session| session.lane_gain_db(lane)); let shown = player.sub_lane_on(lane); - let chord_style = type_scale::mono(type_scale::CHORD_METADATA_MIN_PX, gpui::FontWeight::MEDIUM); let drop = player .lane_drop .filter(|drop| drop.lane == lane && cx.has_active_drag()); @@ -930,56 +919,30 @@ fn lane_row( div() .flex() .items_center() - .gap(px(2.)) - // MOCK-SPEC.md "Bench": "V1, A1 in mono". - .type_style(type_scale::mono( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK2())) - .child(lane.label()) - .when(lane.kind == LaneKind::Audio, |d| { - d.child( - div() - .id(("bench-mix-lane", lane.ord)) - .flex() - .items_center() - .gap(px(1.)) - .rounded(px(3.)) - .px(px(2.)) - .cursor_pointer() - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) - .tooltip(move |_, cx| { - cx.new(|_| { - Tip(format!( - "{} {gain_db:+.0} dB — mix this lane", - lane.label() - ) - .into()) - }) - .into() - }) - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { - this.act_lane(ActionId::Mix, lane, cx); - })) - .children(hitmap::dynamic( - move || { - ( - format!("lane.{}.mix", lane.label()), - format!("Mix {}", lane.label()), - ) - }, - true, - )) - .child("≋") - .child( - div() - .type_style(chord_style.clone()) - .text_color(rgb(INK3())) - .child(player.keymap.chord(ActionId::Mix)), - ), - ) - }) + .gap(px(5.)) + // The head is the source dot and the lane's name, and + // nothing else (DESIGN §5, cleanse round 2): the verbs + // it used to wear -- mix, remove -- are rows in its own + // right-click menu (`oracle::lane_items`) and keep + // their chords there. + .child( + div() + .flex_none() + .w(px(LANE_DOT_D)) + .h(px(LANE_DOT_D)) + .rounded(px(LANE_DOT_D / 2.)) + .bg(rgb(dot)), + ) + .child( + div() + // MOCK-SPEC.md "Bench": "V1, A1 in mono". + .type_style(type_scale::mono( + type_scale::CHORD_METADATA_MIN_PX, + gpui::FontWeight::MEDIUM, + )) + .text_color(rgb(INK2())) + .child(lane.label()), + ) .when(lane.kind == LaneKind::Subtitle, |d| { d.child( div() @@ -1014,62 +977,7 @@ fn lane_row( )) .child("◉"), ) - }) - .when(lane.kind != LaneKind::Subtitle, |d| { - let action = match lane.kind { - LaneKind::Video => ActionId::RemoveVideoLane, - LaneKind::Audio => ActionId::RemoveAudioLane, - LaneKind::Subtitle => unreachable!(), - }; - d.child( - div() - .id(("bench-remove-lane", lane.ord * 10 + lane.kind as usize)) - .flex() - .items_center() - .gap(px(1.)) - .rounded(px(3.)) - .px(px(2.)) - .cursor_pointer() - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) - .tooltip(move |_, cx| { - cx.new(|_| { - Tip(format!( - "Remove {} — it must be empty first", - lane.label() - ) - .into()) - }) - .into() - }) - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { - this.act_lane(action, lane, cx); - })) - .children(hitmap::dynamic( - move || { - ( - format!("lane.{}.remove", lane.label()), - format!("Remove {}", lane.label()), - ) - }, - player.enable(action, None).yes(), - )) - .child("×") - .child( - div() - .type_style(chord_style) - .text_color(rgb(INK3())) - .child(player.keymap.chord(action)), - ), - ) }), - ) - .child( - div() - .flex_none() - .w(px(LANE_DOT_D)) - .h(px(LANE_DOT_D)) - .rounded(px(LANE_DOT_D / 2.)) - .bg(rgb(dot)), ), ) .child( @@ -1313,16 +1221,6 @@ pub(crate) fn render( .map_or_else(|| vec![Lane::V1, Lane::A1], PlaybackSession::lanes); let position = player.active_session().map_or(0., PlaybackSession::now); let scale = player.scale; - let select_all = player.enable(ActionId::SelectAll, None); - let select_all_tip: SharedString = match select_all.why() { - Some(why) => format!("{} — {why}", player.keymap.display(ActionId::SelectAll)), - None => format!( - "{} — {}", - player.keymap.display(ActionId::SelectAll), - ActionId::SelectAll.label() - ), - } - .into(); let bed_w = f32::from(player.ruler.get().size.width).max(1.); let filled = scale.px_at(position).clamp(0., bed_w); let (picks, pick_links) = player.marks(); @@ -1336,16 +1234,13 @@ pub(crate) fn render( // first tick at or after the bed's left edge to the bed's right edge. // Guarded on `pps > 0` -- a zero scale (no session yet) has no interval // that ever advances past the bed's own width, which would loop forever. - // The ruler's two reserved bands, and no tick label may enter either. - // Left: the playhead timecode plate, which now shows only while a scrub + // The ruler's one reserved band, which no tick label may enter: the + // playhead timecode plate, which now shows only while a scrub // drag is live (the hero timecode leads the time band at rest, DESIGN // §4, and the ledger keeps position, §5 -- a third resting copy is the // crowding) -- at rest the band is zero and the ticks have the width - // back. Right: `bench-select-all`, which used to be drawn straight over - // the `00:20` label because only the left plate was ever suppressed. + // back. let plate_w = if player.scrubbing { PLATE_W } else { 0. }; - let all_chord = player.keymap.chord(ActionId::SelectAll); - let all_w = select_all_band(&all_chord); let mut ticks = Vec::new(); if scale.pps > 0. { let interval = tick_interval(scale.pps); @@ -1354,7 +1249,7 @@ pub(crate) fn render( let x = scale.px_at(t).max(0.); let label = tick_mmss(t); let label_w = label.chars().count() as f32 * char_w(type_scale::FLOOR_PX); - if x >= plate_w && x + label_w <= bed_w - all_w { + if x >= plate_w && x + label_w <= bed_w { ticks.push((x, label)); } t += interval; @@ -1397,21 +1292,6 @@ pub(crate) fn render( .on_mouse_down( MouseButton::Left, cx.listener(|this, event: &MouseDownEvent, _, cx| { - // The reserved right-edge band is `bench-select-all`'s, - // not the scrub's: a press there used to select all AND - // seek the playhead under the control (11:12 -> 20:14). - // The guard lives here rather than as a - // `stop_propagation` on the control, because stopping - // the press also swallows the control's own click -- - // gpui builds a click out of that same mouse-down. - let bounds = this.ruler.get(); - let bed_w = f32::from(bounds.size.width).max(1.); - let band = select_all_band(&this.keymap.chord(ActionId::SelectAll)); - if f32::from(crate::timeline_math::px_along(event.position.x, bounds)) - >= bed_w - band - { - return; - } this.scrubbing = true; this.scrub_to(event.position.x, true, cx); }), @@ -1479,35 +1359,7 @@ pub(crate) fn render( .child(playhead_tc), ) }) - .child( - div() - .id("bench-select-all") - .absolute() - .right(px(4.)) - .top_0() - .h_full() - .flex() - .items_center() - .gap(px(3.)) - .px(px(3.)) - .rounded(px(2.)) - .tooltip(move |_, cx| cx.new(|_| Tip(select_all_tip.clone())).into()) - .when(!select_all.yes(), |d| d.opacity(0.4).cursor_not_allowed()) - .when(select_all.yes(), |d| { - d.cursor_pointer() - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) - .on_click(cx.listener(|this, _: &ClickEvent, window, cx| { - this.act(ActionId::SelectAll, window, cx) - })) - }) - .type_style(type_scale::mono( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK3())) - .child("all") - .child(all_chord), - ), + ) .child( div() diff --git a/crates/app/src/ui/overlays.rs b/crates/app/src/ui/overlays.rs index e01deeb..a093f9b 100644 --- a/crates/app/src/ui/overlays.rs +++ b/crates/app/src/ui/overlays.rs @@ -375,6 +375,21 @@ impl Player { event.position(), cx, ); + } else if matches!(menu.on, MenuOn::Head) + && matches!( + action, + ActionId::Mix + | ActionId::RemoveVideoLane + | ActionId::RemoveAudioLane + ) + { + // The head's own verbs, which left the + // head itself for this menu (cleanse + // round 2): they act on the lane the + // hand named, the way the head's + // buttons did, not on the last of the + // kind the bare stroke reaches. + this.act_lane(action, menu.lane, cx); } else { this.act(action, window, cx); } diff --git a/crates/app/src/ui/stance.rs b/crates/app/src/ui/stance.rs index 547f92f..63107a0 100644 --- a/crates/app/src/ui/stance.rs +++ b/crates/app/src/ui/stance.rs @@ -136,15 +136,12 @@ pub(crate) const LEDGER_H: f32 = 28.; /// role [`BENCH_H`] plays for the bench. pub(crate) const DOCK_W: f32 = 280.; /// What [`bench`] spends above `bench_stance::render`'s own content: the -/// `bench` div's own `.border_t_1()` (1px) + its `py(4.)` top padding + -/// the section head's real line box -- `type_scale::head()` sizes text at -/// `SECTION_HEAD_PX` (12) but never calls `.line_height()`, so gpui's -/// default `TextStyle::line_height` (the golden ratio, `gpui::phi()` == -/// `1.618034`, not 1x the font size) is what it actually draws: -/// `round(12. * 1.618034)` = `round(19.416408)` = `19`. -/// `1 + 4 + 19` = `24`. Named and `pub(crate)` rather than an inline -/// subtraction, so `layout::BENCH_MIN_H` can derive from the real chrome. -pub(crate) const BENCH_CHROME_H: f32 = 24.; +/// `bench` div's own `.border_t_1()` (1px) + its `py(4.)` top padding, and +/// nothing else since the `BENCH` section head went (cleanse round 2 -- the +/// ruler row starts the region and the geography says what it is). `1 + 4` +/// = `5`. Named and `pub(crate)` rather than an inline subtraction, so +/// `layout::BENCH_MIN_H` can derive from the real chrome. +pub(crate) const BENCH_CHROME_H: f32 = 5.; /// The lowest a menu's top edge may sit and still land inside the /// bench/ledger/dock footprint below the screen (DESIGN §5, §9, §11 check 6): @@ -517,16 +514,6 @@ fn scale_plate(player: &Player) -> impl IntoElement { .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 { - div() - .flex_none() - .type_style(type_scale::head()) - .text_color(rgb(INK3())) - .child(label.to_uppercase()) -} - /// A room verb at the ledger's right end (DESIGN §4, §5 as amended /// 2026-09-09 -- user decision "option C"): the name in `ink3`, its chord /// beside it, read live off the keymap so a rebind can never leave the @@ -724,7 +711,6 @@ fn bench( .flex_col() .px(px(12.)) .py(px(4.)) - .child(section_head("bench")) .child(bench_stance::render(player, bench_h - BENCH_CHROME_H, cx)) } @@ -733,16 +719,14 @@ fn bench( fn ledger(player: &Player, position: f64, cx: &mut Context) -> impl IntoElement { let name = match player.project_path.as_os_str().is_empty() { true => "untitled".to_string(), - false => file_name(&player.project_path), + false => stem(&player.project_path), }; - let identity = format!( - "{name} · {}", - if player.autosave_dirty { - "unsaved" - } else { - "saved" - } - ); + // The project's own name, extension dropped (`files::stem`, the bench's + // plates read with the same helper) and the middot the state word hangs + // off -- the word itself is a child of its own, because when the project + // is unsaved it is not a word but Save's door (below). + let identity = format!("{name} ·"); + let dirty = player.autosave_dirty; let last_action = player.notices.back().cloned().unwrap_or_else(|| "—".into()); // With the floating plate gone (user 2026-08-27, "we also have notifier // at the ledger section"), this strip is the one notice surface left -- @@ -770,7 +754,6 @@ fn ledger(player: &Player, position: f64, cx: &mut Context) -> impl Into .items_center() .gap(px(14.)) .px(px(12.)) - .child(section_head("ledger")) // MOCK-SPEC.md "Ledger": "All mono" -- project identity, last // action, export progress and position are all what the film/project // says, not the room's own voice. @@ -783,6 +766,23 @@ fn ledger(player: &Player, position: f64, cx: &mut Context) -> impl Into .text_color(rgb(INK1())) .child(identity), ) + // Saved is a state and reads as one; unsaved is a thing to *do*, and + // this is Save's home now that the time band no longer carries it + // (cleanse round 2) -- the same room-verb ghost the four verbs at the + // strip's other end are built from, so its chord, its hover plate and + // its hitmap door all come from one place. + .child(match dirty { + true => room_ghost(player, "unsaved", ActionId::Save, false, cx).into_any_element(), + false => div() + .flex_none() + .type_style(type_scale::mono( + type_scale::CHORD_METADATA_MIN_PX, + gpui::FontWeight::MEDIUM, + )) + .text_color(rgb(INK1())) + .child("saved") + .into_any_element(), + }) .child( div() .flex_1()