This commit is contained in:
bflatastic committed 2026-11-18 13:37:11 +07:00
commit 17db0bf507
11 files changed
+1987 -106

No files matched your search

+5
View File
@@ -640,6 +640,11 @@ pub fn tr_ctx<'a>(lang: Lang, context: &str, s: &'a str) -> &'a str {
lang.catalog().contextual(context, s).unwrap_or_else(|| tr(lang, s))
}
/// The translation of `s` in `lang`'s `context` rows alone, or `None` when it has no such row.
pub fn tr_ctx_row(lang: Lang, context: &str, s: &str) -> Option<&'static str> {
lang.catalog().contextual(context, s)
}
/// A name the app gives something (a default swatch's), translated where the current language has
/// a `context` row for it; any other name (one the user gave) comes back as it is.
pub fn t_name<'a>(context: &str, name: &'a str) -> &'a str {
+15
View File
@@ -814,6 +814,21 @@ fn anti_aliasing_method_labels_are_in_complete_catalogs() {
}
}
/// Each row in the `search` context, which adds a language's words to a group of words with the same
/// meaning for the command palette, names a group and adds single words of no other group. No
/// catalog has to have these rows.
#[test]
fn search_rows_name_a_group_and_add_single_words() {
let mut bad = Vec::new();
for l in LANGUAGES.iter().filter(|l| !l.source.is_empty()) {
let (entries, _) = parse_entries(l.source);
for (_, src, tr) in entries.iter().filter(|(ctx, _, _)| ctx == crate::palette::words::CONTEXT) {
bad.extend(crate::palette::words::row_problems(src, tr).into_iter().map(|p| format!("{}: {p}", l.code)));
}
}
assert!(bad.is_empty(), "{bad:#?}");
}
/// The Painted and Sketched graphic style library's name and its styles' names have a row in every
/// bundled catalog.
#[test]
+1
View File
@@ -78,6 +78,7 @@ pub use run::{check_params, run_ui_command};
pub(crate) use run::{normalize_panel, opt_bool, opt_index, opt_number};
#[cfg(test)]
use slots::RECENT_FONT_IDS;
pub(crate) use state::why_off;
pub use state::{checked, enabled, plugin_revision, shortcut_of, shown_state};
pub(crate) use submenus::PATH_EFFECTS;
pub(crate) use tree::arrange_documents_items;
+21 -5
View File
@@ -202,22 +202,38 @@ pub(super) fn has_subject(app: &VectorcraftApp) -> bool {
/// Can command `id` run now? An engine command asks the engine, a UI command the app's state;
/// none that would act on text an input method is still composing.
pub fn enabled(app: &VectorcraftApp, id: &str) -> bool {
why_off(app, id).is_none()
}
/// Why command `id` can't run now ([`enabled`]): `None` while it can, else `Some` with the
/// engine's reason when the engine's check of an engine command fails. The engine's check runs at
/// most once.
pub(crate) fn why_off(app: &VectorcraftApp, id: &str) -> Option<Option<String>> {
if waits_for_ime(app, id) {
return false;
return Some(None);
}
if SUBJECT_COMMANDS.contains(&id) {
return has_subject(app);
return (!has_subject(app)).then_some(None);
}
// The Artboard tool's canvas menu measured this when it opened.
if id == "artboard.deleteEmpty"
&& let Some(facts) = crate::panels::artboards::open_menu_facts(app)
{
return facts.any_empty;
return (!facts.any_empty).then_some(None);
}
if let Some(c) = vectorcraft_engine::find_command(id) {
// The system clipboard's contents can be pasted with an empty internal clipboard.
return (c.enabled)(&app.session).is_ok() || app.system_paste && id.starts_with("edit.paste");
return match (c.enabled)(&app.session) {
Ok(()) => None,
// The system clipboard's contents can be pasted with an empty internal clipboard.
Err(_) if app.system_paste && id.starts_with("edit.paste") => None,
Err(why) => Some(Some(why)),
};
}
(!ui_enabled(app, id)).then_some(None)
}
/// Can UI command `id` run now?
fn ui_enabled(app: &VectorcraftApp, id: &str) -> bool {
match id {
// Save is off for a clean document that already has its own file.
"file.save" => app.session.active().is_some_and(|d| d.path.is_none() || d.converted || d.is_dirty()),
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+125
View File
@@ -0,0 +1,125 @@
//! Words that mean the same thing when searching the command palette: VectorCraft's own groups,
//! written for this table. A query word in a group also finds results whose label or menu path
//! holds another word of its group ([`super::search`]).
//!
//! A word that is the whole label of a command stays out of a group whose other words name a
//! different command: Merge is the label of Pathfinder and Live Paint commands that are not Unite,
//! and Mirror is the label of a repeat that is not Reflect…, so these are in no group. Insert is left
//! out too, since it starts the labels of type commands that are not Place…. A word that only starts
//! or ends other labels can be in a group, and a search for another word of its group also lists
//! those labels: "unite" lists Combine Slices after Unite, and "delete" lists Clear Guides. Plural and
//! verb forms that the search's English stem forms already join (round and rounded) are not groups.
//!
//! A catalog may add a group's words in its language with a row in the `search` context: the group's
//! English words joined by ", ", then that language's words joined by ", ". The words join the group
//! while that language is the UI language. No catalog has to have these rows. The search splits
//! labels into words only at spaces and punctuation, so in a language written without spaces a row's
//! word finds only a label that is that word alone.
/// The groups: lowercase single English words, at most `MAX_WORDS` in a group and `MAX_GROUPS`
/// groups, no word longer than [`MAX_CHARS`] characters and no word in two groups.
pub(crate) const GROUPS: &[&[&str]] = &[
&["remove", "delete", "erase", "clear"],
&["background", "bg"],
&["image", "picture", "photo", "img", "bitmap"],
&["text", "type"],
&["reflect", "flip"],
&["unite", "combine"],
&["trace", "vectorize"],
&["color", "colour"],
&["gray", "grey"],
&["grayscale", "greyscale"],
&["center", "centre"],
&["duplicate", "clone"],
&["zoom", "magnify"],
&["rotate", "turn", "spin"],
&["scale", "resize"],
&["opacity", "transparency"],
&["font", "typeface"],
&["preferences", "settings", "prefs"],
&["artboard", "canvas"],
&["swatch", "palette"],
&["eyedropper", "dropper"],
];
/// The most groups [`GROUPS`] may hold.
#[cfg(test)]
const MAX_GROUPS: usize = 60;
/// The most words a group may hold.
#[cfg(test)]
const MAX_WORDS: usize = 6;
/// The most characters a word may have.
pub(crate) const MAX_CHARS: usize = 20;
/// The context of a catalog row that adds a group's words in its language.
pub(crate) const CONTEXT: &str = "search";
/// The source text of group `group`'s row in a catalog: its words joined by ", ".
pub(crate) fn row_key(group: &[&str]) -> String {
group.join(", ")
}
/// The words of a catalog row's translation `text`, each trimmed and lowercased with its runs of
/// whitespace made one space, and whether each is a single word of at most [`MAX_CHARS`]
/// characters that the search can look up.
pub(crate) fn row_words(text: &str) -> impl Iterator<Item = (String, bool)> + '_ {
text.split(',').map(|w| {
let w = super::search::normalize(w);
let single = !w.is_empty() && w.chars().count() <= MAX_CHARS && super::search::is_one_word(&w);
(w, single)
})
}
/// What is wrong with a catalog's `search` row for `source` translated as `text`: a source that is
/// no group's [`row_key`], an empty word, a word that is not a single word, or a word that is a word
/// of another group.
#[cfg(test)]
pub(crate) fn row_problems(source: &str, text: &str) -> Vec<String> {
let Some(group) = GROUPS.iter().position(|g| row_key(g) == source) else {
return vec![format!("{source:?} is not a group")];
};
let mut problems = vec![];
for (w, single) in row_words(text) {
if w.is_empty() {
problems.push(format!("{source:?}: an empty word"));
} else if !single {
problems.push(format!("{source:?}: {w:?} is not a single word"));
} else if let Some(other) = GROUPS.iter().enumerate().find(|&(i, g)| i != group && g.contains(&w.as_str())) {
problems.push(format!("{source:?}: {w:?} is a word of {:?}", row_key(other.1)));
}
}
problems
}
#[cfg(test)]
mod tests {
use super::*;
/// The table keeps to its limits: groups, words per group, characters per word, and each word
/// lowercase, a single word and in one group only.
#[test]
fn the_groups_keep_to_their_limits() {
assert!(GROUPS.len() <= MAX_GROUPS, "{} groups", GROUPS.len());
let mut seen = std::collections::HashSet::new();
for group in GROUPS {
assert!((2..=MAX_WORDS).contains(&group.len()), "{group:?}");
for &w in *group {
assert!(w.chars().count() <= MAX_CHARS, "{w}");
assert_eq!(super::super::search::normalize(w), w, "{w} is lowercase");
assert!(super::super::search::is_one_word(w), "{w} is one word");
assert!(seen.insert(w), "{w} is in two groups");
}
}
}
/// A catalog row passes when it names a group and adds single words of no other group, and fails
/// otherwise.
#[test]
fn catalog_rows_are_checked() {
assert!(row_problems("remove, delete, erase, clear", "entfernen, löschen").is_empty());
assert_eq!(row_problems("remove, delete", "entfernen").len(), 1, "not a group's words");
assert_eq!(row_problems("remove, delete, erase, clear", "entfernen,, löschen").len(), 1, "an empty word");
assert_eq!(row_problems("remove, delete, erase, clear", "ganz entfernen").len(), 1, "two words");
assert_eq!(row_problems("remove, delete, erase, clear", "Text").len(), 1, "a word of another group once lowercased");
}
}
+51 -16
View File
@@ -935,17 +935,27 @@ pub(crate) fn menu_target(id: &str) -> Option<(String, Value)> {
/// status line ([`dimmed`]), as for Remove Background… with no image selected.
pub(crate) fn menu_target_now(app: &VectorcraftApp, id: &str) -> Option<Result<(String, Value), String>> {
let target = menu_target(id)?;
Some(if menus::enabled(app, id) { Ok(target) } else { dimmed(app, id) })
Some(match dimmed(app, id, id) {
None => Ok(target),
Some(why) => Err(why),
})
}
/// What [`menu_target_now`] gives for command `id` while its menu bar item is dimmed: the status
/// line, with the engine's reason when it gives one. The app's own rules ([`menus::enabled`]) dim
/// UI commands, and some commands the engine would run, without giving a reason.
pub(crate) fn dimmed(app: &VectorcraftApp, id: &str) -> Result<(String, Value), String> {
let Some(why) = vectorcraft_engine::find_command(id).and_then(|c| (c.enabled)(&app.session).err()) else {
return Err(format!("command `{id}` is not available right now"));
/// What [`menu_target_now`] gives for command `id` while its menu bar item is dimmed, or `None`
/// while the item is not dimmed: the status line, which calls the command `name` (its id on the
/// status line), with the engine's reason when it gives one. The app's own rules
/// ([`menus::enabled`]) dim UI commands, and some commands the engine would run, without giving a
/// reason. The engine's check runs at most once.
pub(crate) fn dimmed(app: &VectorcraftApp, id: &str, name: &str) -> Option<String> {
let why = match menus::why_off(app, id)? {
Some(why) => Some(why),
// Dimmed before the engine was asked (no Appearance subject, an input method composing).
None => vectorcraft_engine::find_command(id).and_then(|c| (c.enabled)(&app.session).err()),
};
Err(vectorcraft_engine::EngineError::Disabled(id.to_string(), why).to_string())
Some(match why {
Some(why) => vectorcraft_engine::EngineError::Disabled(name.to_string(), why).to_string(),
None => format!("command `{name}` is not available right now"),
})
}
/// Is `key` a command with no default shortcut that a key press can't run: no item of the menu
@@ -1017,14 +1027,10 @@ fn names_a_required_field(params: &str) -> bool {
!(f.is_empty() || f.starts_with('…') || f[end..].starts_with('=') || f[..end].split('|').all(|n| n.trim().ends_with('?')))
};
let Some(rest) = params.strip_prefix('{') else { return false };
let (mut depth, mut quoted, mut start) = (0usize, false, 0);
for (i, ch) in rest.char_indices() {
let mut start = 0;
for (i, ch, depth) in outside_quotes(rest) {
match ch {
'"' => quoted = !quoted,
_ if quoted => {}
'{' | '[' | '(' => depth += 1,
'}' if depth == 0 => return required(&rest[start..i]),
'}' | ']' | ')' => depth = depth.saturating_sub(1),
',' if depth == 0 => {
if required(&rest[start..i]) {
return true;
@@ -1037,6 +1043,29 @@ fn names_a_required_field(params: &str) -> bool {
false
}
/// Each character of `text` that is not a double quote or inside a pair of them, with its byte
/// offset and the number of `{`, `[` and `(` groups open before it. A closing `}`, `]` or `)` comes
/// with a count that includes the group it closes, and one with no group open counts none.
pub(crate) fn outside_quotes(text: &str) -> impl Iterator<Item = (usize, char, usize)> + '_ {
let (mut depth, mut quoted) = (0usize, false);
text.char_indices().filter_map(move |(i, ch)| {
if ch == '"' {
quoted = !quoted;
return None;
}
if quoted {
return None;
}
let before = depth;
match ch {
'{' | '[' | '(' => depth += 1,
'}' | ']' | ')' => depth = depth.saturating_sub(1),
_ => {}
}
Some((i, ch, before))
})
}
pub fn entry(key: &str) -> Option<Entry> {
entries().iter().find(|e| e.key == key).cloned()
}
@@ -2966,13 +2995,19 @@ mod tests {
use vectorcraft_testkit::fixtures::Fixture;
let none = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
assert!(!menus::enabled(&none, "edit.findReplace"));
assert_eq!(dimmed(&none, "edit.findReplace"), Err("command `edit.findReplace` is not available right now: no document open".into()));
let why = "command `edit.findReplace` is not available right now: no document open";
assert_eq!(dimmed(&none, "edit.findReplace", "edit.findReplace").as_deref(), Some(why));
// A name to show takes the id's place.
let shown = "command `Edit › Find and Replace…` is not available right now: no document open";
assert_eq!(dimmed(&none, "edit.findReplace", "Edit › Find and Replace…").as_deref(), Some(shown));
let empty = VectorcraftApp::new(Fixture::Empty.session(), crate::Services::default());
for id in ["appearance.addFill", "ui.cropImage"] {
assert!(!menus::enabled(&empty, id), "{id}");
assert!(vectorcraft_engine::find_command(id).is_none_or(|c| (c.enabled)(&empty.session).is_ok()), "{id}: the engine gives no reason");
assert_eq!(dimmed(&empty, id), Err(format!("command `{id}` is not available right now")));
assert_eq!(dimmed(&empty, id, id), Some(format!("command `{id}` is not available right now")));
}
assert!(menus::enabled(&empty, "edit.findReplace"));
assert_eq!(dimmed(&empty, "edit.findReplace", "edit.findReplace"), None, "not dimmed");
}
/// Every command the editor lists, run as a key press runs it on a document with one or with
+2
View File
@@ -1893,6 +1893,8 @@ fn the_command_search_that_opens_while_enter_is_down_waits_for_a_new_press() {
let held = HeldKey::new(Key::Enter, Modifiers::NONE);
app.select_tool("rectangle");
held.press(&mut app);
// The empty search lists the recent picks, so the last pick is the highlighted result.
app.ui.recent_commands = vec!["paint.swap".into()];
app.ui.palette_open = true;
for repeat in 0..4 {
held.press(&mut app);
+5
View File
@@ -711,6 +711,10 @@ pub struct UiState {
/// Help › Search Commands' Recent Commands list: the ids of the last picks, most recent first.
#[serde(default)]
pub recent_commands: Vec<String>,
/// How many times each command was picked in Help › Search Commands, which ranks the commands
/// picked most often first among results that match as well.
#[serde(default, deserialize_with = "crate::palette::deserialize_command_uses")]
pub command_uses: crate::palette::CommandUses,
/// Families starred in the font menus (the ★ filter shows only these).
#[serde(default)]
pub favorite_fonts: Vec<String>,
@@ -1269,6 +1273,7 @@ impl Default for UiState {
recent_files: vec![],
recent_fonts: vec![],
recent_commands: vec![],
command_uses: Default::default(),
favorite_fonts: vec![],
engine_prefs: Value::Null,
color_guide: Default::default(),
+7
View File
@@ -1094,6 +1094,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`).
- With Smart Guides › Transform Tools on, a Free Transform shear (Cmd/Ctrl on a side handle) shows its angle next to the pointer, as the Shear tool does, and a handle drag that turns from a scale into a shear and back shows only the current operation's value ([the help page](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/smart-guides-options.html)). The angle's sign and its one decimal place are VectorCraft's own rule, the same as the Shear tool's label (tools `xform::free::tests::shear_drag_shows_its_angle_with_transform_tools_guides`, `a_handle_drag_that_changes_operation_relabels_it`).
- 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).
- With an empty search, or one of spaces only, the Command Palette lists the picks of the Recent Commands list under a Recent Commands heading, most recent first, with the first highlighted and no result count, so opening the palette and pressing Enter runs the last pick again. With no picks yet it lists no results and shows a dimmed No recent commands line. The palette opens with its first result highlighted and its list scrolled to the top. This is VectorCraft's own behavior (`palette` tests `an_empty_search_lists_the_recent_picks_most_recent_first`, `an_empty_search_without_picks_says_there_are_none`, `enter_on_an_empty_search_runs_the_last_pick_again`, `the_palette_opens_again_with_its_first_row_highlighted`).
- 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`).
- A Recent Commands button beside the Help › Search Commands field lists the last five commands, tools, panels and effects 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`).
- The app bar's search control is a field showing a magnifier, "Search commands" and the Help › Search Commands… shortcut. The field shows no shortcut when the shortcut is cleared or too long to fit beside the text; the tooltip and the screen-reader name still give it. A click on the field, or Enter or Space while it has the keyboard focus, toggles the command palette as the shortcut does, and the palette's popup holds the text field. While the field has the focus, the app's existing rule for a focused control keeps the app's own keys off, so Enter does not open Move and Tab moves the focus on. While a dialog is open the field and the icon are drawn disabled and do nothing, as the shortcut does. Screen readers name the field and the icon Search commands, with the shortcut. As the bar narrows, the community button goes first, then Explore tutorials, then the field becomes the magnifier icon, then the workspace switcher narrows to 64 points, then the icon goes; Safe Mode's label keeps its room first. The field is wider than the icon, so the community button and Explore tutorials go at wider bars than they did beside the icon. This is VectorCraft's own addition and does not raise a score (`chrome::tests`: `the_app_bar_gives_up_its_right_hand_controls_in_order`, `a_wide_app_bar_shows_a_search_field_with_the_palette_shortcut`, `the_search_field_follows_the_palettes_shortcut`, `a_long_shortcut_leaves_the_search_hint_readable`, `a_click_on_the_search_field_opens_the_palette`, `the_search_icon_has_the_fields_name_and_both_are_disabled_under_a_dialog`, `the_keyboard_opens_the_palette_from_the_search_field`, `a_narrowing_app_bar_turns_the_search_field_into_the_icon`).
@@ -1450,6 +1451,12 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
A modal window that opens without a press in the window (a dialog opened from the macOS menu bar or by an automation command, the About window, a file dialog, the update prompt, or the progress window of a plug-in, trace or open run) closes the Command Palette, a tool group's flyout, the All Tools drawer and any open menu or popup in the pass it opens. While such a window is open, the palette stays closed, so opening it from the macOS menu bar or by an automation command does not take the keyboard from the window; it opens again once the window closes (`palette` tests `a_dialog_opened_from_the_system_menu_closes_the_palette`, `the_about_window_closes_the_palette`, `a_progress_window_closes_the_palette`, `the_palette_opened_over_a_dialog_closes`, `a_click_on_the_menu_bar_closes_the_palette_before_a_dialog_opens`, `a_dialog_opened_without_a_press_closes_a_flyout`, `a_dialog_opened_without_a_press_closes_the_tools_drawer`, `a_dialog_opened_without_a_press_closes_a_menu`, `the_palette_opened_as_a_dialog_closes_stays_open_until_the_next_dialog`).
The Command Palette ranks its results by how well they match. A query that is a result's id lists that result first (`view.goto1` lists Saved View 1 above Saved View 10); then come results whose name is the query, results whose name without its menu path starts with it, and results whose initials it is ("ea" finds Export As…). Within each of those, a result where every word of the query is a whole word of its name ranks above one where a word only starts a word of the name, then one where it is a word of the menu that holds it, then of its id, then text inside a word, so a query that is a menu's title ("object") lists results named with that word above the items of that menu. A tool ranks above a menu command, panel, effect or filter plug-in that matches as well, so "rect" lists the Rectangle Tool above Effect › Convert to Shape › Rectangle…, and of two results of the same kind the shorter name comes first. Words of the menu bar item that runs a result also find it, the item's own label included ("exit" finds Quit VectorCraft, which File › Exit runs); with the native macOS menu bar, the items that bar moves into its application menu are found under it (Preferences… under Settings). Every result the earlier search found is still found, and the highlight stays on its result when a plug-in is installed, a shortcut changes or the language changes while the palette is open (`palette::search` tests `a_better_word_grade_ranks_first`, `a_better_whole_query_tier_ranks_first`, `kind_and_length_never_lift_a_worse_grade`, `a_menu_title_does_not_lift_its_items`, `common_queries_list_the_command_near_the_top`, `every_result_is_found_first_by_its_name_and_its_id`, `every_result_found_before_is_still_found_and_shown`, `results_know_their_place_in_the_menu_bar`, `native_homes_follow_the_native_application_menu`; `palette` test `the_highlight_stays_on_its_result_when_the_results_change`).
A Command Palette query word in an English plural or verb form finds a result whose English name or menu path holds the base word: "rounded corners" lists Effect › Stylize › Round Corners… first, and "scaling" finds Object › Transform › Scale…. The search drops `'s`; `es` after `s`, `x`, `z`, `ch` or `sh` (also trying the word with only its `s` dropped, so "rasterizes" finds Rasterize…); a final `s` in words of more than 3 letters, except after `ss`, `us` or `is`; `ing` in words of more than 5 letters and `ed` in words of more than 4. After `ing` or `ed`, a doubled `b`, `d`, `g`, `m`, `n`, `p`, `r` or `t` is tried both single and doubled, the single letter only when at least 3 letters are left ("cutting" meets Cut, "added" meets Add); otherwise the word is also tried with an `e` ("scaling" meets Scale…). It turns `ies` into `y` or `ie` in words of more than 5 letters and `sses` into `ss`, and leaves `series` and `species` as they are. Among results that the whole query matches the same way (as an id, as a label, at the start of a label, as initials, or none of these), a result whose name holds the base word of a query word ranks below one that holds the query word whole and above one where the query word only starts a word of the name, so "scale zz" lists a name with "Zz Scaling" above one with "Zz Scalers". "scale" alone still lists "Scalers" above "Scaling", because "Scalers" starts with the query. A partly typed word that is not itself a word of any result ("scal") does not meet a base word. Names shown in other languages and ids are not changed this way, and every result found before is still found (`palette::search` tests `plurals_and_verb_forms_meet_their_base_word`, `a_plural_or_verb_form_finds_the_result`, `a_better_word_grade_ranks_first`, `a_partly_typed_word_does_not_lift_a_verb_form`, `a_whole_query_tier_comes_before_a_stem_form`, `results_matched_without_a_stem_keep_their_order`).
A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches without one, and among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`).
A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`).
The Command Palette ranks the commands listed in Recent Commands first among the results that match a query as well as they do and were picked as often (see the pick counts below), the most recent first, and below every result that matches it better: after a pick of Effect › Convert to Shape › Rectangle…, "rect" lists it above the Rectangle Tool, so Enter runs it again. A recent pick ranks after the whole-query match, the word grades, the matches through a typo, a description or a word with the same meaning, and the pick count's grade, and before the kind of result and the name's length. The ranking uses the list Recent Commands shows, which also holds a pick whose command could not run. This is VectorCraft's own behavior (`palette::search` test `a_recent_pick_ranks_first_within_its_grades`; `palette` tests `a_recent_pick_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_recent_picks`).
The Command Palette also counts how many times each command is picked and ranks the commands picked most often first among the results that match a query as well as they do, also after they leave Recent Commands, and below every result that matches it better. Counts are compared in grades that double: grade 1 starts at 1 pick, grade 2 at 3, grade 3 at 7, and so on up to grade 9, and a command picked once ranks above the commands never picked. The grade ranks after the word grades and the typo, description and same-meaning matches, and before the place among the recent picks. The count is kept for at most 200 commands: a new command then removes the one with the fewest picks, of those the one picked longest ago. When a count reaches 1,000, every count is halved and commands left at 0 are dropped. The counts are saved with the other interface settings (`command_uses` in `ui.json`); a count above 999 loads as 999 and an unreadable entry is dropped. The web build keeps them for the session. This is VectorCraft's own behavior (`palette::search` test `a_command_picked_often_ranks_first_within_its_grades`; `palette` tests `a_command_picked_often_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_pick_counts`, `a_count_does_not_pass_a_better_match`, `pick_counts_rank_in_grades_that_double`, `the_201st_command_removes_the_least_used_and_keeps_itself`, `counts_are_halved_at_one_thousand`, `saved_pick_counts_load_what_is_readable`).
A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`).
A Command Palette result that cannot run now stays in its place in the list and is drawn dimmed: an engine command whose engine check fails (Ungroup with nothing selected, Paste with an empty clipboard and nothing to paste from the system clipboard), a UI command the menus dim, a filter plug-in or an effect whose menu item is dimmed, and a panel in Presentation Mode. Tools are never dimmed. The reason shows on hover, in the row's screen-reader description, on a second line of the search field's screen-reader description and in the footer while the row is highlighted, beside the count or, under the recent picks of an empty search, on a line of its own. The reason is the status line a pick of the dimmed menu item gives, with the result's name in place of the command's id: "command `Object › Ungroup` is not available right now: nothing selected", or without the engine's reason when it gives none. The Recent Commands list beside the search field draws such a pick dimmed too, with the same reason on hover and for screen readers. Only the drawn rows are checked, each once for as long as the state it was checked in lasts: a command run, an edit, a change of selection, document, history, clipboard, language, screen mode or open dialog, a save that marks the document saved, or a background save, export, file read, plug-in run or trace that starts, ends or shows its progress window checks them again on the next frame, and a frame with a click checks them again on that frame only. Typing in the search field does not check them again, and the palette checks them again each time it opens. The check never changes the ranking. A pick of a dimmed result does what it did before (`palette` tests `a_result_that_cannot_run_now_is_dimmed_and_says_why`, `hovering_a_result_that_cannot_run_now_says_why`, `paste_is_dimmed_only_while_nothing_can_be_pasted`, `tools_are_never_dimmed_and_panels_are_in_presentation_mode`, `a_result_without_an_engine_reason_says_it_is_not_available`, `no_reason_shows_a_command_id`, `a_recent_pick_that_cannot_run_now_says_why`, `a_recent_command_that_cannot_run_now_is_dimmed_in_the_list`, `availability_is_asked_again_when_what_it_depends_on_changes`, `availability_is_read_once_per_state`, `the_palette_asks_again_when_it_opens_again`).
`object.setProps` with `visible: false` or `locked: true` deselects every selected object that is then hidden or locked, the key object included, as the eye and lock columns do.
Ctrl/Cmd+Alt-clicking an eye switches the other layers to Outline and the row's layer to Preview, or switches all layers back to Preview when the others are in Outline (`layer.outlineOthers`, `layer.previewAll`).
Ctrl/Cmd+Alt-clicking New Layer adds a layer directly below the current layer, at its level (`layer.new {below: true}`), and Ctrl/Cmd+Alt-clicking New Sublayer adds a sublayer under the contents of the layer it goes into (`layer.newSublayer {bottom: true}`), each in one undo step. The reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists these clicks for placing a layer below the selected layer and a new sublayer at the bottom of the layer list.