feat: 实现状态栏显示功能
- 在消息区域下方添加状态栏 UI(HTML、CSS、JS) - 支持"思考中..."状态显示(蓝色脉冲动画) - 支持"生成中..."状态显示(橙色脉冲动画) - 支持工具执行时显示"正在执行 xxx..." - 在 messageHandler 中添加状态栏消息发送逻辑
This commit is contained in:
@ -105,18 +105,29 @@ async function handleUserMessageWithBackend(
|
||||
|
||||
const historyManager = ChatHistoryManager.getInstance();
|
||||
|
||||
// 显示加载状态
|
||||
// 显示状态栏
|
||||
panel.webview.postMessage({
|
||||
command: "showLoading",
|
||||
text: "正在思考...",
|
||||
command: "updateStatus",
|
||||
text: "思考中...",
|
||||
type: "thinking",
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
currentSession!.sendMessage(text, {
|
||||
onText: (fullText, isStreaming) => {
|
||||
// 暂时只在完成时发送消息(非流式)
|
||||
if (!isStreaming) {
|
||||
if (isStreaming) {
|
||||
// 流式时更新状态为"生成中"
|
||||
panel.webview.postMessage({
|
||||
command: "updateStatus",
|
||||
text: "生成中...",
|
||||
type: "working",
|
||||
});
|
||||
} else {
|
||||
// 完成时发送消息并隐藏状态
|
||||
console.log('[MessageHandler] 发送最终消息, 文本长度:', fullText.length);
|
||||
panel.webview.postMessage({
|
||||
command: "hideStatus",
|
||||
});
|
||||
panel.webview.postMessage({
|
||||
command: "receiveMessage",
|
||||
text: fullText,
|
||||
|
||||
Reference in New Issue
Block a user