diff --git a/crates/doc/src/tests.rs b/crates/doc/src/tests.rs index 12151afc1e..a39260ee91 100644 --- a/crates/doc/src/tests.rs +++ b/crates/doc/src/tests.rs @@ -496,6 +496,7 @@ fn art_for_artboard_copy_takes_artwork_larger_than_artboard_or_with_bleed() { show_video_safe_areas: false, video_ruler_pixel_aspect_ratio: 1.0, color: None, + guide_label: None, }); // Shape spanning (190..300) x (50..150): 10pt on Artboard 0, 100pt on Artboard 1. let neighbor_art = d.alloc_id(); @@ -523,6 +524,7 @@ fn artboard_for_bounds_edge_cases_and_tie_breaks() { show_video_safe_areas: false, video_ruler_pixel_aspect_ratio: 1.0, color: None, + guide_label: None, }); // 1. Artwork whose center is outside all boards, but overlaps Artboard 0 most: diff --git a/crates/ui-egui/src/dialogs/flatten.rs b/crates/ui-egui/src/dialogs/flatten.rs index 973c77a45f..92ee610e3b 100644 --- a/crates/ui-egui/src/dialogs/flatten.rs +++ b/crates/ui-egui/src/dialogs/flatten.rs @@ -175,12 +175,13 @@ pub(crate) fn custom_dialog(ctx: &egui::Context, parent: &HostedPdfExport, job: as_written(&mut o, parent.settings().advanced.overprint); let mut fields = option_fields(&o); fields.set(KEPT_OVERPRINTS, kept); - HostedParamDialog::new(ctx, CUSTOM_KEY, fields, |_| { + HostedParamDialog::new(ctx, CUSTOM_KEY, fields, |fields| { ParamDialog::new( CUSTOM_KEY, tl!("Custom Transparency Flattener Options"), option_params(&FIXED, tl!("PDF 1.3 files clip rasterized areas to their regions, and Overprint sets whether overprints are kept.")), ) + .values(Bind::bound(fields)) }) } @@ -213,8 +214,8 @@ pub(crate) fn apply_custom(job: &mut SavePdfJob, parent: &HostedPdfExport, field /// Open Flatten Transparency for the selection with the default preset. pub(crate) fn open(app: &mut VectorcraftApp) -> Result { let ctx = app.ui_ctx.clone().ok_or("no window")?; - let dialog = HostedParamDialog::new(&ctx, KEY, option_fields(&FlattenOptions::default()), |_| { - ParamDialog::new(KEY, tl!("Flatten Transparency"), option_params(&[], "")).previews(true) + let dialog = HostedParamDialog::new(&ctx, KEY, option_fields(&FlattenOptions::default()), |fields| { + ParamDialog::new(KEY, tl!("Flatten Transparency"), option_params(&[], "")).values(Bind::bound(fields)).previews(true) }) // Flattening complex art is slow: the preview waits until it is turned on. .preview_off(); @@ -450,4 +451,71 @@ mod tests { create(&mut app, &ctx, id, params, "High Resolution"); assert_eq!(app.session.prefs.flattener_presets.len(), 1); } + + #[test] + fn flattened_art_resolution_keeps_a_live_keyboard_edit() { + assert_live_resolution(false); + } + + #[test] + fn pdf_flattener_resolution_keeps_a_live_keyboard_edit() { + assert_live_resolution(true); + } + + fn assert_live_resolution(custom: bool) { + use craft::ui::testing::Fixture; + use std::cell::RefCell; + use std::rc::Rc; + + let app = Rc::new(RefCell::new(scene())); + let shown = app.clone(); + let mut fixture = Fixture::new(move |ui| { + let mut app = shown.borrow_mut(); + let dialogs = app.dialogs().unwrap(); + dialogs.with(|host| host.run(ui)); + super::super::host::pump(&mut app, ui.ctx()); + }); + fixture.room(egui::vec2(880.0, 720.0)); + let ctx = fixture.ctx().clone(); + let document = app.borrow().session.active().unwrap().uid; + let mut job = SavePdfJob { + document, + path: None, + save_mode: None, + flattener: Some(FlattenOptions { line_art_ppi: 611.0, ..FlattenOptions::default() }), + selection: false, + }; + let parent = HostedPdfExport::new(vectorcraft_pdf::APP, vectorcraft_pdf::PdfSettings::default()); + let id = { + let mut app = app.borrow_mut(); + app.ui_ctx = Some(ctx.clone()); + if custom { + let dialog = custom_dialog(&ctx, &parent, &job, &[]); + app.dialogs().unwrap().with(|host| host.open(dialog)) + } else { + open(&mut app).unwrap(); + app.flatten_dialog.open.as_ref().unwrap().id + } + }; + fixture.settle(); + let field = fixture + .by_label("Line Art and Text Resolution") + .or_else(|| fixture.by_label("Line Art and Text Resolution:")) + .expect("the hosted resolution field"); + if custom { + let fields = app.borrow().dialogs().unwrap().with(|h| h.get_by_id::(id).unwrap().fields().clone()); + assert_eq!(fields.number("lineArtPpi"), Some(611.0), "the PDF dialog opens with the job's own resolution"); + } + fixture.click(&field).key(egui::Key::A, egui::Modifiers::COMMAND).type_text("399").key(egui::Key::Tab, egui::Modifiers::NONE).settle(); + let app = app.borrow(); + let fields = app.dialogs().unwrap().with(|h| h.get_by_id::(id).unwrap().fields().clone()); + assert_eq!(fields.number("lineArtPpi"), Some(399.0), "the hosted form keeps its keyboard edit"); + if custom { + apply_custom(&mut job, &parent, &fields, &[]).unwrap(); + assert_eq!(job.flattener.unwrap().line_art_ppi, 399.0); + } else { + let params = command_params(&option_params(&[], ""), &fields, &[]).unwrap(); + assert_eq!(params["lineArtPpi"], 399.0); + } + } } diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index 92d1e2ce53..8a0f587513 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -102,11 +102,63 @@ impl TargetKey { } } +/// A Color mode command from the popover's menu that has not been seen to finish. +struct OwnMode { + /// The document's history step when it ran. + from: (u64, u64), + /// The mode it picked. + mode: ColorPanelMode, + /// The Color panel showed `mode` at an earlier pass with no new history step. + shown: bool, +} + +#[derive(Clone, Copy, PartialEq, Eq)] +enum OwnModeNow { + /// No command is pending. + None, + /// The command has not been seen to finish. + Waiting, + /// The command made the new history step: the changed paint is the popover's own edit. + Edited, + /// The command finished without a history step. + Unchanged, +} + +impl OwnMode { + /// What the command has done by this pass, with the document at history `step` and the Color panel showing + /// `shown_mode`. The first new history step after it is its own edit. Once the panel shows the picked mode, one + /// more pass with no new step means it changed nothing. + fn now(&mut self, step: Option<(u64, u64)>, shown_mode: ColorPanelMode) -> OwnModeNow { + if step != Some(self.from) { + return OwnModeNow::Edited; + } + if shown_mode != self.mode { + return OwnModeNow::Waiting; + } + if std::mem::replace(&mut self.shown, true) { OwnModeNow::Unchanged } else { OwnModeNow::Waiting } + } +} + /// The gradient in that slot as the popover last saw it, including any live edits it applied. #[derive(Clone)] struct TargetOwner { key: TargetKey, paints: Arc, + /// The history step when the popover took `paints`. + step: Option<(u64, u64)>, + /// The document's count of Undo and Redo steps as of the popover's last pass. + restores: Option, + /// The paints the popover owned before its own later edits, newest last, each with the history step it was + /// current at and the stop or point it edited then, so that Undo and Redo of those edits keep it open on the + /// same stop or point. + earlier: Vec, +} + +#[derive(Clone)] +struct Earlier { + step: Option<(u64, u64)>, + key: TargetKey, + paints: Arc, } struct TargetPaints { @@ -115,10 +167,49 @@ struct TargetPaints { } impl TargetOwner { + /// The most earlier paints kept. + const EARLIER: usize = 32; + + fn new(key: TargetKey, paints: Arc, step: Option<(u64, u64)>, restores: Option) -> Self { + Self { key, paints, step, restores, earlier: Vec::new() } + } + fn matches(&self, app: &VectorcraftApp, target: &Target) -> bool { - self.key.matches(app, target) - && self.paints.shown == *target.paint() - && app.session.gradient_edit_paints(!self.key.fill).is_ok_and(|paints| paints == self.paints.edited) + self.key.matches(app, target) && self.owns(app, target, &self.paints) + } + + /// The earlier owned paint and stop or point that the target shows now after Undo or Redo of one of the popover's + /// own edits. A stop selected after Undo that is not the one that paint belonged to matches nothing, and so does + /// an earlier paint set again by anything other than Undo or Redo. + fn owned_earlier(&self, app: &VectorcraftApp, target: &Target, restores: Option) -> Option { + if restores == self.restores { + return None; + } + self.earlier.iter().rev().find(|e| e.key.matches(app, target) && self.owns(app, target, &e.paints)).map(|e| e.key.clone()) + } + + fn owns(&self, app: &VectorcraftApp, target: &Target, paints: &TargetPaints) -> bool { + paints.shown == *target.paint() && app.session.gradient_edit_paints(!self.key.fill).is_ok_and(|now| now == paints.edited) + } + + /// The popover now owns `paints`, taken at history step `step`; the paints it owned until now are kept as earlier + /// ones, with `was`, the stop or point they belonged to. + fn adopt(&mut self, paints: Arc, was: TargetKey, step: Option<(u64, u64)>) { + let old = std::mem::replace(&mut self.paints, paints); + let old_step = std::mem::replace(&mut self.step, step); + self.earlier.retain(|e| !Arc::ptr_eq(&e.paints, &old)); + // Undo and Redo return only to the first or the last paints of one history step. The samples of a live drag + // between them replace each other, so a long drag does not push out the paints before it. + if let [.., before, last] = self.earlier.as_slice() + && before.step == old_step + && last.step == old_step + { + self.earlier.pop(); + } + self.earlier.push(Earlier { step: old_step, key: was, paints: old }); + if self.earlier.len() > Self::EARLIER { + self.earlier.remove(0); + } } } @@ -237,6 +328,8 @@ struct Filed { panels: Vec, /// Only an actual Shift-cycle changes this; an unchanged local snapshot must not overwrite a menu command. mode: Option, + /// The mode whose row of the popover's Color mode menu ran its command this pass. + mode_command: Option, } /// The gradient stop popover. @@ -253,6 +346,9 @@ pub(crate) struct GradientStopPopover { /// The fields set from outside, applied at confirm. set: PopoverFields, filed: Filed, + /// A command the popover's Color mode menu ran, which runs outside `pump`: the document's history step when it + /// ran, the mode it picked, and whether the Color panel already showed that mode at an earlier pass. + own_mode: Option, } impl GradientStopPopover { @@ -266,6 +362,7 @@ impl GradientStopPopover { feed: None, set: PopoverFields::default(), filed: Filed::default(), + own_mode: None, } } @@ -360,7 +457,9 @@ fn body(ui: &mut Ui, feed: &Feed, tab: &mut Tab, panel: &mut ColorPanelState, fi filed.eyedropper |= DropperButton::new(tip, Bind::given(false)).show(ui).edit.value() == Some(&true); } if *tab == Tab::Color { - outside |= mode_menu(ui, &feed.shown, panel.mode); + let (closed, picked) = mode_menu(ui, &feed.shown, panel.mode); + outside |= closed; + filed.mode_command = picked.or(filed.mode_command); } }); match *tab { @@ -389,8 +488,9 @@ fn body(ui: &mut Ui, feed: &Feed, tab: &mut Tab, panel: &mut ColorPanelState, fi } /// The Color panel's existing five mode commands. Native menu ownership keeps its parent popover -/// open on a pick and gives the child the first Escape, including rows outside the parent bounds. -fn mode_menu(ui: &mut Ui, shown: &ColorPanelShown, fallback: ColorPanelMode) -> bool { +/// open on a pick and gives the child the first Escape, including rows outside the parent bounds. Returns whether +/// an outside press closed the menu, and the mode whose row ran its command. +fn mode_menu(ui: &mut Ui, shown: &ColorPanelShown, fallback: ColorPanelMode) -> (bool, Option) { let words = Env::of(ui).words::(); let label = match shown { ColorPanelShown::Mode(mode) => mode.label(&words), @@ -398,13 +498,16 @@ fn mode_menu(ui: &mut Ui, shown: &ColorPanelShown, fallback: ColorPanelMode) -> _ => fallback.label(&words), }; let button = Button::new(label).popup(PopupKind::Menu).show(ui); + let mut picked = None; let menu = Menu::new(tl!("Color mode")).opened_by(&button, Trigger::Click).show(ui, |ui, _| { for mode in ColorPanelMode::FILL_STROKE { - MenuItem::command(mode.command()).show(ui); + if MenuItem::command(mode.command()).show(ui).ran { + picked = Some(mode); + } } }); // The child absorbs an outside press before its parent sees it. Close both for that event only. - menu.output.closed == Some(CloseReason::Outside) + (menu.output.closed == Some(CloseReason::Outside), picked) } /// Document swatches as tiles: a pick gives the stop (or point) that colour. @@ -514,8 +617,10 @@ pub(crate) fn open_at(app: &mut VectorcraftApp, index: usize, anchor: Anchor) { let Some(key) = TargetKey::of(app, &target) else { return }; let Ok(edited) = app.session.gradient_edit_paints(!key.fill) else { return }; let paints = Arc::new(TargetPaints { shown: target.paint().clone(), edited }); + let step = app.session.active().map(|st| st.history.step()); + let restores = app.session.active().map(|st| st.history_restores); dialogs.with(|host| { - host.open(GradientStopPopover::new(anchor, TargetOwner { key, paints })); + host.open(GradientStopPopover::new(anchor, TargetOwner::new(key, paints, step, restores))); }); refresh(app, &ctx, dialog_id(KIND), &target); } @@ -538,13 +643,40 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { Some(_) => return, None => {} } - let Some(mut owner) = dialogs.with(|host| host.get_by_id::(id).map(|popover| popover.target.clone())) else { + let step = app.session.active().map(|st| st.history.step()); + let restores = app.session.active().map(|st| st.history_restores); + let shown_mode = app.ui.color_panel.mode; + let Some((mut owner, own_mode)) = dialogs.with(|host| { + host.get_mut_by_id::(id).map(|popover| { + if let Some(mode) = popover.filed.mode_command.take() { + popover.own_mode = step.map(|from| OwnMode { from, mode, shown: false }); + } + let own = popover.own_mode.as_mut().map_or(OwnModeNow::None, |pending| pending.now(step, shown_mode)); + if own != OwnModeNow::Waiting { + popover.own_mode = None; + } + (popover.target.clone(), own == OwnModeNow::Edited) + }) + }) else { return; }; - let Some(target) = selected(app).filter(|target| owner.matches(app, target)) else { + let accepted = selected(app).and_then(|target| { + if owner.matches(app, &target) || (own_mode && owner.key.matches(app, &target)) { + Some((target, None)) + } else { + owner.owned_earlier(app, &target, restores).map(|key| (target, Some(key))) + } + }); + let Some((target, earlier)) = accepted else { dialogs.with(|host| host.cancel_by_id(ctx, id)); return; }; + // The stop or point the paints owned until now belong to, before Undo or Redo or this pass's edits move it. + let owned_key = owner.key.clone(); + if let Some(key) = earlier { + owner.key = key; + } + owner.restores = restores; let filed = dialogs.with(|host| host.get_mut_by_id::(id).map(GradientStopPopover::take_filed)).unwrap_or_default(); if filed.fields != PopoverFields::default() { apply(app, &target, &filed.fields); @@ -581,7 +713,8 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { }; // The popover can continue with the paints resulting from its own edits in this pass. if owner.paints.shown != *target.paint() || owner.paints.edited != edited { - owner.paints = Arc::new(TargetPaints { shown: target.paint().clone(), edited }); + let step = app.session.active().map(|st| st.history.step()); + owner.adopt(Arc::new(TargetPaints { shown: target.paint().clone(), edited }), owned_key, step); } dialogs.with(|host| { if let Some(popover) = host.get_mut_by_id::(id) { @@ -805,6 +938,139 @@ mod tests { assert!(!is_open(&app)); } + #[test] + fn a_mode_command_that_changes_nothing_stops_counting_as_its_own_edit() { + let (from, other) = ((3, 0), ColorPanelMode::FILL_STROKE[0]); + let picked = ColorPanelMode::FILL_STROKE[1]; + let mut pending = OwnMode { from, mode: picked, shown: false }; + assert!(OwnModeNow::Waiting == pending.now(Some(from), other), "the command has not run yet"); + assert!(OwnModeNow::Waiting == pending.now(Some(from), picked), "the panel shows the mode; one more pass"); + assert!(OwnModeNow::Unchanged == pending.now(Some(from), picked), "no history step followed: nothing changed"); + let mut pending = OwnMode { from, mode: picked, shown: false }; + assert!(OwnModeNow::Edited == pending.now(Some((4, 0)), picked), "the first new step is the command's own"); + } + + #[test] + fn undo_after_a_stop_crosses_its_neighbor_does_not_edit_the_neighbor() { + let mut app = app(); + open_at(&mut app, 0, Anchor::Screen(egui::pos2(200.0, 200.0))); + assert!(is_open(&app)); + let ctx = ctx(&app); + let edit = |app: &VectorcraftApp, fields: PopoverFields| { + app.dialogs().unwrap().with(|host| host.get_mut_by_id::(dialog_id(KIND)).unwrap().filed.fields = fields); + }; + edit(&app, PopoverFields { location: Some(75.0), ..PopoverFields::default() }); + host::pump(&mut app, &ctx); + assert_eq!(app.session.selected_stop(), Some(1), "the stop crossed its neighbor"); + app.run("edit.undo", json!({})).unwrap(); + host::pump(&mut app, &ctx); + if is_open(&app) { + edit(&app, PopoverFields { opacity: Some(25.0), ..PopoverFields::default() }); + host::pump(&mut app, &ctx); + let stops = stops(&app); + assert!(stops[0].opacity < 1.0, "the edit reaches the stop the popover opened on"); + assert_eq!(stops[1].opacity, 1.0, "the neighbor is left alone"); + } + } + + #[test] + fn redo_after_a_stop_crosses_its_neighbor_does_not_reopen_on_the_neighbor() { + let mut app = app(); + open_at(&mut app, 0, Anchor::Screen(egui::pos2(200.0, 200.0))); + let ctx = ctx(&app); + app.dialogs().unwrap().with(|host| { + host.get_mut_by_id::(dialog_id(KIND)).unwrap().filed.fields.location = Some(75.0); + }); + host::pump(&mut app, &ctx); + assert_eq!(app.session.selected_stop(), Some(1), "the stop crossed its neighbor"); + app.run("edit.undo", json!({})).unwrap(); + app.run("gradient.selectStop", json!({"index": 0})).unwrap(); + host::pump(&mut app, &ctx); + assert!(is_open(&app), "Undo returns to the paint it owned on stop 0"); + app.run("edit.redo", json!({})).unwrap(); + app.run("gradient.selectStop", json!({"index": 0})).unwrap(); + host::pump(&mut app, &ctx); + assert!(!is_open(&app), "after Redo, stop 0 is the neighbor"); + } + + #[test] + fn its_earlier_paint_set_again_from_elsewhere_closes_the_popover() { + let mut app = app(); + open_popover(&mut app); + let ctx = ctx(&app); + let queue = |app: &VectorcraftApp, opacity: f64| { + app.dialogs().unwrap().with(|host| { + host.get_mut_by_id::(dialog_id(KIND)).unwrap().filed.fields.opacity = Some(opacity); + }); + }; + queue(&app, 25.0); + host::pump(&mut app, &ctx); + assert!(is_open(&app) && stops(&app)[1].opacity < 1.0, "the live edit applied"); + // The fixture's gradient again, set without Undo. + let stops_json = json!([{"offset": 0, "color": "#ffffff"}, {"offset": 0.5, "color": "#00ff00"}, {"offset": 1, "color": "#000000"}]); + app.run("paint.setFill", json!({"gradient": {"stops": stops_json, "start": [100, 150], "end": [200, 150]}})).unwrap(); + assert_eq!(app.session.selected_stop(), Some(1)); + queue(&app, 50.0); + host::pump(&mut app, &ctx); + assert!(!is_open(&app), "a gradient from elsewhere closes it, even one it owned before"); + assert_eq!(stops(&app)[1].opacity, 1.0, "the pending edit is discarded"); + } + + #[test] + fn undo_after_a_long_live_drag_keeps_the_popover_open() { + let mut app = app(); + open_popover(&mut app); + let ctx = ctx(&app); + let dialogs = app.dialogs().unwrap(); + let gesture = GestureId::new(1); + let pick = |hex: &str| PickedColor::rgb(Srgba::from_hex(hex).unwrap()); + let before = pick("#00ff00"); + let original = stops(&app)[1].color.to_hex(); + let samples = (0..2 * TargetOwner::EARLIER).map(|i| EditEvent::update(gesture, pick(&format!("#{:02x}0000", 40 + i)))); + for edit in samples.chain([EditEvent::commit(gesture, Mixed::Same(before), pick("#0000ff"))]) { + let mut edit = Some(edit); + ctx.run_ui(Default::default(), |ui| { + let Some(edit) = edit.take() else { return }; + let mut state = ColorPanelState::default(); + let mut output = ColorPanel::new(Bind::bound(&mut state), [before.color; 2]).show(ui); + output.edits.push((PanelTarget::Foreground, edit)); + dialogs.with(|host| { + host.get_mut_by_id::(dialog_id(KIND)).unwrap().filed.panels.push(output); + }); + }) + .textures_delta + .clear(); + host::pump(&mut app, &ctx); + } + assert_eq!(stops(&app)[1].color.to_hex(), "#0000ff"); + app.run("edit.undo", json!({})).unwrap(); + host::pump(&mut app, &ctx); + assert_eq!(stops(&app)[1].color.to_hex(), original, "Undo returns to the paint before the drag"); + assert!(is_open(&app), "the paint before the drag is still the popover's own"); + } + + #[test] + fn undo_of_its_own_edit_keeps_the_popover_open() { + let mut app = app(); + open_popover(&mut app); + app.dialogs().unwrap().with(|host| { + host.get_mut_by_id::(dialog_id(KIND)).unwrap().filed.fields.opacity = Some(25.0); + }); + let ctx = ctx(&app); + host::pump(&mut app, &ctx); + assert!(stops(&app)[1].opacity < 1.0, "the live edit applied"); + app.run("edit.undo", json!({})).unwrap(); + host::pump(&mut app, &ctx); + assert_eq!(stops(&app)[1].opacity, 1.0); + assert!(is_open(&app), "Undo returns to a paint the popover owned"); + app.run("edit.redo", json!({})).unwrap(); + host::pump(&mut app, &ctx); + assert!(is_open(&app), "Redo returns to a paint the popover owned"); + replace_gradient(&mut app); + host::pump(&mut app, &ctx); + assert!(!is_open(&app), "a gradient from elsewhere still closes it"); + } + #[test] fn discards_edits_when_only_a_secondary_selected_gradient_is_replaced() { let mut app = app(); diff --git a/crates/ui-egui/src/dialogs/save_pdf.rs b/crates/ui-egui/src/dialogs/save_pdf.rs index b03cf32bcd..506ef94fce 100644 --- a/crates/ui-egui/src/dialogs/save_pdf.rs +++ b/crates/ui-egui/src/dialogs/save_pdf.rs @@ -38,7 +38,7 @@ const WRONG_DOCUMENT: &str = "Return to the original drawing to save the PDF or /// What the Save PDF dialog was opened for; the preset editor has none. pub(crate) struct SavePdfJob { /// The drawing this job reads and writes. - document: u64, + pub(crate) document: u64, /// The file the PDF goes to; none: the write asks. pub(crate) path: Option, /// The save command (`file.saveAs`, `file.saveCopy`) this PDF finishes; none: a plain PDF copy. diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index c2d41bdb06..201e2f909f 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -146,20 +146,23 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, first: Option<&Node>, n_sel: usiz if anchors != crate::chrome::AnchorControls::None { section(tl!("Anchor Point")).show(ui, |ui, _| crate::chrome::anchor_buttons(app, ui, anchors)); } - let actions = quick_actions(app); section(tl!("Quick Actions")).show(ui, |ui, _| { if is_image { crate::panels::image_trace::trace_button(app, ui); } - Grid::new(&HALVES).show(ui, |ui, _| { - for a in &actions { - Button::command(a.command).label(a.label).show(ui); - } - }); + quick_action_buttons(app, ui); appearance_section::global_edit_row(app, ui); }); } +fn quick_action_buttons(app: &mut VectorcraftApp, ui: &mut Ui) { + Grid::new(&HALVES).show(ui, |ui, _| { + for action in quick_actions(app) { + Button::command(action.command).label(action.label).show(ui); + } + }); +} + /// The ellipsis button that shows the panel `panel` for the section's further options. fn more_options(ui: &mut Ui, panel: &str, tip: &'static str) { IconButton::command(IconId::new("ellipsis"), CommandRef::with_params("window.panel", json!({ "panel": panel }))).label(tip).show(ui); @@ -171,7 +174,13 @@ pub(crate) fn quick_actions(app: &mut VectorcraftApp) -> Vec { let n_sel = super::selection_len(app); let first = first_selected(app); let kind = first.as_deref().map(|n| &n.kind); - let is_group = matches!(kind, Some(NodeKind::Group { .. })); + let (has_group, all_vector) = app.session.active().map_or((false, false), |st| { + let kinds = || st.selection.objects.iter().map(|id| st.doc.node(*id).map(|node| &node.kind)); + ( + kinds().any(|kind| matches!(kind, Some(NodeKind::Group { .. }))), + kinds().all(|kind| matches!(kind, Some(NodeKind::Path { guide: false, .. } | NodeKind::Compound { .. }))), + ) + }); let is_live = matches!(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 @@ -190,11 +199,12 @@ pub(crate) fn quick_actions(app: &mut VectorcraftApp) -> Vec { }; add(n_sel > 1, tl!("Group"), "object.group"); add(n_sel > 1, tl!("Make Clipping Mask"), "object.clippingMask.make"); + add(n_sel > 1 && all_vector, tl!("Unite"), "object.pathfinder.unite"); add(merge_live_paint, tl!("Merge Live Paint"), "livePaint.merge"); add(blend_options, tl!("Blend Options"), "ui.blendOptions"); add(repeat_options, tl!("Repeat Options"), "object.repeat.options"); - add(is_group, tl!("Ungroup"), "object.ungroup"); - add(is_group, tl!("Isolate Group"), "object.isolate"); + add(has_group, tl!("Ungroup"), "object.ungroup"); + add(n_sel == 1 && has_group, tl!("Isolate Group"), "object.isolate"); add(is_live, tl!("Expand Shape"), "object.expandShape"); // A dynamic symbol instance with appearance changes of its own: Reset shows the symbol's again. add(super::symbols::changed_instances_selected(app), tl!("Reset"), "symbol.instance.reset"); diff --git a/crates/ui-egui/src/panels/properties/tests.rs b/crates/ui-egui/src/panels/properties/tests.rs index faeb91c166..868b83c3c7 100644 --- a/crates/ui-egui/src/panels/properties/tests.rs +++ b/crates/ui-egui/src/panels/properties/tests.rs @@ -9,6 +9,78 @@ use super::*; use crate::tests::panel_harness::Panel; use crate::tests::synthetic::key_frame; +/// Two selected groups offer Ungroup and not Isolate Group. The same holds when a path is +/// selected ahead of a group, and when a group that holds another group is selected with other art. +#[test] +fn two_groups_offer_ungroup_without_isolate_group() { + let mut app = new_app(); + let (first, second) = (group_at(&mut app, 20.0), group_at(&mut app, 160.0)); + // The later group is first in the selection, so a check of only the first node still sees a group. + app.run("select.set", json!({"ids": [second, first]})).unwrap(); + + let mut panel = Panel::new(app, quick_action_buttons); + assert!(panel.shows("Ungroup") && !panel.shows("Isolate Group")); + assert!(!panel.shows("Unite"), "groups are not a vector selection"); + // A path selected ahead of a group that itself holds a group. + let inner = group_at(&mut panel.app(), 300.0); + let beside = rect(&mut panel.app(), 380.0, 20.0, 30.0, 30.0); + panel.app().run("select.set", json!({"ids": [inner, beside]})).unwrap(); + let outer = panel.app().run("object.group", json!({})).unwrap()["id"].clone(); + let ahead = rect(&mut panel.app(), 20.0, 120.0, 24.0, 24.0); + panel.app().run("select.set", json!({"ids": [ahead, outer]})).unwrap(); + panel.frame(); + assert!(panel.shows("Ungroup") && !panel.shows("Isolate Group"), "path then nested group"); + assert!(panel.shows("Group") && panel.shows("Make Clipping Mask")); + assert!(!panel.shows("Unite"), "a group in the selection"); +} + +/// One selected group offers Ungroup and Isolate Group, including a group that holds another group. +#[test] +fn one_group_offers_ungroup_and_isolate_group() { + let mut app = new_app(); + let inner = group_at(&mut app, 20.0); + let beside = rect(&mut app, 120.0, 20.0, 30.0, 30.0); + app.run("select.set", json!({"ids": [inner, beside]})).unwrap(); + let outer = app.run("object.group", json!({})).unwrap()["id"].clone(); + app.run("select.set", json!({"ids": [outer]})).unwrap(); + + let panel = Panel::new(app, quick_action_buttons); + assert!(panel.shows("Ungroup") && panel.shows("Isolate Group")); + assert!(!panel.shows("Unite") && !panel.shows("Make Clipping Mask"), "one group"); +} + +/// Several paths, or a compound path with another path, offer Group, Make Clipping Mask and Unite. +/// Unite joins them in one undo step. A path selected with type does not offer Unite. +#[test] +fn several_paths_offer_group_clipping_mask_and_unite() { + let mut app = new_app(); + let (a, b) = (rect(&mut app, 20.0, 20.0, 40.0, 40.0), rect(&mut app, 80.0, 20.0, 40.0, 40.0)); + app.run("select.set", json!({"ids": [a, b]})).unwrap(); + + let mut panel = Panel::new(app, quick_action_buttons); + assert!(panel.shows("Group") && panel.shows("Make Clipping Mask") && panel.shows("Unite")); + let before = panel.app().session.active().unwrap().selection.objects.len(); + let depth = undo_depth(&panel.app()); + panel.click("Unite"); + let after = panel.app().session.active().unwrap().selection.objects.len(); + assert!(after < before, "Unite joins the paths"); + assert_eq!(undo_depth(&panel.app()), depth + 1, "one undo step"); + panel.app().run("edit.undo", json!({})).unwrap(); + assert_eq!(panel.app().session.active().unwrap().selection.objects.len(), before, "Undo restores the paths"); + // A compound path and another path. + panel.app().run("select.set", json!({"ids": [a.clone(), b.clone()]})).unwrap(); + let compound = panel.app().run("object.compoundPath.make", json!({})).unwrap()["id"].clone(); + let c = rect(&mut panel.app(), 160.0, 20.0, 40.0, 40.0); + panel.app().run("select.set", json!({"ids": [compound, c]})).unwrap(); + panel.frame(); + assert!(panel.shows("Group") && panel.shows("Make Clipping Mask") && panel.shows("Unite"), "compound path"); + // Type with a path is not a vector-only selection. + let text = panel.app().run("text.create", json!({"x": 50, "y": 200, "text": "Hi"})).unwrap()["id"].clone(); + panel.app().run("select.set", json!({"ids": [c, text]})).unwrap(); + panel.frame(); + assert!(panel.shows("Group") && !panel.shows("Unite"), "path and type"); +} + /// One selected clip group has Edit Clipping Path and Edit Contents at the top of the panel, /// above the Transform section and before every other section, and they select its clipping path /// or its clipped art; one that clips nothing has Edit Clipping Path alone. A plain group, or a diff --git a/docs/gaps.md b/docs/gaps.md index fc6fc46ae2..e11f5aadcb 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -12,6 +12,8 @@ ## Feature submission evidence +Properties panel Quick Actions follow the whole selection (G12). Ungroup (`object.ungroup`) is offered when any selected object is a group, including several groups, a group selected after other objects, and a group that holds another group. Isolate Group (`object.isolate`) is offered only when that group is the whole selection. Unite (`object.pathfinder.unite`) appears only for selections of at least two objects, each a non-guide path or a compound path. It appears alongside Group and Make Clipping Mask. Unite joins those objects in one undo step. Evidence: `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group` and `several_paths_offer_group_clipping_mask_and_unite` in `crates/ui-egui/src/panels/properties/tests.rs`. Scores and estimates unchanged. + History panel row context menus (2026-11-20, G12): Right-clicking any state offers New Document from State, Step to This State, and Clear History. Creating a document uses the clicked snapshot without stepping the source document; Step to This State uses undo/redo and is disabled on the current row; Clear History removes undo and redo steps without changing artwork and is disabled when history is empty. Headless tests in `crates/ui-egui/src/panels/history.rs` cover opening an earlier row menu, snapshot creation, backward/forward jumps, and clearing history. The snapshot chosen when the menu opens is retained while it stays open; pending tool edits are settled before resolving that snapshot to its new row; a discarded snapshot reports that it is unavailable instead of acting on a neighboring row. Jumps settle pending typing before counting undo/redo steps. Shift+F10 opens the focused row menu; Escape dismisses it and restores row focus. Switching documents dismisses the menu before it can act on another document. Headless tests cover these keyboard and document-switch paths. The list and menu use shared Craft UI controls. Scores and estimates unchanged. OpenType panel feature-row context menus (part of G12): a secondary click on a feature row keeps the text selection and offers Turn Off when that feature is on for every character the panel acts on, or Turn On when it is off or mixed. Turn On and Turn Off use the same toggle as a click on the checkbox, so a mixed row turns the feature on for every character. Reset OpenType Features applies the same default as the panel menu and is enabled on the same condition. Each choice is one undo step. Evidence: `panels::opentype::tests::right_clicking_an_opentype_row_offers_turn_on_or_turn_off`, `panels::opentype::tests::clicking_turn_on_sets_that_feature_in_one_undo_step`, and `panels::opentype::tests::clicking_reset_opentype_features_clears_the_rows` in `crates/ui-egui/src/panels/opentype.rs`. Scores and estimates unchanged. @@ -540,6 +542,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi ## G12 Preferences and panels that don't act yet +- **Implemented and tested (2026-11-21):** Properties panel Quick Actions follow every selected object. Ungroup (`object.ungroup`) is offered when any selected object is a group, including several groups, a group selected after a path, and a group that holds another group. Isolate Group (`object.isolate`) is offered only when that one group is the whole selection. Unite (`object.pathfinder.unite`) appears only for selections of at least two objects, each a non-guide path or a compound path. It appears alongside Group and Make Clipping Mask. Headless regressions: `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group` and `several_paths_offer_group_clipping_mask_and_unite`. Other G12 gaps remain; scores and estimates unchanged. + - **Implemented and tested (2026-11-21):** Document Info's panel menu Selection Only (`ui.docInfo.selectionOnly`; kept in memory for the session, not stored) asks `document.info` for the selection: object counts cover the selected nodes and their descendants, and with no artwork selected it shows `(No artwork selected)` instead of the document's counts, while artboards the Artboard tool has selected still show under Document. With the item off, counts stay for the whole document. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard` and `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. - **Implemented (2026-11-20):** History panel row context menus (2026-11-20, G12): Right-clicking any state offers New Document from State, Step to This State, and Clear History. Creating a document uses the clicked snapshot without stepping the source document; Step to This State uses undo/redo and is disabled on the current row; Clear History removes undo and redo steps without changing artwork and is disabled when history is empty. Headless tests in `crates/ui-egui/src/panels/history.rs` cover opening an earlier row menu, snapshot creation, backward/forward jumps, and clearing history. The snapshot chosen when the menu opens is retained while it stays open; pending tool edits are settled before resolving that snapshot to its new row; a discarded snapshot reports that it is unavailable instead of acting on a neighboring row. Jumps settle pending typing before counting undo/redo steps. Shift+F10 opens the focused row menu; Escape dismisses it and restores row focus. Switching documents dismisses the menu before it can act on another document. Headless tests cover these keyboard and document-switch paths. The list and menu use shared Craft UI controls. Scores and estimates unchanged. @@ -1016,6 +1020,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv |---|---|---| | 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. | | 2026-11-23 | minor | Gradient stop editor: a compact Color-tab menu offers Grayscale Slider, RGB Sliders, HSB Sliders, CMYK Sliders and Web Color Sliders, sharing the Color panel mode and conversion behavior (#7918). Choosing a mode keeps the editor open; Escape closes the menu first. Scores and estimates unchanged. | +| 2026-11-21 | minor | G12: Properties Quick Actions offer Ungroup when any selected object is a group, Isolate Group only for one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path. Headless regressions: `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`. Scores and estimates unchanged. | | 2026-11-21 | minor | G12: Document Info › Selection Only (`ui.docInfo.selectionOnly`) counts objects in the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. | | 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. | | 2026-11-21 | minor | G12: OpenType panel feature rows have an item context menu (Turn On / Turn Off, Reset OpenType Features); a secondary click keeps the text selection, a mixed row turns the feature on, and each choice is one undo step. Headless regressions: panels::opentype::tests. Scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 6cd9249ba6..24321867bb 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -203,7 +203,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) Sampler-owned release/Zoom regression source uses the native canvas and covers ordinary navigation, dock rejection, accepted sampling, unchanged non-view state and no idle replay (#8744; all 25 cases passed in the e8f96d6 CI preview). | 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; scripts have `app`, the open documents, new documents, each document's selection and its page items; the rest of the script document model (layers, artboards, paths, type and the other classes) and batch work remain | 18–27 | -| M14 | 1.0 polish (Asset Export tile context menus implemented for G12; 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 , 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), History row context menus (New Document from State, Step to This State, Clear History; G12, #8845), 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 | +| M14 | 1.0 polish (Properties Quick Actions follow the whole selection: Ungroup for any group, Isolate Group for one group, Unite only for selections of at least two objects, each a non-guide path or a compound path, G12, `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`; Asset Export tile context menus implemented for G12; 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 , 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), History row context menus (New Document from State, Step to This State, Clear History; G12, #8845), 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 | @@ -248,6 +248,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | 2026-11-26 | minor | #8744: native-canvas sampler-owned release/Zoom regression source, retaining ordinary navigation, dock rejection, accepted sampling, document/selection/paint/history controls and no idle replay. Runtime pending; scores, gaps and hours unchanged. | | 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. | | 2026-11-23 | minor | Gradient stop editor: a compact Color-tab menu offers Grayscale Slider, RGB Sliders, HSB Sliders, CMYK Sliders and Web Color Sliders, sharing the Color panel mode and conversion behavior (#7918). Choosing a mode keeps the editor open; Escape closes the menu first. Scores and estimates unchanged. | +| 2026-11-21 | minor | G12: Properties Quick Actions offer Ungroup when any selected object is a group, Isolate Group only for one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path. Headless regressions: `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`. Scores and estimates unchanged. | | 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. | | 2026-11-20 | minor | Color conversion indexes global swatch bases and linked-paint lookups (#8804); scores, estimates and measured budgets unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 137685ae17..9a2d011122 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -355,7 +355,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | anti-aliasing ghost borders (#983); TIFF choices and settings are implemented | 2–4 | estimated | | Print, colour management, separations, flattener | 3 | 80% | Production Preflight available; print preview fidelity remains | 2–4 | estimated | | Automation (Actions, Variables, scripting, batch) | 3 | 60% | a scripting surface (Illustrator: JavaScript/ExtendScript), Batch, image and graph variables, dataset import/export | 8–14 | estimated; MCP `add_text` exposes existing vertical type; score and hours unchanged | -| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`, and with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show (`panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`); Asset Export item context menus implemented (G12); Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the remaining panels that have none (History rows implemented, #8845), accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; the line under the Preferences fields describes each General, Selection & Anchor Display, Guides & Grid, Smart Guides, Slices, Hyphenation, Plug-ins & Scratch Disks, User Interface, Performance, File Handling, Clipboard Handling, Appearance of Black and Devices setting on hover and keyboard focus (#8199, #8223, #8248, #8264, #8360, #8376, #8402, #8429, #8453, #8475, #8483, #8498), score and hours unchanged; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; Swatches item context menus have focused regressions and rendered-layout evidence below; Character Styles and Paragraph Styles item context menus have focused regressions (panels::text_styles::tests::right_click_context_menu_*); scores and estimates unchanged; History row context menus have snapshot, pending-edit, typing and clear-history headless regressions (panels::history::tests, #8845); swatches dropped on New Swatch or Delete Swatch carry the selected swatches the find field or kind filter hides (#8620); scores and estimates unchanged | +| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`, and with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show (`panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`); Properties Quick Actions offer Ungroup for any selected group, Isolate Group only for one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path (`panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`); Asset Export item context menus implemented (G12); Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the remaining panels that have none (History rows implemented, #8845), accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; the line under the Preferences fields describes each General, Selection & Anchor Display, Guides & Grid, Smart Guides, Slices, Hyphenation, Plug-ins & Scratch Disks, User Interface, Performance, File Handling, Clipboard Handling, Appearance of Black and Devices setting on hover and keyboard focus (#8199, #8223, #8248, #8264, #8360, #8376, #8402, #8429, #8453, #8475, #8483, #8498), score and hours unchanged; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; Swatches item context menus have focused regressions and rendered-layout evidence below; Character Styles and Paragraph Styles item context menus have focused regressions (panels::text_styles::tests::right_click_context_menu_*); scores and estimates unchanged; History row context menus have snapshot, pending-edit, typing and clear-history headless regressions (panels::history::tests, #8845); swatches dropped on New Swatch or Delete Swatch carry the selected swatches the find field or kind filter hides (#8620); scores and estimates unchanged | | Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated; #5804: private native-picked raster editor (scores unchanged) | | Generative AI (Text to Vector, Generative Recolor, Shape Fill, Concept to Vector, Prompt to Edit, Rewrite Text) | 2 | 0% | a pluggable provider and the panels; needs an owner decision on models | 30–60 | measured (absent) | | **Feature depth** | **105** | **~75%** | | **~250–420** | | @@ -3318,6 +3318,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | 2026-11-23 | minor | Gradient stop editor: a compact Color-tab menu offers Grayscale Slider, RGB Sliders, HSB Sliders, CMYK Sliders and Web Color Sliders, sharing the Color panel mode and conversion behavior (#7918). Choosing a mode keeps the editor open; Escape closes the menu first. Scores and estimates unchanged. | | 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. | | 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. | +| 2026-11-21 | minor | G12: Properties Quick Actions offer Ungroup when any selected object is a group, Isolate Group only for one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path. Headless regressions: `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`. Scores and estimates unchanged. | | 2026-11-21 | minor | G12: Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. | | 2026-11-20 | minor | Color conversion indexes global swatch bases and linked-paint lookups (#8804); scores, estimates and measured budgets unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 33d4447c01..9b146bfcd4 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -494,7 +494,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Actions panel: Delete Selection (bottom bar) deletes the selected set with its actions and keeps the other sets ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.actionSet.delete`; `panels/actions.rs` tests. VectorCraft's own rules, which the overview does not cover: deleting a set asks first (a selected action is still deleted at once), Shift-click on a set's name selects a range of sets, ≡ › Delete does the same as the button, and Default Actions and the last set can be deleted. Undo does not restore a deleted set, and recorded commands cannot be selected or deleted | | Actions panel: ≡ › Duplicate copies the selected action or set ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.actionSet.duplicate`; `panels/actions.rs` tests. VectorCraft's own rules, which the overview does not cover: the copy goes right after the original, is named after it with " copy" added and is selected, and a copied set holds copies of all its actions. Undo does not remove the copy, and recorded commands cannot be duplicated | | Asset Export tile context menus | done | Export / Remove selected assets, Rename inline, Select Artwork on Canvas, and collect selected artwork as one/multiple assets; right-click selection and multi-selection preservation; `panels::tests_asset_export` | -| Properties panel per context (every selection type's Quick Actions) | partial | one clip group: Edit Clipping Path and Edit Contents, at the top of the panel rather than in Quick Actions (G1); the overview's additional controls ([Properties panel overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html)): Blend Options (one blend selected, with any tool, #4817), Repeat Options (one radial, grid or mirror repeat selected: Object › Repeat › Options, #5181; the overview does not list it) and Merge Live Paint (a Live Paint group with more) in Quick Actions, text Quick Actions (live type selected: Create Outlines, Retype, Find and Replace…; `panels::properties::tests::type_quick_actions_show_text_commands_and_create_outlines`), the Width Profile list (Width tool or a variable-width stroke) and an applied effect's Delete icon in Appearance, Corner and Corner Radius for corners selected with Direct Selection; Variable Font was already there; Edit Artboards: a Transform section (reference point, X, Y, W, H, preset, orientation) above the Artboards section (#5219) | +| Properties panel per context (every selection type's Quick Actions) | partial | Ungroup when any selected object is a group, Isolate Group only for that one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path (`panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`); one clip group: Edit Clipping Path and Edit Contents, at the top of the panel rather than in Quick Actions (G1); the overview's additional controls ([Properties panel overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html)): Blend Options (one blend selected, with any tool, #4817), Repeat Options (one radial, grid or mirror repeat selected: Object › Repeat › Options, #5181; the overview does not list it) and Merge Live Paint (a Live Paint group with more) in Quick Actions, text Quick Actions (live type selected: Create Outlines, Retype, Find and Replace…; `panels::properties::tests::type_quick_actions_show_text_commands_and_create_outlines`), the Width Profile list (Width tool or a variable-width stroke) and an applied effect's Delete icon in Appearance, Corner and Corner Radius for corners selected with Direct Selection; Variable Font was already there; Edit Artboards: a Transform section (reference point, X, Y, W, H, preset, orientation) above the Artboards section (#5219) | | Select › Start Global Edit / Stop Global Edit; Properties › Quick Actions with the Global Edit Options popover (Match: Appearance, Size; On Artboards: All Artboards or a range, Include Objects On Canvas; Result(s)); Escape stops it; the matched objects are highlighted in their layer colour while it runs; a Shift-click on a highlighted match leaves it out | partial | #3521, `select.globalEdit` / `select.globalEditOptions` / `select.globalEditExclude`, `crates/engine/src/tests/globaledit.rs`; paths, compound paths, symbol instances and groups of them (similar groups, #4939: edits inside one group reach the same object in the others; [public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/edit-objects/edit-groups-with-similar-objects.html)); a group holding type or an image is not taken, as Global Edit does not take images or text; Shift-click to leave a match out ([public source](https://helpx.adobe.com/ph_fil/illustrator/how-to/global-editing-sensei.html)); the Control bar's Global Edit Options dropdown opens the same options; the matches are highlighted before the start (`selecting_one_object_highlights_the_similar_objects_before_global_edit_starts`); rotated copies are matched and take an edit turned by their angle ([public source](https://helpx.adobe.com/vn_vi/illustrator/how-to/modern-logo-design.html); `start_global_edit_takes_rotated_copies_and_an_edit_reaches_each_turned_by_its_angle`); reflected copies are not matched (VectorCraft's own rule) | | Contextual task bar | done | | | Control bar with Transform and Stroke popovers | done | | @@ -646,6 +646,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra | 2026-11-26 | minor | #8744: native-canvas sampler-owned release/Zoom regression source, retaining ordinary navigation, dock rejection, accepted sampling, document/selection/paint/history controls and no idle replay. Runtime pending; scores, gaps and hours unchanged. | | 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. | | 2026-11-23 | minor | Gradient stop editor: a compact Color-tab menu offers Grayscale Slider, RGB Sliders, HSB Sliders, CMYK Sliders and Web Color Sliders, sharing the Color panel mode and conversion behavior (#7918). Choosing a mode keeps the editor open; Escape closes the menu first. Scores and estimates unchanged. | +| 2026-11-21 | minor | G12: Properties Quick Actions offer Ungroup when any selected object is a group, Isolate Group only for one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path. Headless regressions: `panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`. Scores and estimates unchanged. | | 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Appearance panel row context menus (Duplicate Stroke/Fill, Delete Stroke/Fill, Hide/Show Stroke/Fill, Edit Effect…, Duplicate Effect, Delete Effect, Hide/Show Effect, Clear Appearance, Reduce to Basic Appearance); right-clicking an unselected row targets that row first. Headless regressions: `panels::tests_appearance`. Scores and estimates unchanged. |