forge
Explore
Log in

Don't you dare go Hollow

The last chord-only controls grow a face

Browse files at this commit

53a56dc6100494a106af50cb8ee16b5c4fa09280Ahmet Kaan GümüşParent: c41d0667b04d88
  • feat
    • the last chord-only controls grow a face
Show full message
✨ feat(ui): the last chord-only controls grow a face

Fit joins its siblings as a verb row in the dock's clip tab, and Redo takes
its place beside Undo on the spine — it had a button in the old room and none
in this one.

The guard is the point: every chord-bound action must now own a visible
affordance in the darkroom or be named in the chord-only list, so the next
one cannot go missing quietly.
crates/app/src/tests/layout.rsmodified+73 -0
@@ -2305,3 +2305,76 @@ fn hdr_reference_rows_read_content_light_and_use_the_established_empty_state() {
2305 // ("N/A", "None", "Unknown"...) invented for the same absence.2305 // ("N/A", "None", "Unknown"...) invented for the same absence.
2306 assert!(project_body.contains("\"—\".to_string()"), "the HDR reference rows must reuse the page's own empty-state dash");2306 assert!(project_body.contains("\"—\".to_string()"), "the HDR reference rows must reuse the page's own empty-state dash");
2307 }2307 }
2308+/// The parity class this user has reported four separate times: "some
2309+/// options are only reachable via keyboard shortcut". A source scan (this
2310+/// binary has no `TestAppContext` to click through) over every darkroom
2311+/// surface -- the spine, the dock, the bench/timeband transport, the
2312+/// settings page, the maximized cards and the clip context menu
2313+/// (`menus.rs`'s `MENU_ITEMS`, rendered mouse-and-chord-visible by
2314+/// `overlays.rs`) -- for a literal `ActionId::<variant>` mention. An
2315+/// [`ActionId`] reachable by chord ([`Keymap::defaults`]) but absent from
2316+/// every one of those texts has no mouse door into the darkroom at all,
2317+/// which is exactly this bug's shape (`Fit` and `Redo` shipped that way
2318+/// until this commit).
2319+///
2320+/// [`ActionId::Resolution`] and [`ActionId::SubtitleStyle`] are the two
2321+/// deliberate exceptions: their settings-page rows open them through
2322+/// `Pick::Resolution` and `open_subtitle_style(cx)` respectively, never
2323+/// spelling the action name itself, so each is matched on its own door
2324+/// string instead.
2325+///
2326+/// [`ALLOWED_CHORD_ONLY`] is the honest remainder: fine-grained playhead/edit
2327+/// strokes with no button in the *legacy* tree either (`toolbar.rs`,
2328+/// `inspector.rs`, `library.rs` were all swept for the same names and come
2329+/// up equally empty) -- not a regression this task closes, just an existing
2330+/// keyboard-only stroke this editor has never given a face.
2331+#[test]
2332+fn every_chord_bound_action_has_a_darkroom_affordance_or_is_named_chord_only() {
2333+ use crate::ActionId;
2334+ const ALLOWED_CHORD_ONLY: &[ActionId] = &[
2335+ ActionId::StepBack,
2336+ ActionId::StepForward,
2337+ ActionId::GoStart,
2338+ ActionId::GoEnd,
2339+ ActionId::PrevSyncPoint,
2340+ ActionId::NextSyncPoint,
2341+ ActionId::WalkCutNext10,
2342+ ActionId::WalkCutPrev10,
2343+ ActionId::SetIn,
2344+ ActionId::SetOut,
2345+ ActionId::ClearRange,
2346+ ActionId::SelectAll,
2347+ ActionId::RemoveVideoLane,
2348+ ActionId::RemoveAudioLane,
2349+ ActionId::Crossfade,
2350+ ];
2351+ let darkroom = [
2352+ "ui/bench_stance.rs",
2353+ "ui/cards.rs",
2354+ "ui/dock_stance.rs",
2355+ "ui/overlays.rs",
2356+ "ui/settings_stance.rs",
2357+ "ui/spine_stance.rs",
2358+ "ui/stance.rs",
2359+ "ui/timeband_stance.rs",
2360+ "ui/timeline.rs",
2361+ "menus.rs",
2362+ ]
2363+ .map(src_text)
2364+ .join("\n");
2365+ for action in ActionId::ALL {
2366+ if ALLOWED_CHORD_ONLY.contains(&action) {
2367+ continue;
2368+ }
2369+ let name = format!("{action:?}");
2370+ let mentioned = darkroom.contains(&format!("ActionId::{name}"))
2371+ || (action == ActionId::Resolution && darkroom.contains("Pick::Resolution"))
2372+ || (action == ActionId::SubtitleStyle && darkroom.contains("open_subtitle_style(cx)"));
2373+ assert!(
2374+ mentioned,
2375+ "ActionId::{name} is bound to a chord but has no visible affordance \
2376+ anywhere in the darkroom tree -- either mount it (see Fit/Redo, this \
2377+ commit) or add it to ALLOWED_CHORD_ONLY with a reason"
2378+ );
2379+ }
2380+}
crates/app/src/ui/dock_stance.rsmodified+17 -0
@@ -619,6 +619,23 @@ fn clip_tab(player: &Player, width: f32, window_size: Size<Pixels>, cx: &mut Con
619 "track volumes and the limiter",619 "track volumes and the limiter",
620 player,620 player,
621 cx.listener(|this, _: &ClickEvent, _, cx| this.open_mix(None, cx)),621 cx.listener(|this, _: &ClickEvent, _, cx| this.open_mix(None, cx)),
622+ ))
623+ // Fit: a cycle, not a card, so `active` is always false --
624+ // there is no open state to hold it down for, only the click
625+ // itself (same anatomy as `cycle_fit`'s own inspector.rs row,
626+ // legacy's `crates/app/src/ui/inspector.rs:244-253`). It was
627+ // reachable only by its chord or buried in the clip's
628+ // right-click menu (`overlays.rs`'s `Pick::Fit`); this is its
629+ // direct button, beside the other per-clip verbs it keeps
630+ // company with.
631+ .child(ghost_verb(
632+ "dock-verb-fit",
633+ "Fit",
634+ ActionId::Fit,
635+ false,
636+ "how this picture is placed on the project canvas",
637+ player,
638+ cx.listener(|this, _: &ClickEvent, _, cx| this.cycle_fit(cx)),
622 )),639 )),
623 )640 )
624 .child(641 .child(
crates/app/src/ui/spine_stance.rsmodified+8 -1
@@ -224,7 +224,14 @@ pub(crate) fn render(player: &Player, cx: &mut Context<Player>) -> impl IntoElem
224 .child(group_head("edit"))224 .child(group_head("edit"))
225 .child(glyph("spine-split", "||", ActionId::Cut, false, false, player, cx))225 .child(glyph("spine-split", "||", ActionId::Cut, false, false, player, cx))
226 .child(glyph("spine-delete", "⊂⊃", ActionId::Delete, false, false, player, cx))226 .child(glyph("spine-delete", "⊂⊃", ActionId::Delete, false, false, player, cx))
227- .child(glyph("spine-undo", "↺", ActionId::Undo, false, false, player, cx))227+ .child(pair(
228+ glyph("spine-undo", "↺", ActionId::Undo, false, false, player, cx),
229+ // Redo had a legacy toolbar button (`toolbar.rs:347`) but no
230+ // darkroom home -- Undo got a glyph here and Redo did not.
231+ // Same row, same door (`this.act`), the pair anatomy the
232+ // cut-prev/cut-next row below already uses.
233+ glyph("spine-redo", "⟳", ActionId::Redo, false, false, player, cx),
234+ ))
228 .child(group_head("cut"))235 .child(group_head("cut"))
229 .child(pair(236 .child(pair(
230 glyph("spine-cut-prev", "‹", ActionId::WalkCutPrev, false, false, player, cx),237 glyph("spine-cut-prev", "‹", ActionId::WalkCutPrev, false, false, player, cx),