Files
FreeCADWasmDev/docs/current/web-print-preview-checkpoint.md

67 lines
3.8 KiB
Markdown

# Web CommandDoc checkpoint: 2026-09-16
Requested batch: `25fec62bbe201d403f9f3916`.
Selected commands: Std_Alignment, Std_PrintPdf, Std_PrintPreview, Std_ProjectInfo.
## Completed in this turn
Std_PrintPreview now uses the existing Std_Print native view capture workflow.
The browser adapter preserves the requested command and capability identity;
the mounted CommandDoc task exposes Preview, Print and Cancel, and the shell
mounts the existing native document view renderer for this command. Application
result validation requires an actual capture for preview/print results.
Changed implementation files:
- web/src/web-print-adapter.ts
- web/src/web-desktop-adapter.ts
- web/src/web-commanddoc-contract.ts
- web/src/web-commanddoc-task.tsx
- web/src/workbench-shell.tsx
The existing executable print case in tools/web-business-cases.mjs now also runs
through the actual Std_PrintPreview command. Added assertions verify capability
identity and that preview does not invoke the browser print dialog. Existing
assertions exercise native OCCT volume/validity, rendered bitmap pixels, native
visibility, actual browser beforeprint handoff, mounted cancellation, invalid
requests, preservation of two documents and undo/redo counts, and mobile layout.
## Verification
- `npm run build`: passed, including geometry-boundary prebuild and TypeScript.
Existing WASM reused. Asset synchronization took 108.721 seconds; Vite reported
110 seconds total. No native rebuild was needed.
- An initial standalone geometry check invoked from the login-shell root failed
because that root package has no such script. The actual web prebuild then ran
`check:geometry-boundary` successfully with no findings.
- `node --check tools/web-business-cases.mjs`: passed.
- `python3 tools/run_business_acceptance.py --module Web --ids Web:desktop:Std_PrintPreview --reuse`:
passed, executedCount=1, reused=false, 13 assertions, totalSeconds=6.964.
- Evidence: docs/current/business-evidence/36fa1e2ada84ec69b399f1c0-20260916T132259471432.json
- Visually inspected desktop screenshot: docs/current/print-business-1789564976669-desktop.png
- Visually inspected mobile screenshot: docs/current/print-business-1789564978843-mobile.png
- Desktop bitmap: 504 colors, 1425x420, fully opaque; hidden objects: 1 color.
Mobile bitmap: 476 colors, 390x420, fully opaque, preview width 390 at viewport 390.
The runner produced the passing evidence. Acceptance machinery, acceptance
contract, proof requirements and IFC semantic export contract were not edited.
No covers tags were added. No deployment, push, message to others, full parity
gate or API gate was run. Build and focused acceptance processes completed.
## Remaining boundaries and next action
Std_Alignment, Std_PrintPdf and Std_ProjectInfo remain incomplete for this batch;
this turn makes no acceptance claim for them. Prior Std_Print evidence is retained.
Browser dialog acceptance versus cancellation is unobservable; explicit task
cancel is tested. Preview proof covers the native PartBox 3D view, not other view
types or the DocumentProbe owner. PDF export requires actual downloadable PDF
content and its own assertions; browser print handoff does not certify it.
Continue with the missing selected behavior using the packet source reader.
Desktop source anchors are CommandDoc.cpp:1841 (Alignment), :1034 (PrintPdf),
and :909 (ProjectInfo). The :990-1089 window already inspected this turn shows
PrintPreview invoking activeWindow()->printPreview() and PrintPdf separately
invoking activeWindow()->printPdf(), with active-view message availability.
Reuse the completed capture path for PDF presentation where appropriate, while
preserving actual PDF export semantics. Reuse supplied OCCT/WASM and completed
workflows; do not replay unchanged passing cases or change acceptance requirements.