-
Notifications
You must be signed in to change notification settings - Fork 973
Description
Feature request
The AI chat panel currently renders streaming text without animation. Streamdown 2.2+ (marimo already depends on at ^1.3.0) ships with built-in per-word animation and a streaming caret that would make the chat experience significantly smoother.
Current behavior
MarkdownRenderer passes content to <Streamdown> without animated, isAnimating, or caret props. Text appears as raw token dumps — functional but flat compared to ChatGPT, Claude.ai, and Cursor, which all use per-word fade/blur-in animations.
Proposed change
- Upgrade
streamdownfrom^1.3.0to^2.2.0 - Add
isStreamingprop toMarkdownRenderer - Enable animation + caret during active streaming
The diff is small:
// markdown-renderer.tsx
export const MarkdownRenderer = memo(({ content, isStreaming }: {
content: string;
isStreaming?: boolean;
}) => {
return (
<Streamdown
components={COMPONENTS}
className="mo-markdown-renderer"
animated={{
animation: "blurIn",
duration: 200,
easing: "ease-out",
sep: "word",
}}
isAnimating={isStreaming}
caret={isStreaming ? "block" : undefined}
>
{content}
</Streamdown>
);
});// chat-panel.tsx, line ~206
case "text":
return <MarkdownRenderer key={i} content={part.text} isStreaming={isLast && isLoading} />;Why blurIn
For fast models (200+ tokens/sec), multiple tokens arrive per React commit. blurIn combines opacity + blur-to-sharp which masks batch arrivals better than pure fadeIn. The caret (block) adds a blinking cursor at the streaming edge via CSS ::after pseudo-element with zero extra DOM nodes.