Repository navigation
Sketch: paste copied sketch geometry into another design (#9258) - #9675
Merged
bherbruck merged 2 commits intoOct 31, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#9258) Sketch geometry copied or cut in a sketch (sketch.copy / sketch.cut) now pastes into a sketch of another open design with Ctrl+V or the context menu, at the cursor or at the copied coordinates, with the constraints and dimensions among it. A dimension whose expression names the copied design's parameters keeps its value, in its unit; a text keeps its numbers. SketchClip::for_another_design prepares the clipboard; the app keeps the last sketch copy beside the cross-design body/component copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PaddleStroke
force-pushed
the
feat/9258-cross-document-paste
branch
from
October 31, 2026 03:41
6ce572f to
c0eab48
Compare
PaddleStroke
marked this pull request as ready for review
October 31, 2026 03:42
bherbruck
enabled auto-merge
October 31, 2026 03:54
bherbruck
added this pull request to the merge queue
Oct 31, 2026
Merged
via the queue into
tangency-labs:main
with commit Oct 31, 2026
c2f6610
145 of 166 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Part of #9258. On
main, bodies and components copied in one design already paste into another open design (#3511), and so do completed sketches as timeline features (#5427). Sketch geometry copied inside a sketch did not:sketch.copykeeps its clipboard in the design's own session, so in a sketch of another tab Ctrl+V said "Nothing to paste: copy sketch geometry first" and the context menu's Paste was greyed out.With this change, sketch entities copied or cut in a sketch (Ctrl+C / Ctrl+X, or the context menu) paste into a sketch of another open design with Ctrl+V or the context menu's Paste. The geometry lands at the cursor, or at the copied coordinates when the pointer is off the viewport. The constraints and dimensions among the copied entities come with it, and the paste is one undo step, the same as a paste within one design.
w) is pasted with its value as a number in the same unit. It is not tied to a parameter of the same name in the target design, which may mean something else (this follows the reporter's comment that standalone geometry is what they need). A dimension typed as a number keeps its number. A pasted text keeps its words, height and angle as numbers.SketchClip::for_another_design()(crates/engine/src/cmd/sketch_clipboard.rs) prepares the clipboard for another design. It also sets the source sketch id to none, because sketch ids repeat across designs and a matching id would offset the paste as if it went back into its own sketch.SolveApp::foreign_sketch_clipkeeps the last sketch copy, using the same "last copy in any design wins" stamps as the existing cross-design body and component copy (crates/ui-egui/src/edit_clipboard.rs). The sketch context menu's Paste uses the newcan_paste_sketch.No new commands, UI strings, design-format changes or dependencies.
Changes a default: no
Validation
cargo fmt --all -- --check: clean.cargo clippy -p solidcraft-engine -p solidcraft-ui-egui --all-targets -- -D warnings: clean.cargo test -p solidcraft-engine --lib sketch_clipboard: 9 passed. This includes the newsketch_geometry_pastes_into_another_design_with_values_not_foreign_parameters: a dimension driven byw = 1 inpastes as 25.4 mm into a design whose ownwis 3 mm, thatwstays untouched, the paste lands at the copied coordinates even though the target sketch has the same id, and a second paste lands there again.cargo test -p solidcraft-ui-egui --lib edit_clipboard: 33 passed, 3 failed. The newsketch_geometry_copies_into_a_sketch_of_another_designpasses: Ctrl+C in a sketch, new tab, Paste is off outside a sketch and on in the sketch's context menu, Ctrl+V pastes the 4 lines at the cursor with both dimensions in one undo step, and a copy made later in the second tab is what pastes back in the first. The 3 failures are the middle-button tests, which panic inside epaint on this machine with "Dropped TexturesDelta". This is known local noise and unrelated to the change.cargo xtask ci,cargo xtask wasmand the other xtask checks (the engine change is plain Rust with no new dependencies). After rebasing onto main 60b9e9d there was no conflict, and the build was not run again.Screenshots of the behavior (when observable)
Debug build, empty designs, driven over the control channel.
Steps: in design A, set the user parameter
w = 60 mmand draw a sketch: a rectangle with widthwand height 30, and an 8 mm hole. Select it all and press Ctrl+C. Open a new tab (design B), set its ownw = 10 mm, create a sketch on XY and press Ctrl+V.Before (main): in B's sketch, Ctrl+V reports "Nothing to paste: copy sketch geometry first" (no screenshot: a second app build would have taken about 40 minutes on the shared machine).
After, design A: the copied geometry, with the width driven by

w(fx: 60.00 mm):After, design B: pasted with its dimensions. The width is a plain

60.00 mm, not B'sw(10 mm). The status reads "Pasted 5 sketch entities". In B,parameters.listshowsd1 = 60,d2 = 30,d3 = 8, andwis still10 mm.Integration status
Rebased onto upstream main 60b9e9d with no conflicts. No other open PR covers #9258. #2250 (point-to-point sketch move and clipboard placement) touches the same clipboard files but does not cover pasting sketch entities across designs.
🤖 Generated with Claude Code