@@ -691,8 +691,11 @@ const WorkflowContent = React.memo(() => {
691691 return
692692 }
693693
694- // Set pending selection before adding blocks - sync effect will apply it
695- pendingSelectionRef . current = new Set ( pastedBlocksArray . map ( ( b ) => b . id ) )
694+ // Set pending selection before adding blocks - sync effect will apply it (accumulates for rapid pastes)
695+ pendingSelectionRef . current = new Set ( [
696+ ...( pendingSelectionRef . current ?? [ ] ) ,
697+ ...pastedBlocksArray . map ( ( b ) => b . id ) ,
698+ ] )
696699
697700 collaborativeBatchAddBlocks (
698701 pastedBlocksArray ,
@@ -737,8 +740,11 @@ const WorkflowContent = React.memo(() => {
737740 return
738741 }
739742
740- // Set pending selection before adding blocks - sync effect will apply it
741- pendingSelectionRef . current = new Set ( pastedBlocksArray . map ( ( b ) => b . id ) )
743+ // Set pending selection before adding blocks - sync effect will apply it (accumulates for rapid pastes)
744+ pendingSelectionRef . current = new Set ( [
745+ ...( pendingSelectionRef . current ?? [ ] ) ,
746+ ...pastedBlocksArray . map ( ( b ) => b . id ) ,
747+ ] )
742748
743749 collaborativeBatchAddBlocks (
744750 pastedBlocksArray ,
@@ -880,8 +886,11 @@ const WorkflowContent = React.memo(() => {
880886 return
881887 }
882888
883- // Set pending selection before adding blocks - sync effect will apply it
884- pendingSelectionRef . current = new Set ( pastedBlocks . map ( ( b ) => b . id ) )
889+ // Set pending selection before adding blocks - sync effect will apply it (accumulates for rapid pastes)
890+ pendingSelectionRef . current = new Set ( [
891+ ...( pendingSelectionRef . current ?? [ ] ) ,
892+ ...pastedBlocks . map ( ( b ) => b . id ) ,
893+ ] )
885894
886895 collaborativeBatchAddBlocks (
887896 pastedBlocks ,
0 commit comments