Files
FreeCADWasmDev/docs/current/std-randomcolor-implementation-boundary.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.1 KiB

Std_RandomColor implementation boundary

Batch: dc77142108d99da9fcd15d92 Record: Web:desktop:Std_RandomColor

Implementation remains incomplete. No runtime behavior or registration was changed.

Confirmed desktop semantics

Source: freecad-source/src/Gui/CommandFeat.cpp:84.

  • Activation requires a nonempty selection.
  • Each processed view gets a random entry from the native CET R1 palette.
  • Link view providers enable OverrideMaterial and update ShapeMaterial diffuse color.
  • Other view providers update ShapeAppearance when it is a material or material list.
  • Selected parts and document object groups also process their immediate group children.
  • The complete selection is processed inside the Set Random Color command transaction.

Remaining integration work

The four permitted supplemental source windows were consumed by the packet metadata, the desktop implementation, and WebViewCommands.h lines 1-200. Those header windows show the document command entry point and earlier handlers, but do not establish the existing color/state implementation. This is a source access boundary, not evidence that the business implementation is absent.

Supply exact bounded anchors for the existing random-color handler or persisted view-material helpers in WebViewCommands.h and NativeDocumentView.h, the selected command's adapter mapping and worker envelope, and the actual catalog entries and generator registration logic. Connect the real material mutation and its renderer state through those existing owners before registering the capability. Preserve palette selection, link overrides, group traversal, selection semantics, and undo. Do not replace these with fixed colors, success markers, or a GUI-only fallback.

The mounted shell already supplies document selection to the desktop dispatcher in the provided workbench-shell.tsx excerpt at line 585. The selected command's remaining transport path still needs its exact source anchors.

No tests, builds, browser validation, benchmarks, historical reconciliation, or route receipts were run. Incremental build, synchronization, and route receipts remain with the outer pipeline.