Repository navigation
Drawing views: a view's place parameter is the saved place itself, so the commands stop converting it (#4816) - #17620
Conversation
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| Existing Defaults Unchanged | The PR (tangency-labs/solidcraft #17620, author CamWight) changes no UX default. I read the committed diff at HEAD (ecfcc0a, the PR commit). It touches three files: crates/engine/src/cmd/drawing_vi… |
Full details: Existing Defaults Unchanged
-
Explanation
The PR (tangency-labs/solidcraft
#17620, author CamWight) changes no UX default. I read the committed diff at HEAD (ecfcc0a, the PR commit). It touches three files: crates/engine/src/cmd/drawing_view.rs, crates/engine/src/schema/drawing_view.rs and crates/engine/src/schema/drawing_view_tests.rs. - The command-side change replaces five hand-written conversions between PlaceParam and ViewPlace with direct use of the saved place. Each fallback when no place is given is kept:staged_placeinprojected, andViewPlace::At(parent centre)inauxiliary. Ininspectandmove_view, the reply's place is the record's place wrapped in PlaceParam. - The schema change rewrites PlaceParam's JSON Schema by hand. The PR says the published text is byte-for-byte the same. The diff shows no change to any default value, setting, preference, shortcut, or layout. Changes under the kernel or geometry (solidcore/) are not UX defaults under this check. The description'sChanges a default: noagrees with the code diff. No fail condition applies.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
…, as its sibling parameters do (tangency-labs#4816) `PlaceParam` was a copy of the record's `ViewPlace`, with a conversion at each of five commands. It is now a transparent wrapper over `ViewPlace`, like `SideParam` and `StyleParam`, there for its schema. The conversions go. The schema is written by hand with the text the derive gave, so every contract publishes the same bytes. A test checks that what the record writes fits exactly one branch of that schema, and that what the reader refuses fits none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2aa55e7 to
ecfcc0a
Compare
|
Rebased onto
|
Change
This is an internal cleanup in SolidCraft's drawing commands. It changes nothing a user sees.
A drawing view's place is either a point on the sheet or a position along the line it shares with its parent view. The saved drawing calls this
ViewPlace. The commands that move, edit, inspect and project views had their own copy of it,PlaceParam, with the same two variants. So five commands converted between the two by hand:drawing.view.projected,drawing.view.auxiliary,drawing.view.edit,drawing.view.moveanddrawing.view.inspect.Now
PlaceParamwrapsViewPlace, as the file's other parameter types (SideParam,StyleParam) wrap theirs. It is only there for its schema.The published schema is written by hand with exactly the text the derive gave. So every command contract stays byte for byte the same.
This is the first follow-up to #16492 (moving a view on its sheet) for #4816.
Changes a default: no
Validation
On
drawingsab2b556, in--profile ci:cargo test -p solidcraft-engine --lib: 11 passed. These are the new testa_place_reads_and_writes_as_the_record_and_its_schema_says_so, the view command tests that read or write a place,schema::coverage_tests,registry_is_consistentandhostile_params_never_panic.Byte-for-byte proof (run once, not committed): the old
PlaceParamand the new one publish the same schema, and write the same reply JSON for each kind of place. 3 of 3 passed.4 planted faults, each caught by its named test:
The clean run after them: 4 passed.
rustfmt --check,cargo clippy -p solidcraft-engine --all-targets -- -D warnings, andcargo check -p solidcraft-engine --target wasm32-unknown-unknown: all clean.Not covered: the shared test helper
conformsdoesn't check insideoneOf. So no existing reply check looks inside a place, and the new test checks each branch itself. TeachingconformsaboutoneOfis its own change, because it may start failing other areas' reply checks.Screenshots of the behavior (when observable)
None: nothing changes on screen, and the command contracts are byte for byte the same.
Integration status
drawingsab2b556, checked 15 Nov.ViewPlacedirectly and never namePlaceParam's variants, so there are no conflicts beyond text.