Skip to content

Links: update linked designs that changed while the assembly's tab was away (#7601) - #7622

Closed
chrishamm wants to merge 5 commits into
tangency-labs:mainfrom
chrishamm:update-changed-links
Closed

chrishamm wants to merge 5 commits into
tangency-labs:mainfrom
chrishamm:update-changed-links

Conversation

@chrishamm

@chrishamm chrishamm commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Change

A part linked into an assembly can only be edited in its own design, so after saving it in another tab the assembly kept showing the old bodies until Update Links was run by hand.

Each design now keeps, for every linked design file, the modification time and size it last read: when Update Links reads the link without an error, or when the design first shows the link. When the tab comes back, the links whose files differ from that are read again the way Update Links does it, on the worker thread with its progress overlay, one link per run (file_load's Update Links request now passes its options on). A file that can't be read holds up no other and is tried again the next time. That covers a part saved in another tab, in another SolidCraft window or by a git checkout, also while the assembly was the tab in front. The assembly is marked as changed afterwards, since it keeps its own copy of the linked bodies.

Closing several tabs together or quitting reads nothing on the way, and a tab shown to answer "save changes?" reads nothing before its save. The check runs component.links and one file stat per link on the window thread when a tab comes back, so an allowed network share that is slow shows there; a network location that isn't allowed is never looked at. The web build keeps no modification times, so nothing changes there. The assembly guide says so.

Closes #7601

Changes a default: yes - an assembly updates its changed linked designs when its tab comes back (Preferences, Design, "Update changed linked designs when a tab comes back"), old behaviour kept behind preference update_changed_links

Validation

On Linux: nine tests in linked_source cover a save in the part's tab and outside the app, the preference turned off, a link that can't be read next to one that can, a change made while the assembly is shown, a design opened in place of the blank one, a missing file that comes back, Close All with and without Cancel, the save-changes prompt, and reads dropped for a design no longer shown. cargo xtask ci passes fmt, clippy, lists, layers and the engine, doc, kernel, scenario and action-matrix tests, and every ui-egui test apart from progressive_image_controls_route_to_the_registered_host ("inconsistent glass medium paths"), which also fails on an unchanged main; the gpu path tracer tests fail on this machine's Radeon iGPU, in a crate this doesn't touch. The wasm check couldn't run here for lack of the target; the previous version passed cargo xtask wasm on another machine. Not run on Windows or macOS.

Screenshots of the behavior (when observable)

A base plate with a post and a knob, each a linked design, held by two rigid joints. The knob gets a pin in its own tab and is saved; switching back updates the assembly and keeps both joints. Last, the new setting under Preferences, Design.

1-assembly-before 2-knob-edited-and-saved 3-assembly-updated 4-preference-new

Integration status

Based on 4afd933. #5674 (Update Links skips unchanged files) would make these updates cheaper and doesn't conflict. #5449 also works on links in component_link.rs, which this doesn't touch.

chrishamm and others added 2 commits October 27, 2026 10:11
…s away

A design coming back to its tab compares the modification time and size of its linked
design files with what they were when it went to the background, and runs Update Links
on the worker thread for those that changed: saved in another tab, another window or by
a checkout. Preference update_changed_links (Design, Linked designs) turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…turns

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:infra CI, tooling, repo, docs area:ui desktop/web front end, dialogs, viewport labels Oct 27, 2026
chrishamm and others added 3 commits October 27, 2026 12:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s tried again

A design's linked files are now recorded as the design last read them: when Update Links reads a
link without an error, or when the link is first seen. Coming back to the tab reads again what
differs, one link per run, so a file that cannot be read holds up no other and is tried again
the next time, and a part changed while the assembly was shown is taken up on its next return.
Closing several tabs together reads nothing on the way, and the web build, which keeps no file
times, looks at nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gns and missing files

A tab shown to answer "save changes?" reads no link before its save, and Cancel there or on a
batch lets the tab left in front read what it skipped. A design opened in place of the blank one
records its links at once, a link whose file is missing is recorded as missing so it is read when
the file comes back, and a read queued for a design that is no longer shown by the time it starts
is dropped. More changed links than can wait at once are read on the next return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chrishamm

Copy link
Copy Markdown
Contributor Author

#7819 took these commits into main with its squash merge (aae2c5e), so there is nothing left to merge here. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:infra CI, tooling, repo, docs area:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update linked designs in an assembly when their files change

1 participant