@@ -27,7 +27,7 @@ function ChatLoadingSpinner() {
27
27
// We use a span for each sequence, only one visible at a time via keyframes.
28
28
// Inline style for keyframes to avoid external CSS dependencies.
29
29
return (
30
- < span className = 'ml -2 mt-2 inline-flex h-3 select-none text-base text-muted-foreground' >
30
+ < span className = 'mt -2 font-mono inline-flex h-3 select-none text-base text-muted-foreground flex ' >
31
31
< style >
32
32
{ `
33
33
@keyframes chatDot1 {
@@ -48,23 +48,18 @@ function ChatLoadingSpinner() {
48
48
` }
49
49
</ style >
50
50
< span style = { { animation : 'chatDot1 1.2s linear infinite' } } >
51
- .
51
+ ・
52
52
</ span >
53
- < span
54
- style = { { animation : 'chatDot2 1.2s linear infinite' } }
55
- className = 'ml-0.5'
56
- >
57
- .
53
+ < span style = { { animation : 'chatDot2 1.2s linear infinite' } } >
54
+ ・
58
55
</ span >
59
- < span
60
- style = { { animation : 'chatDot3 1.2s linear infinite' } }
61
- className = 'ml-0.5'
62
- >
63
- .
56
+ < span style = { { animation : 'chatDot3 1.2s linear infinite' } } >
57
+ ・
64
58
</ span >
65
59
</ span >
66
60
)
67
61
}
62
+
68
63
function isMessageAlmostEmpty ( message : UIMessage ) {
69
64
if ( message . parts . length === 0 ) {
70
65
return true
@@ -112,14 +107,13 @@ export const ChatAssistantMessage = memo(function ChatMessage({
112
107
message . role === 'assistant' ,
113
108
)
114
109
115
- let content = children
116
- if (
117
- isLastAssistantMessage &&
118
- isChatGenerating &&
119
- isMessageAlmostEmpty ( message )
120
- ) {
121
- content = < ChatLoadingSpinner />
122
- }
110
+ // if (
111
+ // isLastAssistantMessage &&
112
+ // isChatGenerating &&
113
+ // isMessageAlmostEmpty(message)
114
+ // ) {
115
+ // content = <ChatLoadingSpinner />
116
+ // }
123
117
124
118
return (
125
119
< article
@@ -137,7 +131,10 @@ export const ChatAssistantMessage = memo(function ChatMessage({
137
131
'space-y-4 w-full' ,
138
132
) }
139
133
>
140
- { content }
134
+ { children }
135
+ { isLastAssistantMessage && isChatGenerating && (
136
+ < ChatLoadingSpinner />
137
+ ) }
141
138
</ div >
142
139
</ article >
143
140
)
0 commit comments