Merge remote-tracking branch 'origin/main' into HEAD

# Conflicts:
#	docs/gaps.md
#	docs/roadmap.md
#	docs/target-app-parity.md
#	docs/ui-parity.md
This commit is contained in:
bflatastic
2026-11-20 23:46:03 +07:00
12 changed files with 423 additions and 17 deletions
+2
View File
@@ -2169,4 +2169,6 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"",
"{plane?: left|right|ground (default: the active plane)} open the plane's options, as double-clicking its plane widget does (dialog `perspectivePlane`: location (pt along the plane's normal), objects: none|move|copy): OK runs perspective.plane.move",
),
("ui.findAndReplace", "Find and Replace…", "", "{} open the Find and Replace dialog (Edit › Find and Replace…; dialog `findReplace`)"),
("ui.retype", "Retype", "", "{} open the Retype panel (Window › Retype) or start Retype"),
];
+5
View File
@@ -1249,6 +1249,11 @@ fn run_ui_part13(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result
"ui.livePaintGapOptions" => crate::dialogs::live_paint_gaps::open(app),
"ui.perspectivePlane" => crate::dialogs::perspective_plane::open(app, p),
crate::dialogs::check_spelling::COMMAND => crate::dialogs::check_spelling::open(app),
"ui.findAndReplace" => {
let empty = serde_json::Map::new();
crate::dialogs::find_replace::open(app, &empty)
}
"ui.retype" => crate::panel_docking::reveal_panel(app, crate::panels::retype::ID),
_ => return None,
};
+1 -1
View File
@@ -380,7 +380,7 @@ fn ui_enabled(app: &VectorcraftApp, id: &str) -> bool {
id if id.starts_with(crate::dialogs::perspective_presets::SLOT) => {
app.session.active().is_some() && crate::dialogs::perspective_presets::slot_preset(app, id).is_some()
}
"ui.perspectivePlane" => app.session.active().is_some(),
"ui.perspectivePlane" | "ui.findAndReplace" | "ui.retype" => app.session.active().is_some(),
"window.newWindow" => app.session.active().is_some(),
// Tile and Cascade with two windows or more (documents, or views of one from New Window);
// Float in Window for a current window under the tabs; Float All in Windows while a window
+2
View File
@@ -2170,4 +2170,6 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"",
"{plane?: left|right|ground (default: the active plane)} open the plane's options, as double-clicking its plane widget does (dialog `perspectivePlane`: location (pt along the plane's normal), objects: none|move|copy): OK runs perspective.plane.move",
),
("ui.findAndReplace", "Find and Replace…", "", "{} open the Find and Replace dialog (Edit › Find and Replace…; dialog `findReplace`)"),
("ui.retype", "Retype", "", "{} open the Retype panel (Window › Retype) or start Retype"),
];
+28 -7
View File
@@ -113,15 +113,20 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
crate::chrome::anchor_buttons(app, ui, anchors);
}
divider(ui);
quick_actions_section(app, ui, first.as_deref(), n_sel);
global_edit_row(app, ui);
}
fn quick_actions_section(app: &mut VectorcraftApp, ui: &mut Ui, first: Option<&vectorcraft_doc::Node>, n_sel: usize) {
section_header(ui, tl!("Quick Actions"));
let is_group = matches!(first.as_ref().map(|n| &n.kind), Some(NodeKind::Group { .. }));
let is_live = matches!(first.as_ref().map(|n| &n.kind), Some(NodeKind::Path { live: Some(l), .. }) if !matches!(**l, LiveShape::Path { .. }));
let is_group = matches!(first.map(|n| &n.kind), Some(NodeKind::Group { .. }));
let is_live = matches!(first.map(|n| &n.kind), Some(NodeKind::Path { live: Some(l), .. }) if !matches!(&**l, LiveShape::Path { .. }));
// Blend Options for one selected blend, Merge Live Paint for a Live Paint group selected with
// more to merge into it, as the Properties panel overview lists them
// (<https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html>).
// The overview names the Blend tool; the blending page has the button for a blend selected with
// any tool (<https://helpx.adobe.com/illustrator/using/blending-objects.html>, #4817).
let blend_options = n_sel == 1 && matches!(first.as_ref().map(|n| &n.kind), Some(NodeKind::Blend { .. }));
let blend_options = n_sel == 1 && matches!(first.map(|n| &n.kind), Some(NodeKind::Blend { .. }));
let merge_live_paint = n_sel > 1 && can_merge_live_paint(app);
// Repeat Options for one selected repeat (radial, grid or mirror), or one object of its source
// art in isolation mode: Object › Repeat › Options, the dialog of the repeat options pages
@@ -156,6 +161,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
if multi_color(app, ui.ctx()) {
actions.push((tl!("Recolor"), "ui.recolorDialog"));
}
let is_image = n_sel == 1 && matches!(first.map(|n| &n.kind), Some(NodeKind::Image(_)));
if is_image {
crate::panels::image_trace::trace_button(app, ui, ui.available_width());
actions.push((tl!("Crop Image"), "ui.cropImage"));
@@ -166,10 +172,26 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
}
// Object › Path's Offset Path and Simplify take paths: type alone could only fail, and offsets
// live through the Appearance panel's Effect › Path › Offset Path (#2238).
let type_only = app.session.active().is_some_and(|st| {
let mut nodes = st.selection.objects.iter().filter_map(|id| st.doc.node(*id));
nodes.all(|n| matches!(n.kind, NodeKind::Text(_)))
let (has_type, type_only) = app.session.active().map_or((false, false), |st| {
let mut any_type = false;
let mut all_type = !st.selection.objects.is_empty();
for id in &st.selection.objects {
let is_text = st.doc.node(*id).is_some_and(|n| matches!(n.kind, NodeKind::Text(_)));
any_type |= is_text;
all_type &= is_text;
}
(any_type, all_type)
});
// Contextual Quick Actions for type selection (G12, Properties panel per context): Create
// Outlines, Retype and Find and Replace…
// (<https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html>).
if has_type {
actions.push((tl!("Create Outlines"), "type.createOutlines"));
if crate::menus::enabled(app, "ui.retype") || crate::menus::enabled(app, "type.retype") {
actions.push((tl!("Retype"), "ui.retype"));
}
actions.push((tl!("Find and Replace…"), "ui.findAndReplace"));
}
if !type_only {
actions.push((tl!("Offset Path"), "object.path.offsetPath"));
actions.push((tl!("Simplify"), "object.path.simplify"));
@@ -189,7 +211,6 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
}
});
}
global_edit_row(app, ui);
}
/// Whether Merge Live Paint can take the selection: a Live Paint group among the selected objects
@@ -1807,6 +1807,64 @@ fn offset_path_and_simplify_are_not_quick_actions_for_type_alone() {
assert!(shows(&texts, "Offset Path") && shows(&texts, "Simplify"), "type and a path: {texts:?}");
}
/// Contextual Quick Actions for type selection (G12): with text selected, Quick Actions shows
/// Create Outlines, Retype and Find and Replace…; clicking Create Outlines converts the text
/// to vector paths with one undo step. A non-text selection (plain path) displays Offset Path
/// and Simplify without displaying Create Outlines.
#[test]
fn type_quick_actions_show_text_commands_and_create_outlines() {
let mut app = new_app();
let t = app.run("text.create", json!({"x": 50, "y": 200, "text": "Hello"})).unwrap()["id"].clone();
let ctx = egui::Context::default();
let texts = tall(&mut app, &ctx, vec![]);
assert!(shows(&texts, "Create Outlines"), "text shows Create Outlines: {texts:?}");
assert!(shows(&texts, "Retype"), "text shows Retype: {texts:?}");
assert!(shows(&texts, "Find and Replace…"), "text shows Find and Replace…: {texts:?}");
assert!(shows(&texts, "Arrange: Bring to Front") && shows(&texts, "Lock"), "standard object actions: {texts:?}");
assert!(!shows(&texts, "Offset Path") && !shows(&texts, "Simplify"), "no offset path/simplify for type alone");
let undo0 = app.session.doc().unwrap().history.undo.len();
press(&mut app, &ctx, text_at(&texts, "Create Outlines").center());
assert_eq!(app.session.doc().unwrap().history.undo.len(), undo0 + 1, "one undo step");
let sel = app.session.doc().unwrap().selection.objects.clone();
assert!(!sel.is_empty(), "outlines are selected");
for id in &sel {
let node = app.session.doc().unwrap().doc.node(*id).unwrap();
assert!(!matches!(node.kind, NodeKind::Text(_)), "converted from live text: {:?}", node.kind);
}
app.run("edit.undo", json!({})).unwrap();
assert_eq!(app.session.doc().unwrap().history.undo.len(), undo0);
let node = app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(t.as_u64().unwrap())).unwrap();
assert!(matches!(node.kind, NodeKind::Text(_)), "undo restores live text");
// Non-text selection (plain path): continues to show Offset Path and Simplify without Create Outlines.
let r = rect(&mut app, 20.0, 20.0, 40.0, 40.0);
app.run("select.set", json!({"ids": [r]})).unwrap();
let texts = tall(&mut app, &ctx, vec![]);
assert!(shows(&texts, "Offset Path") && shows(&texts, "Simplify"), "path shows Offset Path and Simplify");
assert!(!shows(&texts, "Create Outlines"), "path does not show Create Outlines");
// Find and Replace… quick action opens the Find and Replace dialog.
app.run("select.set", json!({"ids": [t]})).unwrap();
let texts = tall(&mut app, &ctx, vec![]);
press(&mut app, &ctx, text_at(&texts, "Find and Replace…").center());
assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some("findReplace"), "opens findReplace dialog");
// Retype quick action reveals the Retype panel and leaves it open if already visible.
app.ui.dialog = None;
let retype_panel = crate::panels::retype::ID;
assert!(!crate::panel_docking::visible(&app.ui, retype_panel), "Retype is initially hidden");
let texts = tall(&mut app, &ctx, vec![]);
press(&mut app, &ctx, text_at(&texts, "Retype").center());
assert!(crate::panel_docking::visible(&app.ui, retype_panel), "Retype panel is revealed when initially hidden");
// Clicking Retype again leaves the panel open rather than toggling it closed.
let texts = tall(&mut app, &ctx, vec![]);
press(&mut app, &ctx, text_at(&texts, "Retype").center());
assert!(crate::panel_docking::visible(&app.ui, retype_panel), "Retype panel remains visible when already open");
}
/// A dynamic symbol instance with appearance changes of its own has Reset in Quick Actions, which
/// drops them (#4938); without changes there is no Reset.
#[test]
+57 -2
View File
@@ -98,7 +98,7 @@ fn highlight_made(ctx: &egui::Context, kind: Kind, names: Vec<String>) {
/// Duplicates the styles `names` (`charStyle.duplicate`, `paraStyle.duplicate`) in one undo step
/// and highlights the copies.
fn duplicate(app: &mut VectorcraftApp, ctx: &egui::Context, kind: Kind, names: &[String]) {
fn duplicate(app: &mut VectorcraftApp, ctx: &egui::Context, kind: Kind, names: &[String]) -> Vec<String> {
let p = kind.prefix();
let made = if let [name] = names {
app.run(&format!("{p}.duplicate"), json!({ "name": name })).map(|r| vec![r])
@@ -108,7 +108,11 @@ fn duplicate(app: &mut VectorcraftApp, ctx: &egui::Context, kind: Kind, names: &
app.run("command.batch", json!({ "label": label, "commands": commands })).map(|r| r["results"].as_array().cloned().unwrap_or_default())
};
if let Ok(made) = made {
highlight_made(ctx, kind, made.iter().filter_map(|r| r["name"].as_str().map(str::to_string)).collect());
let names: Vec<String> = made.iter().filter_map(|r| r["name"].as_str().map(str::to_string)).collect();
highlight_made(ctx, kind, names.clone());
names
} else {
vec![]
}
}
@@ -254,6 +258,48 @@ fn open_style_options(app: &mut VectorcraftApp, kind: Kind, name: &str) {
app.run(command, json!({ "name": name })).ok();
}
/// An item's right-click context menu in the Character Styles / Paragraph Styles panel.
fn item_context_menu(app: &mut VectorcraftApp, ui: &mut Ui, kind: Kind, name: &str, normal: &str, sel: &mut Vec<String>, listed: &[&str]) {
let p = kind.prefix();
let is_normal = name == normal;
let targets = dragged(sel, listed, name);
let doomed: Vec<String> = targets.iter().filter(|s| *s != normal).cloned().collect();
let has_text_target = text_style(app).is_some();
let options_label = crate::i18n::fmt(tl!("{kind} Style Options…"), &[("kind", kind.what_label())]);
if menu_item(ui, &options_label, !is_normal, false) {
open_style_options(app, kind, name);
ui.close();
}
let duplicate_label = crate::i18n::fmt(tl!("Duplicate {kind} Style"), &[("kind", kind.what_label())]);
if menu_item(ui, &duplicate_label, true, false) {
let made = duplicate(app, ui.ctx(), kind, &targets);
if !made.is_empty() {
*sel = made;
}
ui.close();
}
let delete_label = crate::i18n::fmt(tl!("Delete {kind} Style"), &[("kind", kind.what_label())]);
if menu_item(ui, &delete_label, !is_normal && !doomed.is_empty(), false) {
if app.run(&format!("{p}.delete"), json!({ "names": doomed })).is_ok() {
*sel = vec![];
set_highlighted(ui.ctx(), kind, vec![]);
}
ui.close();
}
ui.separator();
let redefine_label = crate::i18n::fmt(tl!("Redefine {kind} Style"), &[("kind", kind.what_label())]);
if menu_item(ui, &redefine_label, has_text_target, false) {
end_typing(app);
app.run(&format!("{p}.redefine"), target(app, kind, json!({ "name": name }))).ok();
ui.close();
}
if menu_item(ui, tl!("Clear Overrides"), has_text_target, false) {
app.run(&format!("{p}.apply"), apply_target(app, kind, json!({ "name": name, "clearOverrides": true }))).ok();
ui.close();
}
}
/// The style list and its New and Delete buttons. Shift-click highlights every style from the
/// last one clicked without Shift through this one, and Cmd/Ctrl-click adds or removes one; both
/// leave the text as it is. Delete deletes every highlighted style but the Normal style.
@@ -296,6 +342,11 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui, kind: Kind) {
if scroll_to.as_deref() == Some(name.as_str()) {
ui.scroll_to_rect(r, None);
}
if resp.secondary_clicked() && !sel.contains(name) {
sel = vec![name.clone()];
set_pstate(ui.ctx(), kind.anchor_key(), name.clone());
set_highlighted(ui.ctx(), kind, sel.clone());
}
let (fill, outline) = row_look(is_cur, sel.contains(name), resp.hovered(), &t);
if let Some(fill) = fill {
ui.painter().rect_filled(r, 0.0, fill);
@@ -308,6 +359,10 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui, kind: Kind) {
let shown = super::label_or_name(name, *name == normal);
let label = if overridden { format!("{shown}+") } else { shown.to_string() };
ui.painter().text(r.left_center() + vec2(8.0, 0.0), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(12.5), t.text);
resp.widget_info(|| egui::WidgetInfo::selected(egui::Role::ListItem, ui.is_enabled(), sel.contains(name), shown.to_string()));
resp.context_menu(|ui| {
item_context_menu(app, ui, kind, name, &normal, &mut sel, &listed);
});
if resp.clicked() {
clicked = Some((name.clone(), ui.input(|i| i.modifiers)));
}
@@ -1478,3 +1478,249 @@ fn character_style_unicode_boundary_capture_controls() {
capture_from_ui(Some((2, 5)), redefine, footer, true);
}
}
#[test]
fn right_click_context_menu_in_character_styles_panel() {
use egui::vec2;
use egui_kittest::Harness;
use egui_kittest::kittest::{NodeT, Queryable};
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "Hello world", "size": 18})).unwrap()["id"].as_u64().unwrap();
app.run("select.set", json!({"ids": [id]})).unwrap();
app.run("charStyle.new", json!({"name": "Body", "attrs": {"size": 18.0}})).unwrap();
let mut h = Harness::builder().with_size(vec2(280.0, 500.0)).with_accessibility_check(false).build_ui_state(
|ui, app: &mut VectorcraftApp| {
show(app, ui, Kind::Char);
},
app,
);
h.run_steps(2);
// Initial state: Body is unselected in panel
assert_eq!(pstate::<Option<String>>(&h.ctx, Kind::Char.key()), None, "Body is initially unselected");
// Right-click unselected row "Body"
let node = h.get_by_label("Body");
let pos = node.rect().center();
h.event(egui::Event::PointerMoved(pos));
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() });
h.run_steps(2);
// Right-clicking highlights it and opens context menu
assert_eq!(pstate::<Option<String>>(&h.ctx, Kind::Char.key()).as_deref(), Some("Body"));
let opt = h.get_by_label(" Character Style Options…");
let dup = h.get_by_label(" Duplicate Character Style");
let del = h.get_by_label(" Delete Character Style");
let redefine = h.get_by_label(" Redefine Character Style");
let clear = h.get_by_label(" Clear Overrides");
assert!(!opt.accesskit_node().is_disabled());
assert!(!dup.accesskit_node().is_disabled());
assert!(!del.accesskit_node().is_disabled());
assert!(!redefine.accesskit_node().is_disabled());
assert!(!clear.accesskit_node().is_disabled());
// Clicking "Duplicate Character Style" creates a copy (e.g. "Body copy")
dup.click();
h.run_steps(2);
let all_styles = styles(h.state_mut(), Kind::Char);
assert!(all_styles.iter().any(|s| s.0 == "Body copy"), "Body copy was created: {all_styles:?}");
assert_eq!(pstate::<Option<String>>(&h.ctx, Kind::Char.key()).as_deref(), Some("Body copy"), "copy is highlighted");
}
#[test]
fn right_click_context_menu_in_paragraph_styles_panel() {
use egui::vec2;
use egui_kittest::Harness;
use egui_kittest::kittest::{NodeT, Queryable};
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "Paragraph text", "size": 14})).unwrap()["id"].as_u64().unwrap();
app.run("select.set", json!({"ids": [id]})).unwrap();
app.run("paraStyle.new", json!({"name": "Headline"})).unwrap();
let undo_len = app.session.doc().unwrap().history.undo.len();
let mut h = Harness::builder().with_size(vec2(280.0, 500.0)).with_accessibility_check(false).build_ui_state(
|ui, app: &mut VectorcraftApp| {
show(app, ui, Kind::Para);
},
app,
);
h.run_steps(2);
// Initial state: Headline is unselected
assert_eq!(pstate::<Option<String>>(&h.ctx, Kind::Para.key()), None, "Headline is initially unselected");
// Right-click unselected row "Headline"
let node = h.get_by_label("Headline");
let pos = node.rect().center();
h.event(egui::Event::PointerMoved(pos));
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() });
h.run_steps(2);
// Highlights it and opens context menu
assert_eq!(pstate::<Option<String>>(&h.ctx, Kind::Para.key()).as_deref(), Some("Headline"));
let opt = h.get_by_label(" Paragraph Style Options…");
let dup = h.get_by_label(" Duplicate Paragraph Style");
let del = h.get_by_label(" Delete Paragraph Style");
let redefine = h.get_by_label(" Redefine Paragraph Style");
let clear = h.get_by_label(" Clear Overrides");
assert!(!opt.accesskit_node().is_disabled());
assert!(!dup.accesskit_node().is_disabled());
assert!(!del.accesskit_node().is_disabled());
assert!(!redefine.accesskit_node().is_disabled());
assert!(!clear.accesskit_node().is_disabled());
// Clicking "Delete Paragraph Style" deletes the style with undo support
del.click();
h.run_steps(2);
let all_styles = styles(h.state_mut(), Kind::Para);
assert!(!all_styles.iter().any(|s| s.0 == "Headline"), "Headline deleted: {all_styles:?}");
assert_eq!(pstate::<Option<String>>(&h.ctx, Kind::Para.key()), None, "selection cleared after delete");
assert_eq!(h.state().session.doc().unwrap().history.undo.len(), undo_len + 1, "delete recorded one undo step");
// Test undo
h.state_mut().run("edit.undo", json!({})).unwrap();
let restored = styles(h.state_mut(), Kind::Para);
assert!(restored.iter().any(|s| s.0 == "Headline"), "Headline restored by undo: {restored:?}");
}
#[test]
fn right_click_context_menu_normal_style_disables_options_and_delete() {
use egui::vec2;
use egui_kittest::Harness;
use egui_kittest::kittest::{NodeT, Queryable};
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
let mut h = Harness::builder().with_size(vec2(280.0, 500.0)).with_accessibility_check(false).build_ui_state(
|ui, app: &mut VectorcraftApp| {
show(app, ui, Kind::Char);
},
app,
);
h.run_steps(2);
// Right-click Normal Character Style row
let node = h.get_by_label("[Normal Character Style]");
let pos = node.rect().center();
h.event(egui::Event::PointerMoved(pos));
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() });
h.run_steps(2);
let opt = h.get_by_label(" Character Style Options…");
let dup = h.get_by_label(" Duplicate Character Style");
let del = h.get_by_label(" Delete Character Style");
assert!(opt.accesskit_node().is_disabled(), "Options disabled for Normal style");
assert!(!dup.accesskit_node().is_disabled(), "Duplicate enabled for Normal style");
assert!(del.accesskit_node().is_disabled(), "Delete disabled for Normal style");
}
#[test]
fn right_click_context_menu_preserves_multiselection() {
use egui::vec2;
use egui_kittest::Harness;
use egui_kittest::kittest::Queryable;
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
app.run("charStyle.new", json!({"name": "Style A"})).unwrap();
app.run("charStyle.new", json!({"name": "Style B"})).unwrap();
let mut h = Harness::builder().with_size(vec2(280.0, 500.0)).with_accessibility_check(false).build_ui_state(
|ui, app: &mut VectorcraftApp| {
show(app, ui, Kind::Char);
},
app,
);
h.run_steps(2);
// Highlight both styles in pstate
set_highlighted(&h.ctx, Kind::Char, vec!["Style A".into(), "Style B".into()]);
h.run_steps(2);
// Right-click Style B (which is part of the multi-selection)
let node = h.get_by_label("Style B");
let pos = node.rect().center();
h.event(egui::Event::PointerMoved(pos));
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() });
h.run_steps(2);
// Multiselection is preserved
let sel = highlighted(h.state(), &h.ctx, Kind::Char, &["[Normal Character Style]", "Style A", "Style B"]);
assert_eq!(sel, vec!["Style A".to_string(), "Style B".to_string()], "multi-selection preserved on right-click");
}
#[test]
fn right_click_context_menu_clear_overrides_requires_text_target() {
use egui::vec2;
use egui_kittest::Harness;
use egui_kittest::kittest::{NodeT, Queryable};
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
app.run("charStyle.new", json!({"name": "Style 1"})).unwrap();
// Select a non-text shape: rectangle
let rect_id = app.run("shape.rectangle", json!({"x": 20, "y": 20, "width": 60, "height": 60})).unwrap()["id"].as_u64().unwrap();
app.run("select.set", json!({"ids": [rect_id]})).unwrap();
let mut h = Harness::builder().with_size(vec2(280.0, 500.0)).with_accessibility_check(false).build_ui_state(
|ui, app: &mut VectorcraftApp| {
show(app, ui, Kind::Char);
},
app,
);
h.run_steps(2);
// Right-click Style 1
let node = h.get_by_label("Style 1");
let pos = node.rect().center();
h.event(egui::Event::PointerMoved(pos));
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() });
h.run_steps(2);
let clear_overrides = h.get_by_label(" Clear Overrides");
let redefine = h.get_by_label(" Redefine Character Style");
assert!(clear_overrides.accesskit_node().is_disabled(), "Clear Overrides disabled when only a rectangle is selected");
assert!(redefine.accesskit_node().is_disabled(), "Redefine disabled when only a rectangle is selected");
// Close menu
h.event(egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() });
h.run_steps(2);
// Now select a text object
let text_id = h.state_mut().run("text.create", json!({"x": 10, "y": 10, "text": "Hello"})).unwrap()["id"].as_u64().unwrap();
h.state_mut().run("select.set", json!({"ids": [text_id]})).unwrap();
h.run_steps(2);
// Right-click Style 1 again
let node = h.get_by_label("Style 1");
let pos = node.rect().center();
h.event(egui::Event::PointerMoved(pos));
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() });
h.run_steps(2);
let clear_overrides = h.get_by_label(" Clear Overrides");
let redefine = h.get_by_label(" Redefine Character Style");
assert!(!clear_overrides.accesskit_node().is_disabled(), "Clear Overrides enabled when text is selected");
assert!(!redefine.accesskit_node().is_disabled(), "Redefine enabled when text is selected");
}
+8 -1
View File
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -76,6 +76,7 @@ M7 type: Touch Type moves a right-to-left character along its line and up from i
|---|---|---|
| 2026-11-20 | minor | M14/G12: Appearance panel item context menus for stroke, fill, effect, and root object rows (Duplicate, Delete, Hide/Show, Edit Effect…, Clear Appearance, Reduce to Basic Appearance); secondary-click selects unselected rows including via name label links; headless tests in `crates/ui-egui/src/panels/tests_appearance.rs`; scores and estimates unchanged. |
| 2026-11-19 | minor | M14/G12: Graphic Styles panel item context menus in thumbnail and list views (Options…, Duplicate, Delete, Redefine, Break Link); regression tests in crates/ui-egui/src/panels/graphic_styles.rs; scores and estimates unchanged. |
| 2026-11-19 | minor | M14/G12: Character Styles and Paragraph Styles panels item context menus (Options…, Duplicate, Delete, Redefine, Clear Overrides); regression tests in crates/ui-egui/src/panels/text_styles/tests.rs; scores and estimates unchanged. |
| 2026-11-18 | minor | M10/G5: Media Controls joins Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons and Weather Icons as a seventh built-in symbol library (Play, Pause, Stop, Skip Next, Shuffle, Repeat; original procedural vector symbols generated in code, no default 9-slice); G5 estimate decremented to 2–12 h, milestone estimates unchanged |
| 2026-11-18 | minor | M14: PDF export writes the document language (Document Setup) as the catalog's `/Lang` (#3644). Scores and estimates unchanged. |
| 2026-11-13 | minor | Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged. |
@@ -195,7 +196,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule
| M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View (hiding the guides and the grid while it is on, #8363), middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 |
| M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color (manual picker and canvas eyedropper from original pixels, no canvas View change, missed pixels keep the pick armed, Preview/Undo retained; #8068), Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 |
| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; the script document model and batch work remain | 18–27 |
| M14 | 1.0 polish (preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset <name>, UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646) and give the document language as the catalog's `/Lang` (#3644); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307); Swatches item context menus tested in all five views and rendered layouts inspected; Linux full CI passed, Windows engine baseline limitations documented (G12); Graphic Styles item context menus in thumbnail and list views with Options, Duplicate, Delete, Redefine, Break Link (#8755); Appearance panel row context menus for strokes, fills, effects, and root object row (Duplicate, Delete, Hide/Show, Edit Effect…, Clear Appearance, Reduce to Basic Appearance) with secondary click row selection (#8809); Window > Toolbars > Compact Tools offers optional denser main Tools spacing in one or two columns, with the existing layout still the default (#7234) | 18–28 |
| M14 | 1.0 polish (preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset <name>, UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646) and give the document language as the catalog's `/Lang` (#3644); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307); Swatches item context menus tested in all five views and rendered layouts inspected; Linux full CI passed, Windows engine baseline limitations documented (G12); Graphic Styles item context menus in thumbnail and list views with Options, Duplicate, Delete, Redefine, Break Link (#8755); Appearance panel row context menus for strokes, fills, effects, and root object row (Duplicate, Delete, Hide/Show, Edit Effect…, Clear Appearance, Reduce to Basic Appearance) with secondary click row selection (#8809); Character Styles and Paragraph Styles item context menus (panels::text_styles::tests::right_click_context_menu_*); Window > Toolbars > Compact Tools offers optional denser main Tools spacing in one or two columns, with the existing layout still the default (#7234) | 18–28 |
| — | Interaction fidelity pass (every tool's modifiers, Properties panel per context, isolation, nuance; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed) | ⬜ (new ruler-guide Alt orientation implemented; existing-guide Escape cancellation regression-tested; broader pass remains) | 60–90 |
| — | Hardening at scale (big-file corpus, fuzzing, cross-platform + browser QA) | 🟡 PngSuite integrity and bounded fetching verified (#1729); real-world corpus/manual QA remain | 50–80 |
| M14 follow-up | Color Picker layout (#2008) | ✅ Compact controls, centered header, stacked actions, aligned fields and screen sampling; narrow windows scroll vertically | Included above |
@@ -241,6 +242,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours
| 2026-11-19 | minor | M11: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688). Scores and estimates unchanged. |
| 2026-11-19 | minor | M14/G12: Character Styles and Paragraph Styles panels item context menus (Options…, Duplicate, Delete, Redefine, Clear Overrides); regression tests in crates/ui-egui/src/panels/text_styles/tests.rs; scores and estimates unchanged. |
| 2026-11-18 | minor | M10/G5: Media Controls joins Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons and Weather Icons as a seventh built-in symbol library (Play, Pause, Stop, Skip Next, Shuffle, Repeat; original procedural vector symbols generated in code, no default 9-slice); G5 estimate decremented to 2–12 h, milestone estimates unchanged |
| 2026-11-18 | minor | M7/G4: Retype phase 1 (#4934): `type.retype` turns outlined text that exactly matches an available font back into point text. Scores and estimates unchanged |
| 2026-11-18 | minor | M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538). Scores and estimates unchanged. |
@@ -476,3 +478,5 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours
Ordinary Save and Save As keep EPS as EPS, with the chosen page frame, transparent margins and the complete editable VectorCraft document. Existing import-loss confirmation and transparency warnings remain; the Save TIFF preview is capped at 1024 pixels, while Export retains 2048. See [file-format-parity.md](file-format-parity.md#eps-save-and-source-protection) for limits and regression evidence. This narrows G9 save-back workflow coverage; native Illustrator editing-data fidelity, parity scores and hour estimates are unchanged. Since 2026-11-12 the EPS Options of Save As show Use Artboards, unchecked by default: unchecked, the bounding box fits the visible art; checked, Save keeps the chosen page frame and margins described here.
> **Swatches status (2026-11-15):** Item context menus are implemented and covered by headless tests; full CI passed on the latest-main integration (all 13 gates), including the updated panel-view harness; parity scores and estimates are unchanged.
> **Text styles status (2026-11-19):** Character Styles and Paragraph Styles panels item context menus (Options…, Duplicate, Delete, Redefine, Clear Overrides) are implemented and covered by headless tests; parity scores and estimates are unchanged.
File diff suppressed because one or more lines are too long
+7 -3
View File
File diff suppressed because one or more lines are too long