The bench and the ledger say each thing once — cleanse round 2
Browse files at this commit69dfc115748bcbfeccd1dde1baeaa708645755ebParent: 9513e4a- style
- the bench and the ledger say each thing once — cleanse round 2
6 changed files +58 -56
- DESIGN.md +3 -1
- crates/app/src/files.rs +2 -2
- crates/app/src/interact.rs +8 -8
- crates/app/src/tests/layout.rs +43 -0
- crates/app/src/ui/stance.rs +2 -1
- crates/app/src/ui/timeband_stance.rs +0 -44
DESIGN.mdmodified+3 -1
| @@ -151,7 +151,9 @@ ruler answers presses itself), and the ledger's first word is the project. `all | |||
| 151 | ruler's right edge for the ruler's own right-click menu; the lane head's `≋` mix and `×` remove | 151 | ruler's right edge for the ruler's own right-click menu; the lane head's `≋` mix and `×` remove |
| 152 | leave the head for the head's own right-click menu, where they still act on the lane that was | 152 | leave the head for the head's own right-click menu, where they still act on the lane that was |
| 153 | clicked. Every one of them keeps its chord and its KEYS row: nothing lost a door, each one moved | 153 | clicked. Every one of them keeps its chord and its KEYS row: nothing lost a door, each one moved |
| 154 | -to the thing it acts on, which is the "option C" rule below applied a second time. | 154 | +to the thing it acts on, which is the "option C" rule below applied a second time. Save moves |
| 155 | +the same way: the time band's ghost — parked there only because the ledger was another | ||
| 156 | +builder's file at the time — is deleted, and the ledger's own state word is its door. | ||
| 155 | 157 | ||
| 156 | **Amendment (2026-09-09), user decision "option C":** there is no rail. The 56px spine — every | 158 | **Amendment (2026-09-09), user decision "option C":** there is no rail. The 56px spine — every |
| 157 | command as a ghost glyph + chord down the left edge — is deleted, and the picture, time band, | 159 | command as a ghost glyph + chord down the left edge — is deleted, and the picture, time band, |
crates/app/src/files.rsmodified+2 -2
| @@ -147,8 +147,8 @@ pub(crate) fn is_project(path: &std::path::Path) -> bool { | |||
| 147 | 147 | ||
| 148 | /// A path's name without its extension, for every surface that shows what a | 148 | /// A path's name without its extension, for every surface that shows what a |
| 149 | /// file *is* rather than what it is stored as (cleanse round 2: the bench's | 149 | /// file *is* rather than what it is stored as (cleanse round 2: the bench's |
| 150 | -/// name plates, the ledger's project identity, the dock's rows). One place, | 150 | +/// name plates and the ledger's project identity). One place, so the two can |
| 151 | -/// so those three can never come to disagree about the same file's name. | 151 | +/// never come to disagree about the same file's name. |
| 152 | pub(crate) fn stem(path: &std::path::Path) -> String { | 152 | pub(crate) fn stem(path: &std::path::Path) -> String { |
| 153 | path.file_stem().map_or_else( | 153 | path.file_stem().map_or_else( |
| 154 | || file_name(path), | 154 | || file_name(path), |
crates/app/src/interact.rsmodified+8 -8
| @@ -258,20 +258,20 @@ pub(crate) fn drag_scrim(cx: &mut Context<Player>) -> Div { | |||
| 258 | /// 2026-09-09: "panes should be enlargable and shrinkable" -- they already | 258 | /// 2026-09-09: "panes should be enlargable and shrinkable" -- they already |
| 259 | /// were). The hairline is painted *by the band*, not by the strip, so the | 259 | /// were). The hairline is painted *by the band*, not by the strip, so the |
| 260 | /// whole band lights it: a line raised only by the pixels that already grab | 260 | /// whole band lights it: a line raised only by the pixels that already grab |
| 261 | -/// the seam tells a hand nothing. The bench's band is deeper still | 261 | +/// the seam tells a hand nothing. The bench's band ([`BENCH_GRAB_H`]) is every |
| 262 | -/// ([`BENCH_GRAB_H`]) -- the row under its seam is the bench's own section | 262 | +/// other seam's reach: the section head under it is gone (cleanse round 2) and |
| 263 | -/// head, and that is where a hand aiming at "the top of the timeline" lands. | 263 | +/// the ruler that starts the bench now answers presses itself, so a deeper |
| 264 | +/// band would eat scrubs at the film's own top edge. | ||
| 264 | /// | 265 | /// |
| 265 | /// A double press resets the seam to the window's own share | 266 | /// A double press resets the seam to the window's own share |
| 266 | /// ([`Splits::clear`]): the cheap way back from a layout dragged somewhere | 267 | /// ([`Splits::clear`]): the cheap way back from a layout dragged somewhere |
| 267 | /// unusable, and the one every editor's dividers answer to. | 268 | /// unusable, and the one every editor's dividers answer to. |
| 268 | pub(crate) fn divider(split: Split, held: bool, cx: &mut Context<Player>) -> Div { | 269 | pub(crate) fn divider(split: Split, held: bool, cx: &mut Context<Player>) -> Div { |
| 269 | let across = matches!(split, Split::Timeline | Split::Bench); | 270 | let across = matches!(split, Split::Timeline | Split::Bench); |
| 270 | - // A row seam parts the picture from a panel whose own first row is its | 271 | + // Named per seam anyway ([`BENCH_GRAB_H`] is [`GRAB_W`] since the bench |
| 271 | - // section head -- empty land -- so the bench's band reaches down through | 272 | + // lost its section head): every neighbour's first row carries content the |
| 272 | - // it ([`BENCH_GRAB_H`]). Every other seam keeps [`GRAB_W`]: the dock's | 273 | + // hand may want instead -- the bench's ruler scrubs, the dock's rows start |
| 273 | - // neighbour is a list whose rows start at its very edge, and the legacy | 274 | + // at its very edge, the legacy timeline's are the edit toolbar's buttons. |
| 274 | - // timeline's is the edit toolbar's buttons. | ||
| 275 | let grab = match split { | 275 | let grab = match split { |
| 276 | Split::Bench => BENCH_GRAB_H, | 276 | Split::Bench => BENCH_GRAB_H, |
| 277 | _ => GRAB_W, | 277 | _ => GRAB_W, |
crates/app/src/tests/layout.rsmodified+43 -0
| @@ -3188,6 +3188,49 @@ fn select_all_left_the_ruler_for_the_rulers_own_menu() { | |||
| 3188 | ); | 3188 | ); |
| 3189 | } | 3189 | } |
| 3190 | 3190 | ||
| 3191 | +/// The rest of cleanse round 2's bench + ledger, which is all about *one* | ||
| 3192 | +/// saying per thing: the head is a dot and a name (its verbs left, checked | ||
| 3193 | +/// above), a source's name is drawn once per source -- the audio half of a | ||
| 3194 | +/// linked insert has no plate, because the picture plate directly above it | ||
| 3195 | +/// and the shared dot already say whose it is -- names lose their extension | ||
| 3196 | +/// through one helper, and the ledger's state word is Save's only door now | ||
| 3197 | +/// (the time band's parking-spot ghost, filed there because the ledger was a | ||
| 3198 | +/// concurrent builder's file, is deleted). | ||
| 3199 | +#[test] | ||
| 3200 | +fn one_name_per_source_one_stem_helper_and_one_save_door() { | ||
| 3201 | + let bench = src_text("ui/bench_stance.rs"); | ||
| 3202 | + assert!( | ||
| 3203 | + bench.contains(".filter(|_| !(audio && clip.link.is_some()))"), | ||
| 3204 | + "the audio half of a linked insert wears a second name plate again" | ||
| 3205 | + ); | ||
| 3206 | + assert!( | ||
| 3207 | + bench.contains("stem(&s.path)") && !bench.contains("file_name(&s.path)"), | ||
| 3208 | + "a name plate shows the file's extension again" | ||
| 3209 | + ); | ||
| 3210 | + let stance = src_text("ui/stance.rs"); | ||
| 3211 | + assert!( | ||
| 3212 | + stance.contains("stem(&player.project_path)"), | ||
| 3213 | + "the ledger shows the project's extension again" | ||
| 3214 | + ); | ||
| 3215 | + assert!( | ||
| 3216 | + stance.contains(r#"room_ghost(player, "unsaved", ActionId::Save"#), | ||
| 3217 | + "the ledger's unsaved state is not Save's door -- it is a word again" | ||
| 3218 | + ); | ||
| 3219 | + assert!( | ||
| 3220 | + !src_text("ui/timeband_stance.rs").contains("ActionId::Save"), | ||
| 3221 | + "Save has two doors: the ledger's state word and the time band's ghost" | ||
| 3222 | + ); | ||
| 3223 | + // The helper itself, since three surfaces read one file's name through | ||
| 3224 | + // it: a plain name loses its extension, a name with none is itself, and | ||
| 3225 | + // a path with no name at all still reads as something. | ||
| 3226 | + use crate::files::{file_name, stem}; | ||
| 3227 | + use std::path::Path; | ||
| 3228 | + assert_eq!(stem(Path::new("/x/he_is_not_the_only_one.mp4")), "he_is_not_the_only_one"); | ||
| 3229 | + assert_eq!(stem(Path::new("/x/untitled")), "untitled"); | ||
| 3230 | + assert_eq!(stem(Path::new("/x/a.b.edith")), "a.b"); | ||
| 3231 | + assert_eq!(stem(Path::new("/")), file_name(Path::new("/"))); | ||
| 3232 | +} | ||
| 3233 | + | ||
| 3191 | /// DESIGN §4/§5: the hero timecode leads the time band and the ledger carries | 3234 | /// DESIGN §4/§5: the hero timecode leads the time band and the ledger carries |
| 3192 | /// position. The ruler's left plate was a third resting copy of the same | 3235 | /// position. The ruler's left plate was a third resting copy of the same |
| 3193 | /// reading -- it stays only for the state change it belongs to, a live scrub. | 3236 | /// reading -- it stays only for the state change it belongs to, a live scrub. |
crates/app/src/ui/stance.rsmodified+2 -1
| @@ -767,7 +767,8 @@ fn ledger(player: &Player, position: f64, cx: &mut Context<Player>) -> impl Into | |||
| 767 | .child(identity), | 767 | .child(identity), |
| 768 | ) | 768 | ) |
| 769 | // Saved is a state and reads as one; unsaved is a thing to *do*, and | 769 | // Saved is a state and reads as one; unsaved is a thing to *do*, and |
| 770 | - // this is Save's home now that the time band no longer carries it | 770 | + // this is Save's home; the time band's parking-spot ghost, filed there only |
| 771 | + // because the ledger was a concurrent builder's file, is deleted | ||
| 771 | // (cleanse round 2) -- the same room-verb ghost the four verbs at the | 772 | // (cleanse round 2) -- the same room-verb ghost the four verbs at the |
| 772 | // strip's other end are built from, so its chord, its hover plate and | 773 | // strip's other end are built from, so its chord, its hover plate and |
| 773 | // its hitmap door all come from one place. | 774 | // its hitmap door all come from one place. |
crates/app/src/ui/timeband_stance.rsmodified+0 -44
| @@ -906,50 +906,6 @@ pub(crate) fn render( | |||
| 906 | .when(layers.marks, |el| el.child(range_marks(player, cx))) | 906 | .when(layers.marks, |el| el.child(range_marks(player, cx))) |
| 907 | .child(cut_readout(player, position)) | 907 | .child(cut_readout(player, position)) |
| 908 | .child(contact_strip(player, position, cx)) | 908 | .child(contact_strip(player, position, cx)) |
| 909 | - .child(save_verb(player, cx)) | ||
| 910 | .child(export_chip(player, cx)) | 909 | .child(export_chip(player, cx)) |
| 911 | } | 910 | } |
| 912 | 911 | ||
| 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 | -} | ||