Skip to content

Commit fb10473

Browse files
fix(mothership): park the chase only on real upward top moves, not growth
1 parent f7a94da commit fb10473

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

apps/sim/lib/core/utils/smooth-bottom-chase.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ export function createSmoothBottomChase(
8080
}
8181
const top = target.getTop()
8282
const bottomTop = target.getBottomTop()
83-
if (
84-
lastTop !== null &&
85-
lastBottomTop !== null &&
86-
lastTop - top > lastBottomTop - bottomTop + 1
87-
) {
83+
// A user scroll is an ACTUAL upward top move (first clause — growth alone
84+
// must not trip this) that exceeds any upward move of the bottom itself
85+
// (second clause — a shrink clamp moves both together).
86+
const topDrop = lastTop === null ? 0 : lastTop - top
87+
const bottomDrop = lastBottomTop === null ? 0 : lastBottomTop - bottomTop
88+
if (topDrop > 1 && topDrop > bottomDrop + 1) {
8889
park()
8990
return
9091
}

0 commit comments

Comments
 (0)