Skip to content

Commit abf18d3

Browse files
committed
fix: use static mode for completed markdown to prevent render delay
After the ORPC migration, async event boundaries let React deprioritize Streamdown's useTransition() indefinitely, causing 10+ second delays for plan body rendering. Fix: Set mode='static' for completed content (parseIncompleteMarkdown=false) to bypass useTransition() and render immediately. This aligns with Streamdown's intended API usage.
1 parent b061c16 commit abf18d3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

bun.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"lockfileVersion": 1,
3+
"configVersion": 0,
34
"workspaces": {
45
"": {
56
"name": "mux",

src/browser/components/Messages/MarkdownCore.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export const MarkdownCore = React.memo<MarkdownCoreProps>(
6262
remarkPlugins={REMARK_PLUGINS}
6363
rehypePlugins={REHYPE_PLUGINS}
6464
parseIncompleteMarkdown={parseIncompleteMarkdown}
65+
// Use "static" mode for completed content to bypass useTransition() deferral.
66+
// After ORPC migration, async event boundaries let React deprioritize transitions indefinitely.
67+
mode={parseIncompleteMarkdown ? "streaming" : "static"}
6568
className="space-y-2" // Reduce from default space-y-4 (16px) to space-y-2 (8px)
6669
controls={{ table: false, code: true, mermaid: true }} // Disable table copy/download, keep code/mermaid controls
6770
>

0 commit comments

Comments
 (0)