mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-30 21:58:36 +00:00
Merge remote-tracking branch 'upstream/main' into fix-9227-offset-pasted-clip
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
name: Notify Services on Release Change
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
- unpublished
|
||||
- created
|
||||
- edited
|
||||
- deleted
|
||||
- prereleased
|
||||
- released
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
uses: storytold/craft-common-actions/.github/workflows/notify-services.yml@main
|
||||
secrets:
|
||||
ARTCRAFT_SERVICES_DISPATCH_TOKEN: ${{ secrets.ARTCRAFT_SERVICES_DISPATCH_TOKEN }}
|
||||
@@ -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:
|
||||
|
||||
@@ -868,6 +868,7 @@ pub const DESKTOP_MENU_ITEMS: &[(&[&str], &str)] = &[
|
||||
(&["View"], "Snap to Pixel"),
|
||||
(&["View"], "Snap to Point"),
|
||||
(&["View"], "Snap to Glyph"),
|
||||
(&["View"], "Snapping"),
|
||||
(&["View"], "Saved View"),
|
||||
];
|
||||
|
||||
|
||||
@@ -477,7 +477,9 @@ mod tests {
|
||||
});
|
||||
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() }),
|
||||
|
||||
@@ -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<TargetPaints>,
|
||||
/// 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<u64>,
|
||||
/// 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<Earlier>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Earlier {
|
||||
step: Option<(u64, u64)>,
|
||||
key: TargetKey,
|
||||
paints: Arc<TargetPaints>,
|
||||
}
|
||||
|
||||
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<TargetPaints>, step: Option<(u64, u64)>, restores: Option<u64>) -> 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<u64>) -> Option<TargetKey> {
|
||||
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<TargetPaints>, 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<ColorPanelOutput>,
|
||||
/// Only an actual Shift-cycle changes this; an unchanged local snapshot must not overwrite a menu command.
|
||||
mode: Option<ColorPanelMode>,
|
||||
/// The mode whose row of the popover's Color mode menu ran its command this pass.
|
||||
mode_command: Option<ColorPanelMode>,
|
||||
}
|
||||
|
||||
/// 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<OwnMode>,
|
||||
}
|
||||
|
||||
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<ColorPanelMode>) {
|
||||
let words = Env::of(ui).words::<ColorPanelWords>();
|
||||
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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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::<GradientStopPopover>(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();
|
||||
|
||||
@@ -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<String>,
|
||||
/// The save command (`file.saveAs`, `file.saveCopy`) this PDF finishes; none: a plain PDF copy.
|
||||
|
||||
@@ -75,6 +75,95 @@ fn answer_open(app: &mut VectorcraftApp, fields: Value, ok: bool) {
|
||||
crate::tests::picks::answer_dialog(app, dialog.id, &fields, ok);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn view_snapping_submenu_keeps_top_level_commands_and_shortcuts() {
|
||||
let mut app = crate::testing::windowed(VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()));
|
||||
let ctx = app.ui_ctx.clone().unwrap();
|
||||
crate::tests_synthetic::key_frame(&mut app, &ctx, vec![]);
|
||||
let view = menu_nodes("View");
|
||||
let items = submenu_nodes(&view, "Snapping").expect("View › Snapping");
|
||||
let expected = [
|
||||
("Smart Guides", "view.smartGuides"),
|
||||
("Snap to Point", "view.snapToPoint"),
|
||||
("Snap to Grid", "view.snapToGrid"),
|
||||
("Snap to Pixel", "view.snapToPixel"),
|
||||
("Snap to Glyph", "view.snapToGlyph"),
|
||||
("Pixel Snapping Options…", "view.snapToPixel.options"),
|
||||
];
|
||||
assert_eq!(items.len(), 7);
|
||||
assert_eq!(separators(items), [5]);
|
||||
let commands: Vec<_> = command_rows(items).into_iter().map(|(label, id, _)| (label, id)).collect();
|
||||
assert_eq!(commands, expected);
|
||||
let entries = menu_entries(&app);
|
||||
for (_, id) in expected.iter().take(5) {
|
||||
let top = entries.iter().find(|e| e.path == ["View"] && e.command.as_deref() == Some(id)).unwrap();
|
||||
let nested = entries.iter().find(|e| e.path == ["View", "Snapping"] && e.command.as_deref() == Some(id)).unwrap();
|
||||
assert_eq!(top.shortcut, nested.shortcut, "{id}");
|
||||
assert_eq!(top.shortcut, shortcut_of(&app, id).map(|c| c.to_string()).unwrap_or_default(), "{id}");
|
||||
}
|
||||
let previous_lang = crate::i18n::current();
|
||||
crate::i18n::set_current(crate::i18n::Lang::from_code("de").unwrap());
|
||||
model::refresh(&mut app, &ctx);
|
||||
let view = app.menus.bar.menus.iter().find(|m| m.title == tl!("View")).unwrap();
|
||||
let translated = tl!("Snapping").to_string();
|
||||
let localized = submenu_nodes(&view.children, &translated).is_some();
|
||||
crate::i18n::set_current(previous_lang);
|
||||
assert!(localized, "the built menu uses the localized Snapping label");
|
||||
assert_ne!(translated, "Snapping");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn snapping_menu_clicks_toggle_view_state_and_painted_checkmarks() {
|
||||
use crate::tests::panel_harness::Panel;
|
||||
use craft::behavior::Mixed;
|
||||
|
||||
// Draw the model's real Snapping children in a small menu bar, without the top-level
|
||||
// duplicate rows, so each pointer target and its checkmark have an unambiguous name.
|
||||
fn draw(app: &mut VectorcraftApp, ui: &mut egui::Ui) {
|
||||
model::refresh(app, ui.ctx());
|
||||
let view = app.menus.bar.menus.iter().find(|m| m.title == "View").unwrap();
|
||||
let items = submenu_nodes(&view.children, "Snapping").unwrap().to_vec();
|
||||
let bar = craft::tracked::Tracked::new(craft::menu::MenuBar::new(vec![craft::menu::Menu::new("Snapping", items)]));
|
||||
craft::menu::MenuBarUi::new(&bar).show(ui);
|
||||
}
|
||||
let states = |app: &VectorcraftApp| {
|
||||
let v = &app.ui.view;
|
||||
[v.smart_guides, v.snap_to_point, v.snap_to_grid, v.snap_to_pixel, v.snap_to_glyph]
|
||||
};
|
||||
crate::i18n::set_current(crate::i18n::Lang::EN);
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
|
||||
app.run("file.new", json!({})).unwrap();
|
||||
let mut menu = Panel::new(app, draw);
|
||||
menu.click("Snapping");
|
||||
for (index, (label, id)) in [
|
||||
("Smart Guides", "view.smartGuides"),
|
||||
("Snap to Point", "view.snapToPoint"),
|
||||
("Snap to Grid", "view.snapToGrid"),
|
||||
("Snap to Pixel", "view.snapToPixel"),
|
||||
("Snap to Glyph", "view.snapToGlyph"),
|
||||
]
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
{
|
||||
for _ in 0..2 {
|
||||
let before = states(&menu.app());
|
||||
assert!(menu.enabled(label), "{id}");
|
||||
assert_eq!(checked(&menu.app(), id, &Value::Null), Some(before[index]), "{id}");
|
||||
// The shared renderer exposes the state of the row's drawn checkmark.
|
||||
assert_eq!(menu.toggled(label), Some(Mixed::Same(before[index])), "{id}");
|
||||
menu.click(label);
|
||||
let mut expected = before;
|
||||
expected[index] = !expected[index];
|
||||
assert_eq!(states(&menu.app()), expected, "{id} must toggle only its own state");
|
||||
assert_eq!(checked(&menu.app(), id, &Value::Null), Some(expected[index]), "{id}");
|
||||
menu.click("Snapping");
|
||||
assert_eq!(menu.toggled(label), Some(Mixed::Same(expected[index])), "{id}");
|
||||
}
|
||||
}
|
||||
assert!(menu.enabled("Pixel Snapping Options…"));
|
||||
assert_eq!(menu.toggled("Pixel Snapping Options…"), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn help_f1_opens_discover_without_a_document() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
|
||||
|
||||
@@ -701,6 +701,18 @@ fn built_in_tree(english_names: bool, listed: &Listed) -> Vec<(&'static str, Vec
|
||||
c("Snap to Pixel", "view.snapToPixel"),
|
||||
c("Snap to Point", "view.snapToPoint"),
|
||||
c("Snap to Glyph", "view.snapToGlyph"),
|
||||
sub(
|
||||
"Snapping",
|
||||
vec![
|
||||
c("Smart Guides", "view.smartGuides"),
|
||||
c("Snap to Point", "view.snapToPoint"),
|
||||
c("Snap to Grid", "view.snapToGrid"),
|
||||
c("Snap to Pixel", "view.snapToPixel"),
|
||||
c("Snap to Glyph", "view.snapToGlyph"),
|
||||
Sep,
|
||||
c("Pixel Snapping Options…", "view.snapToPixel.options"),
|
||||
],
|
||||
),
|
||||
Sep,
|
||||
c("New View…", "view.saved.new"),
|
||||
c("Edit Views…", "view.saved.edit"),
|
||||
|
||||
@@ -44,8 +44,7 @@ const WRAPPED: &[(&str, &str)] = &[
|
||||
/// every preference, Forget Import Matches forgets every saved match, Begin Undo Group and End
|
||||
/// Undo Group begin and end a group, the six Save … Preset commands save a new preset (Save
|
||||
/// Gradient Preset the selection's gradient), Delete Gradient Preset deletes the saved preset the
|
||||
/// selection's gradient matches, Pixel Snapping Options…
|
||||
/// opens its dialog, the three Asset Export commands open the Asset Export panel (#4864), New
|
||||
/// selection's gradient matches, the three Asset Export commands open the Asset Export panel (#4864), New
|
||||
/// Symbol makes a symbol of the selection, Gradient Vector gives the selection the default
|
||||
/// gradient, Define Perspective Grid makes the document's grid, Select Slice deselects the
|
||||
/// slices, and Find Next goes on from the last Find and Replace search or opens its dialog, as
|
||||
@@ -65,7 +64,6 @@ const PICK_RUNS: &[&str] = &[
|
||||
"perspective.presets.save",
|
||||
"gradient.presets.save",
|
||||
"gradient.presets.delete",
|
||||
"view.snapToPixel.options",
|
||||
"assets.export",
|
||||
"assets.export3D",
|
||||
"assets.settings.set",
|
||||
@@ -1057,7 +1055,7 @@ mod tests {
|
||||
fn a_pick_opens_the_dialog_its_menu_item_opens() {
|
||||
type Opened = fn(&VectorcraftApp) -> bool;
|
||||
let any: Opened = |app| app.any_dialog_open();
|
||||
let expected: [(&str, Opened); 5] = [
|
||||
let expected: [(&str, Opened); 6] = [
|
||||
("object.path.cleanUp", any),
|
||||
("object.mesh.create", any),
|
||||
("type.smartPunctuation", |app| {
|
||||
@@ -1067,6 +1065,10 @@ mod tests {
|
||||
}),
|
||||
("edit.findReplace", |app| app.dialogs().is_some_and(|d| d.with(|h| h.is_open::<craft::text::ui::find::FindReplaceDialog>()))),
|
||||
("object.path.smooth", crate::dialogs::smooth_slider::showing),
|
||||
("view.snapToPixel.options", |app| {
|
||||
app.dialogs()
|
||||
.is_some_and(|d| d.with(|h| h.open_dialogs().iter().any(|d| d.key.as_deref() == Some(crate::dialogs::pixel_snap_options::KIND))))
|
||||
}),
|
||||
];
|
||||
for (id, opened) in expected {
|
||||
assert!(items().iter().any(|(_, item)| item == id), "{id} is in the palette");
|
||||
|
||||
@@ -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<QuickAction> {
|
||||
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<QuickAction> {
|
||||
};
|
||||
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");
|
||||
|
||||
@@ -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
|
||||
|
||||
+12
-3
@@ -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.
|
||||
@@ -694,10 +698,13 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
deletes saved ones; `gradient.presets.*` commands.
|
||||
- **Improved (#6164):** Control bar › Snapping also exposes the existing Snap to Glyph and Alignment Guides
|
||||
toggles through their existing commands. Floating-panel parity remains unverified; the estimate is unchanged.
|
||||
- **Done (2026-11-21):** View › Snapping contains Smart Guides, Snap to Point, Snap to Grid,
|
||||
Snap to Pixel and Snap to Glyph, followed by a separator and Pixel Snapping Options…. All reuse the
|
||||
existing view commands, checkmarks and localized labels; top-level View toggles and shortcuts remain.
|
||||
Headless menu tests cover the hierarchy, clicks and painted checkmarks. Public reference:
|
||||
[snapping and alignment](https://www.adobe.com/learn/illustrator/web/snapping-for-perfect-alignment).
|
||||
- **Missing:** the rest of the snapping enhancements (29.8.1): forced snapping to the grid, showing guides while
|
||||
snapping, and limiting snapping to the active artboard or to isolated objects; the Snapping panel is partial
|
||||
(the Control bar's Snapping quick access exists, but there is no View › Snapping submenu and floating-panel
|
||||
parity is unverified, see [ui-parity.md](ui-parity.md)). The Smart Guides snapping tolerance and 30.0's Snap to
|
||||
snapping, and limiting snapping to the active artboard or to isolated objects; floating-panel parity is unverified (the Control bar's Snapping quick access and View › Snapping submenu are done, see [ui-parity.md](ui-parity.md)). The Smart Guides snapping tolerance and 30.0's Snap to
|
||||
Tangent and Snap to Perpendicular are done. Not yet checked: snapping to the endpoints, midpoints and centers of
|
||||
rotated objects, and the reworked Snap to Grid and Snap to Pixel feedback. Also missing: artboard colors in exports and print, and
|
||||
managing artboards from the canvas other than locking and unlocking them from the Artboard tool's right-click
|
||||
@@ -1016,6 +1023,8 @@ 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 | G13: View › Snapping groups five existing toggles and Pixel Snapping Options…; top-level commands and shortcuts remain; headless click/checkmark coverage added; 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. |
|
||||
|
||||
+6
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4
-2
@@ -297,7 +297,7 @@ tools, never checked side by side) isn't captured row by row.
|
||||
| Snap to Point, Snap to Grid, Snap to Pixel; Pixel Preview | done | #1840: with Snap to Grid on, anchors and objects snap to the grid even when Snap to Pixel is also ticked (#1816 waits for the reporter); #3835: a straight segment dragged with Direct Selection lands its anchors on the grid, the box round them putting an edge on a gridline on each axis, as a moved object does |
|
||||
| Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`); new type and drawing snap to live-text baselines and glyph bounds when Smart Guides are on (#3124). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to them too; that is VectorCraft's choice. Character panel menu › Show Snap to Glyph Options: a Snap to Glyph checkbox (View › Snap to Glyph), then a checkbox for each guide (Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides, Anchor Point), dimmed while Snap to Glyph is off (#4232); showing them scrolls the panel to them (#5273) |
|
||||
| Tangent and perpendicular snapping for line endpoints (new in 30.0) | done | #2530: tangent snapping to curves and perpendicular snapping to straight segments for lines drawn with the Line Segment, Pen and Curvature tools, and for an existing line whose end anchor is dragged with Direct Selection (the only anchor selected, an open path's end on a straight segment; Shift keeps its angle step instead; Group Selection moves the path whole and does not snap so); mid-line anchors, curved segments' ends and curves as perpendicular targets are excluded, as the pages say. Saved Preferences › Smart Guides › Geometric Guides controls, on by default. [Perpendicular](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/snap-to-perpendicular.html) and [tangent](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/snap-to-tangent.html) pages; test `dragged_line_ends_snap_perpendicular_to_segments_and_tangent_to_curves` |
|
||||
| Snapping panel/popover consolidating the snap options (30.0) | partial | Control bar › Snapping provides quick access through existing view commands and prefs.set, including Snap to Glyph and Alignment Guides (#6164); no View › Snapping submenu. Floating-panel parity remains unverified. |
|
||||
| Snapping panel/popover consolidating the snap options (30.0) | done | Control bar › Snapping provides quick access through existing view commands and prefs.set, including Snap to Glyph and Alignment Guides (#6164). View › Snapping groups Smart Guides, Snap to Point/Grid/Pixel/Glyph and Pixel Snapping Options… using existing commands, localization and checkmarks; top-level View commands and shortcuts remain. Structure, pointer clicks and painted checkmarks: `menus/tests.rs`. Floating-panel parity remains separately unverified. |
|
||||
| Customisable rotation snap angle (#973) | missing | Illustrator: Constrain Angle and construction angles only |
|
||||
| Ruler guides: drag out, select, move, delete, lock, Make/Release Guides | done | #414, #451; marquee selects unlocked ruler guides |
|
||||
| A double-click on a ruler adds a guide at the pointer: a vertical one on the top ruler, a horizontal one on the left ruler (swapped in a view turned 90°, where the rulers read the other document axis; the nearer axis in between), exactly where the pointer is (no snapping), shown even with guides hidden, one undo step (`guide.add`); both clicks of the pair must be on that ruler, and the first adds nothing. The [public page on rulers](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/use-rulers.html) doesn't describe this gesture, so it follows the request in #5239 | done | #5239; an artboard guide with the Artboard tool, as a drag from a ruler makes one; `canvas/tests.rs` `double_clicking_a_ruler_adds_a_guide_at_that_position`, `a_canvas_click_then_a_ruler_click_adds_no_guide`, `a_ruler_double_click_follows_a_rotated_view` |
|
||||
@@ -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,8 @@ 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 | G13: View › Snapping groups five existing toggles and Pixel Snapping Options…; top-level commands and shortcuts remain; headless click/checkmark coverage added; 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. |
|
||||
|
||||
Reference in New Issue
Block a user