forge
Explore
Log in

Don't you dare go Hollow

ce0324523463751b74b7fec38a709fed8aedbeb2Ahmet Kaan GümüşParent: 30984faf83cf0a
crates/app/src/tests/layout.rsmodified+22 -25
@@ -2483,30 +2483,24 @@ fn hdr_reference_rows_read_content_light_and_use_the_established_empty_state() {
2483 /// spelling the action name itself, so each is matched on its own door2483 /// spelling the action name itself, so each is matched on its own door
2484 /// string instead.2484 /// string instead.
2485 ///2485 ///
2486-/// [`ALLOWED_CHORD_ONLY`] is the honest remainder: fine-grained playhead/edit2486+/// Every action gets a persistent regional control or the context-menu row for
2487-/// strokes with no button in the *legacy* tree either (`toolbar.rs`,2487+/// the thing it acts on. The four exemptions are independently-owned lane
2488-/// `inspector.rs`, `library.rs` were all swept for the same names and come2488+/// parity work, named with their owners so a future removal cannot silently
2489-/// up equally empty) -- not a regression this task closes, just an existing2489+/// turn any unrelated action back into keyboard-only.
2490-/// keyboard-only stroke this editor has never given a face.
2491 #[test]2490 #[test]
2492-fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() {2491+fn every_action_has_a_darkroom_widget_home_or_explicit_owner() {
2493 use crate::ActionId;2492 use crate::ActionId;
2494- const ALLOWED_CHORD_ONLY: &[ActionId] = &[2493+ const EXPLICITLY_OWNED_ELSEWHERE: &[(ActionId, &str)] = &[
2495- ActionId::StepBack,2494+ (
2496- ActionId::StepForward,2495+ ActionId::RemoveVideoLane,
2497- ActionId::GoStart,2496+ "lane-header remove parity owns video-lane controls",
2498- ActionId::GoEnd,2497+ ),
2499- ActionId::PrevSyncPoint,2498+ (
2500- ActionId::NextSyncPoint,2499+ ActionId::RemoveAudioLane,
2501- ActionId::WalkCutNext10,2500+ "lane-header remove parity owns audio-lane controls",
2502- ActionId::WalkCutPrev10,2501+ ),
2503- ActionId::SetIn,2502+ (ActionId::Crossfade, "fade parity owns crossfade controls"),
2504- ActionId::SetOut,2503+ (ActionId::Dissolve, "fade parity owns dissolve controls"),
2505- ActionId::ClearRange,
2506- ActionId::SelectAll,
2507- ActionId::RemoveVideoLane,
2508- ActionId::RemoveAudioLane,
2509- ActionId::Crossfade,
2510 ];2504 ];
2511 let darkroom = [2505 let darkroom = [
2512 "ui/bench_stance.rs",2506 "ui/bench_stance.rs",
@@ -2523,7 +2517,11 @@ fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() {
2523 .map(src_text)2517 .map(src_text)
2524 .join("\n");2518 .join("\n");
2525 for action in ActionId::ALL {2519 for action in ActionId::ALL {
2526- if ALLOWED_CHORD_ONLY.contains(&action) {2520+ if let Some((_, owner)) = EXPLICITLY_OWNED_ELSEWHERE
2521+ .iter()
2522+ .find(|(owned, _)| *owned == action)
2523+ {
2524+ assert!(!owner.is_empty(), "ActionId::{action:?} needs an owner");
2527 continue;2525 continue;
2528 }2526 }
2529 let name = format!("{action:?}");2527 let name = format!("{action:?}");
@@ -2533,8 +2531,7 @@ fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() {
2533 assert!(2531 assert!(
2534 mentioned,2532 mentioned,
2535 "ActionId::{name} is bound to a chord but has no visible affordance \2533 "ActionId::{name} is bound to a chord but has no visible affordance \
2536- anywhere in the darkroom tree -- either mount it (see Fit/Redo, this \2534+ anywhere in the darkroom tree -- either mount it or name the owning parity lane"
2537- commit) or add it to ALLOWED_CHORD_ONLY with a reason"
2538 );2535 );
2539 }2536 }
2540 }2537 }
crates/app/src/ui/bench_stance.rsmodified+39 -0
@@ -1093,6 +1093,16 @@ pub(crate) fn render(
1093 .map_or_else(|| vec![Lane::V1, Lane::A1], PlaybackSession::lanes);1093 .map_or_else(|| vec![Lane::V1, Lane::A1], PlaybackSession::lanes);
1094 let position = player.active_session().map_or(0., PlaybackSession::now);1094 let position = player.active_session().map_or(0., PlaybackSession::now);
1095 let scale = player.scale;1095 let scale = player.scale;
1096+ let select_all = player.enable(ActionId::SelectAll, None);
1097+ let select_all_tip: SharedString = match select_all.why() {
1098+ Some(why) => format!("{} — {why}", player.keymap.display(ActionId::SelectAll)),
1099+ None => format!(
1100+ "{} — {}",
1101+ player.keymap.display(ActionId::SelectAll),
1102+ ActionId::SelectAll.label()
1103+ ),
1104+ }
1105+ .into();
1096 let bed_w = f32::from(player.ruler.get().size.width).max(1.);1106 let bed_w = f32::from(player.ruler.get().size.width).max(1.);
1097 let filled = scale.px_at(position).clamp(0., bed_w);1107 let filled = scale.px_at(position).clamp(0., bed_w);
1098 let (picks, pick_links) = player.marks();1108 let (picks, pick_links) = player.marks();
@@ -1209,6 +1219,35 @@ pub(crate) fn render(
1209 ))1219 ))
1210 .text_color(rgb(INK1()))1220 .text_color(rgb(INK1()))
1211 .child(playhead_tc),1221 .child(playhead_tc),
1222+ )
1223+ .child(
1224+ div()
1225+ .id("bench-select-all")
1226+ .absolute()
1227+ .right(px(4.))
1228+ .top_0()
1229+ .h_full()
1230+ .flex()
1231+ .items_center()
1232+ .gap(px(3.))
1233+ .px(px(3.))
1234+ .rounded(px(2.))
1235+ .tooltip(move |_, cx| cx.new(|_| Tip(select_all_tip.clone())).into())
1236+ .when(!select_all.yes(), |d| d.opacity(0.4).cursor_not_allowed())
1237+ .when(select_all.yes(), |d| {
1238+ d.cursor_pointer()
1239+ .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1())))
1240+ .on_click(cx.listener(|this, _: &ClickEvent, window, cx| {
1241+ this.act(ActionId::SelectAll, window, cx)
1242+ }))
1243+ })
1244+ .type_style(type_scale::mono(
1245+ type_scale::CHORD_METADATA_MIN_PX,
1246+ gpui::FontWeight::MEDIUM,
1247+ ))
1248+ .text_color(rgb(INK3()))
1249+ .child("all")
1250+ .child(player.keymap.chord(ActionId::SelectAll)),
1212 ),1251 ),
1213 )1252 )
1214 .child(1253 .child(
crates/app/src/ui/spine_stance.rsmodified+20 -0
@@ -278,6 +278,26 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
278 cx,278 cx,
279 ),279 ),
280 ))280 ))
281+ .child(pair(
282+ glyph(
283+ "spine-cut-prev-ten",
284+ "‹10",
285+ ActionId::WalkCutPrev10,
286+ false,
287+ false,
288+ player,
289+ cx,
290+ ),
291+ glyph(
292+ "spine-cut-next-ten",
293+ "10›",
294+ ActionId::WalkCutNext10,
295+ false,
296+ false,
297+ player,
298+ cx,
299+ ),
300+ ))
281 .child(trim_control(player.loop_trim.is_some(), player, cx))301 .child(trim_control(player.loop_trim.is_some(), player, cx))
282 .child(glyph(302 .child(glyph(
283 "spine-loop-trim",303 "spine-loop-trim",
crates/app/src/ui/timeband_stance.rsmodified+69 -0
@@ -169,6 +169,26 @@ fn cut_readout(player: &Player) -> impl IntoElement {
169 .child("roll"),169 .child("roll"),
170 )170 )
171 }171 }
172+/// Export-range marks belong beside the cut readout they constrain (DESIGN §9):
173+/// each is a direct mouse door to the same action its chord asks for.
174+fn range_marks(player: &Player, cx: &mut Context<Player>) -> impl IntoElement {
175+ div()
176+ .id("stance-range-marks")
177+ .flex_none()
178+ .flex()
179+ .items_center()
180+ .gap(px(4.))
181+ .child(ghost("stance-mark-in", player, "I", ActionId::SetIn, false, cx))
182+ .child(ghost("stance-mark-out", player, "O", ActionId::SetOut, false, cx))
183+ .child(ghost(
184+ "stance-clear-range",
185+ player,
186+ "×",
187+ ActionId::ClearRange,
188+ false,
189+ cx,
190+ ))
191+}
172 192
173 /// The contact strip (MOCK-SPEC "Contact strip"): the whole-film minimap193 /// The contact strip (MOCK-SPEC "Contact strip"): the whole-film minimap
174 /// filling the band's remaining width, with a 1px viewport bracket marking194 /// filling the band's remaining width, with a 1px viewport bracket marking
@@ -577,6 +597,54 @@ pub(crate) fn render(player: &mut Player, position: f64, cx: &mut Context<Player
577 false,597 false,
578 cx,598 cx,
579 ))599 ))
600+ .child(ghost(
601+ "stance-tb-step-back",
602+ player,
603+ "◀",
604+ ActionId::StepBack,
605+ false,
606+ cx,
607+ ))
608+ .child(ghost(
609+ "stance-tb-step-forward",
610+ player,
611+ "▶",
612+ ActionId::StepForward,
613+ false,
614+ cx,
615+ ))
616+ .child(ghost(
617+ "stance-tb-start",
618+ player,
619+ "↤",
620+ ActionId::GoStart,
621+ false,
622+ cx,
623+ ))
624+ .child(ghost(
625+ "stance-tb-end",
626+ player,
627+ "↦",
628+ ActionId::GoEnd,
629+ false,
630+ cx,
631+ ))
632+ .child(ghost(
633+ "stance-tb-sync-prev",
634+ player,
635+ "‹|",
636+ ActionId::PrevSyncPoint,
637+ false,
638+ cx,
639+ ))
640+ .child(ghost(
641+ "stance-tb-sync-next",
642+ player,
643+ "|›",
644+ ActionId::NextSyncPoint,
645+ false,
646+ cx,
647+ ))
580 // Loop (homeless per this task's audit): the playback-loop648 // Loop (homeless per this task's audit): the playback-loop
581 // toggle -- burst-use during editing per the charter's own649 // toggle -- burst-use during editing per the charter's own
582 // classification -- earns the transport cluster it plays650 // classification -- earns the transport cluster it plays
@@ -624,6 +692,7 @@ pub(crate) fn render(player: &mut Player, position: f64, cx: &mut Context<Player
624 .child(volume_slider(player, cx))692 .child(volume_slider(player, cx))
625 .child(ghost("stance-tb-vol-up", player, "+", ActionId::VolumeUp, false, cx)),693 .child(ghost("stance-tb-vol-up", player, "+", ActionId::VolumeUp, false, cx)),
626 )694 )
695+ .child(range_marks(player, cx))
627 .child(cut_readout(player))696 .child(cut_readout(player))
628 .child(contact_strip(player, position, cx))697 .child(contact_strip(player, position, cx))
629 .child(save_verb(player, cx))698 .child(save_verb(player, cx))