fix: RAG检索状态消息在AI回复后自动清除

给 appendSystemMessage 增加可选 tempClass 参数,
所有 RAG 状态消息标记为 'rag-status' class,
流式结束后和报错时统一移除这些临时消息。
This commit is contained in:
Metona
2026-04-05 00:44:12 +08:00
parent 1e3f4d4ba5
commit 6b793f669b
2 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -309,9 +309,10 @@ export function appendAssistantPlaceholder() {
}
/** 追加系统提示消息 */
export function appendSystemMessage(text) {
export function appendSystemMessage(text, tempClass) {
const div = document.createElement('div');
div.style.cssText = 'text-align:center;padding:8px;font-size:12px;color:var(--text-muted);';
if (tempClass) div.classList.add(tempClass);
div.textContent = text;
emptyStateEl.style.display = 'none';
messagesContainerEl.style.display = '';