mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
8182e06be4
Five more useStates leave WiredCreatorToolsView: selectedFurni, selectedFurniLiveState, selectedUser, selectedUserLiveState, and the monotonic selectedUserActionVersion counter. All five now live in useWiredCreatorToolsUiStore; the room-event listeners (useObjectSelectedEvent, the per-kind useMessageEvent + useNitroEvent handlers, the per-action effects that bump the version counter) stay in the component because they need React's subscription lifecycle — they just call the store actions instead of setState. Same persistence benefit as the previous monitorSnapshot pass: the currently-inspected target survives a panel close/reopen instead of being dropped to null on remount. Live-state setters and the action version counter accept Updater<T> so the many `previousValue => ...` call sites stayed verbatim. Tests: six new cases (setSelectedFurni + null clear, functional updater on FurniLiveState, paired setSelectedUser + LiveState, monotonic ActionVersion via updater, close/reopen persistence). The test fixtures use the real interface shapes — InspectionFurniSelection includes a renderer-typed `info: AvatarInfoFurni` that is cast through `as never` so the test doesn't have to construct the full avatar info shape. 187/187 passing.