Files
FreeCADWasmDev/docs/current/open-document-20260915.md
wangdequan 9a7c4f0335 Save FreeCAD Web workspace sources and user validation evidence
IFC native binding remains incomplete; preserve accurate test results.
2026-09-15 22:01:58 +08:00

2.7 KiB

Native file-open workflow

Implemented

Std_Open now connects the browser file picker, OPFS original-file cache, and existing PartBox/DocumentProbe native document owners. It supports multiple files, cancelling the picker, reopening cached originals, choosing a registered import handler, per-file errors and activating/rendering the opened document.

FCStd uses App.openDocument. Other formats use the selected runtime's actual App.getImportType registration and module open function. BREP/IGES registrations are reused from Mod/Part/Init.py. STEP-with-colors is not silently replaced by a geometry-only Part import when its Import handler is missing. Handlers unavailable in the selected runtime remain explicit errors; this does not claim every independently built module is loaded into one document owner.

Files are cached under a content hash plus filename in OPFS and native memory filesystem. This avoids overwriting an already-open, unsaved same-name document. Identical already-open native FCStd documents are activated rather than restored over current edits. On an individual open failure, only documents newly created during that attempt are closed. Original bytes remain available for retry. Native PartialRestore/RestoreError flags are displayed, not masked as a clean restore.

No fixture geometry, alternative parser or new WASM module was added. The existing native scene path supplies display data; a failed scene refresh does not repeat the file open.

Preventing repeated source reads

The latest scheduler log still used a task-packet path with a C++ line number. Packet summaries now include explicit sourceReadCommand values and state that packet line offsets do not read source. This preserves the existing file/window budgets while directing the next operation to the actual native file.

Build receipt and scope

PartBox and DocumentProbe were incrementally compiled/linked. Embedded Python syntax compiled. Final frontend build succeeded in 5.46 seconds. No automated business/browser/regression tests were run.

open-document-pipeline-20260915.json records implementation_ready. Final handoff: 10.383 seconds, comprising module registry 0.107 s, capability registry 8.895 s, link preflight 0.042 s, cached native build handoff 0.201 s, asset sync 0.052 s and completion bookkeeping 1.086 s. The cache hit is for the final TypeScript buffer annotation; native compilation preceded it.

The original-file cache is separate from the existing saved-FCStd store. Unsupported import providers and document types in other WASM owners are not declared implemented by this command. Snapshot: 1432/1452 registered routes, 20 pending, not whole-project acceptance or completion.