diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index f8237a5..f168fa2 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2305,3 +2305,76 @@ fn hdr_reference_rows_read_content_light_and_use_the_established_empty_state() { // ("N/A", "None", "Unknown"...) invented for the same absence. assert!(project_body.contains("\"—\".to_string()"), "the HDR reference rows must reuse the page's own empty-state dash"); } +/// The parity class this user has reported four separate times: "some +/// options are only reachable via keyboard shortcut". A source scan (this +/// binary has no `TestAppContext` to click through) over every darkroom +/// surface -- the spine, the dock, the bench/timeband transport, the +/// settings page, the maximized cards and the clip context menu +/// (`menus.rs`'s `MENU_ITEMS`, rendered mouse-and-chord-visible by +/// `overlays.rs`) -- for a literal `ActionId::` mention. An +/// [`ActionId`] reachable by chord ([`Keymap::defaults`]) but absent from +/// every one of those texts has no mouse door into the darkroom at all, +/// which is exactly this bug's shape (`Fit` and `Redo` shipped that way +/// until this commit). +/// +/// [`ActionId::Resolution`] and [`ActionId::SubtitleStyle`] are the two +/// deliberate exceptions: their settings-page rows open them through +/// `Pick::Resolution` and `open_subtitle_style(cx)` respectively, never +/// 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. +#[test] +fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() { + 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, + ]; + let darkroom = [ + "ui/bench_stance.rs", + "ui/cards.rs", + "ui/dock_stance.rs", + "ui/overlays.rs", + "ui/settings_stance.rs", + "ui/spine_stance.rs", + "ui/stance.rs", + "ui/timeband_stance.rs", + "ui/timeline.rs", + "menus.rs", + ] + .map(src_text) + .join("\n"); + for action in ActionId::ALL { + if ALLOWED_CHORD_ONLY.contains(&action) { + continue; + } + let name = format!("{action:?}"); + let mentioned = darkroom.contains(&format!("ActionId::{name}")) + || (action == ActionId::Resolution && darkroom.contains("Pick::Resolution")) + || (action == ActionId::SubtitleStyle && darkroom.contains("open_subtitle_style(cx)")); + 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" + ); + } +} diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index 8c861a8..adf74e5 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -619,6 +619,23 @@ fn clip_tab(player: &Player, width: f32, window_size: Size, cx: &mut Con "track volumes and the limiter", player, cx.listener(|this, _: &ClickEvent, _, cx| this.open_mix(None, cx)), + )) + // Fit: a cycle, not a card, so `active` is always false -- + // there is no open state to hold it down for, only the click + // itself (same anatomy as `cycle_fit`'s own inspector.rs row, + // legacy's `crates/app/src/ui/inspector.rs:244-253`). It was + // reachable only by its chord or buried in the clip's + // right-click menu (`overlays.rs`'s `Pick::Fit`); this is its + // direct button, beside the other per-clip verbs it keeps + // company with. + .child(ghost_verb( + "dock-verb-fit", + "Fit", + ActionId::Fit, + false, + "how this picture is placed on the project canvas", + player, + cx.listener(|this, _: &ClickEvent, _, cx| this.cycle_fit(cx)), )), ) .child( diff --git a/crates/app/src/ui/spine_stance.rs b/crates/app/src/ui/spine_stance.rs index 545ee62..bab11f7 100644 --- a/crates/app/src/ui/spine_stance.rs +++ b/crates/app/src/ui/spine_stance.rs @@ -224,7 +224,14 @@ pub(crate) fn render(player: &Player, cx: &mut Context) -> impl IntoElem .child(group_head("edit")) .child(glyph("spine-split", "||", ActionId::Cut, false, false, player, cx)) .child(glyph("spine-delete", "⊂⊃", ActionId::Delete, false, false, player, cx)) - .child(glyph("spine-undo", "↺", ActionId::Undo, false, false, player, cx)) + .child(pair( + glyph("spine-undo", "↺", ActionId::Undo, false, false, player, cx), + // Redo had a legacy toolbar button (`toolbar.rs:347`) but no + // darkroom home -- Undo got a glyph here and Redo did not. + // Same row, same door (`this.act`), the pair anatomy the + // cut-prev/cut-next row below already uses. + glyph("spine-redo", "⟳", ActionId::Redo, false, false, player, cx), + )) .child(group_head("cut")) .child(pair( glyph("spine-cut-prev", "‹", ActionId::WalkCutPrev, false, false, player, cx),