fix(ui): show verified selection shortcuts in command palette

This commit is contained in:
AnhNgoo
2026-10-28 08:56:28 +07:00
parent f77d70502a
commit bf4a3969e8
2 changed files with 25 additions and 0 deletions
@@ -120,6 +120,8 @@ fn command_search_shortcut(id: &str, mac: bool) -> Option<&'static str> {
"edit.pasteSpecial" => ("Ctrl+Cmd+V", Some("Ctrl+Alt+V")),
"home.alignLeft" => ("⌘L", None),
"home.alignCenter" => ("⌘E", None),
"selection.row" => ("Shift+Space", Some("Shift+Space")),
"selection.column" => ("Control+Space", Some("Ctrl+Space")),
"view.showObjects" => ("Ctrl+6", Some("Ctrl+6")),
"formulas.showFormulas" => ("⌘`", Some("Ctrl+`")),
_ => return None,
+23
View File
@@ -171,3 +171,26 @@ fn command_search_uses_runtime_os_and_verified_shortcuts() {
}
}
}
/// Selection shortcuts use the same bindings as the runtime keyboard handler.
#[test]
fn command_search_selection_shortcuts_match_runtime_os() {
for (os, column_label) in [
(egui::os::OperatingSystem::Windows, "Select Entire Column (Ctrl+Space)"),
(egui::os::OperatingSystem::Mac, "Select Entire Column (Control+Space)"),
] {
let mut h = harness();
h.ctx.set_os(os);
h.run_steps(2);
h.state_mut().open_dialog("commandSearch", json!({}));
h.run_steps(6);
h.state_mut().dialog.as_mut().unwrap().search = "selection.row".into();
h.run_steps(3);
h.get_by_label_contains("Select Entire Row (Shift+Space)");
h.state_mut().dialog.as_mut().unwrap().search = "selection.column".into();
h.run_steps(3);
h.get_by_label_contains(column_label);
}
}