improvement(ui): delegate streaming animation to Streamdown component#4163
improvement(ui): delegate streaming animation to Streamdown component#4163emir-karabeg merged 5 commits intostagingfrom
Conversation
Remove custom useStreamingText hook and useThrottledValue indirection in favor of Streamdown's built-in streaming props. This eliminates the manual character-by-character reveal logic (setInterval, easing, chase factor) and lets the library handle animation natively, reducing complexity and improving consistency across Mothership and chat.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Simplifies markdown rendering by making the markdown components static ( Reviewed by Cursor Bugbot for commit be9e2d3. Configure here. |
Greptile SummaryThis PR removes the custom
Confidence Score: 4/5Safe to merge for the animation/UI changes; the bundled use-chat.ts logic simplifications need a verification pass before shipping. The streaming animation refactor is clean and well-executed. The concern is the unrelated logic changes bundled in use-chat.ts: the skipped/rejected → error mapping is a confirmed behavior change against a still-valid server contract, warranting a check that those outcomes are truly deprecated before this reaches production. apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts — specifically the tool-outcome status resolution (lines ~1800-1820) and the unconditional activeSubagent clear on span end. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tool result event received] --> B{isCancelled?}
B -- yes --> C[tc.status = 'cancelled']
B -- no --> D["success = payload.success ?? (status === 'success')"]
D --> E{success?}
E -- true --> F[tc.status = 'success']
E -- false --> G[tc.status = 'error']
subgraph REMOVED["Removed handling"]
H["status='skipped' → ToolCallStatus.skipped"]
I["status='rejected' → ToolCallStatus.rejected"]
end
style REMOVED fill:#fee2e2,stroke:#f87171
style G fill:#fca5a5,stroke:#dc2626
J["Server can still send 'skipped'/'rejected'\n(MothershipStreamV1ToolOutcome)"] -.->|maps to| G
|
apps/sim/app/chat/components/message/components/markdown-renderer.tsx
Outdated
Show resolved
Hide resolved
- Inline EnhancedMarkdownRenderer which became a trivial passthrough after removing useThrottledValue - Add hydration guard to MarkdownRenderer to prevent replaying the entrance animation when mounting mid-stream with existing content
|
@greptile |
Remove animate-stream-fade-in from OptionsDisplay, CredentialDisplay, MothershipErrorDisplay, and UsageUpgradeDisplay. These components re-render after streaming ends, causing a visible flash as the opacity animation replays. PendingTagIndicator retains its animation since it only renders during active streaming.
|
@greptile |
|
@cursor review |
...space/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx
Show resolved
Hide resolved
mode='static' disables Remend (auto-closing incomplete markdown), incremental block splitting, and React Transitions. Switch to streaming mode while isStreaming is true so partial markdown renders correctly, without re-adding animation props.
|
@cursor review |
There was a problem hiding this comment.
✅ 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 be9e2d3. Configure here.
Summary
useStreamingTexthook anduseThrottledValueindirection from chat and Mothership message renderingmode,isStreaming, andanimatedpropsType of Change
Testing
Tested manually
Checklist