From e8f13a5825a75579ef5babe9194d19670efd120c Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sun, 15 Nov 2026 17:11:15 +0100 Subject: [PATCH] Validate Illustrator clipboard sample and record QCAD workflow --- .../fixtures/illustrator-rectangles.README.md | 14 +++++++++ .../tests/fixtures/illustrator-rectangles.svg | 8 +++++ crates/canvas-pilot/tests/import.rs | 30 +++++++++++++++++++ docs/canvas-pilot/changelog.md | 5 ++++ docs/canvas-pilot/guide/files.md | 13 ++++++++ docs/canvas-pilot/plan.md | 8 +++-- 6 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 crates/canvas-pilot/tests/fixtures/illustrator-rectangles.README.md create mode 100644 crates/canvas-pilot/tests/fixtures/illustrator-rectangles.svg diff --git a/crates/canvas-pilot/tests/fixtures/illustrator-rectangles.README.md b/crates/canvas-pilot/tests/fixtures/illustrator-rectangles.README.md new file mode 100644 index 0000000..c123822 --- /dev/null +++ b/crates/canvas-pilot/tests/fixtures/illustrator-rectangles.README.md @@ -0,0 +1,14 @@ +# Illustrator SVG clipboard sample + +Supplied by the user on 2026-11-15 as Illustrator clipboard text. The fixture +removes chat Markdown escaping, restores Markdown-linked namespace URLs to plain +URLs, and decodes chat ` ` indentation as spaces. SVG values and element +order are unchanged. Illustrator version, platform and copy command were not supplied. + +Expected geometry: two 1814.174 × 1020.473 rectangles at (0.354, 0.354) and +(395.791, 461.357). Both have a 0.709-unit centered stroke. Including outlines +expands each side by 0.3545, giving 1814.883 × 1021.182 bounds. The first outline +starts at (-0.0005, -0.0005); do not clamp away this fractional offset. + +This validates the supplied SVG text through the paste parser, not Illustrator's +other native clipboard formats or live operating-system clipboard delivery. diff --git a/crates/canvas-pilot/tests/fixtures/illustrator-rectangles.svg b/crates/canvas-pilot/tests/fixtures/illustrator-rectangles.svg new file mode 100644 index 0000000..cd50b24 --- /dev/null +++ b/crates/canvas-pilot/tests/fixtures/illustrator-rectangles.svg @@ -0,0 +1,8 @@ + + + Untitled-1 + + + + + diff --git a/crates/canvas-pilot/tests/import.rs b/crates/canvas-pilot/tests/import.rs index 25171e6..40fb103 100644 --- a/crates/canvas-pilot/tests/import.rs +++ b/crates/canvas-pilot/tests/import.rs @@ -31,6 +31,36 @@ fn supplied_figma_svg_clipboard_preserves_rectangle_order_and_translation() { } } #[test] +fn supplied_illustrator_svg_clipboard_preserves_fractional_bounds_and_strokes() { + let doc = parse_values(include_str!("fixtures/illustrator-rectangles.svg")).unwrap(); + assert!(doc.svg); + assert_eq!(doc.shapes.len(), 2); + for (shape, (x, y)) in doc.shapes.iter().zip([(0.354, 0.354), (395.791, 461.357)]) { + let expected = Geometry { + x, + y, + width: 1814.174, + height: 1020.473, + }; + close(shape.geometry.x, expected.x); + close(shape.geometry.y, expected.y); + close(shape.geometry.width, expected.width); + close(shape.geometry.height, expected.height); + assert!(!shape.background); + assert!(!shape.background_only); + assert_eq!(shape.outline, [0.709, 0.709]); + assert_eq!( + shape.paste_geometry(expected, true, false).unwrap(), + shape.geometry + ); + let outlined = shape.paste_geometry(expected, true, true).unwrap(); + close(outlined.x, x - 0.3545); + close(outlined.y, y - 0.3545); + close(outlined.width, 1814.883); + close(outlined.height, 1021.182); + } +} +#[test] fn svg_detects_rectangles_background_names_transforms_and_outlines() { let doc=parse_svg(&svg(r#""#)).unwrap(); assert_eq!(doc.shapes.len(), 3); diff --git a/docs/canvas-pilot/changelog.md b/docs/canvas-pilot/changelog.md index 8370aaf..e305b33 100644 --- a/docs/canvas-pilot/changelog.md +++ b/docs/canvas-pilot/changelog.md @@ -4,6 +4,11 @@ ## Unreleased +- Validate the supplied Illustrator SVG clipboard sample with regression coverage + for fractional coordinates and optional centered-stroke bounds. Record QCAD as + a file-exchange workflow based on user feedback; no clipboard adapter is planned. + Existing SVG parsing handles the sample; live clipboard delivery remains unverified. + - Mark export/workflow cleanup solved following user confirmation; move it from the remaining backlog to completed implementation. diff --git a/docs/canvas-pilot/guide/files.md b/docs/canvas-pilot/guide/files.md index 861f4e1..f15e6eb 100644 --- a/docs/canvas-pilot/guide/files.md +++ b/docs/canvas-pilot/guide/files.md @@ -76,6 +76,19 @@ Paste SVG text and review the detected shapes in the mapping dialog. This evidence covers the supplied SVG text only; native Figma binary/HTML clipboard formats and live clipboard delivery have not been validated. +### Illustrator SVG clipboard text + +The supplied [Illustrator SVG sample](../../../crates/canvas-pilot/tests/fixtures/illustrator-rectangles.svg) +works through the existing SVG/value paste parser. Its two 1814.174 × 1020.473 +rectangles retain fractional positions (0.354, 0.354) and (395.791, 461.357). +Enabling outline inclusion adds the centered 0.709-unit stroke to their bounds, +producing 1814.883 × 1021.182 boxes. Stroke colors are not imported as artwork +through this geometry workflow. Other native Illustrator clipboard formats and +live clipboard delivery have not been validated. + +For QCAD, use file exchange; no clipboard adapter is planned for the user's +reported workflow. + ### draw.io clipboard The draw.io adapter accepts single-page `.drawio`/`.xml` files (including native diff --git a/docs/canvas-pilot/plan.md b/docs/canvas-pilot/plan.md index 4c42777..5852e82 100644 --- a/docs/canvas-pilot/plan.md +++ b/docs/canvas-pilot/plan.md @@ -73,9 +73,11 @@ device readback and physical-screen acceptance. - [ ] **Additional native clipboard adapters.** Obtain actual software/version clipboard samples before implementing or claiming Inkscape, Illustrator, Figma, - etc. native clipboard support. The supplied Figma SVG-text sample is covered - by a paste-parser regression test; native clipboard formats and live delivery - remain unverified. File import is not native clipboard compatibility. + etc. native clipboard support. The supplied Figma and Illustrator SVG-text + samples are covered by paste-parser regression tests; other native clipboard + formats and live delivery remain unverified. QCAD is a file-exchange workflow + per user feedback, with no clipboard adapter planned. File import is not native + clipboard compatibility. - [ ] **Non-Centered/masked Midra layer import.** Expand conversion only after verifying those semantics. Source routing synchronization remains separate from the opt-in shared-input settings editor.