Skip to content

Commit f97021f

Browse files
waleedlatif1claude
andcommitted
fix(workflow): persist keyboard movements to backend
Keyboard arrow key movements now call collaborativeBatchUpdatePositions to sync position changes to the backend for persistence and real-time collaboration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7c0952d commit f97021f

File tree

1 file changed

+8
-2
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]

1 file changed

+8
-2
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,8 @@ const WorkflowContent = React.memo(() => {
23642364
}
23652365

23662366
// Handle position changes (e.g., from keyboard arrow key movement)
2367-
// Update container dimensions when child nodes are moved
2367+
// Update container dimensions when child nodes are moved and persist to backend
2368+
const keyboardPositionUpdates: Array<{ id: string; position: { x: number; y: number } }> = []
23682369
for (const change of changes) {
23692370
if (
23702371
change.type === 'position' &&
@@ -2373,10 +2374,15 @@ const WorkflowContent = React.memo(() => {
23732374
change.position
23742375
) {
23752376
updateContainerDimensionsDuringMove(change.id, change.position)
2377+
keyboardPositionUpdates.push({ id: change.id, position: change.position })
23762378
}
23772379
}
2380+
// Persist keyboard movements to backend for collaboration sync
2381+
if (keyboardPositionUpdates.length > 0) {
2382+
collaborativeBatchUpdatePositions(keyboardPositionUpdates)
2383+
}
23782384
},
2379-
[blocks, updateContainerDimensionsDuringMove]
2385+
[blocks, updateContainerDimensionsDuringMove, collaborativeBatchUpdatePositions]
23802386
)
23812387

23822388
/**

0 commit comments

Comments
 (0)