修改了Thinking的显示
This commit is contained in:
@@ -522,6 +522,7 @@ export default function AIPage({ variant = "page", onClose }: AIPageProps = {})
|
|||||||
},
|
},
|
||||||
onDone: () => {
|
onDone: () => {
|
||||||
setSending(false);
|
setSending(false);
|
||||||
|
updateAssistant((m) => ({ ...m, pending: false }));
|
||||||
// 如果是新建会话,后端首次返回时会创建 chat_id;这里拉一次会话列表补上 id
|
// 如果是新建会话,后端首次返回时会创建 chat_id;这里拉一次会话列表补上 id
|
||||||
const resolveAndRefresh = async () => {
|
const resolveAndRefresh = async () => {
|
||||||
let id = currentChatId;
|
let id = currentChatId;
|
||||||
@@ -809,13 +810,6 @@ export default function AIPage({ variant = "page", onClose }: AIPageProps = {})
|
|||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
{sending &&
|
|
||||||
(() => {
|
|
||||||
const last = messages[messages.length - 1];
|
|
||||||
return last && last.kind === "chat" && last.pending ? (
|
|
||||||
<TypingIndicator />
|
|
||||||
) : null;
|
|
||||||
})()}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1062,9 +1056,9 @@ function MessageBubble({ aiText, msg }: { aiText: AILocale; msg: ChatUIMessage }
|
|||||||
<div className={cn("markdown-body", msg.error && "text-red-400")}>
|
<div className={cn("markdown-body", msg.error && "text-red-400")}>
|
||||||
{msg.text ? (
|
{msg.text ? (
|
||||||
<Streamdown parseIncompleteMarkdown>{msg.text}</Streamdown>
|
<Streamdown parseIncompleteMarkdown>{msg.text}</Streamdown>
|
||||||
) : (
|
) : msg.pending ? (
|
||||||
<span className="text-white/40 italic">{aiText.thinking}</span>
|
<span className="text-white/40 italic">{aiText.thinking}</span>
|
||||||
)}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1072,16 +1066,6 @@ function MessageBubble({ aiText, msg }: { aiText: AILocale; msg: ChatUIMessage }
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TypingIndicator() {
|
|
||||||
return (
|
|
||||||
<div className="flex items-center gap-1.5 ml-9 mt-1">
|
|
||||||
<span className="w-1.5 h-1.5 rounded-full bg-white/40 animate-pulse" style={{ animationDelay: "0ms" }} />
|
|
||||||
<span className="w-1.5 h-1.5 rounded-full bg-white/40 animate-pulse" style={{ animationDelay: "150ms" }} />
|
|
||||||
<span className="w-1.5 h-1.5 rounded-full bg-white/40 animate-pulse" style={{ animationDelay: "300ms" }} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function HistoryPanel({
|
function HistoryPanel({
|
||||||
aiText,
|
aiText,
|
||||||
chats,
|
chats,
|
||||||
|
|||||||
Reference in New Issue
Block a user