Skip to content

fix(mothership): stop-button transitions freeze in place#5838

Merged
TheodoreSpeaks merged 12 commits into
stagingfrom
improve/thinking-blob
Jul 22, 2026
Merged

fix(mothership): stop-button transitions freeze in place#5838
TheodoreSpeaks merged 12 commits into
stagingfrom
improve/thinking-blob

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Hitting stop no longer settle-scrolls: a user stop suppresses the post-stream chase (shouldFollowSettle), so the transcript freezes where it is
  • "Stopped by user" now swaps into the thinking shimmer's slot in the same render — stopping mid-"Thinking…" reads as an in-place replacement instead of a collapse/mount shuffle
  • Fixed a 1px/frame upward creep when the sizer floor is load-bearing (fractional min-height rounded scrollHeight above the scrolled-to extent; now Math.floored)

Type of Change

  • Bug fix

Testing

Tested manually on a local dev server (stop mid-thinking, credential-request reply); vitest 110/110 in the touched tree; lint + strict boundary validation + typecheck clean

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 22, 2026 7:24pm

Request Review

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches intricate pinned-scroll, virtualizer sizing, and end-of-turn layout in the primary workspace chat; regressions would show as scroll jumps or stuck follow, but no auth or data-path changes.

Overview
Improves stop and end-of-turn behavior in mothership chat so the transcript does not jump or creep when generation ends or the user hits stop.

Message tail layout: "Stopped by user" and message actions now render in the same fixed-height tail region as the thinking shimmer (TAIL_REGION_CLASSES), so mid-stop replaces the shimmer in place instead of collapsing and remounting elsewhere. When a stopped block follows trailing text, reveal/scroll hooks stay on the text segment until the reveal finishes, not on the stopped marker.

Scroll / auto-follow: Chat scroll containers disable overflow anchor. Auto-scroll follows sizer ResizeObserver growth (replacing subtree mutation + CSS animation follow), extends post-teardown idle chase (~800ms) for late-mounted stop UI, and cancels overlapping settle when a new stream starts. The virtualizer sizer min-height floor uses Math.floor, a 1px dead-band, and an eased drain at SMOOTH_CHASE_RATE instead of clearing all phantom height at once. createSmoothBottomChase compares scroll-top vs content-bottom moves so floor drains are not mistaken for user scroll-up.

Reviewed by Cursor Bugbot for commit 243cd37. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes transcript movement around user-stopped chat turns. The main changes are:

  • Replaces the thinking shimmer with the stopped marker in place.
  • Keeps reveal tracking active for text immediately before a stopped marker.
  • Adds a short, cancellable settle chase after streaming ends.
  • Drains the virtualized sizer floor gradually and limits fractional-pixel feedback.
  • Disables native scroll anchoring in both chat layouts.

Confidence Score: 5/5

This looks safe to merge.

  • The latest changes preserve reveal tracking through stopped turns.
  • Settle listeners and animation handles are cleaned up on resend and unmount.
  • The floor drain handles visible debt without restoring the earlier abrupt clamp.
  • No blocking issue was found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx Moves the stopped marker into the tail region and keeps reveal callbacks attached to trailing text.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Adds scroll-anchor control and a guarded, debt-aware sizer-floor drain.
apps/sim/hooks/use-auto-scroll.ts Uses sizer resize observation and retains cleanup for the post-stream settle window.
apps/sim/lib/core/utils/smooth-bottom-chase.ts Separates user upward scrolling from movement caused by content shrink.

Reviews (11): Last reviewed commit: "fix(mothership): debt-aware drain fast-p..." | Re-trigger Greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e7ea9db. Configure here.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c9d7e7c. Configure here.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/hooks/use-auto-scroll.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/lib/core/utils/smooth-bottom-chase.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit fb10473. Configure here.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/hooks/use-auto-scroll.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/hooks/use-auto-scroll.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 243cd37. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit d7d42fa into staging Jul 22, 2026
20 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the improve/thinking-blob branch July 22, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant