Second default keys, also in menu lines

F2 Deselect All, Cmd+Shift+T Effect Controls, Cmd+Alt+Left / Right Go to Start /
End, Cmd+Shift+/ Add to Render Queue.

Effect Controls is a menu entry with bound parameters, which could hold one key:
a menu line can now give further default keys after a comma
(F3, Cmd+Shift+T); the menus show the first. MenuEntry gains alt_shortcuts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pravdomil
2026-10-12 17:37:18 +02:00
co-authored by Claude Opus 5.5
parent 6f5bd0c272
commit eec84a8095
8 changed files with 90 additions and 34 deletions
+20
View File
@@ -430,6 +430,26 @@ fn default_keys_for_commands_that_had_none() {
assert!(t.all_conflicts().is_empty(), "{:?}", t.all_conflicts());
}
/// Second default keys: on the command, or after a comma in a menu line with bound parameters.
#[test]
fn second_default_keys() {
let s = Session::default();
let t = s.shortcuts();
for (key, want) in [
("edit.deselectAll", ["Cmd+Shift+A", "F2"]),
("time.start", ["Home", "Cmd+Alt+ArrowLeft"]),
("time.end", ["End", "Cmd+Alt+ArrowRight"]),
("renderQueue.add", ["Cmd+M", "Cmd+Shift+/"]),
(r#"window.panel {"panel":"effectControls"}"#, ["F3", "Cmd+Shift+T"]),
] {
assert_eq!(t.keys.get(key).map(Vec::as_slice), Some(want.map(String::from).as_slice()), "{key}");
}
// The menus keep showing the first key.
assert_eq!(t.shortcut_of("window.panel", &json!({"panel": "effectControls"})), Some("F3"));
assert_eq!(t.shortcut_of("edit.deselectAll", &json!(null)), Some("Cmd+Shift+A"));
assert!(t.all_conflicts().is_empty(), "{:?}", t.all_conflicts());
}
/// Cmd+Left / Cmd+Right Arrow step a frame like Page Up / Page Down (Shift: 10 frames).
#[test]
fn cmd_arrows_step_frames_like_page_keys() {