Prepare a PERSISTED layout node tree for loading into golden-layout.
Two jobs, both load-bearing:
NORMALIZE GL-serialized fields: size + sizeUnit combine into GL's
single-string form ("50%"), invalid width/height are dropped, and GL
internals (minSizeUnit) are stripped.
ISOLATE the persisted config from GL's runtime: every node is a fresh
object and componentState is DEEP-CLONED. Golden Layout mutates
container state at runtime (UpdateTabStyle Object.assigns into it) —
handing it shared references would let those mutations reach back into
the persisted workspace configuration object. The mobile flatten path
already clones; this closes the same hole for DESKTOP restores (main
layout AND records region), making "GL never holds persisted refs" a
structural invariant rather than a per-path convention.
Prepare a PERSISTED layout node tree for loading into golden-layout.
Two jobs, both load-bearing:
NORMALIZE GL-serialized fields:
size+sizeUnitcombine into GL's single-string form ("50%"), invalid width/height are dropped, and GL internals (minSizeUnit) are stripped.ISOLATE the persisted config from GL's runtime: every node is a fresh object and
componentStateis DEEP-CLONED. Golden Layout mutates container state at runtime (UpdateTabStyle Object.assigns into it) — handing it shared references would let those mutations reach back into the persisted workspace configuration object. The mobile flatten path already clones; this closes the same hole for DESKTOP restores (main layout AND records region), making "GL never holds persisted refs" a structural invariant rather than a per-path convention.