diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 5a7737e..707fff2 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2408,30 +2408,24 @@ fn hdr_reference_rows_read_content_light_and_use_the_established_empty_state() { /// spelling the action name itself, so each is matched on its own door /// string instead. /// -/// [`ALLOWED_CHORD_ONLY`] is the honest remainder: fine-grained playhead/edit -/// strokes with no button in the *legacy* tree either (`toolbar.rs`, -/// `inspector.rs`, `library.rs` were all swept for the same names and come -/// up equally empty) -- not a regression this task closes, just an existing -/// keyboard-only stroke this editor has never given a face. +/// Every action gets a persistent regional control or the context-menu row for +/// the thing it acts on. The four exemptions are independently-owned lane +/// parity work, named with their owners so a future removal cannot silently +/// turn any unrelated action back into keyboard-only. #[test] -fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() { +fn every_action_has_a_darkroom_widget_home_or_explicit_owner() { use crate::ActionId; - const ALLOWED_CHORD_ONLY: &[ActionId] = &[ - ActionId::StepBack, - ActionId::StepForward, - ActionId::GoStart, - ActionId::GoEnd, - ActionId::PrevSyncPoint, - ActionId::NextSyncPoint, - ActionId::WalkCutNext10, - ActionId::WalkCutPrev10, - ActionId::SetIn, - ActionId::SetOut, - ActionId::ClearRange, - ActionId::SelectAll, - ActionId::RemoveVideoLane, - ActionId::RemoveAudioLane, - ActionId::Crossfade, + const EXPLICITLY_OWNED_ELSEWHERE: &[(ActionId, &str)] = &[ + ( + ActionId::RemoveVideoLane, + "lane-header remove parity owns video-lane controls", + ), + ( + ActionId::RemoveAudioLane, + "lane-header remove parity owns audio-lane controls", + ), + (ActionId::Crossfade, "fade parity owns crossfade controls"), + (ActionId::Dissolve, "fade parity owns dissolve controls"), ]; let darkroom = [ "ui/bench_stance.rs", @@ -2448,7 +2442,11 @@ fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() { .map(src_text) .join("\n"); for action in ActionId::ALL { - if ALLOWED_CHORD_ONLY.contains(&action) { + if let Some((_, owner)) = EXPLICITLY_OWNED_ELSEWHERE + .iter() + .find(|(owned, _)| *owned == action) + { + assert!(!owner.is_empty(), "ActionId::{action:?} needs an owner"); continue; } let name = format!("{action:?}"); @@ -2458,8 +2456,7 @@ fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() { assert!( mentioned, "ActionId::{name} is bound to a chord but has no visible affordance \ - anywhere in the darkroom tree -- either mount it (see Fit/Redo, this \ - commit) or add it to ALLOWED_CHORD_ONLY with a reason" + anywhere in the darkroom tree -- either mount it or name the owning parity lane" ); } } diff --git a/crates/app/src/ui/bench_stance.rs b/crates/app/src/ui/bench_stance.rs index ceb3185..a1cd330 100644 --- a/crates/app/src/ui/bench_stance.rs +++ b/crates/app/src/ui/bench_stance.rs @@ -848,6 +848,16 @@ 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(); @@ -964,6 +974,35 @@ pub(crate) fn render( )) .text_color(rgb(INK1())) .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(player.keymap.chord(ActionId::SelectAll)), ), ) .child( diff --git a/crates/app/src/ui/spine_stance.rs b/crates/app/src/ui/spine_stance.rs index 7a8d669..549344b 100644 --- a/crates/app/src/ui/spine_stance.rs +++ b/crates/app/src/ui/spine_stance.rs @@ -278,6 +278,26 @@ pub(crate) fn render(player: &Player, cx: &mut Context) -> impl IntoElem cx, ), )) + .child(pair( + glyph( + "spine-cut-prev-ten", + "‹10", + ActionId::WalkCutPrev10, + false, + false, + player, + cx, + ), + glyph( + "spine-cut-next-ten", + "10›", + ActionId::WalkCutNext10, + false, + false, + player, + cx, + ), + )) .child(trim_control(player.loop_trim.is_some(), player, cx)) .child(glyph( "spine-loop-trim", diff --git a/crates/app/src/ui/timeband_stance.rs b/crates/app/src/ui/timeband_stance.rs index 3687c9e..35df902 100644 --- a/crates/app/src/ui/timeband_stance.rs +++ b/crates/app/src/ui/timeband_stance.rs @@ -169,6 +169,26 @@ fn cut_readout(player: &Player) -> impl IntoElement { .child("roll"), ) } +/// Export-range marks belong beside the cut readout they constrain (DESIGN §9): +/// each is a direct mouse door to the same action its chord asks for. +fn range_marks(player: &Player, cx: &mut Context) -> impl IntoElement { + div() + .id("stance-range-marks") + .flex_none() + .flex() + .items_center() + .gap(px(4.)) + .child(ghost("stance-mark-in", player, "I", ActionId::SetIn, false, cx)) + .child(ghost("stance-mark-out", player, "O", ActionId::SetOut, false, cx)) + .child(ghost( + "stance-clear-range", + player, + "×", + ActionId::ClearRange, + false, + cx, + )) +} /// The contact strip (MOCK-SPEC "Contact strip"): the whole-film minimap /// filling the band's remaining width, with a 1px viewport bracket marking @@ -532,6 +552,54 @@ pub(crate) fn render(player: &mut Player, position: f64, cx: &mut Context