Commit fd653d6
authored
🤖 fix: prevent thinking block collapse on page load (#1011)
When navigating to a chat with existing thinking blocks, they would
collapse immediately after the page loaded, causing a jarring layout
shift.
**Root cause:** The `ReasoningMessage` component initialized
`isExpanded` to `true`, then a `useEffect` collapsed it when
`isStreaming` was false. For historical messages (already `isStreaming:
false`), this effect fired on mount—expanding then immediately
collapsing.
**Fix:** Initialize `isExpanded` to `message.isStreaming`. Historical
messages start collapsed; actively streaming messages start expanded and
collapse when streaming ends.
---
_Generated with `mux`_1 parent c80f3d3 commit fd653d6
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments