feat: 实现状态栏显示功能

- 在消息区域下方添加状态栏 UI(HTML、CSS、JS)
- 支持"思考中..."状态显示(蓝色脉冲动画)
- 支持"生成中..."状态显示(橙色脉冲动画)
- 支持工具执行时显示"正在执行 xxx..."
- 在 messageHandler 中添加状态栏消息发送逻辑
This commit is contained in:
XiaoFeng
2025-12-16 19:20:14 +08:00
parent 7c1f1fae07
commit c21ad95963
2 changed files with 84 additions and 5 deletions

View File

@ -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,