🔥 remove(app): the clip menu is what this clip can be told, per kind
Browse files at this commit24b3bde01852fbde3bbc6575298c6e1852b8f788Parent: fae390a4 changed files +68 -32
- crates/app/src/menus.rs +26 -22
- crates/app/src/oracle.rs +7 -2
- crates/app/src/tests/editing.rs +6 -7
- crates/app/src/tests/layout.rs +29 -1
crates/app/src/menus.rsmodified+26 -22
| @@ -188,45 +188,49 @@ impl RowItem { | |||
| 188 | /// action a stroke already reaches -- the menu is a second way *to* the actions | 188 | /// action a stroke already reaches -- the menu is a second way *to* the actions |
| 189 | /// and never a second version of them -- so both the label and the hint come | 189 | /// and never a second version of them -- so both the label and the hint come |
| 190 | /// out of the keymap registry and the two can never disagree. | 190 | /// out of the keymap registry and the two can never disagree. |
| 191 | -pub(crate) const MENU_ITEMS: [ActionId; 21] = [ | 191 | +pub(crate) const MENU_ITEMS: [ActionId; 16] = [ |
| 192 | ActionId::Cut, | 192 | ActionId::Cut, |
| 193 | // The cut machinery (DESIGN.md §6) on the very clip it is about: the | 193 | // The cut machinery (DESIGN.md §6) on the very clip it is about: the |
| 194 | - // trims, their trim-to-playhead pair and the loop-trim were strokes the | 194 | + // trims and the loop-trim were strokes the spine rail listed and nothing |
| 195 | - // spine rail listed and nothing else did, and the subject cut a | 195 | + // else did, and the subject cut a right-click names is exactly the one |
| 196 | - // right-click names is exactly the one they act on. | 196 | + // they act on. Their trim-to-playhead pair is *not* here: `^[` and `^]` |
| 197 | + // are the keyboard's own version of a gesture the pointer already has -- | ||
| 198 | + // drag the edge to where you want it -- so a row for them in the menu the | ||
| 199 | + // pointer opens is the junk drawer §9 forbids. They keep their chords and | ||
| 200 | + // their KEYS rows. | ||
| 197 | ActionId::TrimIn, | 201 | ActionId::TrimIn, |
| 198 | ActionId::TrimOut, | 202 | ActionId::TrimOut, |
| 199 | - ActionId::TrimInToPlayhead, | ||
| 200 | - ActionId::TrimOutToPlayhead, | ||
| 201 | ActionId::LoopTrim, | 203 | ActionId::LoopTrim, |
| 202 | - // The clipboard pair, which had no door but a chord: copy takes the clip the | 204 | + // The clipboard pair, which had no door but a chord: copy takes the clip |
| 203 | - // menu names, and paste is the timeline's rather than this clip's -- the | 205 | + // the menu names, and paste is the timeline's rather than this clip's. |
| 204 | - // same kind of global item the mute below already is. | ||
| 205 | ActionId::Copy, | 206 | ActionId::Copy, |
| 206 | ActionId::Paste, | 207 | ActionId::Paste, |
| 207 | - ActionId::Regroup, | 208 | + // The two joins, one per kind, each hidden over the other kind |
| 208 | - ActionId::Detach, | 209 | + // (`oracle::enable`, DESIGN §8's class refusal): sound crossfades, picture |
| 209 | - ActionId::Group, | 210 | + // dissolves, and neither is ever offered over the wrong waveform. |
| 210 | - ActionId::Equalizer, | 211 | + ActionId::Crossfade, |
| 211 | - ActionId::Speed, | ||
| 212 | - // The scan is a clip card like the two above it -- opened on whichever half | ||
| 213 | - // was clicked -- and a card only a stroke could open is one a pointer never | ||
| 214 | - // finds. | ||
| 215 | - ActionId::Silence, | ||
| 216 | - // The dissolve is a video clip's own join, same door as the crossfade | ||
| 217 | - // above it would be for sound -- a stroke-only pair, opened here on | ||
| 218 | - // whichever half was clicked. | ||
| 219 | ActionId::Dissolve, | 212 | ActionId::Dissolve, |
| 213 | + // The picture cards... | ||
| 220 | ActionId::Color, | 214 | ActionId::Color, |
| 221 | ActionId::Transform, | 215 | ActionId::Transform, |
| 216 | + // ...and the sound ones, the same class refusal the other way round. | ||
| 217 | + ActionId::Equalizer, | ||
| 218 | + ActionId::Silence, | ||
| 219 | + ActionId::Speed, | ||
| 222 | ActionId::Fit, | 220 | ActionId::Fit, |
| 223 | - ActionId::ToggleMute, | ||
| 224 | // Last, under the rule line the render draws before the first of them | 221 | // Last, under the rule line the render draws before the first of them |
| 225 | // (DESIGN §9): the two that take the clip off the lane. | 222 | // (DESIGN §9): the two that take the clip off the lane. |
| 226 | ActionId::Delete, | 223 | ActionId::Delete, |
| 227 | ActionId::Lift, | 224 | ActionId::Lift, |
| 228 | ]; | 225 | ]; |
| 229 | 226 | ||
| 227 | +// Not rows, and deliberately: the group trio (`Group`, `Detach`, `Regroup`) | ||
| 228 | +// is the ctrl-click grammar plus its chords -- a group is made by picking the | ||
| 229 | +// halves and taking it apart the same way -- and the mute is the *mix's*, | ||
| 230 | +// which the transport already carries a button for. A clip menu is what this | ||
| 231 | +// clip can be told (DESIGN §9, "Never a junk drawer"); those are told to the | ||
| 232 | +// selection and to the project. | ||
| 233 | + | ||
| 230 | /// What a right-click on the bench itself offers -- the ruler and the empty | 234 | /// What a right-click on the bench itself offers -- the ruler and the empty |
| 231 | /// stretch under the lanes. The verbs of the *timeline*: walking its cuts at | 235 | /// stretch under the lanes. The verbs of the *timeline*: walking its cuts at |
| 232 | /// either stride (DESIGN §6's odometer), what it is looked at through, and the | 236 | /// either stride (DESIGN §6's odometer), what it is looked at through, and the |
crates/app/src/oracle.rsmodified+7 -2
| @@ -210,7 +210,9 @@ pub(crate) fn enable(action: ActionId, ctx: Ctx) -> Enable { | |||
| 210 | // -- class: what kind of thing the action is about. The equalizer | 210 | // -- class: what kind of thing the action is about. The equalizer |
| 211 | // filters samples, and a video clip has none of its own here: the sound | 211 | // filters samples, and a video clip has none of its own here: the sound |
| 212 | // is the audio lane's, clip for clip. | 212 | // is the audio lane's, clip for clip. |
| 213 | - ActionId::Equalizer => match ctx.clip { | 213 | + // The crossfade is the sound join, for the same reason: it fades one |
| 214 | + // clip's samples into the next one's, and a picture has none. | ||
| 215 | + ActionId::Equalizer | ActionId::Crossfade => match ctx.clip { | ||
| 214 | Some((_, lane)) if lane.kind != LaneKind::Audio => { | 216 | Some((_, lane)) if lane.kind != LaneKind::Audio => { |
| 215 | Enable::Hidden("this clip is picture") | 217 | Enable::Hidden("this clip is picture") |
| 216 | } | 218 | } |
| @@ -218,7 +220,10 @@ pub(crate) fn enable(action: ActionId, ctx: Ctx) -> Enable { | |||
| 218 | }, | 220 | }, |
| 219 | // A grade is a picture setting and an audio clip has no picture. A fit | 221 | // A grade is a picture setting and an audio clip has no picture. A fit |
| 220 | // policy is a picture setting for the same reason. | 222 | // policy is a picture setting for the same reason. |
| 221 | - ActionId::Color | ActionId::Fit | ActionId::Transform => match ctx.clip { | 223 | + // The dissolve is the picture join and the crossfade's mirror: two |
| 224 | + // pictures cross, and there is no picture on a waveform to cross. | ||
| 225 | + ActionId::Color | ActionId::Fit | ActionId::Transform | ActionId::Dissolve => match ctx.clip | ||
| 226 | + { | ||
| 222 | Some((_, lane)) if lane.kind != LaneKind::Video => Enable::Hidden("this clip is sound"), | 227 | Some((_, lane)) if lane.kind != LaneKind::Video => Enable::Hidden("this clip is sound"), |
| 223 | _ => Enable::Yes, | 228 | _ => Enable::Yes, |
| 224 | }, | 229 | }, |
crates/app/src/tests/editing.rsmodified+6 -7
| @@ -335,14 +335,11 @@ fn a_caption_is_deleted_by_the_same_row_and_stroke_every_box_is() { | |||
| 335 | menu_items(cap), | 335 | menu_items(cap), |
| 336 | vec![ | 336 | vec![ |
| 337 | ActionId::Paste, | 337 | ActionId::Paste, |
| 338 | - ActionId::Detach, | ||
| 339 | - ActionId::Group, | ||
| 340 | - ActionId::ToggleMute, | ||
| 341 | // Below the rule line the render draws before it, like every | 338 | // Below the rule line the render draws before it, like every |
| 342 | // other row that takes something away (DESIGN §9). | 339 | // other row that takes something away (DESIGN §9). |
| 343 | ActionId::Delete, | 340 | ActionId::Delete, |
| 344 | ], | 341 | ], |
| 345 | - "the caption's menu is its removal, its group rows, and the global ones", | 342 | + "the caption's menu is its removal and the one global row left", |
| 346 | ); | 343 | ); |
| 347 | // ...and the same reading with a clip under it is the clip menu, untouched: | 344 | // ...and the same reading with a clip under it is the clip menu, untouched: |
| 348 | // the flag is off wherever a `Clip` was clicked. | 345 | // the flag is off wherever a `Clip` was clicked. |
| @@ -802,7 +799,6 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() { | |||
| 802 | // split off -- a row the next click of the playhead lights. | 799 | // split off -- a row the next click of the playhead lights. |
| 803 | for rows in [menu(a1, false, 30), menu(v1, false, 30), menu(v1, true, 30)] { | 800 | for rows in [menu(a1, false, 30), menu(v1, false, 30), menu(v1, true, 30)] { |
| 804 | assert!(rows.contains(&ActionId::Cut), "{rows:?}"); | 801 | assert!(rows.contains(&ActionId::Cut), "{rows:?}"); |
| 805 | - assert!(rows.contains(&ActionId::Detach), "{rows:?}"); | ||
| 806 | } | 802 | } |
| 807 | // The actions card is the other half of the rule: it lists the whole | 803 | // The actions card is the other half of the rule: it lists the whole |
| 808 | // registry, so a class refusal is dimmed there with its reason and never | 804 | // registry, so a class refusal is dimmed there with its reason and never |
| @@ -2761,8 +2757,11 @@ fn every_verb_the_spine_carried_is_a_right_click_row() { | |||
| 2761 | (ActionId::WalkCutNext10, "bench"), | 2757 | (ActionId::WalkCutNext10, "bench"), |
| 2762 | (ActionId::TrimIn, "clip"), | 2758 | (ActionId::TrimIn, "clip"), |
| 2763 | (ActionId::TrimOut, "clip"), | 2759 | (ActionId::TrimOut, "clip"), |
| 2764 | - (ActionId::TrimInToPlayhead, "clip"), | 2760 | + // The trim-to-playhead pair is *not* in this list: `^[` and `^]` are |
| 2765 | - (ActionId::TrimOutToPlayhead, "clip"), | 2761 | + // the keyboard's version of dragging a clip edge to a spot, a gesture |
| 2762 | + // the pointer already has, so the clip menu leaves them out (DESIGN §9, | ||
| 2763 | + // "Never a junk drawer"). They keep their chords and their KEYS rows, | ||
| 2764 | + // which is what the layout sweep's exemption for them names. | ||
| 2766 | (ActionId::LoopTrim, "clip"), | 2765 | (ActionId::LoopTrim, "clip"), |
| 2767 | // VIEW | 2766 | // VIEW |
| 2768 | (ActionId::ZoomOut, "bench"), | 2767 | (ActionId::ZoomOut, "bench"), |
crates/app/src/tests/layout.rsmodified+29 -1
| @@ -2447,7 +2447,6 @@ fn hdr_reference_rows_read_content_light_and_use_the_established_empty_state() { | |||
| 2447 | fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { | 2447 | fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { |
| 2448 | use crate::ActionId; | 2448 | use crate::ActionId; |
| 2449 | const EXPLICITLY_OWNED_ELSEWHERE: &[(ActionId, &str)] = &[ | 2449 | const EXPLICITLY_OWNED_ELSEWHERE: &[(ActionId, &str)] = &[ |
| 2450 | - (ActionId::Crossfade, "fade parity owns crossfade controls"), | ||
| 2451 | ( | 2450 | ( |
| 2452 | ActionId::FocusPanels, | 2451 | ActionId::FocusPanels, |
| 2453 | "keyboard-only by design: a mouse already focuses whatever it \ | 2452 | "keyboard-only by design: a mouse already focuses whatever it \ |
| @@ -2471,6 +2470,35 @@ fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { | |||
| 2471 | accelerator for cycling that existing selection, not a new door -- legacy had no \ | 2470 | accelerator for cycling that existing selection, not a new door -- legacy had no \ |
| 2472 | toolbar button for it either", | 2471 | toolbar button for it either", |
| 2473 | ), | 2472 | ), |
| 2473 | + // The group trio: a group is *made* with the pointer already -- | ||
| 2474 | + // ctrl-click the halves and the grammar is the selection itself | ||
| 2475 | + // (DESIGN §9) -- so a row per verb in the clip menu was three rows | ||
| 2476 | + // saying what the click had already said. Chords and KEYS rows keep | ||
| 2477 | + // them reachable. | ||
| 2478 | + ( | ||
| 2479 | + ActionId::Group, | ||
| 2480 | + "made by ctrl-clicking the halves: the selection is the grammar", | ||
| 2481 | + ), | ||
| 2482 | + ( | ||
| 2483 | + ActionId::Detach, | ||
| 2484 | + "made by ctrl-clicking the halves: the selection is the grammar", | ||
| 2485 | + ), | ||
| 2486 | + ( | ||
| 2487 | + ActionId::Regroup, | ||
| 2488 | + "made by ctrl-clicking the halves: the selection is the grammar", | ||
| 2489 | + ), | ||
| 2490 | + // The keyboard's own trim: `^[` and `^]` do with a stroke what the | ||
| 2491 | + // pointer does by dragging the clip edge to the spot it wants, and | ||
| 2492 | + // that drag is the door -- a menu row for it would be a second name | ||
| 2493 | + // for a gesture the bench already answers. | ||
| 2494 | + ( | ||
| 2495 | + ActionId::TrimInToPlayhead, | ||
| 2496 | + "the pointer's version is dragging the clip edge to the playhead", | ||
| 2497 | + ), | ||
| 2498 | + ( | ||
| 2499 | + ActionId::TrimOutToPlayhead, | ||
| 2500 | + "the pointer's version is dragging the clip edge to the playhead", | ||
| 2501 | + ), | ||
| 2474 | // The rail's own eighteen are gone from this list: the right-click | 2502 | // The rail's own eighteen are gone from this list: the right-click |
| 2475 | // parity (DESIGN §5 as amended 2026-09-09, user decision "option C") | 2503 | // parity (DESIGN §5 as amended 2026-09-09, user decision "option C") |
| 2476 | // gave every one of them a door on the thing it acts on -- the clip | 2504 | // gave every one of them a door on the thing it acts on -- the clip |