Repository navigation
Drawing views: moving a view on its sheet is one rule in the drawing, ready for a drag preview (#4816) - #17645
Merged
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…th it go too (tangency-labs#4816) Where a view sits was split between the record and the engine: the record read, checked and mapped a drag to a place, and the engine wrote it, walked the views lined up with it and shifted a group onto another sheet. The drag preview the sheet page will get would have had to repeat the engine's write. Now the record's view module holds the whole rule: - Drawing::move_view moves a view across its sheet, writes it, and answers the views that moved (it, then the views lined up with it whose centres changed). drawing.view.move and drawing.view.move_to_sheet on the view's own sheet call it, and a preview can run it on a copy. - Drawing::places_beside gives a view placed apart at a point and the views lined up with it, each kept beside it. move_to_sheet and copy_to_sheet use it for another sheet. - Drawing::lined_up_with and with_projected share one walk down a view's chains. The engine's drag, lined_up, descendants and shifted go, with shifted's arm for a base view lined up with nothing, which the record refuses. Behaviour is unchanged, except that a copied view is now placed exactly at the asked position. The line-up rules get tests of their own on a plain drawing. A view the move places apart is given its letter inside the same doc call, so the drag and its preview show the same label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Rebased onto
|
CamWight
force-pushed
the
view-move-in-doc-4816
branch
from
November 16, 2026 10:17
f3db82b to
b8f5acf
Compare
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
This is a cleanup in SolidCraft's drawing code, ahead of a drag preview on the sheet. A user sees no change.
Moving a view on a drawing sheet used to be split between two layers:
shifted a group of views onto another sheet.
A drag preview would have had to repeat the engine's part. Now the drawing's view module holds the whole rule:
Drawing::move_viewmoves a view across its sheet, writes it, gives it its letter when the move places itapart, and answers which views moved.
drawing.view.move, anddrawing.view.move_to_sheeton the view's ownsheet, both call it. A preview can run it on a copy.
Drawing::places_besidegives a view placed apart at a point, and the views lined up with it, their placesbeside it. Moving or copying to another sheet uses it.
Drawing::lined_up_withandwith_projectedshare one walk down a view's chains. It usesViewKind::parent(),so projected and section views follow the same rule.
The engine's
drag,lined_up,descendantsandshiftedgo. Behaviour is unchanged, except that a copied baseview is now placed exactly at the asked position.
This is stacked on #17620, whose commit is the first one here. Once #17620 lands, this PR is rebased and that
commit drops out. Part of #4816.
Changes a default: no
Validation
On
drawingse069e4e, in--profile ci:cargo test -p solidcraft-doc --lib -- drawing::view: 28 passed. This includes four line-up tests on a plaindrawing, and a check that a view moved apart gets its letter from
move_view.cargo test -p solidcraft-engine --lib, the view command, schema and view tests, plushostile_params_never_panicandregistry_is_consistent: 129 passed.4 planted faults, each caught by its named test:
break_alignmentignored;The clean run after them passes.
rustfmt --check,cargo clippy -p solidcraft-doc -p solidcraft-engine --all-targets -- -D warnings, andcargo check -p solidcraft-doc -p solidcraft-engine --target wasm32-unknown-unknown: all clean.Screenshots of the behavior (when observable)
None: nothing changes on screen. A view moved apart already showed its letter after the command; the letter now
comes from the same call a preview will use.
Integration status
drawingse069e4e (Drawings: a drawing can hold section views, cut along a line on their parent view (#13046) #13047's section views), checked 16 Nov.lined_upinedit. Whichever of the two lands second usesDrawing::lined_up_with.