Skip to content

Sketch: copy completed sketches between designs (#5427) - #8962

Merged
bherbruck merged 2 commits into
tangency-labs:mainfrom
cfaulkingham:codex/sketch-copy-5427
Oct 30, 2026
Merged

bherbruck merged 2 commits into
tangency-labs:mainfrom
cfaulkingham:codex/sketch-copy-5427

Conversation

@cfaulkingham

@cfaulkingham cfaulkingham commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Change

Fixes #5427.

Copying a completed sketch and pasting into a new design used to report “Nothing to paste: copy bodies or timeline features first”. Completed sketches now use the application’s cross-design clipboard and paste as independent, editable features through timeline.paste. Keyboard Paste and the Sketches folder/group menus share this path; the snapshot survives edits to or closure of its source tab.

The paste copies numeric and text parameter dependencies, resolves destination name collisions, retains source units, remaps references between copied sketches, and preserves world placement when the destination component is moved. The operation is one undo step. Same-design paste continues to use its existing path.

Scope: sketch features with self-contained planes and references. Planes tied to model geometry and projected geometry outside the copied set are rejected before changing the destination, with an explanation; they cannot accidentally bind to matching IDs in another design. No kernel behavior or design format changes.

Changes a default: no

Validation

  • Reproduced on the official macOS 0.26.1 app and an upstream build at 1c0001af8. The new-design UI regression failed before the fix and passed afterward.
  • cargo test --profile ci --workspace --lib clipboard -- --test-threads=4: 65 tests passed (29 engine, 32 UI, 4 document), including eight new regression tests. They cover tab closure, group-menu paste, parameter independence, units, name collisions, linked sketches, equation curves, moved components, atomic refusal, undo/redo and serialization.
  • Extended the moved-component regression to include 3D arcs in both stored coordinate spaces and explicit paste translation. It failed before the wire mapping fix and all six cross-design engine tests passed after it.
  • Desktop reproduction on the fixed build: a 30 × 20 mm rectangle pastes as one sketch in a new design, remains fully constrained and editable, and survives undo/redo without an error message. Same-design paste still succeeds.
  • Full cargo xtask ci on the implementation based on 15e324518: repository checks, formatting, Clippy, wasm and doc tests passed, as did the full UI library (3,499 passed), kernel library (878 passed), command-atomicity suite and interaction matrix. The gate is not green: agent_chat_home_page timed out waiting for “Add agent”, and cmd::features::prism_local_tests::a_ring_cut_round_a_counterbored_hole_in_a_chamfered_disc failed. Both also failed in the baseline before this fix. The remaining broad engine run was interrupted after these failures; its coverage is incomplete, and the subsequent web-offline check was not reached.
  • After the final upstream rebase: formatting and workspace Clippy passed; the complete clipboard filter passed all 66 tests (29 engine, 33 UI, 4 document), including the added 3D-wire coverage and upstream text-field clipboard test.

Screenshots of the behavior

On macOS, create an XY sketch with a 30 × 20 mm rectangle, finish it, select its feature, Copy, create a New Design, then Paste.

Before (1c0001af8): the original design accepts Paste, but the new design stays empty and reports “Nothing to paste”.

Before: Paste leaves the new design empty

After: the new design contains the pasted sketch; Undo removes it and Redo restores it.

After: the sketch is pasted into the new design

Editing the pasted sketch shows the original dimensions and fully constrained state.

After: the pasted sketch is editable and fully constrained at 30 by 20 mm

Integration status

Rebased onto upstream main at 6fcdca1bb without conflicts. Reran clipboard tests after integrating the upstream equation-curve, parameter-unit and text-field clipboard changes. This remains a draft PR pending maintainer review.

@cfaulkingham
cfaulkingham marked this pull request as ready for review October 29, 2026 18:39
@cfaulkingham
cfaulkingham marked this pull request as draft October 29, 2026 18:40
@cfaulkingham
cfaulkingham force-pushed the codex/sketch-copy-5427 branch from cd5cdc3 to cbe3637 Compare October 29, 2026 18:56
@cfaulkingham
cfaulkingham marked this pull request as ready for review October 29, 2026 18:59
@bherbruck bherbruck added ready to merge reviewed, every ask addressed; merge once CI is green owner-approved Owner reviewed a sensitive-path change (kernel, CI, build scripts, deps); only the owner adds this approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Oct 30, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

Looks good, approved. It conflicts with main right now, so it needs a rebase before it can merge. #3512 has already landed, so you only have to rebase onto main, not wait on another PR.

@bherbruck
bherbruck force-pushed the codex/sketch-copy-5427 branch from cbe3637 to ec81b89 Compare October 30, 2026 13:56
@bherbruck
bherbruck added this pull request to the merge queue Oct 30, 2026
Merged via the queue into tangency-labs:main with commit 0858533 Oct 30, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) owner-approved Owner reviewed a sensitive-path change (kernel, CI, build scripts, deps); only the owner adds this ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design - Sketch: unexpected result - Coping sketch from one document to another (not working)

2 participants