forked from 1b-agent/opencadstudio-upstream
Turning a 141k-entity layer off/on took 1.5-5 s; it now takes ~0.6-0.9 s. - Off/freeze toggles go through invalidate_layer_visibility: entities on the layer keep their tessellation memo (visibility gates them before tessellation); only block users re-expand. No mesh recolor. - The resident patch reuses a surviving memo entry instead of re-tessellating, guarded by the same display-context hash as the full build. - The patch looked up `layout.order` linearly per re-shown entity, which made turning a big layer back on quadratic. - recolor_meshes_for_handles resolved materials for handles with no mesh. - Wire arena: a hidden slab keeps its instances and sets a `hidden` flag in its consts (collapsed in the vertex shader); an unchanged re-show only clears the flag. Const writes are batched into merged spans. - The `layer_visible` automation action indexed the document's layer table instead of the sortable panel rows the Layer* messages use. Co-Authored-By: Claude Opus 5.5 <[email protected]>