Files
Tanish Manku c6217eb88e PageScene: ColorAction signals panel refresh on apply/revert
When the user undoes a color change while the Object Panel is open,
the THREE.js material reverts correctly but the panel's local React
`color` state stays at the redo value — the panel preview Button and
the color input value disagree with the actual scene material.

Root cause: the per-frame `getSelectedSum` check in renderSingleFrame
pushes a fresh `objectPanel` slice to Zustand whenever transforms
change, which re-fires the panel's useEffect and re-reads
userData.color. Color changes don't move the sum, so the push never
happens after a color undo/redo.

Fix: ColorAction.apply/revert now calls
`editor.selection.updateSelectedUI()` after the engine setColor.
That pushes a new currentSceneObject reference into Zustand, the
panel's [currentSceneObject] effect fires, and
`setColor(editorEngine?.selected?.userData.color)` reads the freshly
reverted value. Same pattern the lock/transform paths already use
for UI sync.
2026-05-01 05:03:06 -07:00
..
2026-03-12 21:35:29 +07:00