From 7b04d8867d68d76162f4c12995c0b60f24cd26e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 21 Aug 2026 06:11:35 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(ui):=20fit=20and=20redo=20find?= =?UTF-8?q?=20their=20own=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fit had a chord and a spot buried in the clip's right-click menu but no direct button in the darkroom dock; Redo had a legacy toolbar button Undo's darkroom glyph never grew a twin for. Both now sit beside their siblings (Fit in the dock's clip verbs, Redo paired with Undo in the spine), chord still visible on each. Re-audited the settings page landed since the original parity scout ran: the four project pickers, subtitle style and both proxy toggles are confirmed already mouse-reachable there. Adds a source-scan regression guard: every chord-bound ActionId must show up in the darkroom tree's text or be named as an accepted chord-only stroke, so this "keyboard-only option" class gets caught before it ships again instead of being found by hand a fifth time. --- crates/app/src/tests/layout.rs | 74 +++++++++++++++++++++++++++++++ crates/app/src/ui/dock_stance.rs | 17 +++++++ crates/app/src/ui/spine_stance.rs | 9 +++- 3 files changed, 99 insertions(+), 1 deletion(-) diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index aa90a93..3ae26f0 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2272,3 +2272,77 @@ fn settings_project_rows_have_no_bare_noun_placeholder() { ); } } + +/// 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 dc6ce87..d0b697d 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -587,6 +587,23 @@ fn clip_tab(player: &Player, width: f32, window_h: Pixels, 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),