Repository navigation
Assembly: Relink Source takes a .json design, as Insert Design does - #10394
Merged
Merged
Conversation
`component.insert_design` links a design saved as a .sc container or as plain
JSON (`.json`), but `component.relink` refused every path that was not a
container ("choose a saved .sc design"), so a component linked to a JSON
design could not be pointed at another one. Relink now takes any design path
Insert Design takes (`is_design_path`: .sc, a legacy extension or .json); the
file is read by the same `design_bodies`, which already reads both. The Relink
Source file dialog opens on a filter that lists .json among the designs, too.
Assisted-by: LLM
bherbruck
enabled auto-merge
November 1, 2026 01:43
bherbruck
added this pull request to the merge queue
Nov 1, 2026
Merged
via the queue into
tangency-labs:main
with commit Nov 1, 2026
5c1aad8
96 of 147 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
component.insert_designlinks a design saved either as a.sccontainer or as plain JSON (.json).component.relink(Relink Source) refused every path that was not a container: "choose a saved .sc design". So a component linked to a JSON design could not be pointed at another JSON design, and one linked to a container could not be pointed at a JSON one.Relink now takes any design path Insert Design takes (
solidcraft_io::is_design_path:.sc, a legacy extension, or.json). The file is read by the samedesign_bodies, which already reads both. The parameter text and the refusal name both kinds.In the app, Relink Source's file dialog opened on a filter of
.scand the legacy extensions, so.jsondesigns didn't show until you switched filters. That filter now lists.jsontoo.Changes a default: no
Validation
Run on Linux x86_64 (Fedora 44, Rust 1.99.1),
--profile ci, on this branch rebased onmainat ed66ada:cargo test --profile ci -p solidcraft-engine --lib cmd::component_link::relink_tests: 17 passed, 0 failed, the newrelink_takes_a_json_design_as_insert_design_doesamong them. It inserts a 10 × 20 × 30 box saved as.sc(6000 mm³), relinks it to a 10 × 20 × 45 box saved as.json(expected 9000 mm³), then back to the container (expected 6000 mm³), and checks thatfile.savereally wrote the.jsonas plain JSON.cargo test --profile ci -p solidcraft-ui-egui --lib linked_source: 18 passed, 0 failed, the newrelink_picks_a_plain_json_design_as_insert_design_doesamong them. It answers Relink Source's file dialog with a.jsondesign and checks that the link follows it. The existing picker tests now expect.jsonamong the extensions the dialog opens on.cargo xtask ci, on this PR's head (8749936, onmainat b99d4dd): fmt, assets, icons, licences, lists, skills, layering, UI containers,clippy --workspace --all-targets -D warnings, the wasm check and the doc tests pass. 81 of the 83 test binaries pass, among themsolidcraft-enginelib (3092 passed, 0 failed) and the UIscenariostest (146 passed). The two that fail have failures unrelated to this change:solidcraft-gpulib: 28 of 165 tests, all path-tracer tests on this machine's AMD Radeon 890M (RADV). Onmainat 653bc00, 28 fail as well.solidcraft-ui-eguilib: 3969 passed and 3 failed, thelinked_sourcetests among those that pass.render_workspace::tests::progressive_image_controls_route_to_the_registered_hostis a path-traced render ("inconsistent glass medium paths") and fails onmaintoo.op_auto::tests::primitives_and_revolves_join_cut_or_stand_apartandviewport::overlays_tests::corner_toast_keeps_its_width_beside_a_docked_dialogfailed only inside the full run; run alone, they pass on this branch and onmain.cargo xtask ciresults first posted here came from a run in another checkout, not of this branch. These are from this branch.Reproduction with
solidcraft-cli run, built frommainat ed66ada and from this branch, on the same two files (scripts below):maincomponent.insert_designsource.sccomponent.relinktosource.jsoncomponent.relink: choose a saved .sc design"previous_pathsource.sc,geometry_changed: trueinspect.measureScripts
make-sc.jsonandmake-json.jsonwrite the two sources;relinked.jsonis the run above.make-json.jsonismake-sc.jsonwith"height": 45andsource.json.{"commands": [ {"command": "solid.box", "params": {"length": 10, "width": 20, "height": 30, "corner": [0, 0, 0]}}, {"command": "file.save", "params": {"path": "source.sc"}} ]}{"commands": [ {"command": "component.insert_design", "params": {"path": "source.sc", "name": "Source"}}, {"command": "inspect.measure", "params": {}}, {"command": "component.relink", "params": {"component": "Source", "path": "source.json"}}, {"command": "inspect.measure", "params": {}} ]}solidcraft-cli run make-sc.json && solidcraft-cli run make-json.json && solidcraft-cli run relinked.json --resultsScreenshots of the behavior (when observable)
Steps: save a 10 × 20 × 30 box as
source.scand a 10 × 20 × 45 box assource.json. In a new design, Insert Designsource.sc, then Relink Source tosource.json.Before the relink: the component shows the 30 mm box from

source.sc.After Relink Source to
source.json: the same component, now the 45 mm box. Onmainthis step is refused with "choose a saved .sc design" and the component stays as it was.Captured from this branch's desktop build (
--profile ci) on Linux x86_64 under Xvfb. Both shots use the same isometric camera. The steps were sent through the control channel (engine.execute), because Relink Source picks its file in the system's file dialog, which Xvfb can't drive.Integration status
Rebased on
mainat b99d4dd (2026-11-01); no conflicts. No open issue or PR covers it (#2772, Relink Source itself, is closed). #5449 (open) moves Relink's reading of the design intoopen_linked, which already takes.json. But it keeps Relink's own.sc-only check in front of that, so the refusal stays. Both changerelink()incomponent_link.rs, a few lines apart.Assisted-by: LLM