Skip to content

improvement(mothership): stable thinking indicator and jump-free streaming scroll#5828

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

improvement(mothership): stable thinking indicator and jump-free streaming scroll#5828
TheodoreSpeaks merged 7 commits into
stagingfrom
improve/thinking-blob

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Rework the thinking indicator into a single fixed-height slot on the last turn — shimmer swaps with arriving output via opacity only, so it never shifts the transcript (previously 4 mount/unmount sites caused up/down jumps)
  • Contextual labels derived from the stream (Thinking/Dispatching/Returning); dispatch yields to the agent lane's own shimmer once open
  • Fix auto-scroll jerk: followToBottom spawned a new chase loop per animationstart (up to 20 concurrent writers snapping the scroll) — now folded into createSmoothBottomChase via a deadline-extending kickUntil
  • Prevent transcript drops from transient markdown re-parse shrinks: sizer min-height floored at the scrolled-to extent while streaming

Type of Change

  • Improvement

Testing

Verified with in-browser scroll instrumentation (0 stacked scroll writers, 0 downward transcript moves during streaming, 0px phantom space at settle); vitest 107/107 in the touched tree; lint + strict boundary validation pass

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 1:32am

Request Review

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches live streaming UI, virtualizer sizing, and auto-scroll in the main chat path; behavior is intricate but limited to presentation and scroll, with no auth or data-layer changes.

Overview
Mothership chat streaming UX is reworked so the “waiting” state no longer mounts in several places or shifts layout mid-turn.

The turn-level thinking shimmer lives in a fixed-height slot on the last assistant message only (MessageContent + isLast). It fades in/out with opacity instead of inserting/removing rows; PendingTagIndicator is removed from inline ChatContent and from empty-stream rows in mothership-chat. deriveThinkingLabel replaces shouldShowTrailingThinking, picking Thinking… / Dispatching… / Returning… from the latest content block and hiding the turn shimmer when an open subagent lane owns delegation. ChatContent reports pending special tags separately via onPendingTagChange so mid-stream tags can show the shimmer without treating them as active text painting.

Copy/thumbs move into MessageContent as an actions slot that swaps with the thinking area in one render when the turn settles, instead of appearing below with a separate phase gate.

Scroll stability: createSmoothBottomChase gains kickUntil so use-auto-scroll uses one chase loop (including post-stream settle and coalesced animationstart events) instead of spawning per-animation followToBottom writers. mothership-chat floors the virtualizer sizer minHeight to the current scrolled extent while streaming/reveal animates, reducing transcript drops when markdown re-parse briefly shrinks row height. Chase rate is slightly increased (0.12 → 0.16).

Reviewed by Cursor Bugbot for commit 65c9cf2. 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 makes streaming chat activity and automatic scrolling more stable. The main changes are:

  • Replaces multiple thinking indicators with one fixed activity slot.
  • Adds stream-aware Thinking, Dispatching, and Returning labels.
  • Coalesces animation-driven scrolling into one deadline-based chase loop.
  • Floors the transcript height during streaming to prevent scroll jumps.
  • Swaps the activity slot for message actions when the turn settles.

Confidence Score: 5/5

This looks safe to merge.

  • The executing-tool suppression and scroll restart fixes cover the reported failure paths.
  • No distinct blocking issue remains in the latest changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx Adds the fixed activity slot, contextual activity labels, pending-tag tracking, and settled action swap.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx Separates visible text-reveal activity from pending special-tag activity.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx Makes the activity indicator label configurable.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Integrates the final-turn activity slot and adds a streaming transcript height floor.
apps/sim/hooks/use-auto-scroll.ts Uses the shared chase loop for animation following and post-stream settling.
apps/sim/lib/core/utils/smooth-bottom-chase.ts Adds deadline extension, restart baseline seeding, and deadline cleanup to the scroll chase.

Reviews (8): Last reviewed commit: "improvement(mothership): swap actions in..." | Re-trigger Greptile

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

@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 23e3875. 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/lib/core/utils/smooth-bottom-chase.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 8ac08dd. 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 65c9cf2. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit 2cbecb5 into staging Jul 22, 2026
20 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the improve/thinking-blob branch July 22, 2026 02:11
@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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 65c9cf2. Configure here.

// trailing text keeps visually revealing on a timer after the network stream
// closes, and collapsing under a still-growing reveal reads as the blob
// winking out early while everything shifts.
const thinkingExpanded = phase !== 'settled' && lastSegment?.type !== 'stopped'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stop collapses slot during reveal

Medium Severity

thinkingExpanded forces the reserved slot closed whenever the last segment is stopped, even while phase is still revealing. That contradicts the nearby comment about keeping the slot through post-stream reveal, and with actions gated as already settled it swaps the shimmer slot for the actions row while paced text can still be draining — the layout jump this change set out to avoid.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 65c9cf2. Configure here.

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