fix(refboard): full sync audit — batch multi-drag, persist resize, sync lock

- Batch broadcastTransform: sends all selected items in one emit instead
  of throttle-dropping all but the first (multi-select drag now syncs all)
- TransformBox onDragEnd: persist+sync final state after resize/rotate
  (was only broadcasting ephemeral transforms, never the final position)
- Layer lock toggle: add missing onCanvasChange() call for sync+save
- Receiver handles both batched and legacy single-item transform formats
This commit is contained in:
Hiren Kangad
2026-03-10 04:16:14 +05:30
parent f0f124d1d2
commit cebe4a3eb9
5 changed files with 64 additions and 29 deletions
+8 -1
View File
@@ -126,13 +126,20 @@ export function useCanvasSetup(deps: CanvasSetupDeps) {
},
});
// Wire live drag/resize transforms to sync broadcast
// Wire live drag/resize transforms to sync broadcast (batched for multi-select)
selection.onItemsTransform = (items) => {
syncRef.current?.broadcastTransform(items);
};
selection.onItemTransform = (item) => {
syncRef.current?.broadcastTransform(item);
};
selection.transformBox.onItemTransform = (item) => {
syncRef.current?.broadcastTransform(item);
};
selection.transformBox.onDragEnd = () => {
syncRef.current?.broadcastSceneNow();
onCanvasChange();
};
socket.on('user:joined', (data: any) => {
const uid = data.userId || data.id;