Repository navigation
Conversation
DaveMDS
force-pushed
the
feat/unified-transforms
branch
from
November 22, 2026 09:43
2fa7abc to
34799a2
Compare
… copies Document::transform_mixed_selection moves, rotates, or scales a selection that also holds construction guides as one undo step: each guide is carried as transform_guide carries one, beside the nodes and sketches. Its neighbours do the same for copies and mirrors: duplicate_mixed_placements and duplicate_mixed_array copy each guide once per placement with the nodes, and flip_mixed and flip_mixed_copy reflect or mirror-copy the guides across the plane the nodes name. The existing entry points delegate to them with no guides, so their behavior and callers are unchanged. Every guide is checked and posed before anything mutates: a stale or deleted guide, or a pose that would break one, refuses the whole batch, nodes included, with the document and its history untouched. TransformSelection records each carried guide's prior geometry; undo writes it back verbatim and redo re-poses that same value, so undo and redo reproduce the commit bit for bit. DuplicatedArray records its guide copies, hidden on undo and shown on redo like the node copies, also inside a linked copy. Copied guides are always independent: linking is a property of component definitions, and a guide has none. A copy of guides alone is recorded as a guide array, and a transform of guides alone names its step for guides. The mirror plane of a flip comes from the nodes and sketches alone, so guides with nothing else listed refuse as an empty selection. Annotations are not listed: one anchored to a moving node already follows it, once. The specs compare each mixed operation with a twin document that reaches the same state through the single-kind operations, with a property over random selections and transforms. The session fuzz harness gains a mixed transform and a mixed copy array, each also salted with a stale guide. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
Scene gains transform_mixed_selection, duplicate_mixed_selection_array, duplicate_mixed_selection_placements and flip_mixed_selection: the existing selection transform, array copy, grid copy and flip, each taking the selection's construction guides beside its nodes, in the same one undo step. The copy methods return the linked-copy JSON with the guide copies beside it, so a caller can select them. Each records under a new additive RecordedCall variant, documented in DIAGNOSTICS.md. The existing methods keep their signatures and their recorded shapes, so every existing recording replays unchanged, and a new recording that uses a mixed method fails to parse on an older build, loudly. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
…y fuzz The mixed transform and copy arms of the session fuzz accepted any refusal that left the document untouched, so a wrong error on a valid selection went unnoticed. They now hold the mixed delete's standard: with every handle live, a refusal must be one the kernel documents for that listing — a lock on a moved node, an open session refusing outside geometry, a linked copy of a node beside the group that holds it, or a transform of nodes that flatten to nothing with no guide listed. Any other refusal fails the case. The mixed picks now take only world nodes, as the mixed delete's do, so a definition member no longer reaches these arms as a handle that is always refused. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
Guides selected with nodes, or several guides at once, move with the selection in one undo step through transform_mixed_selection, and a copy, an ×N / /N array or a grid copies them beside the nodes through the mixed duplicate calls, every copy joining the new selection. Inside a component session the guides take their own world transform in the same history bracket as the members. A Select drag on a selected node carries the selected guides too. A grid of guides alone is refused, as for a single guide: its copies would stack along each guide's own line. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
Guides selected with nodes, or several guides at once, rotate with the selection in one undo step through transform_mixed_selection, and a copy or an ×N / /N array copies them beside the nodes through duplicate_mixed_selection_array, every copy joining the new selection. With guides alone the click sets their pivot. The node and guide ghost is now shared with Move (withGuidePreviews). Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
Guides selected with nodes scale and mirror with them in one undo step, through transform_mixed_selection and flip_mixed_selection, and a mirrored copy copies them beside the nodes' copies, every copy joining the new selection. Object > Flip Along carries them too. The grips and the mirror plane come from the nodes alone, so guides with nothing else selected are refused: there is nothing to scale or flip. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
DaveMDS
force-pushed
the
feat/unified-transforms
branch
from
November 24, 2026 16:49
34799a2 to
d02bc5a
Compare
The user guide says how guides selected with objects, or several guides at once, move, rotate, scale and mirror with the selection, copies and arrays included, and when they are refused: a grid of guides alone, and guides alone in Scale and Flip. The roadmap records the carried guides and the mixed kernel and wasm-api calls behind them, and the architecture notes how a transform or copy records its guides in one undo entry. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
…odes The user guide still described a selection of nodes beside at most one guide or annotation. It now says that a click, every click modifier, a marquee and Select All take guides, dimensions and text as they take objects, that an endless guide line is taken only by a crossing, that Object Info counts a mixed selection per kind, and that Delete removes it all as one undo step named by what it took. The roadmap records the ordered mixed selection and the mixed delete. Signed-off-by: Dave Andreoli <dave@gurumeditation.it>
DaveMDS
marked this pull request as ready for review
November 24, 2026 17:37
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.
Unified selection, part 2: transforms
Second of the three PRs planned in #106. Move, Rotate, Scale, Flip and their
copies and arrays carry the selected construction guides with the nodes, as
one undo step: the kernel and wasm-api half with its specs, then the app.
Kernel
Every addition sits beside an existing entry point, which now delegates to
it with no guides, so no existing signature or caller changes.
Document::transform_mixed_selection(nodes, sketches, guides, t), behindtransform_selection.Document::duplicate_mixed_placements(nodes, guides, placements, policy)and
duplicate_mixed_array(nodes, guides, step, count, policy), behindduplicate_nodes_placementsandduplicate_nodes_array. They return theguide copies beside the node roots, placement-major.
Document::flip_mixedandflip_mixed_copy, behindflip_nodesandflip_copy.What they hold to:
mutates. A stale or deleted guide refuses
UnknownGuide, and a pose thatbreaks a guide refuses
DegenerateGuide. Either refuses the whole batch,nodes included, with the document and its history untouched.
DocAction::TransformSelectiongains
guides: Vec<(GuideId, Guide)>, the prior geometry of each carriedguide, the same posture as
Rescale. Undo writes it back verbatim, andredo re-poses that same value.
DocAction::DuplicatedArraygainsguides: Vec<GuideId>, hidden on undo and shown on redo like the nodecopies, including inside
LinkedCopies. Both are in-memory history only,so there is no
.hewchange.alone is the
transformkind with the new nounguide("Move 2guides"), and the counts take in the guides. A copy of guides alone is
recorded as
DuplicatedGuides, asduplicate_guide_arrayrecords it.LinkPolicy::Linkedlinks the nodesonly.
follows it, once. One anchored elsewhere stays where it is.
with nothing else selected refuse
EmptySelection, and the app will saythere is nothing to flip. Scale will refuse the same way, since it sizes
its grips from the nodes.
DuplicateMember, as a node listed twice does.EmptySelectionrefusal rather thanbecoming a no-op, which is what
transform_selectionhas always answered.wasm-api (additive)
New
Scenemethods, beside the existing ones, which are unchanged and keeptheir recorded shapes:
transform_mixed_selection(kinds, ids, sketches, guides, affine)duplicate_mixed_selection_array(kinds, ids, guides, affine, count, linked)duplicate_mixed_selection_placements(kinds, ids, guides, affines, linked)flip_mixed_selection(kinds, ids, sketch_ids, guides, nx, ny, nz, about_kind, ax, ay, az, copy)The three copy methods return
{"nodes":[...],"linked":[...],"guides":[...]},the existing linked JSON plus the guide copies.
New additive
RecordedCallvariants:TransformMixedSelection,DuplicateMixedSelectionArray,DuplicateMixedSelectionPlacementsandFlipMixedSelection, documented in DIAGNOSTICS.md. Existing recordingsreplay unchanged.
Specs
crates/kernel/tests/mixed_transform_specs.rs. Each mixed operation ischecked against a twin document that reaches the same state through the
existing single-kind operations, and must match it in one undo step that
undo and redo reproduce bit for bit. Also covered: stale, deleted, listed
twice, degenerate and singular refusals; guides alone; linked copies;
flip; an anchored annotation moving once. A property test runs random
selections through moves, rotations, scales and reflections, then an
array copy.
session_fuzz.rsgains a mixed transform and a mixed copy array, eachsalted with a stale guide handle.
App
Which guides a tool carries:
too, or when several guides are selected alone. A single guide selected
alone keeps its existing path (
transform_guide,duplicate_guide_array,the click that takes a guide), unchanged.
and mirror plane come from the nodes alone, so guides with nothing else
selected are refused with "Nothing to scale" or "Nothing to flip", and the
status bar says why.
What each tool does with them:
(
duplicate_mixed_selection_placements) and a retyped distance. A grid ofguides alone is refused, as a grid of one guide already is: its copies
would stack along each guide's own line. A Select drag on a selected node
carries the selected guides too.
guides alone, the click sets their pivot.
flip_mixed_selection, and a linked orindependent mirrored copy that copies the guides beside the nodes. Beside
drawing with no solid, the kernel has nothing to center a flip on, so the
guides take the same flip matrix the drawing takes
(
transform_mixed_selection,duplicate_mixed_selection_array). Object ▸Flip Along carries them too.
Common to all four:
transform chains off the copies.
withGuidePreviews, sharedby the four tools).
before, and the guides take the world transform through
transform_mixed_selectionin the same history bracket: one undo step.A mirrored copy inside a component stays refused, as before.
App tests:
*.guides.test.ts) for each path above,checked by mutation: removing the guides from a commit or an array fails
them.
transformSelection.guides.wasm.test.tsandFlipTool.guides.test.tscheck one undo step that undo and redo reproduceexactly, a stale guide refusing with the document untouched, and the
mirror plane ignoring the guides.
mixed-selection.spec.ts(Move with a retyped distance, a Selectdrag, Rotate, each undone in one step) and
flip.spec.ts(two boards anda guide across the blue plane).
New strings are in the catalogs, with German translations.
Plugin bus
Unchanged.
hew.entity.move,rotate,scaleandflipact on explicitnode ids rather than on the selection. Extending them to guides would be new
bus surface, to discuss separately if it is wanted.
Docs
docs/agents/ROADMAP.mdanddocs/agents/ARCHITECTURE.md§2.9 describethe carried guides.
part 1's mixed selection (click modifiers, marquee, Select All, Object
Info counts, the mixed Delete), which that PR left undocumented.