Help: Search Commands… is the first Help menu item

Search Commands… moves from the middle of the Help menu to the top,
with a separator after it. It runs the same help.commandPalette
command and shows its shortcut. In the native macOS menu bar it is
the first item below the system's search field.
This commit is contained in:
dotCooCoo
2026-11-15 22:04:56 -08:00
parent a9dc138ecd
commit 2e639f150a
4 changed files with 42 additions and 1 deletions
+26
View File
@@ -61,6 +61,32 @@ fn file_ends_with_exit() {
assert!(matches!(last, Item::Cmd("Exit", "app.quit", _)), "{last:?}");
}
/// Help starts with Search Commands…, the command search's own command, showing its shortcut,
/// then a separator; the menus list it once.
#[test]
fn help_starts_with_search_commands() {
let app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
let tree = menu_tree();
let (_, help) = tree.iter().find(|(t, _)| *t == "Help").unwrap();
assert!(matches!(help[0], Item::Cmd("Search Commands…", "help.commandPalette", _)), "{:?}", help[0]);
assert!(matches!(help[1], Item::Sep), "{:?}", help[1]);
let Some(Entry::Item(row)) = entry(&app, &help[0]) else { panic!("Search Commands… is not shown") };
assert!(row.enabled);
assert_eq!(row.shortcut, shortcut_of("help.commandPalette"));
assert!(row.shortcut.is_some(), "the search's shortcut shows next to the item");
fn count(items: &[Item]) -> usize {
items
.iter()
.map(|it| match it {
Item::Cmd(_, "help.commandPalette", _) => 1,
Item::Sub(_, children) => count(children),
_ => 0,
})
.sum()
}
assert_eq!(tree.iter().map(|(_, items)| count(items)).sum::<usize>(), 1);
}
/// No application menu in the window (as in Illustrator): the bar starts at File.
#[test]
fn the_bar_starts_at_file() {
+2 -1
View File
@@ -738,12 +738,13 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec<Item>)> {
(
"Help",
vec![
c("Search Commands…", "help.commandPalette"),
Sep,
c("Join Our Discord", "help.discord"),
c("ArtCraft Website", "help.website"),
c("VectorCraft on getartcraft.com", "help.appPage"),
c("VectorCraft on GitHub", "help.github"),
Sep,
c("Search Commands…", "help.commandPalette"),
todos("VectorCraft Help…", "F1"),
c("Safe Mode…", "help.safeMode"),
c("Copy Troubleshooting Info", "help.copyTroubleshootingInfo"),
+13
View File
@@ -210,6 +210,19 @@ fn the_window_menu_has_the_system_items() {
assert_eq!(Standard::Zoom.label(), "Zoom");
}
/// The Mac Help menu keeps Search Commands… first among VectorCraft's items, with its shortcut,
/// then a separator.
#[test]
fn the_mac_help_menu_starts_with_search_commands() {
let bar = bar(&app(true));
let help = &bar.menu(MenuRole::Help).unwrap().children;
assert_eq!(ids(help)[..2], ["help.commandPalette".to_string(), "---".into()]);
let search = find(&bar, "help.commandPalette");
assert_eq!(search.label, "Search Commands…");
assert_eq!(search.shortcut, menus::shortcut_of("help.commandPalette"));
assert!(search.shortcut.is_some());
}
/// A system key a command already has stays the command's: the system item goes without. The
/// user's shortcuts show in the menus.
#[test]
+1
View File
@@ -1013,6 +1013,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- The Free Transform widget's Constrain works in Free Distort as well as in Free Transform ([the help page](https://helpx.adobe.com/illustrator/using/tool-techniques/free-transform-tool.html)). With Constrain on, or Shift held, a corner dragged in Free Distort moves only along the line through the opposite corner, in the box's own proportions, and the other three corners stay in place; on a turned box the line runs through the box's own corners. The line is VectorCraft's own rule. Cmd/Ctrl+Alt+Shift on a corner still drags in Perspective Distort, where Constrain stays unavailable (tools `xform::free::tests::free_distort_corner_keeps_to_its_diagonal_with_shift_or_constrain`, `shift_pressed_during_a_free_distort_drag_constrains_it`, `a_turned_box_is_constrained_along_its_own_diagonal`, `along_diagonal_of_a_degenerate_box`; engine `xform::free_transform_constrained_distort_keeps_the_corner_on_its_diagonal`; ui-egui `free_transform::tests::the_widget_sets_the_mode_and_a_corner_drag_then_distorts`).
- Native macOS menu bar, vector tool cursors, a command palette (Help › Search Commands…), middle-button panning with any tool. Native menus explicitly end tracking on command selection, outside window presses and Escape; menu updates wait until tracking ends, and a dismissing press never starts a canvas gesture (M14.8).
- A Recent Commands button beside the Help › Search Commands field lists the last five commands and tools picked from the palette, most recent first, with a command picked again moved to the top. Choosing a row closes the palette and runs it as a pick of the same result does; with no picks yet the list shows a dimmed No recent commands row, and a command that is not available now, such as a filter of a plug-in that is not loaded, is left out until it comes back. The ids are saved with the UI state. While the list is open, Up and Down move through its rows, wrapping at the ends, and Escape closes the list before the palette. This is VectorCraft's own addition and does not raise a score (#6376; `palette` tests `recent_commands_*`, `a_recent_command_runs_what_its_pick_runs`, `the_keys_wrap_within_recent_commands`, `escape_closes_recent_commands_before_the_palette`).
- Help › Search Commands… is the first item of the Help menu in the window, with its shortcut and a separator after it; in the native macOS menu bar it is the first item below the system's search field. This is VectorCraft's own order and does not raise a score (`menus::tests::help_starts_with_search_commands`, `tests::nativemenu::the_mac_help_menu_starts_with_search_commands`).
- The Learn panel (Window › Learn, or Explore tutorials beside the search icon on the app bar) has a For you tab with a Get started section and a Quick skill guide card, and a Skills tab that lists VectorCraft's own skills with their progress rings and counts of tutorials finished; a skill lists its tutorials, a tutorial shows its numbered steps, and Back goes up a level; `learn.list`, `learn.tab {tab}`, `learn.skill {skill}`, `learn.show {tutorial}` and `learn.back` script it, and the tab buttons, the rows and Back run them ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`).
- A tool's name in a Learn tutorial step is a blue link that shows where the tool is without choosing it (`learn.locateTool {tool}`): its toolbar button is marked, a collapsed group's flyout opens with the tool's row marked, a torn-off strip comes to the front, and a tool no shown toolbar holds is marked in the All Tools drawer. The mark, its 3 seconds and the hidden-toolbar cases are VectorCraft's own rules ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`, the `a_learn_link_*` tests in `toolbar::tests`).
- Under a tutorial's steps, View more opens the tutorial's own practice sample as a new untitled document, and once the tutorial is finished, Next Up moves to the next tutorial in the same skill, as the help page describes ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html)). The samples are VectorCraft's own drawings. A Finish tutorial button that shows once the sample is open, the untitled copy, Back to skills in place of Next Up after a skill's last tutorial, and Next Up showing the next tutorial without opening its sample are VectorCraft's own rules. `learn.openSample`, `learn.finish`, `learn.next` and `learn.skills` (Back to skills) script them. Not done: the help page's short video. Regression tests: `view_more_opens_the_tutorial_s_sample_as_a_new_untitled_document`, `finishing_a_tutorial_offers_next_up_in_its_skill`, `the_practice_controls_work_from_the_keyboard`, `the_last_tutorial_of_a_skill_offers_back_to_skills`, `learn_finish_and_learn_next_follow_the_practice`, `learn_skills_shows_the_list_of_skills`, `the_practice_commands_reject_a_missing_or_unknown_tutorial`, `every_tutorial_has_its_own_readable_sample` and `the_next_tutorial_is_the_next_one_in_the_same_skill` in `crates/ui-egui/src/panels/learn/tests.rs`.