Skip to content

Commit 8ac08dd

Browse files
fix(mothership): hold sizer floor through reveal and reset chase deadline on park
1 parent 7c37401 commit 8ac08dd

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,17 @@ export function MothershipChat({
304304
* estimate correction (a fresh row measuring smaller than
305305
* ROW_HEIGHT_ESTIMATE) releases immediately instead of holding phantom space
306306
* the chase would scroll into and bounce back out of.
307+
*
308+
* Active on the same signal as auto-scroll: the reveal keeps re-parsing
309+
* markdown (and shrinking) after the network stream closes, so the floor
310+
* must hold through `lastRowAnimating` too.
307311
*/
312+
const floorActive = isStreamActive || lastRowAnimating
308313
useLayoutEffect(() => {
309314
const sizer = sizerRef.current
310315
const el = scrollElementRef.current
311316
if (!sizer || !el) return
312-
if (!isStreamActive) {
317+
if (!floorActive) {
313318
sizer.style.minHeight = ''
314319
return
315320
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export function createSmoothBottomChase(
6161
if (raf !== null) cancelAnimationFrame(raf)
6262
raf = null
6363
lastTop = null
64+
// A stale deadline must not leak into a later plain kick() — kick alone
65+
// parks at rest, only a live kickUntil window idles through it.
66+
deadline = 0
6467
}
6568

6669
const step = () => {

0 commit comments

Comments
 (0)