From 2e639f150a8f770636bf3baafc1f32f64490b032 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 21:56:34 -0800 Subject: [PATCH 01/22] =?UTF-8?q?Help:=20Search=20Commands=E2=80=A6=20is?= =?UTF-8?q?=20the=20first=20Help=20menu=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- crates/ui-egui/src/menus/tests.rs | 26 ++++++++++++++++++++++++++ crates/ui-egui/src/menus/tree.rs | 3 ++- crates/ui-egui/src/tests/nativemenu.rs | 13 +++++++++++++ docs/target-app-parity.md | 1 + 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index 1bb152292e..3e2673a651 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -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::(), 1); +} + /// No application menu in the window (as in Illustrator): the bar starts at File. #[test] fn the_bar_starts_at_file() { diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index ec8ec99018..617d0d403e 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -738,12 +738,13 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec)> { ( "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"), diff --git a/crates/ui-egui/src/tests/nativemenu.rs b/crates/ui-egui/src/tests/nativemenu.rs index 689ae8a60c..12b106ee88 100644 --- a/crates/ui-egui/src/tests/nativemenu.rs +++ b/crates/ui-egui/src/tests/nativemenu.rs @@ -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] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index cc4082ad68..c2d645cc61 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -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`. From e68aa17f0a838373f40b63a32391fbc4ae798c47 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 22:46:00 -0800 Subject: [PATCH 02/22] App bar: a search field in place of the search icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The magnifier at the right of the app bar becomes a field showing the magnifier, "Search commands" and the Help › Search Commands… shortcut, or no shortcut when it is cleared or too long to fit. A click on it, or Enter or Space with the keyboard focus on it, toggles the command palette as the shortcut does, and the palette's popup holds the text field. While a dialog is open the field and the icon do nothing, as the shortcut does; the icon used to open the palette over a dialog. Screen readers name the field "Search commands" with the shortcut, and its tooltip stays "Search commands and tools". As the bar narrows, the community button goes first, then Explore tutorials, then the field becomes the 28-point icon, then the workspace switcher narrows to 64 points, then the icon goes. Safe Mode's label keeps its room first. The order is the same as before, with the field's collapse to the icon as a new step after Explore tutorials goes. --- crates/ui-egui/src/chrome.rs | 183 +++++++++-- crates/ui-egui/src/chrome/tests.rs | 381 +++++++++++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/panels/learn/tests.rs | 6 +- docs/development.md | 2 +- docs/mcp.md | 2 +- docs/target-app-parity.md | 3 +- 34 files changed, 574 insertions(+), 31 deletions(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index 7e48fc244e..d10d320ad9 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -82,10 +82,8 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { ui.add_space(2.0); // With the macOS menu bar the menus are at the top of the screen instead. let menus_end = if app.services.native_menu.is_some() { ui.cursor().min.x } else { menus::menu_bar(app, ui) }; - // The right-side group fills the space after the menus from the right; when it runs - // short, Discord goes first (it is also under Help), then Explore tutorials (also - // Window › Learn), then the search icon (the palette stays under its shortcut), then - // the workspace switcher narrows. + // The right-side group fills the space after the menus from the right, in the order + // [`fit_right_group`] gives. let full = ui.max_rect(); let right_edge = if captions_right > 0.0 { full.right() - captions_right - 10.0 } else { full.right() }; let right = egui::Rect::from_min_max(egui::pos2(menus_end + 8.0, full.top()), egui::pos2(right_edge, full.bottom())); @@ -97,21 +95,22 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { let text = ui.painter().layout_no_wrap(label.text().to_string(), egui::FontId::proportional(12.0), t.warning); text.size().x + 2.0 * ui.spacing().button_padding.x + 8.0 + ui.spacing().item_spacing.x }); - let room = (right.width() - safe_w).max(0.0); - let switcher = safe.is_none() || room >= 64.0 + 8.0; // Built-in workspace names translate; the user's own stay as typed. let ws_name = if crate::workspaces::is_builtin(&app.ui.workspace) { tl!(&app.ui.workspace).to_string() } else { app.ui.workspace.clone() }; let ws = ui.painter().layout_no_wrap(ws_name, egui::FontId::proportional(12.0), t.text); - let ws_w = (ws.size().x + 36.0).clamp(112.0, 190.0); - let gap = ui.spacing().item_spacing.x; - // The search icon, as in PhotoCraft: shown while a minimal switcher fits beside it. - let icon = 28.0; - let search = switcher && room >= 64.0 + 8.0 + gap + icon; - let ws_w = ws_w.min(room - 8.0 - gap - if search { icon } else { 0.0 }).max(64.0); - // Explore tutorials, beside the search icon, opens the Learn panel. - let learn = search && room >= ws_w + 8.0 + 2.0 * (gap + icon); - let discord = learn && room >= ws_w + 8.0 + 2.0 * (gap + icon) + 10.0 + gap + crate::community::discord_width(ui, false); + let shortcut = menus::shortcut_of("help.commandPalette").map(menus::shown_shortcut); + let field = SearchField::new(ui, &t, shortcut); + let fit = fit_right_group(&RightWidths { + room: (right.width() - safe_w).max(0.0), + safe_mode: safe.is_some(), + switcher: (ws.size().x + 36.0).clamp(112.0, 190.0), + field: field.width, + icon: BAR_ICON, + gap: ui.spacing().item_spacing.x, + discord: crate::community::discord_width(ui, false), + }); + let (switcher, ws_w, learn, discord) = (fit.switcher, fit.switcher_w, fit.learn, fit.discord); let mut rui = ui.new_child(egui::UiBuilder::new().max_rect(right).layout(egui::Layout::right_to_left(egui::Align::Center))); let ui = &mut rui; // Workspace switcher: shows the current workspace, opens Window → Workspace. @@ -131,19 +130,26 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { ui.add_space(8.0); } // Search → command palette (its shortcut opens it too). - if search { - let tip = match menus::shortcut_of("help.commandPalette") { - Some(sc) => format!("{} ({})", tl!("Search commands and tools"), menus::shown_shortcut(sc)), - None => tl!("Search commands and tools").to_string(), - }; - if widgets::icon_button(ui, "search", &tip, app.ui.palette_open, icon).clicked() { - app.ui.palette_open = !app.ui.palette_open; - app.ui.palette_query.clear(); - } + let with_shortcut = |text: &str| match &field.shortcut { + Some(sc) => format!("{text} ({sc})"), + None => text.to_string(), + }; + let tip = with_shortcut(tl!("Search commands and tools")); + let name = with_shortcut(tl!("Search commands")); + let clicked = match fit.search { + Search::Field => field.show(ui, &t, &name, &tip, app.ui.palette_open).clicked(), + Search::Icon => widgets::icon_button(ui, "search", &tip, app.ui.palette_open, BAR_ICON).clicked(), + Search::Hidden => false, + }; + // The field and the icon toggle the palette as its shortcut does, and like the shortcut + // they do nothing while a dialog is open. + if clicked && app.ui.dialog.is_none() { + app.ui.palette_open = !app.ui.palette_open; + app.ui.palette_query.clear(); } if learn { let shown = crate::panels::learn::visible(&app.ui); - if widgets::icon_button(ui, "graduation-cap", tl!("Explore tutorials"), shown, icon).clicked() + if widgets::icon_button(ui, "graduation-cap", tl!("Explore tutorials"), shown, BAR_ICON).clicked() && let Err(e) = app.run("window.learn", json!({})) { app.ui.status = e; @@ -168,6 +174,133 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { } } +/// The side of the app bar's square icon buttons (the search icon, Explore tutorials). +const BAR_ICON: f32 = 28.0; +/// The narrowest the workspace switcher gets. +const MIN_SWITCHER: f32 = 64.0; + +/// How the app bar shows the search that opens the command palette. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum Search { + /// A field with the magnifier, "Search commands" and the palette's shortcut. + Field, + /// The magnifier alone. + Icon, + /// Not in the bar; the palette stays under its shortcut and Help › Search Commands…. + Hidden, +} + +/// The widths [`fit_right_group`] fits into `room`, in points. +#[derive(Clone, Copy, Debug)] +struct RightWidths { + /// The room after the menus, less the Safe Mode label's. + room: f32, + safe_mode: bool, + /// The workspace switcher's full width. + switcher: f32, + /// The search field's width. + field: f32, + icon: f32, + gap: f32, + discord: f32, +} + +/// What the right-hand group of the app bar shows. +#[derive(Clone, Copy, Debug, PartialEq)] +struct RightGroup { + switcher: bool, + switcher_w: f32, + search: Search, + learn: bool, + discord: bool, +} + +/// The right-hand group for the room it has. As the room runs short, the community button goes first +/// (it is also under Help), then Explore tutorials (also Window › Learn), then the search field becomes the +/// search icon, then the workspace switcher narrows to [`MIN_SWITCHER`], then the icon goes. In Safe +/// Mode the label's width is taken first, and the switcher (also under Window › Workspace) goes when +/// a minimal one does not fit. +fn fit_right_group(w: &RightWidths) -> RightGroup { + let room = w.room; + let switcher = !w.safe_mode || room >= MIN_SWITCHER + 8.0; + let icon = switcher && room >= MIN_SWITCHER + 8.0 + w.gap + w.icon; + let field = icon && room >= w.switcher + 8.0 + w.gap + w.field; + let search = if field { + Search::Field + } else if icon { + Search::Icon + } else { + Search::Hidden + }; + let search_w = match search { + Search::Field => w.gap + w.field, + Search::Icon => w.gap + w.icon, + Search::Hidden => 0.0, + }; + let switcher_w = w.switcher.min(room - 8.0 - search_w).max(MIN_SWITCHER); + let learn_end = switcher_w + 8.0 + search_w + w.gap + w.icon; + let learn = field && room >= learn_end; + let discord = learn && room >= learn_end + 10.0 + w.gap + w.discord; + RightGroup { switcher, switcher_w, search, learn, discord } +} + +/// The app bar's search field: a button drawn as a field. The command palette's popup holds the +/// only text field. +struct SearchField { + hint: Arc, + /// The palette's shortcut as the menus show it; none when the user cleared it. + shortcut: Option, + key: Option>, + width: f32, +} + +impl SearchField { + /// Space from the field's left edge to the hint text (the magnifier sits in it). + const TEXT_LEFT: f32 = 26.0; + /// The widest the field gets. + const MAX_WIDTH: f32 = 220.0; + + fn new(ui: &Ui, t: &Tokens, shortcut: Option) -> SearchField { + let hint = ui.painter().layout_no_wrap(tl!("Search commands").to_string(), egui::FontId::proportional(12.0), t.text_dim); + let text_w = Self::TEXT_LEFT + hint.size().x + 8.0; + // A shortcut that leaves no room for the hint in the widest field is left to the tooltip. + let key = shortcut + .as_ref() + .map(|s| ui.painter().layout_no_wrap(s.clone(), egui::FontId::proportional(11.0), t.text_dim)) + .filter(|k| text_w + 12.0 + k.size().x <= Self::MAX_WIDTH); + let key_w = key.as_ref().map_or(0.0, |k| 12.0 + k.size().x); + let width = (text_w + key_w + 24.0).clamp(120.0, Self::MAX_WIDTH); + SearchField { hint, shortcut, key, width } + } + + /// Draws the field. A click, or Enter or Space with the keyboard on it, clicks it. Screen + /// readers get a button called `name`, and hovering it shows `tip`. + fn show(self, ui: &mut Ui, t: &Tokens, name: &str, tip: &str, open: bool) -> egui::Response { + let (r, resp) = ui.allocate_exact_size(vec2(self.width, WIDGET_H), Sense::click()); + let fill = if open { + t.tool_active + } else if resp.hovered() { + t.hover + } else { + t.input + }; + let border = if resp.has_focus() { t.accent } else { t.input_border }; + ui.painter().rect(r, CornerRadius::same(4), fill, Stroke::new(1.0, border), egui::StrokeKind::Inside); + icons::paint(ui, "search", egui::Rect::from_center_size(r.left_center() + vec2(14.0, 0.0), vec2(14.0, 14.0)), t.icon); + let mut text_right = r.right() - 8.0; + if let Some(key) = self.key { + let at = egui::pos2(text_right - key.size().x, r.center().y - key.size().y / 2.0); + text_right = at.x - 12.0; + ui.painter().with_clip_rect(r).galley(at, key, t.text_dim); + } + let clip = egui::Rect::from_min_max(r.min, egui::pos2(text_right.max(r.left()), r.bottom())); + let at = egui::pos2(r.left() + Self::TEXT_LEFT, r.center().y - self.hint.size().y / 2.0); + ui.painter().with_clip_rect(clip).galley(at, self.hint, t.text_dim); + resp.widget_info(|| widgets::icon_button_info(ui.is_enabled(), open, name)); + resp.on_hover_text(tip) + } +} + /// Whether the window shows the system's title bar instead of the app drawing its own /// ([`VectorcraftApp::desktop_frame`]): Windows with Preferences › User Interface › System Title /// Bar, and Linux whenever the desktop draws the frame, with or without the preference. The diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index f1c63eafb4..f0ac33613b 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -159,6 +159,387 @@ fn hints_name_keys_as_the_menus_do() { } } +/// The widths of the app bar's right-hand group used by the fitting tests. +fn right_widths(room: f32, safe_mode: bool) -> super::RightWidths { + super::RightWidths { room, safe_mode, switcher: 150.0, field: 170.0, icon: 28.0, gap: 8.0, discord: 80.0 } +} + +/// What the group shows, in words, with the switcher's width as full, narrower or minimal. +fn right_stage(g: &super::RightGroup) -> String { + let switcher = match g.switcher_w { + _ if !g.switcher => "no switcher", + w if w >= 150.0 => "full switcher", + w if w > super::MIN_SWITCHER => "narrower switcher", + _ => "minimal switcher", + }; + format!("discord {}, learn {}, {:?}, {switcher}", g.discord, g.learn, g.search) +} + +/// As the app bar's room runs short, Discord goes first, then Explore tutorials, then the search +/// field becomes the icon, then the workspace switcher narrows to its minimum, then the icon goes. +/// Whatever shows fits in the room, down to the minimal switcher alone. +#[test] +fn the_app_bar_gives_up_its_right_hand_controls_in_order() { + let mut stages: Vec = Vec::new(); + for room in (0..=700).rev().map(|r| r as f32) { + let w = right_widths(room, false); + let g = super::fit_right_group(&w); + let stage = right_stage(&g); + if stages.last() != Some(&stage) { + stages.push(stage); + } + let search = match g.search { + super::Search::Field => w.gap + w.field, + super::Search::Icon => w.gap + w.icon, + super::Search::Hidden => 0.0, + }; + let learn = if g.learn { w.gap + w.icon } else { 0.0 }; + let discord = if g.discord { 10.0 + w.gap + w.discord } else { 0.0 }; + let used = g.switcher_w + 8.0 + search + learn + discord; + assert!(used <= room || g.switcher_w == super::MIN_SWITCHER && g.search == super::Search::Hidden, "{room}: {g:?} needs {used}"); + } + assert_eq!( + stages, + [ + "discord true, learn true, Field, full switcher", + "discord false, learn true, Field, full switcher", + "discord false, learn false, Field, full switcher", + "discord false, learn false, Icon, full switcher", + "discord false, learn false, Icon, narrower switcher", + "discord false, learn false, Icon, minimal switcher", + // Once the icon has gone, the switcher takes the room it leaves. + "discord false, learn false, Hidden, narrower switcher", + "discord false, learn false, Hidden, minimal switcher", + ] + ); + // In Safe Mode the label's width is taken first (not counted in `room`), and the switcher goes + // when a minimal one does not fit. + let safe = |room| right_stage(&super::fit_right_group(&right_widths(room, true))); + assert_eq!(safe(700.0), "discord true, learn true, Field, full switcher"); + assert_eq!(safe(72.0), "discord false, learn false, Hidden, minimal switcher"); + assert_eq!(safe(71.0), "discord false, learn false, Hidden, no switcher"); +} + +/// What screen readers call the app bar's search field, before its shortcut, and how the collapsed +/// icon's name starts. +const SEARCH_NAME: &str = "Search commands"; + +/// A native menu bar that draws nothing. +struct NoMenus; +impl crate::native_menu::Backend for NoMenus { + fn sync(&mut self, _: &crate::native_menu::MenuBar) {} + fn drain(&mut self) -> Vec { + Vec::new() + } +} + +/// The app bar drawn alone, `width` points wide. +struct AppBar { + app: crate::VectorcraftApp, + ctx: egui::Context, + width: f32, + /// Handle the app's keys before the bar and show the command palette after it, as the app's + /// frame does. Off, Tab moves the keyboard focus through the bar's controls, as with a screen + /// reader. + keys: bool, +} + +/// The app bar's search control, as a screen reader and the painter see it. +#[derive(Debug)] +struct SearchSeen { + name: String, + rect: egui::Rect, + texts: Vec, +} + +impl AppBar { + fn new(width: f32) -> AppBar { + crate::i18n::set_current(crate::i18n::Lang::EN); + let ctx = egui::Context::default(); + ctx.enable_accesskit(); + crate::theme::install_fonts(&ctx); + let app = crate::VectorcraftApp::new(Session::new(), Default::default()); + crate::shortcut_editor::sync(&app.ui); + AppBar { app, ctx, width, keys: false } + } + + /// One frame; the accessibility nodes and the texts painted, with where each is. + fn frame(&mut self, events: Vec) -> (Vec, Vec<(String, egui::Rect)>) { + fn walk(s: &egui::Shape, v: &mut Vec<(String, egui::Rect)>) { + match s { + egui::Shape::Text(t) => v.push((t.galley.text().to_string(), egui::Rect::from_min_size(t.pos, t.galley.size()))), + egui::Shape::Vec(s) => s.iter().for_each(|s| walk(s, v)), + _ => {} + } + } + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(self.width, 600.0)); + let (app, keys) = (&mut self.app, self.keys); + let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect: Some(screen), ..Default::default() }, |ui| { + if keys { + crate::shortcuts::handle(app, ui.ctx()); + } + super::app_bar(app, ui); + if keys { + crate::palette::show(app, ui.ctx()); + } + }); + out.textures_delta.clear(); + let mut texts = vec![]; + out.shapes.iter().for_each(|c| walk(&c.shape, &mut texts)); + (out.platform_output.accesskit_update.map(|u| u.nodes.into_iter().map(|(_, n)| n).collect()).unwrap_or_default(), texts) + } + + /// The search control after two frames, if the bar shows it. + fn search(&mut self) -> Option { + self.frame(vec![]); + let (nodes, texts) = self.frame(vec![]); + let node = nodes.iter().find(|n| n.label().is_some_and(|l| l.starts_with(SEARCH_NAME)))?; + let b = node.bounds()?; + let rect = egui::Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32)); + // Without the icon set loaded, a test frame draws an icon as a warning sign; leave it out. + let mut texts: Vec<(String, egui::Rect)> = + texts.into_iter().filter(|(t, r)| rect.expand(0.5).contains_rect(*r) && !t.starts_with('\u{26a0}')).collect(); + texts.sort_by(|a, b| a.1.left().total_cmp(&b.1.left())); + let texts = texts.into_iter().map(|(t, _)| t).collect(); + Some(SearchSeen { name: node.label().unwrap_or_default().to_string(), rect, texts }) + } + + /// Where the in-window menus end: the right edge of the Help menu's title, if the bar shows it. + fn menus_end(&mut self) -> Option { + self.frame(vec![]); + let nodes = self.frame(vec![]).0; + nodes.iter().filter(|n| n.label() == Some("Help")).filter_map(|n| n.bounds()).map(|b| b.x1 as f32).reduce(f32::max) + } + + fn has(&mut self, name: &str) -> bool { + self.frame(vec![]); + self.frame(vec![]).0.iter().any(|n| n.label() == Some(name)) + } + + fn click(&mut self, at: egui::Pos2) { + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + self.frame(vec![egui::Event::PointerMoved(at), press(true)]); + self.frame(vec![press(false)]); + } + + /// Whether the widget at `rect` has the keyboard focus. + fn focused_at(&self, rect: egui::Rect) -> bool { + self.ctx.memory(|m| m.focused()).and_then(|id| self.ctx.read_response(id)).is_some_and(|r| r.rect == rect) + } + + /// A press and release of `key`; Space also types a space, as a keyboard does. + fn key(&mut self, key: egui::Key) { + let event = |pressed| egui::Event::Key { key, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + let mut press = vec![event(true)]; + if key == egui::Key::Space { + press.push(egui::Event::Text(" ".into())); + } + self.frame(press); + self.frame(vec![event(false)]); + } +} + +/// A wide app bar shows a search field with the palette's shortcut in it, and screen readers get a +/// button named [`SEARCH_NAME`] with the shortcut. +#[test] +fn a_wide_app_bar_shows_a_search_field_with_the_palette_shortcut() { + let mut bar = AppBar::new(1400.0); + let shortcut = crate::menus::shown_shortcut("Cmd+Shift+/"); + let seen = bar.search().expect("the search field shows"); + assert_eq!(seen.name, format!("{SEARCH_NAME} ({shortcut})")); + assert!(seen.rect.width() >= 120.0 && seen.rect.width() <= 220.0, "a field, not the 28-point icon: {seen:?}"); + assert_eq!(seen.texts, [SEARCH_NAME.to_string(), shortcut], "{seen:?}"); + assert!(bar.has("Explore tutorials")); +} + +/// The field shows the palette's shortcut as the user set it, and no shortcut once it is cleared. +#[test] +fn the_search_field_follows_the_palettes_shortcut() { + let mut bar = AppBar::new(1400.0); + crate::keymap::set_override(&mut bar.app.ui.shortcut_overrides, "help.commandPalette", "Alt+F9"); + crate::shortcut_editor::sync(&bar.app.ui); + let rebound = crate::menus::shown_shortcut("Alt+F9"); + let seen = bar.search().expect("the search field shows"); + assert_eq!(seen.name, format!("{SEARCH_NAME} ({rebound})")); + assert_eq!(seen.texts, [SEARCH_NAME.to_string(), rebound], "{seen:?}"); + crate::keymap::set_override(&mut bar.app.ui.shortcut_overrides, "help.commandPalette", ""); + crate::shortcut_editor::sync(&bar.app.ui); + let seen = bar.search().expect("the search field shows"); + assert_eq!(seen.name, SEARCH_NAME); + assert_eq!(seen.texts, [SEARCH_NAME], "{seen:?}"); + bar.app.ui.shortcut_overrides.clear(); + crate::shortcut_editor::sync(&bar.app.ui); +} + +/// A shortcut too long to sit beside "Search commands" in the widest field is left to the tooltip +/// and the screen-reader name, and "Search commands" stays readable. +#[test] +fn a_long_shortcut_leaves_the_search_hint_readable() { + crate::i18n::set_current(crate::i18n::Lang::EN); + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let long = format!("Ctrl+Alt+Shift+{}", "PageDown".repeat(4)); + let mut fields = vec![]; + for _ in 0..2 { + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| { + let t = Tokens::get(ui.ctx()); + fields = [Some("Ctrl+Shift+/".to_string()), Some(long.clone()), None] + .into_iter() + .map(|s| { + let f = super::SearchField::new(ui, &t, s); + (f.width, f.hint.size().x, f.key.as_ref().map(|k| k.size().x), f.shortcut.clone()) + }) + .collect(); + }); + out.textures_delta.clear(); + } + let [(short_w, hint, short_key, _), (long_w, _, long_key, long_shortcut), (none_w, _, none_key, _)] = &fields[..] else { + panic!("three fields: {fields:?}"); + }; + let short_key = short_key.expect("a short shortcut is shown"); + assert!(*short_w <= 220.0 && 26.0 + hint + 12.0 + short_key + 8.0 <= *short_w, "the hint and the shortcut fit side by side: {fields:?}"); + assert_eq!((*long_key, long_shortcut.as_deref()), (None, Some(long.as_str())), "a long one is left to the tooltip and the name"); + assert!(*long_w <= 220.0 && 26.0 + hint + 8.0 <= *long_w, "{fields:?}"); + assert!(none_key.is_none() && *none_w >= 120.0, "{fields:?}"); +} + +/// A click on the field, or on the icon it becomes in a narrow bar, opens the command palette with an +/// empty query, and a second click closes it, as the palette's shortcut does. While a dialog is open +/// neither does anything, as the shortcut does. +#[test] +fn a_click_on_the_search_field_opens_the_palette() { + for icon in [false, true] { + let mut bar = AppBar::new(1400.0); + if icon { + let narrow = (300..1400).rev().step_by(10).find(|w| { + bar.width = *w as f32; + bar.search().is_some_and(|s| s.rect.width() == 28.0) + }); + assert!(narrow.is_some(), "a narrow bar shows the icon"); + } + let at = bar.search().expect("the search control shows").rect.center(); + bar.app.ui.palette_query = "old".into(); + bar.click(at); + assert!(bar.app.ui.palette_open, "icon: {icon}"); + assert_eq!(bar.app.ui.palette_query, "", "icon: {icon}"); + bar.app.ui.palette_query = "typed".into(); + bar.click(at); + assert!(!bar.app.ui.palette_open, "a second click closes it (icon: {icon})"); + assert_eq!(bar.app.ui.palette_query, "", "icon: {icon}"); + bar.app.ui.dialog = Some(crate::state::Dialog::new("about", json!({}))); + bar.click(at); + assert!(!bar.app.ui.palette_open, "not over a dialog (icon: {icon})"); + } +} + +/// The keyboard focus reaches the field, Enter or Space opens the palette and does nothing else, and +/// Tab then moves the focus on. This holds with the app's keys handled, the palette drawn after the +/// bar, a document open, and an object selected with the Selection tool, whose Enter otherwise +/// opens Move. In the app, Tab with no field focused shows and hides the panels instead of moving +/// the focus, so the focus reaches the bar the way a screen reader moves it. +#[test] +fn the_keyboard_opens_the_palette_from_the_search_field() { + let cases = + [(egui::Key::Enter, 0), (egui::Key::Space, 0), (egui::Key::Enter, 1), (egui::Key::Space, 1), (egui::Key::Enter, 2), (egui::Key::Space, 2)]; + for (key, setup) in cases { + let document = setup > 0; + let mut bar = AppBar::new(1400.0); + let field = bar.search().expect("the search field shows").rect; + assert!(field.width() >= 120.0, "a field, not the icon: {field:?}"); + let mut reached = false; + for _ in 0..40 { + bar.key(egui::Key::Tab); + if bar.focused_at(field) { + reached = true; + break; + } + } + assert!(reached, "Tab reaches the search field"); + bar.keys = true; + if document { + bar.app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + } + if setup == 2 { + let id = bar.app.session.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 50, "height": 30})).unwrap()["id"].clone(); + bar.app.select_tool("selection"); + bar.app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + } + // The app's keys leave the focus on the field. + bar.frame(vec![]); + assert!(bar.focused_at(field), "{key:?} (setup {setup})"); + assert!(!bar.app.ui.palette_open); + let status = bar.app.ui.status.clone(); + bar.key(key); + // The key opens the palette and goes no further: it does not pick the first result, type a + // space into the palette's field or open Move. + assert!(bar.app.ui.palette_open, "{key:?} opens the palette (setup {setup})"); + assert!(bar.app.ui.dialog.is_none(), "{key:?} opened no dialog (setup {setup})"); + assert_eq!(bar.app.ui.palette_query, "", "{key:?} (setup {setup})"); + assert!(bar.app.ui.recent_commands.is_empty() && bar.app.ui.status == status, "{key:?} ran nothing (setup {setup})"); + } + // Tab moves the focus off the field with the app's keys handled. + let mut bar = AppBar::new(1400.0); + let field = bar.search().expect("the search field shows").rect; + for _ in 0..40 { + if bar.focused_at(field) { + break; + } + bar.key(egui::Key::Tab); + } + assert!(bar.focused_at(field), "Tab reaches the search field at {field:?}"); + bar.keys = true; + let panels = (bar.app.ui.dock, bar.app.ui.toolbar); + bar.key(egui::Key::Tab); + assert!(!bar.focused_at(field), "Tab leaves the field"); + assert_eq!((bar.app.ui.dock, bar.app.ui.toolbar), panels, "Tab on the field does not hide the panels"); +} + +/// As the window narrows, the search field becomes the icon after Explore tutorials has gone and +/// before the icon goes, never overlapping the menus: with a long workspace name, with the menus in +/// the system's menu bar, and with the window's own caption buttons. +#[test] +fn a_narrowing_app_bar_turns_the_search_field_into_the_icon() { + for case in ["default", "long workspace name", "native menus", "caption buttons"] { + let mut bar = AppBar::new(1400.0); + match case { + "long workspace name" => bar.app.ui.workspace = "A workspace with a very long name indeed".into(), + "native menus" => bar.app.services.native_menu = Some(crate::native_menu::NativeMenu::new(Box::new(NoMenus))), + "caption buttons" => bar.app.custom_titlebar = true, + _ => {} + } + assert_eq!(bar.menus_end().is_some(), case != "native menus", "{case}: the in-window menus show"); + // 0: gone, 1: icon, 2: field. + let mut last = 2; + let mut seen_icon = false; + for width in (300..=1400).rev().step_by(10) { + bar.width = width as f32; + let learn = bar.has("Explore tutorials"); + let search = bar.search(); + let now = match &search { + Some(s) if s.rect.width() >= 120.0 => 2, + Some(s) => { + assert_eq!(s.rect.width(), 28.0, "{case} at {width}"); + assert!(s.texts.is_empty(), "the icon has no text: {case} at {width}"); + 1 + } + None => 0, + }; + assert!(width < 1400 || now == 2, "{case}: a wide bar shows the field"); + assert!(now <= last, "{case} at {width}: the search came back as the bar narrowed"); + assert!(!learn || now == 2, "{case} at {width}: Explore tutorials outlasted the field"); + if let Some(s) = &search { + assert!(s.rect.right() <= width as f32, "{case} at {width}: {s:?}"); + if let Some(menus_end) = bar.menus_end() { + assert!(s.rect.left() >= menus_end, "{case} at {width}: the search overlaps the menus ending at {menus_end}: {s:?}"); + } + } + seen_icon |= now == 1; + last = now; + } + assert!(seen_icon, "{case}: the field becomes the icon before it goes"); + } +} + #[derive(Debug)] struct StatusText { text: String, diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 71e443a399..2ea516f550 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3182,6 +3182,7 @@ digits Malayalam Малаялам Scripts Скриптове Search Търсене Search All Търсене във всички + Search commands Търсене на команди Search commands and tools Търсене на команди и инструменти Search commands and tools… Търсене на команди и инструменти… Recent Commands Последни команди diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 883d6dd387..620d5edd19 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1300,6 +1300,7 @@ lighting Light Svjetlo Name* @ 66.67% (RGB/Preview) Naziv* @ 66,67% (RGB/pregled) No Document Nema dokumenta Press Pritisnite + Search commands Pretraži naredbe Search commands and tools Pretraži naredbe i alate Style: Stil: Switch workspace Promijeni radni prostor diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a8a63cbf55..1a4208cc01 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4110,6 +4110,7 @@ digits Malayalam Malaiàlam Scrub Numeric Fields by Dragging Canvia els camps numèrics arrossegant Search Cerca Search All Cerca a tot + Search commands Cerca ordres Search commands and tools Cerca ordres i eines Search commands and tools… Cerca ordres i eines… Recent Commands Ordres recents diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 569b1347ec..02f5b97abc 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1324,6 +1324,7 @@ lighting Light Světlo Name* @ 66.67% (RGB/Preview) Název* @ 66,67 % (RGB/náhled) No Document Žádný dokument Press Klávesou + Search commands Hledat příkazy Search commands and tools Hledat příkazy a nástroje Style: Styl: Switch workspace Přepnout pracovní prostor diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 4578e4efc1..9733b65591 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3901,6 +3901,7 @@ lighting Light Lys Name* @ 66.67% (RGB/Preview) Navn* @ 66.67% (RGB/forhåndsvisning) No Document Intet dokument Press Tryk på + Search commands Søg i kommandoer Search commands and tools Søg i kommandoer og værktøjer Style: Typografi: Switch workspace Skift arbejdsområde diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index c943c89dd2..8a262a0d66 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3246,6 +3246,7 @@ digits Malayalam Malayalam Filter Layers Panel Rows Zeilen im Ebenenbedienfeld filtern @msg `Custom` stands for changed settings: save the preset under another name `Custom` steht für geänderte Einstellungen: Speichern Sie die Vorgabe unter einem anderen Namen @msg `{key}` must be an array of these names: {_1} `{key}` muss ein Array mit diesen Namen sein: {_1} + Search commands Befehle suchen Search commands and tools Befehle und Werkzeuge suchen Search commands and tools… Befehle und Werkzeuge suchen… Recent Commands Zuletzt verwendete Befehle diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 906640aa0a..0fc84a4f9a 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3948,6 +3948,7 @@ digits Malayalam Μαλαγιάλαμ Scribble… Μουτζούρωμα… Script / Brush Σενάριο / Πινέλο Search All Αναζήτηση όλων + Search commands Αναζήτηση εντολών Search commands and tools Αναζήτηση εντολών και εργαλείων Search commands and tools… Αναζήτηση εντολών και εργαλείων… Recent Commands Πρόσφατες εντολές diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9239c93a73..f6c7c0e152 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3284,6 +3284,7 @@ digits Malayalam Malayálam Filter Layers Panel Rows Filtrar filas del panel Capas @msg `Custom` stands for changed settings: save the preset under another name `Custom` representa ajustes modificados: guarda el preajuste con otro nombre @msg `{key}` must be an array of these names: {_1} `{key}` debe ser una lista de estos nombres: {_1} + Search commands Buscar comandos Search commands and tools Buscar comandos y herramientas Search commands and tools… Buscar comandos y herramientas… Recent Commands Comandos recientes diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 423703e5c1..e971f1fe79 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1302,6 +1302,7 @@ lighting Light Valo Name* @ 66.67% (RGB/Preview) Nimi* @ 66.67% (RGB/esikatselu) No Document Ei asiakirjaa Press Paina + Search commands Hae komentoja Search commands and tools Hae komentoja ja työkaluja Style: Tyyli: Switch workspace Vaihda työtilaa diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 8af602785b..4a89f385bf 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3272,6 +3272,7 @@ digits Malayalam Malayalam Filter Layers Panel Rows Filtrer les lignes du panneau Calques @msg `Custom` stands for changed settings: save the preset under another name `Custom` désigne des réglages modifiés : enregistrez le paramètre prédéfini sous un autre nom @msg `{key}` must be an array of these names: {_1} `{key}` doit être un tableau de noms parmi {_1} + Search commands Chercher des commandes Search commands and tools Chercher commandes et outils Search commands and tools… Chercher commandes et outils… Recent Commands Commandes récentes diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..d8caa0e6b1 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3388,6 +3388,7 @@ Search Commands… આદેશો શોધો… Search Fonts Folder ફોન્ટ ફોલ્ડર શોધો Search Preferences પસંદગીઓ શોધો + Search commands આદેશો શોધો Search commands and tools આદેશો અને ટૂલ્સ શોધો Search commands and tools… આદેશો અને ટૂલ્સ શોધો… Recent Commands તાજેતરના આદેશો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index de33cdbd92..164537497d 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4462,6 +4462,7 @@ antiAlias Sharp शार्प Search खोजें Search All सभी खोजें Search artboards खोज आर्टबोर्ड + Search commands आदेश खोजें Search commands and tools खोज आदेश और टूल Search commands and tools… आदेश और टूल खोजें… Recent Commands हाल के आदेश diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index f869e7d07b..9c856323ce 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3904,6 +3904,7 @@ mark-style Japanese Japán Filter Layers Panel Rows Rétegek panel sorainak szűrése @msg `Custom` stands for changed settings: save the preset under another name a `Custom` a módosított beállításokat jelöli: mentsd az előbeállítást más néven @msg `{key}` must be an array of these names: {_1} `{key}`: ezen nevek tömbje kell: {_1} + Search commands Parancsok keresése Search commands and tools Parancsok és eszközök keresése Search commands and tools… Parancsok és eszközök keresése… Recent Commands Legutóbbi parancsok diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c5f865e69b..0c5b65e7f0 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1227,6 +1227,7 @@ lighting Light Cahaya Name* @ 66.67% (RGB/Preview) Nama* @ 66.67% (RGB/Pratinjau) No Document Tidak ada dokumen Press Tekan + Search commands Cari perintah Search commands and tools Cari perintah dan alat Style: Gaya: Switch workspace Ganti ruang kerja diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08cefdbed7..c4e2f39dc4 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3327,6 +3327,7 @@ digits Malayalam Malayalam Filter Layers Panel Rows Filtra righe del pannello Livelli @msg `Custom` stands for changed settings: save the preset under another name `Custom` indica impostazioni modificate: salva il preset con un altro nome @msg `{key}` must be an array of these names: {_1} `{key}` deve essere un array di questi nomi: {_1} + Search commands Cerca comandi Search commands and tools Cerca comandi e strumenti Search commands and tools… Cerca comandi e strumenti… Recent Commands Comandi recenti diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 59c7628f40..bd1c00f4ae 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3204,6 +3204,7 @@ mark-style Japanese 日本式 Filter Layers Panel Rows レイヤーパネルの行をフィルター @msg `Custom` stands for changed settings: save the preset under another name `Custom` は変更した設定を表します: プリセットを別の名前で保存してください @msg `{key}` must be an array of these names: {_1} `{key}` には {_1} の中の名前の配列を指定してください + Search commands コマンドを検索 Search commands and tools コマンドとツールを検索 Search commands and tools… コマンドとツールを検索… Recent Commands 最近使ったコマンド diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 9393433cdb..6589d60e98 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3269,6 +3269,7 @@ lighting Light სინათლე Name* @ 66.67% (RGB/Preview) სახელი* @ 66.67% (RGB/წინასწარი ნახვა) No Document დოკუმენტი არ არის Press დააჭირეთ + Search commands ბრძანებების ძიება Search commands and tools ბრძანებებისა და ხელსაწყოების ძიება Style: სტილი: Switch workspace სამუშაო სივრცის გადართვა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 49d5e10dc1..13860e91b9 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3193,6 +3193,7 @@ mark-style Japanese 일본식 Filter Layers Panel Rows 레이어 패널 행 필터링 @msg `Custom` stands for changed settings: save the preset under another name `Custom`은 변경된 설정을 나타냅니다. 프리셋을 다른 이름으로 저장하세요 @msg `{key}` must be an array of these names: {_1} `{key}`은(는) 다음 이름의 배열이어야 합니다: {_1} + Search commands 명령 검색 Search commands and tools 명령 및 도구 검색 Search commands and tools… 명령 및 도구 검색… Recent Commands 최근 명령 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f071ebd0e2..9f165efd14 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1795,6 +1795,7 @@ lighting Light Licht Name* @ 66.67% (RGB/Preview) Naam* @ 66.67% (RGB/Voorbeeld) No Document Geen document Press Druk op + Search commands Opdrachten zoeken Search commands and tools Opdrachten en gereedschappen zoeken Style: Stijl: Switch workspace Werkruimte wisselen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2477c73abd..20e2f86d10 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1254,6 +1254,7 @@ lighting Light Światło Name* @ 66.67% (RGB/Preview) Nazwa* @ 66,67% (RGB/Podgląd) No Document Brak dokumentu Press Naciśnij + Search commands Szukaj poleceń Search commands and tools Szukaj poleceń i narzędzi Style: Styl: Switch workspace Przełącz obszar roboczy diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 333351b9af..0d95825dde 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2742,6 +2742,7 @@ digits Malayalam Malaiala @msg `Custom` stands for changed settings: save the preset under another name `Custom` representa configurações alteradas: salve a predefinição com outro nome @msg `{key}` must be an array of these names: {_1} `{key}` deve ser uma matriz destes nomes: {_1} Search Commands… Pesquisar Comandos… + Search commands Pesquisar comandos Search commands and tools Pesquisar comandos e ferramentas Search commands and tools… Pesquisar comandos e ferramentas… Recent Commands Comandos recentes diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ae33aa0d55..3dfaa07482 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3316,6 +3316,7 @@ digits Malayalam Малаялам Filter Layers Panel Rows Фильтровать строки панели «Слои» @msg `Custom` stands for changed settings: save the preset under another name `Custom` обозначает изменённые параметры: сохраните набор под другим именем @msg `{key}` must be an array of these names: {_1} `{key}` должно быть массивом из этих имён: {_1} + Search commands Поиск команд Search commands and tools Поиск команд и инструментов Search commands and tools… Поиск команд и инструментов… Recent Commands Недавние команды diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 1bd4fd0692..248adc3ec7 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3202,6 +3202,7 @@ digits Malayalam Malayalam Scripts Skript Search Sök Search All Sök i alla + Search commands Sök kommandon Search commands and tools Sök kommandon och verktyg Search commands and tools… Sök kommandon och verktyg… Recent Commands Senaste kommandon diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a2a38c679a..c8ff293ebb 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3074,6 +3074,7 @@ digits Malayalam Malayalam Redefine {name} “{name}” Stilini Yeniden Tanımla @msg `Custom` stands for changed settings: save the preset under another name `Custom` değiştirilmiş ayarları ifade eder: ön ayarı başka bir adla kaydedin @msg `{key}` must be an array of these names: {_1} `{key}` şu adlardan oluşan bir dizi olmalıdır: {_1} + Search commands Komutları arayın Search commands and tools Komutları ve araçları arayın Search commands and tools… Komutları ve araçları arayın… Recent Commands Son komutlar diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 17c673885d..c4e95fd2db 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3319,6 +3319,7 @@ digits Malayalam Малаялам Filter Layers Panel Rows Фільтрувати рядки панелі «Шари» @msg `Custom` stands for changed settings: save the preset under another name `Custom` позначає змінені параметри: збережіть набір під іншим ім’ям @msg `{key}` must be an array of these names: {_1} `{key}` має бути масивом цих назв: {_1} + Search commands Пошук команд Search commands and tools Пошук команд та інструментів Search commands and tools… Пошук команд та інструментів… Recent Commands Нещодавні команди diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index da89525314..6c79308d93 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3661,6 +3661,7 @@ mark-style Japanese Kiểu Nhật Filter Layers Panel Rows Lọc hàng bảng Lớp @msg `Custom` stands for changed settings: save the preset under another name `Custom` biểu thị các cài đặt đã thay đổi: hãy lưu thiết lập sẵn với tên khác @msg `{key}` must be an array of these names: {_1} `{key}` phải là một mảng gồm các tên sau: {_1} + Search commands Tìm kiếm lệnh Search commands and tools Tìm kiếm lệnh và công cụ Search commands and tools… Tìm kiếm lệnh và công cụ… Recent Commands Lệnh gần đây diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5f612cb0d4..1e318d4001 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3146,6 +3146,7 @@ digits Malayalam 马拉雅拉姆数字 Locked 已锁定 Hidden 已隐藏 Filter Layers Panel Rows 筛选图层面板行 + Search commands 搜索命令 Search commands and tools 搜索命令和工具 Search commands and tools… 搜索命令和工具… Recent Commands 最近使用的命令 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e0b5a13ee2..e2f1a7950c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4452,6 +4452,7 @@ digits Malayalam 馬來亞拉姆數字 Locked 已鎖定 Hidden 已隱藏 Filter Layers Panel Rows 篩選圖層面板列 + Search commands 搜尋指令 Search commands and tools 搜尋指令與工具 Search commands and tools… 搜尋指令與工具… Recent Commands 最近使用的指令 diff --git a/crates/ui-egui/src/panels/learn/tests.rs b/crates/ui-egui/src/panels/learn/tests.rs index 319ca1decf..21486d4b1a 100644 --- a/crates/ui-egui/src/panels/learn/tests.rs +++ b/crates/ui-egui/src/panels/learn/tests.rs @@ -104,10 +104,10 @@ fn explore_tutorials_on_the_app_bar_shows_and_hides_the_learn_panel() { let ctx = context(); assert!(!shown(&app)); let nodes = frame(&mut app, &ctx, vec![], app_bar); - let search = center_where(&nodes, |label| label.starts_with("Search commands and tools")); + let search = center_where(&nodes, |label| label.starts_with("Search commands")); let learn = center(&nodes, "Explore tutorials"); - let (search, learn) = (search.expect("the search icon shows"), learn.expect("the app bar has Explore tutorials")); - assert!(learn.x < search.x && (learn.y - search.y).abs() < 1.0, "beside the search icon: {learn:?}, {search:?}"); + let (search, learn) = (search.expect("the search field shows"), learn.expect("the app bar has Explore tutorials")); + assert!(learn.x < search.x && (learn.y - search.y).abs() < 1.0, "beside the search field: {learn:?}, {search:?}"); click(&mut app, &ctx, "Explore tutorials", app_bar); assert!(shown(&app), "{}", app.ui.status); click(&mut app, &ctx, "Explore tutorials", app_bar); diff --git a/docs/development.md b/docs/development.md index 64b66678b5..2b1a3d7d87 100644 --- a/docs/development.md +++ b/docs/development.md @@ -111,7 +111,7 @@ When the interface thread stays in one part of a frame for 3 s (VectorCraft's ow ## macOS: the menu bar -On macOS the menus live in the system menu bar, not in the window's app bar (which keeps the brand mark, Home, the search icon and the workspace switcher next to the traffic lights, centred on the bar by `apps/vectorcraft/src/mac_window.rs`). `--in-window-menus` or `VECTORCRAFT_IN_WINDOW_MENUS=1` keeps them in the window, as on Windows, Linux and the web; so does a menu bar AppKit refuses to build (logged). `ui.inspect` says which with `nativeMenuBar`. +On macOS the menus live in the system menu bar, not in the window's app bar (which keeps the brand mark, Home, the search field and the workspace switcher next to the traffic lights, centred on the bar by `apps/vectorcraft/src/mac_window.rs`). `--in-window-menus` or `VECTORCRAFT_IN_WINDOW_MENUS=1` keeps them in the window, as on Windows, Linux and the web; so does a menu bar AppKit refuses to build (logged). `ui.inspect` says which with `nativeMenuBar`. - **One menu model.** `crates/ui-egui/src/native_menu.rs` (platform-free, tested on every platform) builds the menu bar from the in-window menus (`menus::menu_tree`, each item through `menus::entry`, which the in-window menus draw too) and lays it out the Mac way: the VectorCraft menu holds About, Settings ▸ (one item per Preferences page, General… ⌘K), Language ▸, Appearance ▸ (UI brightness), Services, Hide VectorCraft ⌃⌘H (⌘H stays View › Hide Edges), Hide Others ⌥⌘H, Show All and Quit ⌘Q (the app's own `app.quit`, so unsaved documents are asked about); those leave Edit and Help. The in-window bar itself never shows the VectorCraft menu (it starts at File, as in Illustrator, on every platform): Language and Appearance have no in-window menu and are synthesized in `mac_layout`, and Quit is File › Exit in the window, relabelled to Quit in the App menu. Window starts with Minimize ⌃⌘M and Zoom and ends with Bring All to Front, and Help is the system's Help menu (its search field). A system key a command (or a user's shortcut) already has stays the command's, and the log says so. - **The native side** is `apps/vectorcraft/src/mac_menu.rs`: muda (`=0.21.1`, default features off, macOS only, no `unsafe`) builds the `NSMenu`s. Labels, enabled and checked are updated in place when anything they show may have changed (a command ran, the document, its history or selection changed, a click or a key press); a change of structure (a recent file, the language, a shortcut) rebuilds the menus. While an interaction is open (for example a move, scale or shape drag, a dialog's preview or the font menu's preview), the app updates them for the document's changes only when the interaction begins and when it ends. diff --git a/docs/mcp.md b/docs/mcp.md index c7aa202d3f..e2de2d90df 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3212,7 +3212,7 @@ own layout rules. ## Learn panel -Window › Learn and the Explore tutorials button beside the search icon at the right end of the app bar show and hide +Window › Learn and the Explore tutorials button beside the search field at the right end of the app bar show and hide the Learn panel. Its For you tab holds a Get started section with a Quick skill guide card; choosing the card opens the Skills tab. The Skills tab lists VectorCraft's own skills, each with a progress ring and the count of its tutorials finished of all its tutorials. Choosing a skill lists its tutorials, choosing a tutorial shows its numbered steps, and diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 0782bacab9..a4585db2f7 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1017,7 +1017,8 @@ 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`). - - 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`). + - 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 own keys stay off, so Enter does not open Move and Tab moves the focus on. While a dialog is open the field and the icon do nothing, as the shortcut does. Screen readers name the field 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. 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_keyboard_opens_the_palette_from_the_search_field`, `a_narrowing_app_bar_turns_the_search_field_into_the_icon`). + - The Learn panel (Window › Learn, or Explore tutorials beside the search field 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`. - A Learn tutorial's steps are marked complete as the learner works, and a skill's progress ring fills as its tutorials are finished, 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)). Each step has a check box that marks it done once the tutorial's sample is open (`learn.markStep`); Finish tutorial marks every step done; a skill's count shows its tutorials finished of all, and a finished tutorial has a check mark in its skill's list. Marking steps by hand, the count, keeping the progress in the preferences (the web build keeps it while the page is open) and Reset progress (`learn.resetProgress`) are VectorCraft's own rules; `learn.list` reports the progress. Regression tests: `a_step_s_check_box_marks_only_that_step`, `a_step_s_check_box_works_from_the_keyboard`, `finishing_tutorials_fills_their_skill_s_ring_and_count`, `a_skill_with_no_tutorials_shows_0_of_0`, `learn_mark_step_checks_its_params`, `reset_progress_clears_only_the_progress`, `the_preferences_keep_the_progress` and `saved_progress_is_read_leniently` in `crates/ui-egui/src/panels/learn/tests.rs`. From f9f9f9132121b14fb407e0f0b4db77ab72152226 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 01:22:24 -0800 Subject: [PATCH 03/22] App bar: the search icon takes the field's name, and both draw disabled under a dialog - Screen readers now call the search icon "Search commands" with the shortcut, as they call the field; its tooltip stays "Search commands and tools". paint_icon_button_named gives an icon button a name apart from its tooltip. - While a dialog is open the field and the icon are drawn disabled and screen readers report them disabled, since a click on them does nothing then. - The titlebar test now checks that the field shows "Search commands" in a wide window, and its comments describe the field. - The fitting code and its tests call the community button's width and flag `community`, and the new struct fields have doc comments. - The new "Search commands" catalog rows move a few rows down, next to "No recent commands" or "Switch workspace", away from the rows other open pull requests change. - The docs line says the app's existing rule for a focused control keeps the app's keys off while the field has the focus, and that the community button and Explore tutorials go at wider bars than they did beside the icon. --- crates/ui-egui/src/chrome.rs | 42 ++++++++++++------ crates/ui-egui/src/chrome/tests.rs | 61 +++++++++++++++++++-------- crates/ui-egui/src/i18n/bg.tsv | 2 +- crates/ui-egui/src/i18n/bs.tsv | 2 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 2 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/gu.tsv | 2 +- crates/ui-egui/src/i18n/hi.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/id.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 2 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 2 +- crates/ui-egui/src/i18n/zh-hant.tsv | 2 +- crates/ui-egui/src/titlebar.rs | 8 +++- crates/ui-egui/src/widgets.rs | 4 +- crates/ui-egui/src/widgets/buttons.rs | 10 ++++- docs/target-app-parity.md | 2 +- 34 files changed, 118 insertions(+), 65 deletions(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index d10d320ad9..4cbd0e9e85 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -108,9 +108,9 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { field: field.width, icon: BAR_ICON, gap: ui.spacing().item_spacing.x, - discord: crate::community::discord_width(ui, false), + community: crate::community::discord_width(ui, false), }); - let (switcher, ws_w, learn, discord) = (fit.switcher, fit.switcher_w, fit.learn, fit.discord); + let (switcher, ws_w, learn, discord) = (fit.switcher, fit.switcher_w, fit.learn, fit.community); let mut rui = ui.new_child(egui::UiBuilder::new().max_rect(right).layout(egui::Layout::right_to_left(egui::Align::Center))); let ui = &mut rui; // Workspace switcher: shows the current workspace, opens Window → Workspace. @@ -136,14 +136,21 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { }; let tip = with_shortcut(tl!("Search commands and tools")); let name = with_shortcut(tl!("Search commands")); - let clicked = match fit.search { - Search::Field => field.show(ui, &t, &name, &tip, app.ui.palette_open).clicked(), - Search::Icon => widgets::icon_button(ui, "search", &tip, app.ui.palette_open, BAR_ICON).clicked(), - Search::Hidden => false, - }; // The field and the icon toggle the palette as its shortcut does, and like the shortcut - // they do nothing while a dialog is open. - if clicked && app.ui.dialog.is_none() { + // they do nothing while a dialog is open, so they are drawn disabled then. + let enabled = app.ui.dialog.is_none(); + let open = app.ui.palette_open; + let clicked = ui + .add_enabled_ui(enabled, |ui| match fit.search { + Search::Field => field.show(ui, &t, &name, &tip, open).clicked(), + Search::Icon => { + let (_, resp) = ui.allocate_exact_size(vec2(BAR_ICON, BAR_ICON), Sense::click()); + widgets::paint_icon_button_named(ui, resp, "search", &name, &tip, open).clicked() + } + Search::Hidden => false, + }) + .inner; + if clicked && enabled { app.ui.palette_open = !app.ui.palette_open; app.ui.palette_query.clear(); } @@ -195,24 +202,33 @@ enum Search { struct RightWidths { /// The room after the menus, less the Safe Mode label's. room: f32, + /// Whether the bar shows the Safe Mode label. safe_mode: bool, /// The workspace switcher's full width. switcher: f32, /// The search field's width. field: f32, + /// The side of a square icon button. icon: f32, + /// The space between two controls. gap: f32, - discord: f32, + /// The community button's width. + community: f32, } /// What the right-hand group of the app bar shows. #[derive(Clone, Copy, Debug, PartialEq)] struct RightGroup { + /// Whether the workspace switcher shows. switcher: bool, + /// The workspace switcher's width. switcher_w: f32, + /// How the search shows. search: Search, + /// Whether Explore tutorials shows. learn: bool, - discord: bool, + /// Whether the community button shows. + community: bool, } /// The right-hand group for the room it has. As the room runs short, the community button goes first @@ -240,8 +256,8 @@ fn fit_right_group(w: &RightWidths) -> RightGroup { let switcher_w = w.switcher.min(room - 8.0 - search_w).max(MIN_SWITCHER); let learn_end = switcher_w + 8.0 + search_w + w.gap + w.icon; let learn = field && room >= learn_end; - let discord = learn && room >= learn_end + 10.0 + w.gap + w.discord; - RightGroup { switcher, switcher_w, search, learn, discord } + let community = learn && room >= learn_end + 10.0 + w.gap + w.community; + RightGroup { switcher, switcher_w, search, learn, community } } /// The app bar's search field: a button drawn as a field. The command palette's popup holds the diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index f0ac33613b..e19221a91d 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -161,7 +161,7 @@ fn hints_name_keys_as_the_menus_do() { /// The widths of the app bar's right-hand group used by the fitting tests. fn right_widths(room: f32, safe_mode: bool) -> super::RightWidths { - super::RightWidths { room, safe_mode, switcher: 150.0, field: 170.0, icon: 28.0, gap: 8.0, discord: 80.0 } + super::RightWidths { room, safe_mode, switcher: 150.0, field: 170.0, icon: 28.0, gap: 8.0, community: 80.0 } } /// What the group shows, in words, with the switcher's width as full, narrower or minimal. @@ -172,10 +172,10 @@ fn right_stage(g: &super::RightGroup) -> String { w if w > super::MIN_SWITCHER => "narrower switcher", _ => "minimal switcher", }; - format!("discord {}, learn {}, {:?}, {switcher}", g.discord, g.learn, g.search) + format!("community {}, learn {}, {:?}, {switcher}", g.community, g.learn, g.search) } -/// As the app bar's room runs short, Discord goes first, then Explore tutorials, then the search +/// As the app bar's room runs short, the community button goes first, then Explore tutorials, then the search /// field becomes the icon, then the workspace switcher narrows to its minimum, then the icon goes. /// Whatever shows fits in the room, down to the minimal switcher alone. #[test] @@ -194,34 +194,33 @@ fn the_app_bar_gives_up_its_right_hand_controls_in_order() { super::Search::Hidden => 0.0, }; let learn = if g.learn { w.gap + w.icon } else { 0.0 }; - let discord = if g.discord { 10.0 + w.gap + w.discord } else { 0.0 }; - let used = g.switcher_w + 8.0 + search + learn + discord; + let community = if g.community { 10.0 + w.gap + w.community } else { 0.0 }; + let used = g.switcher_w + 8.0 + search + learn + community; assert!(used <= room || g.switcher_w == super::MIN_SWITCHER && g.search == super::Search::Hidden, "{room}: {g:?} needs {used}"); } assert_eq!( stages, [ - "discord true, learn true, Field, full switcher", - "discord false, learn true, Field, full switcher", - "discord false, learn false, Field, full switcher", - "discord false, learn false, Icon, full switcher", - "discord false, learn false, Icon, narrower switcher", - "discord false, learn false, Icon, minimal switcher", + "community true, learn true, Field, full switcher", + "community false, learn true, Field, full switcher", + "community false, learn false, Field, full switcher", + "community false, learn false, Icon, full switcher", + "community false, learn false, Icon, narrower switcher", + "community false, learn false, Icon, minimal switcher", // Once the icon has gone, the switcher takes the room it leaves. - "discord false, learn false, Hidden, narrower switcher", - "discord false, learn false, Hidden, minimal switcher", + "community false, learn false, Hidden, narrower switcher", + "community false, learn false, Hidden, minimal switcher", ] ); // In Safe Mode the label's width is taken first (not counted in `room`), and the switcher goes // when a minimal one does not fit. let safe = |room| right_stage(&super::fit_right_group(&right_widths(room, true))); - assert_eq!(safe(700.0), "discord true, learn true, Field, full switcher"); - assert_eq!(safe(72.0), "discord false, learn false, Hidden, minimal switcher"); - assert_eq!(safe(71.0), "discord false, learn false, Hidden, no switcher"); + assert_eq!(safe(700.0), "community true, learn true, Field, full switcher"); + assert_eq!(safe(72.0), "community false, learn false, Hidden, minimal switcher"); + assert_eq!(safe(71.0), "community false, learn false, Hidden, no switcher"); } -/// What screen readers call the app bar's search field, before its shortcut, and how the collapsed -/// icon's name starts. +/// What screen readers call the app bar's search field, and the icon it becomes, before the shortcut. const SEARCH_NAME: &str = "Search commands"; /// A native menu bar that draws nothing. @@ -432,6 +431,32 @@ fn a_click_on_the_search_field_opens_the_palette() { } } +/// The icon a narrow bar shows has the field's screen-reader name, and while a dialog is open screen +/// readers find the field and the icon disabled. +#[test] +fn the_search_icon_has_the_fields_name_and_both_are_disabled_under_a_dialog() { + let shortcut = crate::menus::shown_shortcut("Cmd+Shift+/"); + for icon in [false, true] { + let mut bar = AppBar::new(1400.0); + if icon { + let narrow = (300..1400).rev().step_by(10).find(|w| { + bar.width = *w as f32; + bar.search().is_some_and(|s| s.rect.width() == 28.0) + }); + assert!(narrow.is_some(), "a narrow bar shows the icon"); + } + let disabled = |bar: &mut AppBar| { + bar.frame(vec![]); + let nodes = bar.frame(vec![]).0; + let node = nodes.iter().find(|n| n.label().is_some_and(|l| l.starts_with(SEARCH_NAME))).expect("the search control shows"); + (node.label().unwrap_or_default().to_string(), node.is_disabled()) + }; + assert_eq!(disabled(&mut bar), (format!("{SEARCH_NAME} ({shortcut})"), false), "icon: {icon}"); + bar.app.ui.dialog = Some(crate::state::Dialog::new("about", json!({}))); + assert_eq!(disabled(&mut bar), (format!("{SEARCH_NAME} ({shortcut})"), true), "icon: {icon}"); + } +} + /// The keyboard focus reaches the field, Enter or Space opens the palette and does nothing else, and /// Tab then moves the focus on. This holds with the app's keys handled, the palette drawn after the /// bar, a document open, and an object selected with the Selection tool, whose Enter otherwise diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 2ea516f550..732b89f37a 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3182,11 +3182,11 @@ digits Malayalam Малаялам Scripts Скриптове Search Търсене Search All Търсене във всички - Search commands Търсене на команди Search commands and tools Търсене на команди и инструменти Search commands and tools… Търсене на команди и инструменти… Recent Commands Последни команди No recent commands Няма последни команди + Search commands Търсене на команди Search Commands… Търсене на команди… Secondary Вторичен Section Symbol Символ за раздел diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 620d5edd19..e57f7d794d 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1300,10 +1300,10 @@ lighting Light Svjetlo Name* @ 66.67% (RGB/Preview) Naziv* @ 66,67% (RGB/pregled) No Document Nema dokumenta Press Pritisnite - Search commands Pretraži naredbe Search commands and tools Pretraži naredbe i alate Style: Stil: Switch workspace Promijeni radni prostor + Search commands Pretraži naredbe Show all open documents Prikaži sve otvorene dokumente Use Koristite the object to select | objekat za odabir | diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 1a4208cc01..3644e3f97f 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4110,11 +4110,11 @@ digits Malayalam Malaiàlam Scrub Numeric Fields by Dragging Canvia els camps numèrics arrossegant Search Cerca Search All Cerca a tot - Search commands Cerca ordres Search commands and tools Cerca ordres i eines Search commands and tools… Cerca ordres i eines… Recent Commands Ordres recents No recent commands No hi ha ordres recents + Search commands Cerca ordres Search Commands… Cerca ordres… Search Fonts Folder Cerca a la carpeta de tipus de lletra Searching… Cercant… diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 02f5b97abc..e18d63dd69 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1324,10 +1324,10 @@ lighting Light Světlo Name* @ 66.67% (RGB/Preview) Název* @ 66,67 % (RGB/náhled) No Document Žádný dokument Press Klávesou - Search commands Hledat příkazy Search commands and tools Hledat příkazy a nástroje Style: Styl: Switch workspace Přepnout pracovní prostor + Search commands Hledat příkazy Show all open documents Zobrazit všechny otevřené dokumenty Use Příkazem the object to select | na objekt jej vybere | diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 9733b65591..89ae110f26 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3901,10 +3901,10 @@ lighting Light Lys Name* @ 66.67% (RGB/Preview) Navn* @ 66.67% (RGB/forhåndsvisning) No Document Intet dokument Press Tryk på - Search commands Søg i kommandoer Search commands and tools Søg i kommandoer og værktøjer Style: Typografi: Switch workspace Skift arbejdsområde + Search commands Søg i kommandoer Show all open documents Vis alle åbne dokumenter Use Brug the object to select | på objektet for at markere det | diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 8a262a0d66..e1be23383f 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3246,11 +3246,11 @@ digits Malayalam Malayalam Filter Layers Panel Rows Zeilen im Ebenenbedienfeld filtern @msg `Custom` stands for changed settings: save the preset under another name `Custom` steht für geänderte Einstellungen: Speichern Sie die Vorgabe unter einem anderen Namen @msg `{key}` must be an array of these names: {_1} `{key}` muss ein Array mit diesen Namen sein: {_1} - Search commands Befehle suchen Search commands and tools Befehle und Werkzeuge suchen Search commands and tools… Befehle und Werkzeuge suchen… Recent Commands Zuletzt verwendete Befehle No recent commands Keine zuletzt verwendeten Befehle + Search commands Befehle suchen Search Commands… Befehle suchen… Secondary Sekundär Section Symbol Paragrafenzeichen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 0fc84a4f9a..4aef4b46b9 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3948,11 +3948,11 @@ digits Malayalam Μαλαγιάλαμ Scribble… Μουτζούρωμα… Script / Brush Σενάριο / Πινέλο Search All Αναζήτηση όλων - Search commands Αναζήτηση εντολών Search commands and tools Αναζήτηση εντολών και εργαλείων Search commands and tools… Αναζήτηση εντολών και εργαλείων… Recent Commands Πρόσφατες εντολές No recent commands Δεν υπάρχουν πρόσφατες εντολές + Search commands Αναζήτηση εντολών Search Commands… Αναζήτηση εντολών… Secondary Δευτερεύον Section Symbol Σύμβολο ενότητας diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f6c7c0e152..d1acec9c47 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3284,11 +3284,11 @@ digits Malayalam Malayálam Filter Layers Panel Rows Filtrar filas del panel Capas @msg `Custom` stands for changed settings: save the preset under another name `Custom` representa ajustes modificados: guarda el preajuste con otro nombre @msg `{key}` must be an array of these names: {_1} `{key}` debe ser una lista de estos nombres: {_1} - Search commands Buscar comandos Search commands and tools Buscar comandos y herramientas Search commands and tools… Buscar comandos y herramientas… Recent Commands Comandos recientes No recent commands No hay comandos recientes + Search commands Buscar comandos Search Commands… Buscar comandos… Secondary Secundario Section Symbol Símbolo de sección diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index e971f1fe79..c4b75dfd05 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1302,10 +1302,10 @@ lighting Light Valo Name* @ 66.67% (RGB/Preview) Nimi* @ 66.67% (RGB/esikatselu) No Document Ei asiakirjaa Press Paina - Search commands Hae komentoja Search commands and tools Hae komentoja ja työkaluja Style: Tyyli: Switch workspace Vaihda työtilaa + Search commands Hae komentoja Show all open documents Näytä kaikki avoimet asiakirjat Use Käytä the object to select | objektia valitaksesi sen | diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 4a89f385bf..25c41029e6 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3272,11 +3272,11 @@ digits Malayalam Malayalam Filter Layers Panel Rows Filtrer les lignes du panneau Calques @msg `Custom` stands for changed settings: save the preset under another name `Custom` désigne des réglages modifiés : enregistrez le paramètre prédéfini sous un autre nom @msg `{key}` must be an array of these names: {_1} `{key}` doit être un tableau de noms parmi {_1} - Search commands Chercher des commandes Search commands and tools Chercher commandes et outils Search commands and tools… Chercher commandes et outils… Recent Commands Commandes récentes No recent commands Aucune commande récente + Search commands Chercher des commandes Search Commands… Rechercher des commandes… Secondary Secondaire Section Symbol Symbole de section diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index d8caa0e6b1..29b99bcea3 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3388,11 +3388,11 @@ Search Commands… આદેશો શોધો… Search Fonts Folder ફોન્ટ ફોલ્ડર શોધો Search Preferences પસંદગીઓ શોધો - Search commands આદેશો શોધો Search commands and tools આદેશો અને ટૂલ્સ શોધો Search commands and tools… આદેશો અને ટૂલ્સ શોધો… Recent Commands તાજેતરના આદેશો No recent commands કોઈ તાજેતરના આદેશો નથી + Search commands આદેશો શોધો Search images છબીઓ શોધો Searching… શોધી રહ્યા છીએ… Secondary ગૌણ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 164537497d..1375038394 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4462,11 +4462,11 @@ antiAlias Sharp शार्प Search खोजें Search All सभी खोजें Search artboards खोज आर्टबोर्ड - Search commands आदेश खोजें Search commands and tools खोज आदेश और टूल Search commands and tools… आदेश और टूल खोजें… Recent Commands हाल के आदेश No recent commands कोई हाल का आदेश नहीं + Search commands आदेश खोजें Search Commands… कमांड खोजें… Search Fonts Folder खोज फ़ॉन्ट फ़ोल्डर Search images इमेज खोजना diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 9c856323ce..7995864553 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3904,11 +3904,11 @@ mark-style Japanese Japán Filter Layers Panel Rows Rétegek panel sorainak szűrése @msg `Custom` stands for changed settings: save the preset under another name a `Custom` a módosított beállításokat jelöli: mentsd az előbeállítást más néven @msg `{key}` must be an array of these names: {_1} `{key}`: ezen nevek tömbje kell: {_1} - Search commands Parancsok keresése Search commands and tools Parancsok és eszközök keresése Search commands and tools… Parancsok és eszközök keresése… Recent Commands Legutóbbi parancsok No recent commands Nincsenek legutóbbi parancsok + Search commands Parancsok keresése Search Commands… Parancsok keresése… Search Fonts Folder Keresés betűtípusmappában Searching… Keresés… diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 0c5b65e7f0..4bfe6020f7 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1227,10 +1227,10 @@ lighting Light Cahaya Name* @ 66.67% (RGB/Preview) Nama* @ 66.67% (RGB/Pratinjau) No Document Tidak ada dokumen Press Tekan - Search commands Cari perintah Search commands and tools Cari perintah dan alat Style: Gaya: Switch workspace Ganti ruang kerja + Search commands Cari perintah Show all open documents Tampilkan semua dokumen terbuka Use Gunakan the object to select | objek untuk memilihnya | diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index c4e2f39dc4..b933002c31 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3327,11 +3327,11 @@ digits Malayalam Malayalam Filter Layers Panel Rows Filtra righe del pannello Livelli @msg `Custom` stands for changed settings: save the preset under another name `Custom` indica impostazioni modificate: salva il preset con un altro nome @msg `{key}` must be an array of these names: {_1} `{key}` deve essere un array di questi nomi: {_1} - Search commands Cerca comandi Search commands and tools Cerca comandi e strumenti Search commands and tools… Cerca comandi e strumenti… Recent Commands Comandi recenti No recent commands Nessun comando recente + Search commands Cerca comandi Search Commands… Cerca comandi… Secondary Secondario Section Symbol Simbolo di sezione diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index bd1c00f4ae..ed710d2fc8 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3204,11 +3204,11 @@ mark-style Japanese 日本式 Filter Layers Panel Rows レイヤーパネルの行をフィルター @msg `Custom` stands for changed settings: save the preset under another name `Custom` は変更した設定を表します: プリセットを別の名前で保存してください @msg `{key}` must be an array of these names: {_1} `{key}` には {_1} の中の名前の配列を指定してください - Search commands コマンドを検索 Search commands and tools コマンドとツールを検索 Search commands and tools… コマンドとツールを検索… Recent Commands 最近使ったコマンド No recent commands 最近使ったコマンドはありません + Search commands コマンドを検索 Secondary セカンダリ Select All Art on Layer レイヤー上のすべてのアートを選択 Select All Assets すべてのアセットを選択 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 6589d60e98..1e7dadf720 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3269,10 +3269,10 @@ lighting Light სინათლე Name* @ 66.67% (RGB/Preview) სახელი* @ 66.67% (RGB/წინასწარი ნახვა) No Document დოკუმენტი არ არის Press დააჭირეთ - Search commands ბრძანებების ძიება Search commands and tools ბრძანებებისა და ხელსაწყოების ძიება Style: სტილი: Switch workspace სამუშაო სივრცის გადართვა + Search commands ბრძანებების ძიება Show all open documents ყველა ღია დოკუმენტის ჩვენება Use გამოიყენეთ the object to select | ობიექტზე — მოსანიშნად | diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 13860e91b9..38cae50e93 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3193,11 +3193,11 @@ mark-style Japanese 일본식 Filter Layers Panel Rows 레이어 패널 행 필터링 @msg `Custom` stands for changed settings: save the preset under another name `Custom`은 변경된 설정을 나타냅니다. 프리셋을 다른 이름으로 저장하세요 @msg `{key}` must be an array of these names: {_1} `{key}`은(는) 다음 이름의 배열이어야 합니다: {_1} - Search commands 명령 검색 Search commands and tools 명령 및 도구 검색 Search commands and tools… 명령 및 도구 검색… Recent Commands 최근 명령 No recent commands 최근 명령 없음 + Search commands 명령 검색 Secondary 보조 Select All Art on Layer 레이어의 모든 아트웍 선택 Select All Assets 모든 에셋 선택 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 9f165efd14..bef25a7478 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1795,10 +1795,10 @@ lighting Light Licht Name* @ 66.67% (RGB/Preview) Naam* @ 66.67% (RGB/Voorbeeld) No Document Geen document Press Druk op - Search commands Opdrachten zoeken Search commands and tools Opdrachten en gereedschappen zoeken Style: Stijl: Switch workspace Werkruimte wisselen + Search commands Opdrachten zoeken Show all open documents Alle geopende documenten tonen Use Gebruik the object to select | op het object om te selecteren | diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 20e2f86d10..c29121f73f 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1254,10 +1254,10 @@ lighting Light Światło Name* @ 66.67% (RGB/Preview) Nazwa* @ 66,67% (RGB/Podgląd) No Document Brak dokumentu Press Naciśnij - Search commands Szukaj poleceń Search commands and tools Szukaj poleceń i narzędzi Style: Styl: Switch workspace Przełącz obszar roboczy + Search commands Szukaj poleceń Show all open documents Pokaż wszystkie otwarte dokumenty Use Użyj the object to select | obiekt, aby go zaznaczyć | diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 0d95825dde..bec56aff21 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2742,11 +2742,11 @@ digits Malayalam Malaiala @msg `Custom` stands for changed settings: save the preset under another name `Custom` representa configurações alteradas: salve a predefinição com outro nome @msg `{key}` must be an array of these names: {_1} `{key}` deve ser uma matriz destes nomes: {_1} Search Commands… Pesquisar Comandos… - Search commands Pesquisar comandos Search commands and tools Pesquisar comandos e ferramentas Search commands and tools… Pesquisar comandos e ferramentas… Recent Commands Comandos recentes No recent commands Nenhum comando recente + Search commands Pesquisar comandos Secondary Secundária Section Symbol Símbolo de Seção Select Selecionar diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 3dfaa07482..2f8eaf86b9 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3316,11 +3316,11 @@ digits Malayalam Малаялам Filter Layers Panel Rows Фильтровать строки панели «Слои» @msg `Custom` stands for changed settings: save the preset under another name `Custom` обозначает изменённые параметры: сохраните набор под другим именем @msg `{key}` must be an array of these names: {_1} `{key}` должно быть массивом из этих имён: {_1} - Search commands Поиск команд Search commands and tools Поиск команд и инструментов Search commands and tools… Поиск команд и инструментов… Recent Commands Недавние команды No recent commands Нет недавних команд + Search commands Поиск команд Search Commands… Поиск команд… Secondary Вторичный Section Symbol Символ параграфа diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 248adc3ec7..f82ed5aef1 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3202,11 +3202,11 @@ digits Malayalam Malayalam Scripts Skript Search Sök Search All Sök i alla - Search commands Sök kommandon Search commands and tools Sök kommandon och verktyg Search commands and tools… Sök kommandon och verktyg… Recent Commands Senaste kommandon No recent commands Inga senaste kommandon + Search commands Sök kommandon Search Commands… Sök kommandon… Secondary Sekundär Section Symbol Paragraftecken diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index c8ff293ebb..7d24eb2167 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3074,11 +3074,11 @@ digits Malayalam Malayalam Redefine {name} “{name}” Stilini Yeniden Tanımla @msg `Custom` stands for changed settings: save the preset under another name `Custom` değiştirilmiş ayarları ifade eder: ön ayarı başka bir adla kaydedin @msg `{key}` must be an array of these names: {_1} `{key}` şu adlardan oluşan bir dizi olmalıdır: {_1} - Search commands Komutları arayın Search commands and tools Komutları ve araçları arayın Search commands and tools… Komutları ve araçları arayın… Recent Commands Son komutlar No recent commands Son komut yok + Search commands Komutları arayın Search Commands… Arama Komutları… Secondary İkincil Section Symbol Bölüm Sembolü diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index c4e95fd2db..33e2e91479 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3319,11 +3319,11 @@ digits Malayalam Малаялам Filter Layers Panel Rows Фільтрувати рядки панелі «Шари» @msg `Custom` stands for changed settings: save the preset under another name `Custom` позначає змінені параметри: збережіть набір під іншим ім’ям @msg `{key}` must be an array of these names: {_1} `{key}` має бути масивом цих назв: {_1} - Search commands Пошук команд Search commands and tools Пошук команд та інструментів Search commands and tools… Пошук команд та інструментів… Recent Commands Нещодавні команди No recent commands Немає нещодавніх команд + Search commands Пошук команд Search Commands… Пошук команд… Secondary Вторинний Section Symbol Символ параграфа diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 6c79308d93..7e24df798e 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3661,11 +3661,11 @@ mark-style Japanese Kiểu Nhật Filter Layers Panel Rows Lọc hàng bảng Lớp @msg `Custom` stands for changed settings: save the preset under another name `Custom` biểu thị các cài đặt đã thay đổi: hãy lưu thiết lập sẵn với tên khác @msg `{key}` must be an array of these names: {_1} `{key}` phải là một mảng gồm các tên sau: {_1} - Search commands Tìm kiếm lệnh Search commands and tools Tìm kiếm lệnh và công cụ Search commands and tools… Tìm kiếm lệnh và công cụ… Recent Commands Lệnh gần đây No recent commands Không có lệnh gần đây + Search commands Tìm kiếm lệnh Search Commands… Tìm kiếm lệnh… Search Fonts Folder Tìm kiếm thư mục phông chữ Searching… Đang tìm kiếm… diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 1e318d4001..392ac019ba 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3146,11 +3146,11 @@ digits Malayalam 马拉雅拉姆数字 Locked 已锁定 Hidden 已隐藏 Filter Layers Panel Rows 筛选图层面板行 - Search commands 搜索命令 Search commands and tools 搜索命令和工具 Search commands and tools… 搜索命令和工具… Recent Commands 最近使用的命令 No recent commands 没有最近使用的命令 + Search commands 搜索命令 Search Commands… 搜索命令… Secondary 次要 Section Symbol 章节符号 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e2f1a7950c..d20b65b184 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4452,11 +4452,11 @@ digits Malayalam 馬來亞拉姆數字 Locked 已鎖定 Hidden 已隱藏 Filter Layers Panel Rows 篩選圖層面板列 - Search commands 搜尋指令 Search commands and tools 搜尋指令與工具 Search commands and tools… 搜尋指令與工具… Recent Commands 最近使用的指令 No recent commands 沒有最近使用的指令 + Search commands 搜尋指令 Search Commands… 搜尋指令… Secondary 次要 Section Symbol 章節符號 diff --git a/crates/ui-egui/src/titlebar.rs b/crates/ui-egui/src/titlebar.rs index cbbd216e75..8f62cbff12 100644 --- a/crates/ui-egui/src/titlebar.rs +++ b/crates/ui-egui/src/titlebar.rs @@ -322,11 +322,15 @@ mod tests { assert!(!a.shrink(0.5).intersects(b.shrink(0.5)), "{a:?} overlaps {b:?} at {width}"); } } - // Wide windows show the whole group; narrow ones drop Discord, then the search icon. + // Wide windows show the whole group, the search field included; narrow ones drop the + // community button first, and the search field goes before the search icon. let texts: Vec = texts(&out).into_iter().map(|(t, _)| t).collect(); let has = |s: &str| texts.iter().any(|t| t == s); assert_eq!(has("Discord"), width > 1000.0, "{width}: {texts:?}"); - // Search is an icon only (as in PhotoCraft): its label lives in the tooltip. + if width > 1000.0 { + assert!(has("Search commands"), "the search field shows at {width}: {texts:?}"); + } + // The search's tooltip text is not painted in the bar. assert!(!has("Search commands and tools"), "{width}: {texts:?}"); } } diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index d4d677a0a6..444cdda37d 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -30,7 +30,9 @@ pub use buttons::{ SPLIT_ARROW, flat_button, flat_button_fit, icon_button, icon_button_enabled, menu_item, menu_item_name, paint_icon_button, primary_button, primary_button_enabled, secondary_button, split_button, split_button_named, toggle_icon, }; -pub(crate) use buttons::{button_width, flat_button_fit_width, icon_button_info, primary_button_width, secondary_button_width}; +pub(crate) use buttons::{ + button_width, flat_button_fit_width, icon_button_info, paint_icon_button_named, primary_button_width, secondary_button_width, +}; #[cfg(test)] use chips::gradient_chip_colors; pub use chips::{ProxyClicks, chip_button, chip_button_named, fill_stroke_proxy, gradient_chip, paint_chip, proxy_chip, swatch_tile}; diff --git a/crates/ui-egui/src/widgets/buttons.rs b/crates/ui-egui/src/widgets/buttons.rs index a8b8486bfa..19062eaf4c 100644 --- a/crates/ui-egui/src/widgets/buttons.rs +++ b/crates/ui-egui/src/widgets/buttons.rs @@ -8,6 +8,12 @@ pub fn icon_button(ui: &mut Ui, icon: &str, tip: &str, selected: bool, size: f32 /// [`icon_button`] drawn for a response the caller made (its own id or sense). pub fn paint_icon_button(ui: &mut Ui, resp: Response, icon: &str, tip: &str, selected: bool) -> Response { + paint_icon_button_named(ui, resp, icon, tl!(tip), tl!(tip), selected) +} + +/// [`paint_icon_button`] that screen readers call `name` and that shows the tool tip `tip` (none +/// when empty), both as given. +pub(crate) fn paint_icon_button_named(ui: &mut Ui, resp: Response, icon: &str, name: &str, tip: &str, selected: bool) -> Response { let t = Tokens::get(ui.ctx()); let rect = resp.rect; let size = rect.width(); @@ -21,8 +27,8 @@ pub fn paint_icon_button(ui: &mut Ui, resp: Response, icon: &str, tip: &str, sel ui.painter().rect_filled(rect, CornerRadius::same(5), bg); let pad = (size * 0.2).round(); icons::paint(ui, icon, rect.shrink(pad), if selected { t.text_strong } else { t.icon }); - resp.widget_info(|| icon_button_info(ui.is_enabled(), selected, tl!(tip))); - if !tip.is_empty() { resp.on_hover_text(tl!(tip)) } else { resp } + resp.widget_info(|| icon_button_info(ui.is_enabled(), selected, name)); + if !tip.is_empty() { resp.on_hover_text(tip) } else { resp } } /// Small flat text button (Quick Actions style). diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index a4585db2f7..ecd556028f 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1017,7 +1017,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`). - - 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 own keys stay off, so Enter does not open Move and Tab moves the focus on. While a dialog is open the field and the icon do nothing, as the shortcut does. Screen readers name the field 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. 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_keyboard_opens_the_palette_from_the_search_field`, `a_narrowing_app_bar_turns_the_search_field_into_the_icon`). + - 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`). - The Learn panel (Window › Learn, or Explore tutorials beside the search field 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`. From 685ab7ccd43ae81f95eeeacff52dc0223971655d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 08:05:40 -0800 Subject: [PATCH 04/22] Ellipse: a click on the word Height in the click dialog copies Width into Height The Ellipse dialog's Height label is now a button. A click, or Space or Enter while it has the keyboard focus, copies the Width value into the Height field, so OK draws a circle. The Rectangle and Rounded Rectangle dialogs keep plain labels. With Constrain Width and Height Proportions on, the link stays on and keeps the circle when a side is typed next. A Width that is empty or not a distance, including one the field refuses as the click leaves it, leaves Height unchanged. Enter on the Height button or on the link button no longer also presses OK. Screen readers read the button as "Height:", which still names the Height field, with the description "Copy Width to Height" (translated in every catalog). --- crates/ui-egui/src/dialogs/shapes.rs | 282 ++++++++++++++++++++++++++- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/target-app-parity.md | 1 + 30 files changed, 310 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/shapes.rs b/crates/ui-egui/src/dialogs/shapes.rs index b761383752..651fa098ff 100644 --- a/crates/ui-egui/src/dialogs/shapes.rs +++ b/crates/ui-egui/src/dialogs/shapes.rs @@ -294,7 +294,15 @@ fn linked_size_form(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { let mut rows: Option = None; egui::Grid::new("shape-size-dlg").num_columns(3).spacing([10.0, 8.0]).show(ui, |ui| { for (key, label) in [("width", "Width:"), ("height", "Height:")] { - let row = form::row_label(ui, label); + let row = if key == "height" && d.kind == "ellipse" { + let (row, pressed) = height_label_button(ui, label); + if pressed { + copy_width_to_height(d); + } + row + } else { + form::row_label(ui, label) + }; if ui.label_inputs_by(row.id, |ui| form::length(ui, d, key, unit, form::FIELD_W)) { follow_link(d, key); } @@ -316,6 +324,8 @@ fn linked_size_form(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { let resp = ui.interact(rect, ui.scope_id().with("shape-size-link"), egui::Sense::click()); let icon = if on { "link" } else { "link-2-off" }; if widgets::paint_icon_button(ui, resp, icon, "Constrain Width and Height Proportions", on).clicked() { + // Enter on the focused button turns the link on or off; it does not also press OK. + ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter)); d.fields.insert(LINK.into(), json!(!on)); sync_link(ui.ctx(), d); } @@ -361,6 +371,61 @@ fn follow_link(d: &mut Dialog, typed: &str) { } } +/// The Ellipse dialog's Height label: a button drawn as the other rows' labels are. Whether it was +/// pressed: a click, or Enter or Space while it has the keyboard focus; that Enter does not also +/// press OK. A click whose press took the focus from a field that then refused its text (Width +/// left empty or not a distance) does not count, as such a click on OK does not. Screen readers +/// read it as the button "Height:" (which also names the Height field) with the description "Copy +/// Width to Height". +fn height_label_button(ui: &mut egui::Ui, label: &str) -> (egui::Response, bool) { + let t = crate::theme::Tokens::get(ui.ctx()); + let text = egui::RichText::new(tl!(label)).color(t.text_dim); + let resp = ui.add(egui::Button::new(text).frame(false)).on_hover_cursor(egui::CursorIcon::PointingHand); + let resp = resp.on_hover_text(tl!("Copy Width to Height")); + let press = resp.id.with("press-pass"); + if resp.contains_pointer() && ui.input(|i| i.pointer.any_pressed()) { + let pass = ui.ctx().cumulative_pass_nr(); + ui.data_mut(|m| m.insert_temp(press, pass)); + } + if !resp.clicked() { + // A press let go without a click (dragged off the button) leaves no press behind. + if ui.input(|i| i.pointer.any_released()) { + ui.data_mut(|m| m.remove::(press)); + } + return (resp, false); + } + ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter)); + let (pressed_at, refused_at, refused_now) = ui.data_mut(|m| { + let pressed_at = m.get_temp::(press); + m.remove::(press); + (pressed_at, m.get_temp::(widgets::dialog_reject_pass()), m.get_temp::(widgets::dialog_reject_commit_flag())) + }); + let refused = refused_now == Some(true) || matches!((refused_at, pressed_at), (Some(r), Some(p)) if r >= p); + (resp, !refused) +} + +/// Height takes the Width the dialog holds (help page "Draw ellipses", +/// ). +/// A Width that is missing, empty, not a distance or not finite leaves Height as it is. With the +/// link on, the link keeps the circle from then on (proportions 1 : 1), or keeps no proportions +/// when Width is 0; the link stays on. +fn copy_width_to_height(d: &mut Dialog) { + let width = match d.fields.get("width") { + Some(Value::Number(n)) => n.as_f64(), + Some(Value::String(s)) => Unit::Points.parse(s), + _ => None, + }; + let Some(width) = width.filter(|w| w.is_finite()) else { return }; + d.fields.insert("height".into(), json!(width)); + if d.bool(LINK) { + if width != 0.0 { + d.fields.insert(RATIO.into(), json!(1.0)); + } else { + d.fields.remove(RATIO); + } + } +} + /// The Ellipse dialog's Anchors: the nearest whole number from 2 to 1000 (4, a live ellipse, when /// left empty or not a number). fn ellipse_anchors(d: &Dialog) -> u64 { @@ -794,6 +859,221 @@ mod tests { assert_eq!(ellipse_anchors(h.state().ui.dialog.as_ref().unwrap()), 4); } + /// A harness drawing `app`'s dialog, with the app's fonts installed on its first frame. + fn dialog_harness(app: VectorcraftApp) -> egui_kittest::Harness<'static, VectorcraftApp> { + let mut fonts = false; + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1100.0, 900.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + if !std::mem::replace(&mut fonts, true) { + crate::theme::install_fonts(ui.ctx()); + return; + } + super::super::show(app, ui.ctx()); + }, + app, + ); + h.run_steps(5); + h + } + + /// The dialog's Width and Height in points. + fn dialog_size(h: &egui_kittest::Harness<'_, VectorcraftApp>) -> (f64, f64) { + let d = h.state().ui.dialog.as_ref().expect("the dialog is open"); + (d.f64("width", -1.0), d.f64("height", -1.0)) + } + + /// Replaces the text of the field named `name` with `text` and leaves it with Tab. + fn retype(h: &mut egui_kittest::Harness<'_, VectorcraftApp>, name: &str, text: &str) { + use egui::accesskit::Role; + use egui_kittest::kittest::Queryable; + let all = egui::Modifiers { ctrl: true, command: true, ..Default::default() }; + h.get_by_role_and_label(Role::TextInput, name).focus(); + h.run_steps(2); + h.key_press_modifiers(all, egui::Key::A); + h.get_by_role_and_label(Role::TextInput, name).type_text(text); + h.run_steps(2); + h.key_press(egui::Key::Tab); + h.run_steps(2); + } + + /// In the Ellipse dialog, a click on the word Height copies Width into Height, also a Width + /// typed and not yet committed; the fields keep their names. Cancel discards it; OK draws the + /// circle as one undo step. + #[test] + fn clicking_height_in_the_ellipse_dialog_copies_width_into_height() { + use egui::accesskit::Role; + use egui_kittest::kittest::{NodeT, Queryable}; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + super::super::open_tool_dialog(&mut app, "ellipse", json!({"x": 10.0, "y": 10.0})); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("width".into(), json!(80.0)); + d.fields.insert("height".into(), json!(30.0)); + let mut h = dialog_harness(app); + h.check_accessibility(); + let button = h.get_by_role_and_label(Role::Button, "Height:"); + assert_eq!(button.accesskit_node().description().as_deref(), Some("Copy Width to Height")); + h.get_by_role_and_label(Role::Button, "Height:").click(); + h.run_steps(2); + assert_eq!(dialog_size(&h), (80.0, 80.0)); + let d = h.state().ui.dialog.as_ref().unwrap(); + assert!(!d.bool(LINK) && !d.fields.contains_key(RATIO), "the link stays off"); + // The value fields keep their names. + h.get_by_role_and_label(Role::TextInput, "Width:"); + h.get_by_role_and_label(Role::TextInput, "Height:"); + + // A Width typed and not committed with Enter or Tab is the one copied. + let all = egui::Modifiers { ctrl: true, command: true, ..Default::default() }; + h.get_by_role_and_label(Role::TextInput, "Width:").focus(); + h.run_steps(2); + h.key_press_modifiers(all, egui::Key::A); + h.get_by_role_and_label(Role::TextInput, "Width:").type_text("50 pt"); + h.run_steps(2); + h.get_by_role_and_label(Role::Button, "Height:").click(); + h.run_steps(3); + assert_eq!(dialog_size(&h), (50.0, 50.0)); + + // A Width the field refuses when the click takes its focus (not a distance, or empty) + // is not copied: Height keeps its value. + h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("height".into(), json!(30.0)); + h.run_steps(2); + for typed in ["wide", ""] { + h.get_by_role_and_label(Role::TextInput, "Width:").focus(); + h.run_steps(2); + h.key_press_modifiers(all, egui::Key::A); + if typed.is_empty() { + h.key_press(egui::Key::Backspace); + } else { + h.get_by_role_and_label(Role::TextInput, "Width:").type_text(typed); + } + h.run_steps(2); + h.get_by_role_and_label(Role::Button, "Height:").click(); + h.run_steps(3); + assert_eq!(dialog_size(&h), (50.0, 30.0), "{typed:?}"); + } + // The field shows its value again, and the next click copies it. + h.get_by_role_and_label(Role::Button, "Height:").click(); + h.run_steps(3); + assert_eq!(dialog_size(&h), (50.0, 50.0)); + + // Cancel: nothing is drawn. + let undo = |h: &egui_kittest::Harness<'_, VectorcraftApp>| h.state().session.active().unwrap().history.undo.len(); + let before = undo(&h); + crate::dialogs::cancel(h.state_mut()); + h.run_steps(2); + assert!(h.state().session.doc().unwrap().doc.layers[0].children().unwrap().is_empty()); + assert_eq!(undo(&h), before); + + // OK: one circle, one undo step. + super::super::open_tool_dialog(h.state_mut(), "ellipse", json!({"x": 10.0, "y": 10.0})); + h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("width".into(), json!(64.0)); + h.run_steps(2); + h.get_by_role_and_label(Role::Button, "Height:").click(); + h.run_steps(2); + super::super::confirm(h.state_mut()).unwrap(); + assert!(h.state().ui.dialog.is_none()); + assert_eq!(undo(&h), before + 1); + let doc = &h.state().session.doc().unwrap().doc; + let b = doc.layers[0].children().unwrap()[0].geometric_bounds().unwrap(); + assert!((b.width() - 64.0).abs() < 1e-6 && (b.height() - 64.0).abs() < 1e-6, "{b:?}"); + } + + /// The Height button works from the keyboard: Space and Enter copy Width into Height, and + /// that Enter does not press OK. With the link on, the link stays on and keeps the circle when + /// Width is typed next; a Width of 0 is copied and leaves the link no proportions to keep. + #[test] + fn the_ellipse_height_button_copies_width_from_the_keyboard_and_keeps_the_link_round() { + use egui::accesskit::Role; + use egui_kittest::kittest::Queryable; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + super::super::open_tool_dialog(&mut app, "ellipse", json!({"x": 10.0, "y": 10.0})); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("width".into(), json!(80.0)); + d.fields.insert("height".into(), json!(20.0)); + d.fields.insert(LINK.into(), json!(true)); + let mut h = dialog_harness(app); + assert_eq!(h.state().ui.dialog.as_ref().unwrap().f64(RATIO, 0.0), 0.25); + h.get_by_role_and_label(Role::Button, "Height:").focus(); + h.run_steps(2); + h.key_press(egui::Key::Space); + h.run_steps(2); + assert_eq!(dialog_size(&h), (80.0, 80.0)); + let d = h.state().ui.dialog.as_ref().unwrap(); + assert!(d.bool(LINK), "the link stays on"); + assert_eq!(d.f64(RATIO, 0.0), 1.0); + // The link now keeps the circle. + retype(&mut h, "Width:", "40 pt"); + assert_eq!(dialog_size(&h), (40.0, 40.0)); + + // Enter on the button copies, and the dialog stays open. + h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("width".into(), json!(0.0)); + h.run_steps(2); + h.get_by_role_and_label(Role::Button, "Height:").focus(); + h.run_steps(2); + h.key_press(egui::Key::Enter); + h.run_steps(2); + assert!(h.state().ui.dialog.is_some(), "Enter on the Height button does not press OK"); + assert_eq!(dialog_size(&h), (0.0, 0.0)); + let d = h.state().ui.dialog.as_ref().unwrap(); + assert!(d.bool(LINK) && !d.fields.contains_key(RATIO), "no proportions to keep at 0"); + assert!(h.state().session.doc().unwrap().doc.layers[0].children().unwrap().is_empty()); + } + + /// Enter on the focused link button turns the link on and leaves the dialog open, as Space does. + #[test] + fn enter_on_the_link_button_turns_the_link_on_without_pressing_ok() { + use egui::accesskit::Role; + use egui_kittest::kittest::Queryable; + const LINK_NAME: &str = "Constrain Width and Height Proportions"; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + super::super::open_tool_dialog(&mut app, "rectangle", json!({"x": 10.0, "y": 10.0})); + let mut h = dialog_harness(app); + assert!(!h.state().ui.dialog.as_ref().unwrap().bool(LINK)); + h.get_by_role_and_label(Role::Button, LINK_NAME).focus(); + h.run_steps(2); + h.key_press(egui::Key::Enter); + h.run_steps(2); + let d = h.state().ui.dialog.as_ref().expect("Enter on the link button does not press OK"); + assert!(d.bool(LINK)); + assert!(h.state().session.doc().unwrap().doc.layers[0].children().unwrap().is_empty()); + } + + /// Rectangle and Rounded Rectangle keep plain Width and Height labels. + #[test] + fn only_the_ellipse_dialog_has_the_height_button() { + use egui::accesskit::Role; + use egui_kittest::kittest::Queryable; + for kind in ["rectangle", "roundedRectangle"] { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + super::super::open_tool_dialog(&mut app, kind, json!({"x": 10.0, "y": 10.0})); + let h = dialog_harness(app); + h.get_by_role_and_label(Role::TextInput, "Height:"); + assert!(h.query_by_role_and_label(Role::Button, "Height:").is_none(), "{kind}"); + } + } + + /// A Width that is missing, empty, not a distance or not finite leaves Height as it is; a + /// Width with a unit is copied in points, and 0 is copied. + #[test] + fn copying_width_takes_only_a_width_that_reads() { + for width in [None, Some(json!("")), Some(json!("wide")), Some(json!("inf")), Some(json!(null)), Some(json!(true))] { + let mut d = Dialog::new("ellipse", json!({"height": 30.0})); + if let Some(w) = width.clone() { + d.fields.insert("width".into(), w); + } + copy_width_to_height(&mut d); + assert_eq!(d.fields.get("height"), Some(&json!(30.0)), "{width:?}"); + } + for (width, want) in [(json!("1 in"), 72.0), (json!(0), 0.0), (json!(12.5), 12.5)] { + let mut d = Dialog::new("ellipse", json!({"width": width.clone(), "height": 30.0})); + copy_width_to_height(&mut d); + assert_eq!(d.f64("height", -1.0), want, "{width}"); + } + } + #[test] fn ellipse_anchors_take_the_nearest_whole_number_from_2_to_1000() { let d = |v: Value| Dialog::new("ellipse", json!({ "anchors": v })); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 613d5cd1e3..e4aa85e716 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -592,6 +592,7 @@ font-technology Variable Променливи Consolidate All Windows Обединяване на всички прозорци Constrain Angle Заключване на ъгъла Constrain Width and Height Proportions Запазване на пропорциите на ширина и височина + Copy Width to Height Копиране на ширината във височината Construction Guides Конструкционни водачи Contextual Alternates Контекстни алтернативи Contextual Task Bar Контекстна лента със задачи diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index fcc034cd0f..6b751766ef 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -3876,6 +3876,7 @@ theme Appearance Izgled Command Click to Select Objects Behind Command-klik za odabir objekata iza Constrain Angle Ograniči ugao Constrain Width and Height Proportions Zadrži proporcije širine i visine + Copy Width to Height Kopiraj širinu u visinu Construction Guides Konstrukcijske vodilice Curvature Tool Alat zakrivljenost Data Recovery Oporavak podataka diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index ac55a78ff4..2eac9f7e17 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -884,6 +884,7 @@ antiAlias Sharp Nítid Constrain Restringeix Constrain Angle Angle de restricció Constrain Width and Height Proportions Restringeix les proporcions d’amplada i alçada + Copy Width to Height Copia l’amplada a l’alçada Construction Guides Guies de construcció Contextual Alternates Alternatives contextuals Contextual Task Bar Barra de tasques contextual diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 69dd46dc23..bc4e94fc22 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -3979,6 +3979,7 @@ theme Appearance Motiv Command Click to Select Objects Behind Kliknutím s Cmd vybírat objekty vzadu Constrain Angle Úhel omezení Constrain Width and Height Proportions Zachovat proporce šířky a výšky + Copy Width to Height Kopírovat šířku do výšky Construction Guides Konstrukční vodítka Curvature Tool Nástroj Zakřivení Data Recovery Obnovení dat diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 7bc0ed6c94..c54e0c961b 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6376,6 +6376,7 @@ theme Appearance Udseende Command Click to Select Objects Behind Command-klik for at markere objekter bagved Constrain Angle Fastlåsningsvinkel Constrain Width and Height Proportions Fasthold forholdet mellem bredde og højde + Copy Width to Height Kopiér bredde til højde Construction Guides Konstruktionshjælpelinjer Curvature Tool Krumningsværktøj Data Recovery Datgendannelse diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 4b17261bfb..33dade7e4c 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -585,6 +585,7 @@ font-technology Variable Variabel Consolidate All Windows Alle Fenster zusammenführen Constrain Angle Winkelbeschränkung Constrain Width and Height Proportions Proportionen von Breite und Höhe beibehalten + Copy Width to Height Breite in Höhe kopieren Construction Guides Konstruktionslinien Contextual Alternates Kontextbedingte Varianten Contextual Task Bar Kontextbezogene Taskleiste diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index bba8d392ad..3bf2b655dd 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -566,6 +566,7 @@ font-technology Variable Μεταβλητές Consolidate All Windows Συγχώνευση όλων των παραθύρων Constrain Angle Περιορισμός γωνίας Constrain Width and Height Proportions Διατήρηση αναλογιών πλάτους και ύψους + Copy Width to Height Αντιγραφή πλάτους στο ύψος Construction Guides Οδηγοί κατασκευής Contextual Alternates Εναλλακτικοί χαρακτήρες βάσει συμφραζομένων Contextual Task Bar Γραμμή εργασιών βάσει περιβάλλοντος diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 57e7f44e87..82b1a47478 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -607,6 +607,7 @@ font-technology Variable Variables Consolidate All Windows Consolidar todas las ventanas Constrain Angle Restringir ángulo Constrain Width and Height Proportions Restringir proporciones de anchura y altura + Copy Width to Height Copiar anchura en altura Construction Guides Guías de construcción Contextual Alternates Alternativas contextuales Contextual Task Bar Barra de tareas contextual diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 0276e5b6ed..44165e80c4 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -3917,6 +3917,7 @@ theme Appearance Ulkoasu Command Click to Select Objects Behind Valitse takana olevat objektit Komento-napsautuksella Constrain Angle Rajoita kulmaa Constrain Width and Height Proportions Säilytä leveyden ja korkeuden suhde + Copy Width to Height Kopioi leveys korkeudeksi Construction Guides Rakenneapuviivat Curvature Tool Kaarevuustyökalu Data Recovery Tietojen palautus diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 75f4f14c6f..c4edd359c5 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -608,6 +608,7 @@ font-technology Variable Variables Consolidate All Windows Regrouper toutes les fenêtres Constrain Angle Contraindre l’angle Constrain Width and Height Proportions Conserver les proportions de largeur et de hauteur + Copy Width to Height Copier la largeur dans la hauteur Construction Guides Repères de construction Contextual Alternates Variantes contextuelles Contextual Task Bar Barre des tâches contextuelle diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..8b448dbf43 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -704,6 +704,7 @@ Constrain મર્યાદિત કરો Constrain Angle ખૂણો મર્યાદિત કરો Constrain Width and Height Proportions પહોળાઈ અને ઊંચાઈનો પ્રમાણ મર્યાદિત કરો + Copy Width to Height પહોળાઈને ઊંચાઈમાં નકલ કરો Construction Guides બાંધકામ ગાઇડ્સ Contextual Alternates સંદર્ભિત વૈકલ્પિક અક્ષરો Contextual Task Bar સંદર્ભિત ટાસ્ક બાર diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 094d49ce52..6a11ade6a4 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1019,6 +1019,7 @@ antiAlias Sharp शार्प Constrain सीमित करें Constrain Angle कंस्ट्रेन एंगल Constrain Width and Height Proportions चौड़ाई और ऊंचाई का अनुपात बनाए रखें + Copy Width to Height चौड़ाई को ऊंचाई में कॉपी करें Construction Guides निर्माण गाइड Conté Crayon कॉन्टे क्रेयॉन Conté Crayon… कॉन्टे क्रेयॉन… diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index d5f42ce788..72460bf22b 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -801,6 +801,7 @@ font-technology Variable Változó Constrain Korlátozás Constrain Angle Korlátozási szög Constrain Width and Height Proportions Szélesség és magasság arányának megtartása + Copy Width to Height Szélesség másolása a magasságba Construction Guides Szerkesztési segédvonalak Contextual Alternates Környezetfüggő változatok Contextual Task Bar Helyzetérzékeny műveletsáv diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index b349f589a5..63bba3c347 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3653,6 +3653,7 @@ theme Appearance Tampilan Command Click to Select Objects Behind Command-klik untuk memilih objek di belakang Constrain Angle Sudut kendala Constrain Width and Height Proportions Kendalikan proporsi lebar dan tinggi + Copy Width to Height Salin lebar ke tinggi Construction Guides Panduan konstruksi Curvature Tool Alat kelengkungan Data Recovery Pemulihan data diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8bc9d44147..aebe1850ae 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -607,6 +607,7 @@ font-technology Variable Variabili Consolidate All Windows Consolida tutte le finestre Constrain Angle Vincola angolo Constrain Width and Height Proportions Vincola proporzioni di larghezza e altezza + Copy Width to Height Copia la larghezza nell’altezza Construction Guides Guide di costruzione Contextual Alternates Alternative contestuali Contextual Task Bar Barra attività contestuale diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 57c9aee61e..b008d3bcb3 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1368,6 +1368,7 @@ antiAlias Sharp シャープ Conflict {n} of {count} 競合 {n} / {count} Constrain Angle 角度を制限 Constrain Width and Height Proportions 幅と高さの縦横比を固定 + Copy Width to Height 幅を高さにコピー Construction Guides 作図ガイド Contextual Alternates 前後関係に依存する字形 Convert 変換 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index a661bc0cbb..5e1e3b4983 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -5631,6 +5631,7 @@ theme Appearance იერსახე Command Click to Select Objects Behind Command-დაწკაპუნებით უკან მდებარე ობიექტების მონიშვნა Constrain Angle კუთხის შეზღუდვა Constrain Width and Height Proportions სიგანისა და სიმაღლის პროპორციების შენარჩუნება + Copy Width to Height სიგანის კოპირება სიმაღლეში Construction Guides სამშენებლო დამხმარე ხაზები Curvature Tool მრუდის ხელსაწყო Data Recovery მონაცემების აღდგენა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 632c2473f8..985a8104c3 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1358,6 +1358,7 @@ antiAlias Sharp 날카롭게 Conflict {n} of {count} 충돌 {n}/{count} Constrain Angle 각도 제한 Constrain Width and Height Proportions 너비와 높이 비율 고정 + Copy Width to Height 너비를 높이로 복사 Construction Guides 작도 안내선 Contextual Alternates 문맥 대체 글자 Convert 변환 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 0137b7ac5b..d78e1f9f6a 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4270,6 +4270,7 @@ theme Appearance Vormgeving Command Click to Select Objects Behind Command-klik om objecten erachter te selecteren Constrain Angle Vastleghoek Constrain Width and Height Proportions Breedte- en hoogteverhouding vastleggen + Copy Width to Height Breedte naar hoogte kopiëren Construction Guides Bouwhulplijnen Curvature Tool Krommingsgereedschap Data Recovery Gegevensherstel diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index a2909473c2..65c5d809dc 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3856,6 +3856,7 @@ theme Appearance Wygląd Command Click to Select Objects Behind Kliknięcie z Command zaznacza obiekty pod spodem Constrain Angle Kąt ograniczenia Constrain Width and Height Proportions Zachowaj proporcje szerokości i wysokości + Copy Width to Height Kopiuj szerokość do wysokości Construction Guides Linie konstrukcyjne Curvature Tool Narzędzie Krzywizna Data Recovery Odzyskiwanie danych diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 9c7e0fddd5..42d0bedbaf 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -552,6 +552,7 @@ antiAlias Sharp Nítido Consolidate All Windows Consolidar Todas as Janelas Constrain Angle Ângulo de Restrição Constrain Width and Height Proportions Restringir Proporções de Largura e Altura + Copy Width to Height Copiar Largura para Altura Construction Guides Guias de Construção Contextual Alternates Variantes Contextuais Contextual Task Bar Barra de Tarefas Contextual diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 87424a1938..6d073b7b6a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -605,6 +605,7 @@ font-technology Variable Вариативные Consolidate All Windows Объединить все окна Constrain Angle Ограничить угол Constrain Width and Height Proportions Сохранять пропорции ширины и высоты + Copy Width to Height Копировать ширину в высоту Construction Guides Направляющие построения Contextual Alternates Контекстные альтернативы Contextual Task Bar Контекстная панель задач diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 62ac5b67a8..55954bc41d 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -594,6 +594,7 @@ font-technology Variable Variabla Consolidate All Windows Samla alla fönster Constrain Angle Begränsa vinkel Constrain Width and Height Proportions Behåll proportioner för bredd och höjd + Copy Width to Height Kopiera bredd till höjd Construction Guides Konstruktionsstödlinjer Contextual Alternates Kontextuella alternativ Contextual Task Bar Kontextuellt aktivitetsfält diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 9076b8da7c..e8d0665fd2 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -587,6 +587,7 @@ font-technology Variable Değişken Consolidate All Windows Tüm Pencereleri Birleştir Constrain Angle Açıyı Sınırla Constrain Width and Height Proportions Genişlik ve Yükseklik Oranlarını Sınırla + Copy Width to Height Genişliği Yüksekliğe Kopyala Construction Guides İnşaat Kılavuzları Contextual Alternates Bağlamsal Alternatifler Contextual Task Bar Bağlamsal Görev Çubuğu diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index c701f1bd5d..7e48b16e08 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -601,6 +601,7 @@ font-technology Variable Варіативні Consolidate All Windows Об’єднати всі вікна Constrain Angle Обмежити кут Constrain Width and Height Proportions Зберігати пропорції ширини та висоти + Copy Width to Height Копіювати ширину у висоту Construction Guides Напрямні побудови Contextual Alternates Контекстні альтернативи Contextual Task Bar Контекстна панель завдань diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 7ce09032d1..665ed7b880 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -705,6 +705,7 @@ font-technology Variable Biến thiên Constrain Giữ tỷ lệ Constrain Angle Ràng buộc góc Constrain Width and Height Proportions Ràng buộc tỷ lệ chiều rộng và chiều cao + Copy Width to Height Sao chép chiều rộng sang chiều cao Construction Guides Đường căn xây dựng Contextual Alternates Ký tự thay thế theo ngữ cảnh Contextual Task Bar Thanh tác vụ theo ngữ cảnh diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 86f04f416e..39b52139a6 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -552,6 +552,7 @@ antiAlias Sharp 锐利 Consolidate All Windows 合并所有窗口 Constrain Angle 约束角度 Constrain Width and Height Proportions 约束宽高比例 + Copy Width to Height 将宽度复制到高度 Construction Guides 构造参考线 Contextual Alternates 上下文替代 Contextual Task Bar 上下文任务栏 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 65e5274812..2fc830e1cb 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -569,6 +569,7 @@ font-technology Variable 可變 Consolidate All Windows 合併所有視窗 Constrain Angle 強制角度 Constrain Width and Height Proportions 強制寬度與高度比例 + Copy Width to Height 將寬度複製到高度 Construction Guides 建構參考線 Contextual Alternates 前後關聯替代字 Contextual Task Bar 快捷工作列 diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index a81d1add49..f9015038e3 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1206,6 +1206,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur While a spiral is dragged out, Alt adds or removes whole winds of four segments and Ctrl/Cmd changes the decay. The spiral's inner end keeps the distance from the center it had on the first modified drag event, while the outer end follows the pointer. The [default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) (archived copy) list Alt-drag to add or subtract winds and Ctrl-drag to change the decay rate; [Draw spirals](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-spirals.html) defines four segments per full wind and Decay as the amount each wind decreases. An 80% spiral has 80% of its outer radius after four segments; newly drawn spirals with the same settings wind more broadly than in earlier VectorCraft builds. Rounding the fitted count to whole winds from the count on the first Alt-only drag event, the held inner radius, the ranges (2…1000 segments, 5…99.99 % decay), Ctrl/Cmd taking precedence when both are held, and the new values staying as Spiral tool options are our own rules. Switching back to Alt uses the current count as its new base while keeping the held inner end. Escape while an arc, spiral or grid is dragged out cancels it and puts back the options its keys, Alt and Ctrl/Cmd changed (slope, open or closed, base axis, segments, decay, dividers and skews), so the next drag and the tool's options start from the values before the canceled drag; a drag that is let go keeps them, and an option set with `tool.setOption` during the drag stays. This is VectorCraft's own rule. VectorCraft's own Anchors field in the Ellipse dialog (a click with the Ellipse tool; `shape.ellipse {anchors}`, part of #7840) sets how many smooth anchors the ellipse has, 4 by default; 4 draws a live ellipse, and any other count from 2 to 1000 draws a plain path with the anchors spaced evenly by angle, fitted to the typed width and height. The count last confirmed stays as the Ellipse tool's `anchors` option, and the next Ellipse dialog opens on it (`ellipse_with_four_anchors_is_the_live_ellipse`, `ellipse_anchors_draw_that_many_anchors_on_the_ellipse`, `ellipse_refuses_a_bad_anchor_count`, `the_ellipse_dialog_draws_and_keeps_its_anchor_count`). + In the Ellipse dialog, a click on the word Height copies the Width value into the Height field, so OK draws a circle of that width, as [the help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=90) describes for drawing ellipses. The Rectangle and Rounded Rectangle dialogs keep plain labels. VectorCraft's own rules: the word Height is a button that Space or Enter also presses, and that Enter does not press OK (nor does Enter on the Constrain Width and Height Proportions button); with the link on, the link stays on and keeps the circle when a side is typed next; a Width that is empty or not a distance, including one the field refuses as the click leaves it, leaves Height as it is; Cancel discards the copy. Evidence: `dialogs::shapes::tests::{clicking_height_in_the_ellipse_dialog_copies_width_into_height, the_ellipse_height_button_copies_width_from_the_keyboard_and_keeps_the_link_round, enter_on_the_link_button_turns_the_link_on_without_pressing_ok, only_the_ellipse_dialog_has_the_height_button, copying_width_takes_only_a_width_that_reads}`. - **Cutting:** Eraser, Scissors, Knife, Mirror & Cut, Line Cut and Rectangle Cut (real geometry, compound paths keep their holes). A Scissors cut (`path.split`) leaves one of the two new end points selected and the rest of the path unselected, as [Cut paths](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html) and the "Split a path" section of the [CS3 user guide](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf) describe: the two end points lie on top of each other, and a Direct Selection drag from them moves the selected one with its handles and no other anchor. A closed path cut once stays one open path. While Alt is held, the Scissors tool works as the Add Anchor Point tool ([Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)): a click on a segment adds an anchor point without cutting (`path.insertAnchor`), and the pointer shows the Add Anchor Point cursor. When Alt is let go, a click cuts again. From 9d93240055f34bcdb0b49c523c4cbbc9b6c8895d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 08:13:36 -0800 Subject: [PATCH 05/22] Ellipse: the Height button's help page link opens at Draw ellipses --- crates/ui-egui/src/dialogs/shapes.rs | 2 +- docs/target-app-parity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/shapes.rs b/crates/ui-egui/src/dialogs/shapes.rs index 651fa098ff..cf78326cac 100644 --- a/crates/ui-egui/src/dialogs/shapes.rs +++ b/crates/ui-egui/src/dialogs/shapes.rs @@ -405,7 +405,7 @@ fn height_label_button(ui: &mut egui::Ui, label: &str) -> (egui::Response, bool) } /// Height takes the Width the dialog holds (help page "Draw ellipses", -/// ). +/// ). /// A Width that is missing, empty, not a distance or not finite leaves Height as it is. With the /// link on, the link keeps the circle from then on (proportions 1 : 1), or keeps no proportions /// when Width is 0; the link stays on. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f9015038e3..f682cc0a47 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1206,7 +1206,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur While a spiral is dragged out, Alt adds or removes whole winds of four segments and Ctrl/Cmd changes the decay. The spiral's inner end keeps the distance from the center it had on the first modified drag event, while the outer end follows the pointer. The [default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) (archived copy) list Alt-drag to add or subtract winds and Ctrl-drag to change the decay rate; [Draw spirals](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-spirals.html) defines four segments per full wind and Decay as the amount each wind decreases. An 80% spiral has 80% of its outer radius after four segments; newly drawn spirals with the same settings wind more broadly than in earlier VectorCraft builds. Rounding the fitted count to whole winds from the count on the first Alt-only drag event, the held inner radius, the ranges (2…1000 segments, 5…99.99 % decay), Ctrl/Cmd taking precedence when both are held, and the new values staying as Spiral tool options are our own rules. Switching back to Alt uses the current count as its new base while keeping the held inner end. Escape while an arc, spiral or grid is dragged out cancels it and puts back the options its keys, Alt and Ctrl/Cmd changed (slope, open or closed, base axis, segments, decay, dividers and skews), so the next drag and the tool's options start from the values before the canceled drag; a drag that is let go keeps them, and an option set with `tool.setOption` during the drag stays. This is VectorCraft's own rule. VectorCraft's own Anchors field in the Ellipse dialog (a click with the Ellipse tool; `shape.ellipse {anchors}`, part of #7840) sets how many smooth anchors the ellipse has, 4 by default; 4 draws a live ellipse, and any other count from 2 to 1000 draws a plain path with the anchors spaced evenly by angle, fitted to the typed width and height. The count last confirmed stays as the Ellipse tool's `anchors` option, and the next Ellipse dialog opens on it (`ellipse_with_four_anchors_is_the_live_ellipse`, `ellipse_anchors_draw_that_many_anchors_on_the_ellipse`, `ellipse_refuses_a_bad_anchor_count`, `the_ellipse_dialog_draws_and_keeps_its_anchor_count`). - In the Ellipse dialog, a click on the word Height copies the Width value into the Height field, so OK draws a circle of that width, as [the help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=90) describes for drawing ellipses. The Rectangle and Rounded Rectangle dialogs keep plain labels. VectorCraft's own rules: the word Height is a button that Space or Enter also presses, and that Enter does not press OK (nor does Enter on the Constrain Width and Height Proportions button); with the link on, the link stays on and keeps the circle when a side is typed next; a Width that is empty or not a distance, including one the field refuses as the click leaves it, leaves Height as it is; Cancel discards the copy. Evidence: `dialogs::shapes::tests::{clicking_height_in_the_ellipse_dialog_copies_width_into_height, the_ellipse_height_button_copies_width_from_the_keyboard_and_keeps_the_link_round, enter_on_the_link_button_turns_the_link_on_without_pressing_ok, only_the_ellipse_dialog_has_the_height_button, copying_width_takes_only_a_width_that_reads}`. + In the Ellipse dialog, a click on the word Height copies the Width value into the Height field, so OK draws a circle of that width, as [the help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=140) describes for drawing ellipses. The Rectangle and Rounded Rectangle dialogs keep plain labels. VectorCraft's own rules: the word Height is a button that Space or Enter also presses, and that Enter does not press OK (nor does Enter on the Constrain Width and Height Proportions button); with the link on, the link stays on and keeps the circle when a side is typed next; a Width that is empty or not a distance, including one the field refuses as the click leaves it, leaves Height as it is; Cancel discards the copy. Evidence: `dialogs::shapes::tests::{clicking_height_in_the_ellipse_dialog_copies_width_into_height, the_ellipse_height_button_copies_width_from_the_keyboard_and_keeps_the_link_round, enter_on_the_link_button_turns_the_link_on_without_pressing_ok, only_the_ellipse_dialog_has_the_height_button, copying_width_takes_only_a_width_that_reads}`. - **Cutting:** Eraser, Scissors, Knife, Mirror & Cut, Line Cut and Rectangle Cut (real geometry, compound paths keep their holes). A Scissors cut (`path.split`) leaves one of the two new end points selected and the rest of the path unselected, as [Cut paths](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html) and the "Split a path" section of the [CS3 user guide](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf) describe: the two end points lie on top of each other, and a Direct Selection drag from them moves the selected one with its handles and no other anchor. A closed path cut once stays one open path. While Alt is held, the Scissors tool works as the Add Anchor Point tool ([Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)): a click on a segment adds an anchor point without cutting (`path.insertAnchor`), and the pointer shows the Add Anchor Point cursor. When Alt is let go, a click cuts again. From c6924c2954708ed3918631eaafe191129c5f1dc5 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 08:43:14 -0800 Subject: [PATCH 06/22] Ellipse: test that a Height typed and not committed does not outlast the copy --- crates/ui-egui/src/dialogs/shapes.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/ui-egui/src/dialogs/shapes.rs b/crates/ui-egui/src/dialogs/shapes.rs index cf78326cac..4d967c83db 100644 --- a/crates/ui-egui/src/dialogs/shapes.rs +++ b/crates/ui-egui/src/dialogs/shapes.rs @@ -956,6 +956,22 @@ mod tests { h.run_steps(3); assert_eq!(dialog_size(&h), (50.0, 50.0)); + // A Height typed and not committed does not outlast the copy: a distance is replaced by + // Width, and a Height the field refuses keeps the copy from happening, as it keeps OK from + // confirming. + for (typed, after) in [("70 pt", (50.0, 50.0)), ("tall", (50.0, 30.0))] { + h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("height".into(), json!(30.0)); + h.run_steps(2); + h.get_by_role_and_label(Role::TextInput, "Height:").focus(); + h.run_steps(2); + h.key_press_modifiers(all, egui::Key::A); + h.get_by_role_and_label(Role::TextInput, "Height:").type_text(typed); + h.run_steps(2); + h.get_by_role_and_label(Role::Button, "Height:").click(); + h.run_steps(3); + assert_eq!(dialog_size(&h), after, "{typed:?}"); + } + // Cancel: nothing is drawn. let undo = |h: &egui_kittest::Harness<'_, VectorcraftApp>| h.state().session.active().unwrap().history.undo.len(); let before = undo(&h); From 51efeba7b46c63ff96824bff41d81b5ed863c551 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 12:05:42 -0800 Subject: [PATCH 07/22] Save PDF: holding Alt turns Cancel into Reset While Alt (Option on macOS) is held, the Save PDF dialog's Cancel button reads Reset. Reset (or ui.dialogReset) puts every option back to the chosen preset's settings, clears the passwords and their checkboxes, and leaves the dialog open with its preset, path, artboard range and section. A saved preset deleted while the dialog is open leaves the options as they are. Choosing a preset now also clears the Security section's password checkboxes, which stayed checked with an empty password before. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/dialogs/save_pdf.rs | 37 +++++++++-- crates/ui-egui/src/dialogs/save_pdf/tests.rs | 65 ++++++++++++++++++++ crates/ui-egui/src/dialogs/tests.rs | 25 ++++++++ crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 3 + docs/target-app-parity.md | 1 + 7 files changed, 129 insertions(+), 6 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index f81ea2f7f9..8234aa1ba4 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1336,7 +1336,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.dialogReset", "Reset", "", - "{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`): its fields go back to their defaults and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open or the open one has no Reset", + "{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`; Save PDF, dialog `savePdf`): its fields go back to their defaults (Save PDF: the chosen preset's settings, with the path and artboards kept) and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open or the open one has no Reset", ), ( "ui.justification", diff --git a/crates/ui-egui/src/dialogs/save_pdf.rs b/crates/ui-egui/src/dialogs/save_pdf.rs index 4f8bdf7667..428a8768ff 100644 --- a/crates/ui-egui/src/dialogs/save_pdf.rs +++ b/crates/ui-egui/src/dialogs/save_pdf.rs @@ -7,7 +7,9 @@ //! `document.pdfSettings`. Save Preset… names the settings as a preset (`pdf.preset.save`). //! Opened from Export As with Use Artboards off (`__artBounds`), the dialog has no Artboards //! section, and OK writes one page of the visible art's bounds through [`io::export`]; opened -//! from Export Selection (`__selection` too), the page is the selection's crop. +//! from Export Selection (`__selection` too), the page is the selection's crop. While Alt (Option +//! on macOS) is held, Cancel reads Reset, which puts the options back to the chosen preset's +//! settings and leaves the dialog open (`ui.dialogReset`). //! //! The same dialog edits a preset (kind `pdfPreset`, from Edit → PDF Presets): a `name` and //! `description` instead of the preset and artboards, and OK saves the preset. @@ -30,8 +32,15 @@ use crate::{VectorcraftApp, io, widgets}; pub(super) const KIND: &str = "savePdf"; -pub(super) const SPEC: DialogSpec = - DialogSpec { heading: |_| tl!("Save PDF").into(), body, confirm, ok: Some("Save PDF"), inputs: |_| &["path"], ..DialogSpec::FORM }; +pub(super) const SPEC: DialogSpec = DialogSpec { + heading: |_| tl!("Save PDF").into(), + body, + confirm, + ok: Some("Save PDF"), + inputs: |_| &["path"], + reset: Some(reset), + ..DialogSpec::FORM +}; /// The dialog kind of the preset editor (New / Edit in Edit → PDF Presets). pub(super) const PRESET_KIND: &str = "pdfPreset"; @@ -502,13 +511,33 @@ fn preset_rows(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { fn apply_preset(app: &mut VectorcraftApp, d: &mut Dialog, name: &str) { match settings_fields(app, &json!({ "preset": name })) { Ok(settings) => { - d.fields.extend(settings); + replace_settings(d, settings); d.fields.insert("preset".into(), json!(name)); } Err(e) => app.status(e), } } +/// The UI-only fields that stand for options: the Security section's password checkboxes. +const OPTION_FLAGS: [&str; 2] = ["__requireOpenPassword", "__restrictPermissions"]; + +/// Replace every option with `settings` (from [`settings_fields`]), the password checkboxes +/// included. The preset, the artboard choice, the path and the other UI-only fields (the section, +/// the Save Preset name) stay. +fn replace_settings(d: &mut Dialog, settings: Map) { + d.fields.retain(|k, _| matches!(k.as_str(), "preset" | "range" | "path") || (k.starts_with("__") && !OPTION_FLAGS.contains(&k.as_str()))); + d.fields.extend(settings); +} + +/// Reset (Cancel with Alt or Option held): the options go back to the chosen preset's settings, as +/// choosing that preset sets them, and the dialog stays open. A preset that can no longer be found +/// (a saved one deleted while the dialog is open) leaves the dialog as it is. +fn reset(app: &VectorcraftApp, d: &mut Dialog) { + if let Ok(settings) = settings_fields(app, &json!({ "preset": d.str("preset") })) { + replace_settings(d, settings); + } +} + /// General: the options, then the artboards (Save PDF) or the description (preset editor). fn general(ui: &mut egui::Ui, d: &mut Dialog, editor: bool) { heading(ui, tl!("Options")); diff --git a/crates/ui-egui/src/dialogs/save_pdf/tests.rs b/crates/ui-egui/src/dialogs/save_pdf/tests.rs index b73ec294b1..9315b29f23 100644 --- a/crates/ui-egui/src/dialogs/save_pdf/tests.rs +++ b/crates/ui-egui/src/dialogs/save_pdf/tests.rs @@ -346,6 +346,71 @@ fn presets_reset_the_settings_and_fields_fall_back_to_defaults() { assert!(app.run("ui.savePdfDialog", json!({"compatibility": "1.0"})).is_err(), "bad options are refused"); } +/// Reset (`ui.dialogReset`, or Cancel with Alt or Option held) puts every option back to the +/// chosen preset's settings, passwords and their checkboxes included, and keeps the preset, the +/// path, the artboard range, the section and the dialog. After another preset is chosen, Reset +/// goes back to that one, and choosing it also clears the password checkboxes. +#[test] +fn reset_puts_the_chosen_presets_settings_back_and_keeps_the_path_and_artboards() { + let (mut app, written, _) = app(); + app.run("pdf.preset.save", json!({"name": "Mine", "compatibility": "1.5", "marks": {"trim": true}})).unwrap(); + app.run("ui.savePdfDialog", json!({"path": "/tmp/reset.pdf", "preset": "Mine"})).unwrap(); + set_field(&mut app, "__allArtboards", json!(false)); + set_field(&mut app, "range", json!("2")); + set_field(&mut app, "__section", json!("Security")); + set_field(&mut app, "compatibility", json!("1.7")); + set_field(&mut app, "marks.trim", json!(false)); + set_field(&mut app, "compression.color.ppi", json!(72)); + set_field(&mut app, OPEN_PASSWORD, json!("secret")); + set_field(&mut app, "__restrictPermissions", json!(true)); + let r = app.run("ui.dialogReset", json!({})).unwrap(); + assert_eq!(r["kind"], KIND); + let d = app.ui.dialog.as_ref().expect("Reset leaves the dialog open"); + assert_eq!(get(d, "compatibility"), "1.5"); + assert_eq!(get(d, "marks.trim"), true); + assert_eq!(get(d, "compression.color.ppi"), 300.0, "a nested option goes back too"); + assert_eq!(get(d, OPEN_PASSWORD).as_str().unwrap_or_default(), "", "the password is cleared"); + assert!(!d.fields.contains_key("__restrictPermissions"), "the checkbox is cleared"); + assert_eq!( + (d.str("preset"), d.str("path"), d.str("range"), d.str("__section")), + ("Mine".to_string(), "/tmp/reset.pdf".to_string(), "2".to_string(), "Security".to_string()) + ); + assert!(!d.bool("__allArtboards")); + + let mut d = d.clone(); + d.fields.insert("__requireOpenPassword".into(), json!(true)); + apply_preset(&mut app, &mut d, pdf::DEFAULT_PRESET); + assert!(!d.fields.contains_key("__requireOpenPassword"), "choosing a preset clears the checkbox"); + app.ui.dialog = Some(d); + set_field(&mut app, "compatibility", json!("1.4")); + app.run("ui.dialogReset", json!({})).unwrap(); + let d = app.ui.dialog.as_ref().expect("the dialog stays open"); + assert_eq!(d.str("preset"), pdf::DEFAULT_PRESET); + assert_eq!(get(d, "compatibility"), "1.7"); + assert_eq!(get(d, "marks.trim"), false); + // OK writes the reset options to the kept path and range. + super::super::confirm(&mut app).unwrap(); + let w = written.borrow(); + assert_eq!((w.len(), w[0].0.as_str()), (1, "/tmp/reset.pdf")); + assert!(w[0].1.starts_with(b"%PDF-1.7")); + assert_eq!(vectorcraft_pdf::import(&w[0].1).unwrap().artboards.len(), 1, "range 2"); +} + +/// Reset with a saved preset deleted while the dialog is open leaves the options as they are, +/// rather than switching to another preset's. +#[test] +fn reset_with_a_deleted_preset_keeps_the_options() { + let (mut app, _, _) = app(); + app.run("pdf.preset.save", json!({"name": "Gone", "compatibility": "1.5"})).unwrap(); + app.run("ui.savePdfDialog", json!({"preset": "Gone"})).unwrap(); + set_field(&mut app, "compatibility", json!("1.6")); + app.run("pdf.preset.delete", json!({"name": "Gone"})).unwrap(); + app.run("ui.dialogReset", json!({})).unwrap(); + let d = app.ui.dialog.as_ref().expect("the dialog stays open"); + assert_eq!(d.str("preset"), "Gone"); + assert_eq!(get(d, "compatibility"), "1.6"); +} + #[test] fn marks_and_bleeds_reach_the_pdf() { let (mut app, written, _) = app(); diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index 201b34171d..9e24b7a276 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -2524,6 +2524,31 @@ fn flare_options_alt_turns_cancel_into_reset() { ); } +/// While Alt is held, Save PDF's Cancel button reads Reset; Reset puts the chosen preset's settings +/// back and leaves the dialog open with its path, letting Alt go shows Cancel again, and Cancel +/// closes the dialog. +#[test] +fn save_pdf_alt_turns_cancel_into_reset() { + let mut app = app(); + app.run("ui.savePdfDialog", json!({"path": "/tmp/alt.pdf"})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("compatibility".into(), json!("1.4")); + let mut f = Frames::new(); + f.button(&mut app, "Cancel"); + f.run(&mut app, vec![egui::Event::ModifiersChanged(egui::Modifiers::ALT)]); + let reset = f.button(&mut app, "Reset"); + let texts = f.texts(&mut app); + assert!(!texts.iter().any(|(t, _)| t == "Cancel"), "Reset takes Cancel's place: {texts:?}"); + f.press(&mut app, reset, true); + f.press(&mut app, reset, false); + let d = app.ui.dialog.as_ref().expect("Reset leaves the dialog open"); + assert_eq!((d.str("compatibility"), d.str("path")), ("1.7".to_string(), "/tmp/alt.pdf".to_string())); + f.run(&mut app, vec![egui::Event::ModifiersChanged(egui::Modifiers::NONE)]); + let cancel = f.button(&mut app, "Cancel"); + f.press(&mut app, cancel, true); + f.press(&mut app, cancel, false); + assert!(app.ui.dialog.is_none(), "Cancel closes the dialog"); +} + /// Reset Actions' question: OK replaces the action sets with the built-in set, Append adds the /// built-in set after them, and Cancel or Escape (`cancel`) leaves them as they are. #[test] diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 2b285c704b..5e43e8576c 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1337,7 +1337,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.dialogReset", "Reset", "", - "{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`): its fields go back to their defaults and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open or the open one has no Reset", + "{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`; Save PDF, dialog `savePdf`): its fields go back to their defaults (Save PDF: the chosen preset's settings, with the path and artboards kept) and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open or the open one has no Reset", ), ( "ui.justification", diff --git a/docs/mcp.md b/docs/mcp.md index bee07110e6..ac1d935cfe 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -1259,6 +1259,9 @@ exporter plug-in's parameters. Other formats are written at once. OK writes the OK returns what `file.exportAs` returns, which has no `format` or `bounds` (Text Export Options: `{path}`). Any option skips the options dialog, but without `path` the save panel still picks the file. To write without a dialog, pass `path`. `file.exportAs {path, exportSelection: true, …options}` writes the selection the same way. +In the Save PDF dialog, `ui.dialogReset {}` (Cancel while Alt, or Option on macOS, is held) puts every option back to +the chosen preset's settings, clears the passwords, and leaves the dialog open with its preset, path, artboard range and +section; `answer_dialog {action: "cancel"}` still closes it without saving. Raster exports default to the document's raster effects resolution. An explicit `scale` sets pixels per point (72 times that value in ppi); `options.ppi` wins over either scale option. CLI `run --export` and diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f506da06e1..ebd2c72f7b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1940,6 +1940,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur In a `.ai` opened from its editing data, Bas Relief in an art style takes its Detail, Smoothness and Light direction from the style's settings block, and an object other than type with it opens as itself with the live effect. A settings block that VectorCraft can't read (malformed, another effect's, a value out of range or a key it doesn't know) keeps the object's drawn look (part of #637; [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [Photoshop File Formats Specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646); `crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`). PDF export and `.ai` saves write a page with a side longer than 14,400 pt with a `UserUnit` (PDF 1.6), its longer side divided by 14,400 and rounded up to the next thousandth, so that no side is longer than 14,400 units (ISO 32000-1, Annex C.2); a PDF 1.5 file with such a page is written as PDF 1.6 with PDF 1.5's encryption, PDF/X files and PDF 1.3 and 1.4 files write it in points (in PDF 1.3 and 1.4, a page past 32,767 pt that needs a real number past 32,767 is refused with an error naming it), a page whose short side is 3 pt or longer but would be under 3 units at that `UserUnit` gets a smaller one that keeps the short side at 3 units, and the export's warnings give each such page's size and how it is written (#6382). The Save PDF dialog's "Write pages longer than 200 in at full size in points" (`longPagesInPoints`, on by default; `.ai` saves leave it off) writes such pages in points without a `UserUnit` at every PDF version, in files without a PDF/X or PDF/A standard, so readers that ignore `UserUnit` show them at full size. Export As PDF with Use Artboards off also opens the Save PDF dialog, without its Artboards section, and writes one page of the visible art's bounds with the dialog's options (`document.exportPdf {useArtboards: false}`; `crates/ui-egui/src/dialogs/tests_export.rs`, `crates/engine/src/cmd/fileio/tests_pdf.rs`). + While Alt (Option on macOS) is held, the Save PDF dialog's Cancel button reads Reset, which puts every option back to the chosen preset's settings, passwords included, and leaves the dialog open; letting the key go shows Cancel again (`ui.dialogReset`). [The help page](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=283) says that holding Alt or Option and clicking Reset returns the options to their defaults. Resetting to the chosen preset's settings, and keeping the preset, path, artboard range and section, are VectorCraft's own rules (`crates/ui-egui/src/dialogs/save_pdf/tests.rs`, `crates/ui-egui/src/dialogs/tests.rs`). `document.exportSelection` run without params (a shortcut) takes the same route after its save panel: a picked PDF opens the Save PDF dialog without its Artboards section, and SVG, the raster formats, EPS, DXF, text and exporter plug-ins with parameters open their options, whose OK writes the selection alone, cropped to it, with the chosen options (`crates/ui-egui/src/dialogs/tests_export_selection.rs`). A `.ai` export with Use Artboards off writes one page of the visible art's bounds without the native document or the editing copy for other apps, with a warning, so the file does not reopen with one artboard in place of the document's; without PDF content it is refused (`crates/engine/src/cmd/fileio/tests_pdfedit.rs`). That page, and an HP-GL plot of the art's bounds, are measured on the art the file draws: non-printing layers the PDF or `.ai` file leaves out do not make it larger, and nor do the non-printing layers, objects at 0% opacity, placed images, clear gradient meshes and unpainted paths a plot leaves out; Export As refuses an HP-GL plot of nothing it draws before the save dialog (`crates/engine/src/cmd/fileio/tests_pdf.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`, `crates/ui-egui/src/dialogs/tests_export.rs`). From 2f7e60dd54c946417130960d70054355d96f28ef Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 12:30:56 -0800 Subject: [PATCH 08/22] WebP: Lossy with a Quality setting writes a lossy WebP file WebP Options has a Compression menu (Lossless, Lossy) and a Quality slider from 0 to 100 that is enabled for Lossy. document.export, document.serialize and Export for Screens take lossless: false with quality (default 90) and write a VP8 file, with an ALPH chunk that keeps the alpha exactly when some pixels are not opaque. Lossless stays the default. A WebP quality above 100, or one that is not a whole number, is refused with an error. The encoder is the one craft-image-codecs already provides; no dependency changes. The note that lossy WebP isn't available, its catalog rows and the format text that described it are removed. --- crates/engine/src/cmd/fileio/commands.rs | 4 +- crates/engine/src/cmd/fileio/encode.rs | 27 +++- crates/engine/src/cmd/fileio/formats.rs | 10 +- .../engine/src/cmd/fileio/tests_exportas.rs | 17 +-- crates/engine/src/cmd/fileio/tests_screens.rs | 9 +- crates/engine/src/cmd/fileio/tests_text.rs | 138 ++++++++++++++---- crates/render/src/encode.rs | 20 ++- crates/render/src/encode/tests.rs | 34 +++++ crates/render/src/options.rs | 2 +- .../ui-egui/src/dialogs/export_for_screens.rs | 11 +- crates/ui-egui/src/dialogs/png_options.rs | 35 ++++- .../src/dialogs/tests_raster_formats.rs | 39 ++++- crates/ui-egui/src/i18n/bg.tsv | 3 +- crates/ui-egui/src/i18n/bs.tsv | 3 +- crates/ui-egui/src/i18n/ca.tsv | 3 +- crates/ui-egui/src/i18n/cs.tsv | 3 +- crates/ui-egui/src/i18n/da.tsv | 3 +- crates/ui-egui/src/i18n/de.tsv | 3 +- crates/ui-egui/src/i18n/el.tsv | 3 +- crates/ui-egui/src/i18n/es.tsv | 3 +- crates/ui-egui/src/i18n/fi.tsv | 3 +- crates/ui-egui/src/i18n/fr.tsv | 3 +- crates/ui-egui/src/i18n/gu.tsv | 3 +- crates/ui-egui/src/i18n/hi.tsv | 3 +- crates/ui-egui/src/i18n/hu.tsv | 3 +- crates/ui-egui/src/i18n/id.tsv | 3 +- crates/ui-egui/src/i18n/it.tsv | 3 +- crates/ui-egui/src/i18n/ja.tsv | 3 +- crates/ui-egui/src/i18n/ka.tsv | 3 +- crates/ui-egui/src/i18n/ko.tsv | 3 +- crates/ui-egui/src/i18n/nl.tsv | 3 +- crates/ui-egui/src/i18n/pl.tsv | 3 +- crates/ui-egui/src/i18n/pt-br.tsv | 3 +- crates/ui-egui/src/i18n/ru.tsv | 3 +- crates/ui-egui/src/i18n/sv.tsv | 3 +- crates/ui-egui/src/i18n/tr.tsv | 3 +- crates/ui-egui/src/i18n/uk.tsv | 3 +- crates/ui-egui/src/i18n/vi.tsv | 3 +- crates/ui-egui/src/i18n/zh-hans.tsv | 3 +- crates/ui-egui/src/i18n/zh-hant.tsv | 3 +- crates/ui-egui/src/io.rs | 21 +-- docs/file-format-parity.md | 2 +- docs/mcp.md | 6 + docs/target-app-parity.md | 3 +- 44 files changed, 348 insertions(+), 114 deletions(-) diff --git a/crates/engine/src/cmd/fileio/commands.rs b/crates/engine/src/cmd/fileio/commands.rs index ccd3439730..4483b4d0c3 100644 --- a/crates/engine/src/cmd/fileio/commands.rs +++ b/crates/engine/src/cmd/fileio/commands.rs @@ -36,7 +36,7 @@ pub fn specs() -> Vec { "Export Document", [], None, - "{path?, format?: svg|svgz|pdf|ai|png|jpg|webp|gif|png8|txt|dxf|eps|emf|wmf|hpgl|tiff|bmp|tga|psd|vectorcraft|template (default: from the path's extension, else png; png8 writes an indexed .png; ait, a .ait template, is written by file.saveAsTemplate; an exporter plug-in's format is plugin., which an extension only it lists picks too), params?: {…} (an exporter plug-in's parameters; missing ones take their defaults, see plugin.info), selectedOnly?: false (the selected objects alone, in the layers and groups that hold them; an object of a blend, envelope, repeat or intertwine on its own), includeArtboardFill?: true (raster, PDF, SVG and EPS draw each exported artboard's background color behind its art, a transparent background too; false leaves it out), artboard?: 0, artboards?: [i…], rect?: [x, y, width, height] (raster formats: that area of the page in points, y down, instead of an artboard; not with artboard, artboards, range or useArtboards), range?: \"1-3, 5\" | \"all\" (1-based; PDF and .ai write one page per artboard, default all; SVG writes one file per artboard, {stem}-{artboard}.svg; raster formats write one artboard), useArtboards?: true (raster: one file per chosen artboard, default all, {stem}-{artboard}.{ext}; pdf/ai: every page) | false (pdf/ai/raster: the bounds of the visible art; pdf/ai: of the layers the file draws, without editing data, with a warning, and ai refuses pdfCompatible: false; SVG has it as an SVG option), ppi?: number (raster formats: pixels per inch, stored in the file; wins over scale; without either, the document's raster effects resolution), scale?: number (pixels per point), background?: transparent|white|black|\"#rrggbb\" (jpg: white when transparent; #rrggbbaa and #rgba are refused here and in matte), antiAlias?: none|art (default)|type (text snapped to pixels), interlaced?: false (png, Adam7), embedIcc?: true (png: an sRGB chunk marks the colours as sRGB), quality?: 90 (jpg: 0–100), colorModel?: rgb|cmyk|gray (jpg), method?: baseline|optimized|progressive, scans?: 3 (3–5, progressive), embedIcc?: true, imageMap?: none|client|server (an HTML or NCSA map of the objects with a URL, written as .html / .map), colors?: 256 (gif/png8: 2–256), reduction?: perceptual|selective (default)|adaptive|web|blackWhite|gray, dither?: none|diffusion (default)|pattern|noise, ditherAmount?: 100, transparency?: true, matte?: white|\"#rrggbb\"|none, interlaced?, lossless?: true (webp: lossy WebP isn't available yet: written lossless, with a warning), encoding?: utf8|utf16 (txt: the stories in stacking order, back to front, a thread once; utf16 with a byte order mark), lineEndings?: lf|crlf, selectionOnly?: false, svg?: {styling, outlineText, images, objectIds, decimals, minify, responsive, useArtboards, preserveEditing, metadata, fewerTspans, hiddenLayers, encoding, profile, embedFonts, variableData} (see document.formats), …the SVG options given flat instead, …the PDF options of document.exportPdf, …the DXF options of document.exportDxf (useArtboards: one drawing per artboard), …the EPS options of document.exportEps (useArtboards: one file per artboard, {stem}_{artboard}.eps, after a central {stem}.eps of the whole document when there are two or more and art shows; else the visible art), …emf and wmf write one picture of the artboard (useArtboards: true one file per chosen artboard, false the bounds of the visible art; EMF keeps curves, clipping, transparent images and gradients as images clipped to their shape; WMF flattens curves into polygons behind a placeable header; what a format leaves out comes back in warnings), …hpgl writes a plot of the artboard as pen moves for plotters and cutters (each visible path once along its line in plotter units; useArtboards: true one file per chosen artboard, false the bounds of the art it plots, without placed images, unpainted paths and art at 0% opacity), hpglVersion?: hpgl (default: IN, SP, PU, PD) | hpgl2 (also NP and PC pen colors, each pen's paths as one encoded polyline PE), curveTolerance?: 0.1 (points, 0.01 to 10), pens?: [\"#rrggbb\"…] (pen 1 first, up to 255; each path takes the nearest; default a pen per color in the order the art first draws in it, numbered alike in every file), origin?: bottomLeft (default) | center, sortPaths?: false (each pen's next path the nearest), insideFirst?: false (a path after the pen's paths that lie inside it), colorModel?: rgb|cmyk|gray (tiff: rgb keeps transparency as an alpha channel), lzw?: true, byteOrder?: little|big, embedIcc?: true, colorModel?: rgb|gray (bmp), depth?: 24 (bmp: 1 black and white, 4|8 a palette by reduction and dither, 16, 24, 32 with alpha), fileFormat?: windows|os2 (1, 4, 8 or 24 bits), rle?: false (4 and 8 bits, windows), flipRows?: false (top-down rows), depth?: 24 (tga: 16 one-bit alpha, 24, 32 with alpha), colorModel?: rgb|cmyk|gray (psd), layers?: true (each top-level layer a pixel layer with its opacity and blend mode; a background colour is a Background layer; false: one flat image, on white), preserveText?: false (with layers: horizontal and vertical point type in solid colors, with left-to-right paragraphs that set only their alignment, without strokes, effects or an appearance of its own, becomes editable type layers with their pixels; a layer holding it becomes a group, unless other art in it blends in a mode other than normal; refused with layers: false), maxEditability?: false (layers and sublayers become groups, each object a layer named as in the Layers panel, text by its text; clipping, masked or knockout layers stay one layer), hiddenLayers?: false (hidden layers and objects written hidden instead of left out), embedIcc?: true (at most 30000 pixels a side; formats without alpha are flattened on white)} → {path, format, bytes, warnings, files?: [path…] (several), linked?: [path…] (linked images, image maps)}; no path → {dataBase64, format, bytes, warnings, files?: [{name, dataBase64}], linked?: [{name, dataBase64}]}. A key no format takes, and an unknown key inside a PDF or EPS option's object, are refused; a key only another format takes is not used, and warnings name it. Under automation read roots, svg and svgz, and the files that carry the native document (vectorcraft, template, eps, ai of every artboard with useArtboards not false but a version 7 file, pdf of every artboard with preserveEditing on and useArtboards not false), are refused, before any file is written, while the document links a JavaScript file outside them (svgInteractivity; a URL is not checked), or while the file would name a linked image's file outside them (images: link, preserveEditing, or an image whose pixels the document doesn't hold; a URL is not checked). Never changes the document's path", + "{path?, format?: svg|svgz|pdf|ai|png|jpg|webp|gif|png8|txt|dxf|eps|emf|wmf|hpgl|tiff|bmp|tga|psd|vectorcraft|template (default: from the path's extension, else png; png8 writes an indexed .png; ait, a .ait template, is written by file.saveAsTemplate; an exporter plug-in's format is plugin., which an extension only it lists picks too), params?: {…} (an exporter plug-in's parameters; missing ones take their defaults, see plugin.info), selectedOnly?: false (the selected objects alone, in the layers and groups that hold them; an object of a blend, envelope, repeat or intertwine on its own), includeArtboardFill?: true (raster, PDF, SVG and EPS draw each exported artboard's background color behind its art, a transparent background too; false leaves it out), artboard?: 0, artboards?: [i…], rect?: [x, y, width, height] (raster formats: that area of the page in points, y down, instead of an artboard; not with artboard, artboards, range or useArtboards), range?: \"1-3, 5\" | \"all\" (1-based; PDF and .ai write one page per artboard, default all; SVG writes one file per artboard, {stem}-{artboard}.svg; raster formats write one artboard), useArtboards?: true (raster: one file per chosen artboard, default all, {stem}-{artboard}.{ext}; pdf/ai: every page) | false (pdf/ai/raster: the bounds of the visible art; pdf/ai: of the layers the file draws, without editing data, with a warning, and ai refuses pdfCompatible: false; SVG has it as an SVG option), ppi?: number (raster formats: pixels per inch, stored in the file; wins over scale; without either, the document's raster effects resolution), scale?: number (pixels per point), background?: transparent|white|black|\"#rrggbb\" (jpg: white when transparent; #rrggbbaa and #rgba are refused here and in matte), antiAlias?: none|art (default)|type (text snapped to pixels), interlaced?: false (png, Adam7), embedIcc?: true (png: an sRGB chunk marks the colours as sRGB), quality?: 90 (jpg: 0–100), colorModel?: rgb|cmyk|gray (jpg), method?: baseline|optimized|progressive, scans?: 3 (3–5, progressive), embedIcc?: true, imageMap?: none|client|server (an HTML or NCSA map of the objects with a URL, written as .html / .map), colors?: 256 (gif/png8: 2–256), reduction?: perceptual|selective (default)|adaptive|web|blackWhite|gray, dither?: none|diffusion (default)|pattern|noise, ditherAmount?: 100, transparency?: true, matte?: white|\"#rrggbb\"|none, interlaced?, lossless?: true (webp: every pixel kept exactly; false writes lossy WebP, a smaller file that loses some detail), quality?: 90 (webp with lossless: false: 0–100, higher keeps more detail in a larger file; more than 100 is refused), encoding?: utf8|utf16 (txt: the stories in stacking order, back to front, a thread once; utf16 with a byte order mark), lineEndings?: lf|crlf, selectionOnly?: false, svg?: {styling, outlineText, images, objectIds, decimals, minify, responsive, useArtboards, preserveEditing, metadata, fewerTspans, hiddenLayers, encoding, profile, embedFonts, variableData} (see document.formats), …the SVG options given flat instead, …the PDF options of document.exportPdf, …the DXF options of document.exportDxf (useArtboards: one drawing per artboard), …the EPS options of document.exportEps (useArtboards: one file per artboard, {stem}_{artboard}.eps, after a central {stem}.eps of the whole document when there are two or more and art shows; else the visible art), …emf and wmf write one picture of the artboard (useArtboards: true one file per chosen artboard, false the bounds of the visible art; EMF keeps curves, clipping, transparent images and gradients as images clipped to their shape; WMF flattens curves into polygons behind a placeable header; what a format leaves out comes back in warnings), …hpgl writes a plot of the artboard as pen moves for plotters and cutters (each visible path once along its line in plotter units; useArtboards: true one file per chosen artboard, false the bounds of the art it plots, without placed images, unpainted paths and art at 0% opacity), hpglVersion?: hpgl (default: IN, SP, PU, PD) | hpgl2 (also NP and PC pen colors, each pen's paths as one encoded polyline PE), curveTolerance?: 0.1 (points, 0.01 to 10), pens?: [\"#rrggbb\"…] (pen 1 first, up to 255; each path takes the nearest; default a pen per color in the order the art first draws in it, numbered alike in every file), origin?: bottomLeft (default) | center, sortPaths?: false (each pen's next path the nearest), insideFirst?: false (a path after the pen's paths that lie inside it), colorModel?: rgb|cmyk|gray (tiff: rgb keeps transparency as an alpha channel), lzw?: true, byteOrder?: little|big, embedIcc?: true, colorModel?: rgb|gray (bmp), depth?: 24 (bmp: 1 black and white, 4|8 a palette by reduction and dither, 16, 24, 32 with alpha), fileFormat?: windows|os2 (1, 4, 8 or 24 bits), rle?: false (4 and 8 bits, windows), flipRows?: false (top-down rows), depth?: 24 (tga: 16 one-bit alpha, 24, 32 with alpha), colorModel?: rgb|cmyk|gray (psd), layers?: true (each top-level layer a pixel layer with its opacity and blend mode; a background colour is a Background layer; false: one flat image, on white), preserveText?: false (with layers: horizontal and vertical point type in solid colors, with left-to-right paragraphs that set only their alignment, without strokes, effects or an appearance of its own, becomes editable type layers with their pixels; a layer holding it becomes a group, unless other art in it blends in a mode other than normal; refused with layers: false), maxEditability?: false (layers and sublayers become groups, each object a layer named as in the Layers panel, text by its text; clipping, masked or knockout layers stay one layer), hiddenLayers?: false (hidden layers and objects written hidden instead of left out), embedIcc?: true (at most 30000 pixels a side; formats without alpha are flattened on white)} → {path, format, bytes, warnings, files?: [path…] (several), linked?: [path…] (linked images, image maps)}; no path → {dataBase64, format, bytes, warnings, files?: [{name, dataBase64}], linked?: [{name, dataBase64}]}. A key no format takes, and an unknown key inside a PDF or EPS option's object, are refused; a key only another format takes is not used, and warnings name it. Under automation read roots, svg and svgz, and the files that carry the native document (vectorcraft, template, eps, ai of every artboard with useArtboards not false but a version 7 file, pdf of every artboard with preserveEditing on and useArtboards not false), are refused, before any file is written, while the document links a JavaScript file outside them (svgInteractivity; a URL is not checked), or while the file would name a linked image's file outside them (images: link, preserveEditing, or an image whose pixels the document doesn't hold; a URL is not checked). Never changes the document's path", has_doc, export::export ), @@ -54,7 +54,7 @@ pub fn specs() -> Vec { "Export for Screens", ["File", "Export"], None, - "{folder?, zip?: false (one .zip of every file, each deflated or stored, whichever is smaller: no folder → {name, dataBase64, bytes, files: [name…]}; with a folder it is written there → {path, bytes, files}), artboard?: index | artboards?: [index…] | range?: \"1-3\" (default all), assets?: [asset id…] (instead of artboards: each asset's art alone, cropped to its bounds and named after the asset; see assets.list), layers?: [layer id…] (instead of artboards: each layer's art alone, sublayers included, named after the layer), selection?: one|each (instead of artboards: the selected art as one file, or a file per selected object, named after it), fullDocument?: false (one file per format instead: a PDF of every artboard, other formats the bounds of all visible art, named after the document), includeBleed?: false (artboards grown by the document's bleed), includeArtboardFill?: true (Include Artboard Fill: each artboard's background color behind its art; false leaves it out), pdfs?: multiple|single (Export PDFs As: with several artboards, single writes them as the pages of one PDF per PDF row, named after the document; refused with assets, layers or selection: each), exportPreset?: (a preset of document.exportPresets.list: its settings, under these params), subfolders?: false (each row's files in a sub-folder: its folder, else its size for raster (1x, 2x, 100w…) or its format (SVG, PDF)), folders?: none|rows (as subfolders)|format (a folder per extension: png, svg, pdf…)|item (a folder per artboard, asset, layer or object)|itemFormat (item/extension) (default: rows with subfolders or a preset, else none), name?: (a file name pattern instead of the item's name, with for the document, for the artboard, asset, layer or object, from 1, #### for the counter zero-padded to the run of #, , , (else the row's suffix ends the name), YYYYMMDD, YYYY-MM-DD, YYYY, ,