2.7 KiB
Native link mutations
Implemented paths
Std_LinkMakeRelative: group selected subpaths with FreeCAD'sData::noElementNameandfindElementName, create nativeApp::Linkobjects withsetLink, retain subelement lists, set LinkTransform and source labels, and select the created links.Std_LinkReplace: read native parent candidates, require the intended parent, create a native link with the source label/placement, and replace the parent's reference.Std_LinkUnlink: resolve the immediate linked object and place that object in the chosen parent's reference. This does not delete the original link object merely to hide it.- Replacement uses the base
ViewProviderDocumentObject::replaceObjectproperty-copy path:PropertyLinkBase::CopyOnLinkReplacefollowed byPaste, including affected references in all documents loaded in the same runtime. No JavaScript approximation of links or geometry was added. GUI-specific custom provider hooks are not invoked by this base path. - All changed documents participate in a shared native transaction. Failures abort that transaction.
DocumentObjectThandles guard objects/properties that may disappear during native link changes. - The dedicated task reads parents before mutation. All three operations are also available through Link Actions. The existing facade validates results and refreshes native display data for changed documents.
Source basis: src/Gui/CommandLink.cpp, src/Gui/ViewProviderDocumentObject.cpp, src/App/Link.h, PropertyLinks.h, ElementNamingUtils.h, and DocumentObserver.h. The UI uses the existing PartBox owner; cross-document work remains within that runtime, not raw pointers between WASM modules.
Build and progress
PartBox and DocumentProbe were incrementally compiled/linked, including the final object-handle correction. Final frontend build: 3.69 seconds. No automated business/browser/regression tests were run.
The final three-command receipt is link-mutations-pipeline-20260915.json, status implementation_ready. Its last handoff took 10.148 seconds: module registry 0.109 s, capability registry 8.657 s, link preflight 0.042 s, cached native build handoff 0.202 s, asset sync 0.054 s, completion bookkeeping 1.084 s. The native cache hit applies to the final UI/menu adjustment, not to the preceding native compilation work.
Separately, scheduler cycle 8945 recorded progress for five window/toolbar/status-bar commands. Snapshot after both changes: 1424/1452 routes and 28 pending (4 BIM, 24 Web). These counts are implementation registration, not acceptance or proof of whole-project completion. Link navigation commands remain pending; their names alone must not be treated as implementations.