Files
Nitro-V3/src/hooks/inventory
simoleo89 8b7bedf534 Pilot: extract useInventoryFurni reducers to a pure module
The four useMessageEvent handlers in useInventoryFurniState (furniture
list add/update, list, removed, plus the dead post-it-placed listener)
were inlined as ~250 LOC of merge logic inside setGroupItems callbacks.
Three things change:

- The three meaningful reducers move to useInventoryFurni.reducers.ts
  as applyFurnitureListAddOrUpdate / applyFurnitureList /
  applyFurnitureListRemoved, plus two helpers clearUnseenFlags and
  refreshGroupItemsLocalization for the existing effect-driven mutations.
  Side effects (CreateLinkEvent, attemptItemPlacement, dispatchAdded)
  are passed in via a ctx object so the reducers stay easy to test.
- The module-level furniMsgFragments buffer becomes a useRef, removing
  a latent bug where two simultaneous client instances would have
  trampled each other's fragments.
- The empty FurniturePostItPlacedEvent handler is dropped (dead code).

useInventoryFurni still owns groupItems via useState so the existing
effect-driven setters (unseen flag reset, localization refresh) keep
working; the message handlers now call setGroupItems(prev =>
applyX(prev, event, ctx)) with the extracted reducers.
2026-05-11 21:11:02 +02:00
..
🆙 Init V3
2026-01-31 09:10:52 +01:00
🆙 Init V3
2026-01-31 09:10:52 +01:00
🆙 Init V3
2026-01-31 09:10:52 +01:00