@@ -495,7 +495,11 @@ export default function ProofSearchCanvas({
495495 const node = nodes [ i ] ;
496496 const grabbed = grabbedId && String ( node . id ) === String ( grabbedId ) ;
497497 const dragging = grabbed && dragState ?. dragging ;
498- if ( ! dragging ) {
498+ const frozen = ! dragging && node . freezeUntil && ts < node . freezeUntil ;
499+ if ( frozen ) {
500+ node . vx = 0 ;
501+ node . vy = 0 ;
502+ } else if ( ! dragging ) {
499503 const target = targets . get ( String ( node . id ) ) ;
500504 if ( target ) {
501505 // Pull back to the layout position.
@@ -511,7 +515,7 @@ export default function ProofSearchCanvas({
511515 node . vx = 0 ;
512516 node . vy = 0 ;
513517 }
514- if ( ! grabbed ) {
518+ if ( ! grabbed && ! frozen ) {
515519 node . x += node . vx ;
516520 node . y += node . vy ;
517521 }
@@ -534,6 +538,7 @@ export default function ProofSearchCanvas({
534538 if ( grabbedId && String ( grabbedId ) === String ( id ) ) return ;
535539 const node = nodeMap . get ( String ( id ) ) ;
536540 if ( ! node ) return ;
541+ if ( node . freezeUntil && ts < node . freezeUntil ) return ;
537542 if ( node . x < x ) {
538543 node . x = x ;
539544 node . vx = 0 ;
@@ -903,6 +908,13 @@ export default function ProofSearchCanvas({
903908 const node = nodesRef . current . get ( state . id ) ;
904909 if ( node ) {
905910 }
911+ } else if ( state && state . type === 'node' ) {
912+ const node = nodesRef . current . get ( state . id ) ;
913+ if ( node ) {
914+ node . freezeUntil = performance . now ( ) + 320 ;
915+ node . vx = 0 ;
916+ node . vy = 0 ;
917+ }
906918 }
907919 dragRef . current = null ;
908920 canvas . style . cursor = 'grab' ;
@@ -1069,10 +1081,15 @@ export default function ProofSearchCanvas({
10691081 if ( state && state . type === 'node' && ! state . dragging ) {
10701082 const now = performance . now ( ) ;
10711083 const tapDuration = state . startTime ? now - state . startTime : 0 ;
1084+ const node = nodesRef . current . get ( state . id ) ;
1085+ if ( node ) {
1086+ node . freezeUntil = now + 320 ;
1087+ node . vx = 0 ;
1088+ node . vy = 0 ;
1089+ }
10721090 if ( tapDuration < 250 ) {
10731091 const last = tapRef . current ;
10741092 if ( last . id === state . id && now - last . time < 320 ) {
1075- const node = nodesRef . current . get ( state . id ) ;
10761093 if ( node && node . status === 'passive' && onSelect ) {
10771094 onSelect ( node . id ) ;
10781095 }
0 commit comments