diff --git a/DESIGN.md b/DESIGN.md index b9b6855..9deb535 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -116,10 +116,10 @@ Fixed geography; nothing moves, nothing occludes the picture: │ (with the in/out grips) │ │ │ → [Export] │ │ ├─────────────────────────────────┤ │ -│ BENCH (lanes V/A/S) │ │ +│ ruler · lanes • V1 • A1 • S1 │ │ ├─────────────────────────────────┤ │ -│ LEDGER (project · state · room │ │ -│ verbs · position) │ │ +│ name · saved | last action | │ │ +│ room verbs · position │ │ └─────────────────────────────────┴──────┘ ``` @@ -139,15 +139,22 @@ all left it — each keeps its chord and its KEYS-tab row, the ruler menu keeps on the ruler, the marks became the strip's grips, and the ledger already says `saved`/`unsaved · ^s`. The picture's `scale 0.59` corner readout is deleted with them: fit is `^0`, and the number was a state nobody acts on. -- **Bench**: lanes. Clip anatomy = ink spine (3px left edge) + real thumbnails/waveform in the - source's ink + name plate + splice gaps in lamp white. -- **Ledger**: project identity (`name.edith · saved`), last action, export progress, and at the +- **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. -- **Dock** (right, the only side panel): SOURCES tab, CLIP tab, KEYS tab. + 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 and CLIP tab; the keys list is dock-body + state behind `?` / the ledger's `keys ?`, not a tab (user 2026-09-09). **Cleanse round 2 (2026-09-10):** SOURCES is a filter and *one* list. The filter is the glass alone (`⌕`, no placeholder word); the list holds every source together — picture, sound and subtitle tracks — in arrival order, with no `Media / Audio / Text` sub-tabs, no sort row, no @@ -161,6 +168,17 @@ was a state nobody acts on. CLIP tab: the per-clip verbs (Speed / Colour / Transform / EQ / Silence / Mix / Fit) as plain ghost rows — label + chord, no head styling — over the param rows they open. +**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. Save moves +the same way: the time band's ghost — parked there only because the ledger was another +builder's file at the time — is deleted, and the ledger's own state word is its door. + **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..3b73f89 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 and the ledger's project identity). One place, so the two 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/interact.rs b/crates/app/src/interact.rs index 4c1f5a4..2551204 100644 --- a/crates/app/src/interact.rs +++ b/crates/app/src/interact.rs @@ -258,20 +258,20 @@ pub(crate) fn drag_scrim(cx: &mut Context) -> Div { /// 2026-09-09: "panes should be enlargable and shrinkable" -- they already /// were). The hairline is painted *by the band*, not by the strip, so the /// whole band lights it: a line raised only by the pixels that already grab -/// the seam tells a hand nothing. The bench's band is deeper still -/// ([`BENCH_GRAB_H`]) -- the row under its seam is the bench's own section -/// head, and that is where a hand aiming at "the top of the timeline" lands. +/// the seam tells a hand nothing. The bench's band ([`BENCH_GRAB_H`]) is every +/// other seam's reach: the section head under it is gone (cleanse round 2) and +/// the ruler that starts the bench now answers presses itself, so a deeper +/// band would eat scrubs at the film's own top edge. /// /// A double press resets the seam to the window's own share /// ([`Splits::clear`]): the cheap way back from a layout dragged somewhere /// unusable, and the one every editor's dividers answer to. pub(crate) fn divider(split: Split, held: bool, cx: &mut Context) -> Div { let across = matches!(split, Split::Timeline | Split::Bench); - // A row seam parts the picture from a panel whose own first row is its - // section head -- empty land -- so the bench's band reaches down through - // it ([`BENCH_GRAB_H`]). Every other seam keeps [`GRAB_W`]: the dock's - // neighbour is a list whose rows start at its very edge, and the legacy - // timeline's is the edit toolbar's buttons. + // Named per seam anyway ([`BENCH_GRAB_H`] is [`GRAB_W`] since the bench + // lost its section head): every neighbour's first row carries content the + // hand may want instead -- the bench's ruler scrubs, the dock's rows start + // at its very edge, the legacy timeline's are the edit toolbar's buttons. let grab = match split { Split::Bench => BENCH_GRAB_H, _ => GRAB_W, diff --git a/crates/app/src/layout.rs b/crates/app/src/layout.rs index d8f19f3..0411406 100644 --- a/crates/app/src/layout.rs +++ b/crates/app/src/layout.rs @@ -320,19 +320,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 1365add..29924e2 100644 --- a/crates/app/src/menus.rs +++ b/crates/app/src/menus.rs @@ -260,7 +260,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 c0cc3e3..1518ebe 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 ddd4cc3..f2100b9 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -1607,17 +1607,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" + ); // Cleanse round 2 (2026-09-10): the monitoring cluster left the band // (chord + KEYS row only). What the band still owes a pointer is the // export range's two grips on the contact strip. @@ -1865,18 +1878,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" ); @@ -2570,11 +2582,6 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { became the contact strip's own grips, and clearing both at once is \ not a thing on the film to point at", ), - ( - ActionId::Save, - "KEYS tab + key: the ledger says `saved`/`unsaved · ^s`, which is the \ - state this verb is about (cleanse round 2)", - ), ( ActionId::Screenshot, "the picture the frame is written from is the *watched* frame and \ @@ -2713,9 +2720,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), @@ -2943,28 +2948,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. @@ -3267,60 +3268,73 @@ 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}; +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"); + for gone in ["bench-select-all", "select_all_band", "SELECT_ALL_PAD"] { + assert!(!bench.contains(gone), "the ruler still carries {gone}"); + } assert!( - bench.contains("x + label_w <= bed_w - all_w"), - "the tick loop no longer keeps the select-all band clear" + BENCH_ITEMS.contains(&ActionId::SelectAll), + "`all` left the ruler with no menu row behind it" ); - // 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`"); + // And the band it reserved is the ticks' again: nothing subtracts a + // control's width from the bed's right edge any more. assert!( - !clear(850. - all_w - label_w + 1.), - "the band's own edge leaks" + 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" ); - 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). +/// The rest of cleanse round 2's bench + ledger, which is all about *one* +/// saying per thing: the head is a dot and a name (its verbs left, checked +/// above), a source's name is drawn 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 -- names lose their extension +/// through one helper, and the ledger's state word is Save's only door now +/// (the time band's parking-spot ghost, filed there because the ledger was a +/// concurrent builder's file, is deleted). #[test] -fn a_press_on_the_select_all_band_does_not_scrub_the_ruler() { - use crate::ui::bench_stance::select_all_band; +fn one_name_per_source_one_stem_helper_and_one_save_door() { 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")]; 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.contains(".filter(|_| !(audio && clip.link.is_some()))"), + "the audio half of a linked insert wears a second name plate again" + ); + assert!( + bench.contains("stem(&s.path)") && !bench.contains("file_name(&s.path)"), + "a name plate shows the file's extension again" + ); + let stance = src_text("ui/stance.rs"); + assert!( + stance.contains("stem(&player.project_path)"), + "the ledger shows the project's extension again" + ); + assert!( + stance.contains(r#"room_ghost(player, "unsaved", ActionId::Save"#), + "the ledger's unsaved state is not Save's door -- it is a word again" ); assert!( - !bench[at..].contains("cx.stop_propagation()"), - "a press stopped inside the ruler also swallows the control's own click" + !src_text("ui/timeband_stance.rs").contains("ActionId::Save"), + "Save has two doors: the ledger's state word and the time band's ghost" ); - // 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"); + // The helper itself, since three surfaces read one file's name through + // it: a plain name loses its extension, a name with none is itself, and + // a path with no name at all still reads as something. + use crate::files::{file_name, stem}; + use std::path::Path; + assert_eq!(stem(Path::new("/x/he_is_not_the_only_one.mp4")), "he_is_not_the_only_one"); + assert_eq!(stem(Path::new("/x/untitled")), "untitled"); + assert_eq!(stem(Path::new("/x/a.b.edith")), "a.b"); + assert_eq!(stem(Path::new("/")), file_name(Path::new("/"))); } /// DESIGN §4/§5: the hero timecode leads the time band and the ledger carries 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 c72e5df..402eb5d 100644 --- a/crates/app/src/ui/overlays.rs +++ b/crates/app/src/ui/overlays.rs @@ -376,6 +376,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 435df54..859421c 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): @@ -436,16 +433,6 @@ pub(crate) fn picture_bottom(player: &Player) -> Option { fitted_bottom(PICTURE_BOUNDS.with(Rc::clone).get(), image.size(0)) } -/// 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 @@ -630,7 +617,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)) } @@ -639,16 +625,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 -- @@ -676,7 +660,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. @@ -689,6 +672,24 @@ 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; the time band's parking-spot ghost, filed there only + // because the ledger was a concurrent builder's file, is deleted + // (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()