From 379486d36c02e5676dcd3b0a126aecda4be53e57 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=85=AC=E6=98=8E?=
<83812544+Ed1s0nZ@users.noreply.github.com>
Date: Mon, 9 Mar 2026 21:35:49 +0800
Subject: [PATCH] Add files via upload
---
web/static/i18n/en-US.json | 1 +
web/static/i18n/zh-CN.json | 1 +
web/static/js/chat.js | 16 ++++++++++++----
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/web/static/i18n/en-US.json b/web/static/i18n/en-US.json
index b5c652f1..949eea63 100644
--- a/web/static/i18n/en-US.json
+++ b/web/static/i18n/en-US.json
@@ -122,6 +122,7 @@
"copyMessageTitle": "Copy message",
"emptyGroupConversations": "This group has no conversations yet.",
"noMatchingConversationsInGroup": "No matching conversations found.",
+ "noHistoryConversations": "No conversation history yet",
"renameGroupPrompt": "Please enter new name:",
"deleteGroupConfirm": "Are you sure you want to delete this group? Conversations in the group will not be deleted, but will be removed from the group.",
"deleteConversationConfirm": "Are you sure you want to delete this conversation?",
diff --git a/web/static/i18n/zh-CN.json b/web/static/i18n/zh-CN.json
index b7c72e45..072de55d 100644
--- a/web/static/i18n/zh-CN.json
+++ b/web/static/i18n/zh-CN.json
@@ -122,6 +122,7 @@
"copyMessageTitle": "复制消息内容",
"emptyGroupConversations": "该分组暂无对话",
"noMatchingConversationsInGroup": "未找到匹配的对话",
+ "noHistoryConversations": "暂无历史对话",
"renameGroupPrompt": "请输入新名称:",
"deleteGroupConfirm": "确定要删除此分组吗?分组中的对话不会被删除,但会从分组中移除。",
"deleteConversationConfirm": "确定要删除此对话吗?",
diff --git a/web/static/js/chat.js b/web/static/js/chat.js
index 10df6d75..67e59698 100644
--- a/web/static/js/chat.js
+++ b/web/static/js/chat.js
@@ -1749,12 +1749,13 @@ async function loadConversations(searchQuery = '') {
const sidebarContent = listContainer.closest('.sidebar-content');
const savedScrollTop = sidebarContent ? sidebarContent.scrollTop : 0;
- const emptyStateHtml = '
暂无历史对话
';
+ const emptyStateHtml = '';
listContainer.innerHTML = '';
// 如果响应不是200,显示空状态(友好处理,不显示错误)
if (!response.ok) {
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
return;
}
@@ -1762,6 +1763,7 @@ async function loadConversations(searchQuery = '') {
if (!Array.isArray(conversations) || conversations.length === 0) {
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
return;
}
@@ -1827,6 +1829,7 @@ async function loadConversations(searchQuery = '') {
if (!rendered) {
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
return;
}
@@ -1845,8 +1848,9 @@ async function loadConversations(searchQuery = '') {
// 错误时显示空状态,而不是错误提示(更友好的用户体验)
const listContainer = document.getElementById('conversations-list');
if (listContainer) {
- const emptyStateHtml = '暂无历史对话
';
+ const emptyStateHtml = '';
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
}
}
}
@@ -3994,12 +3998,13 @@ async function loadConversationsWithGroups(searchQuery = '') {
const sidebarContent = listContainer.closest('.sidebar-content');
const savedScrollTop = sidebarContent ? sidebarContent.scrollTop : 0;
- const emptyStateHtml = '暂无历史对话
';
+ const emptyStateHtml = '';
listContainer.innerHTML = '';
// 如果响应不是200,显示空状态(友好处理,不显示错误)
if (!response.ok) {
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
return;
}
@@ -4007,6 +4012,7 @@ async function loadConversationsWithGroups(searchQuery = '') {
if (!Array.isArray(conversations) || conversations.length === 0) {
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
return;
}
@@ -4068,6 +4074,7 @@ async function loadConversationsWithGroups(searchQuery = '') {
if (fragment.children.length === 0) {
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
return;
}
@@ -4086,8 +4093,9 @@ async function loadConversationsWithGroups(searchQuery = '') {
// 错误时显示空状态,而不是错误提示(更友好的用户体验)
const listContainer = document.getElementById('conversations-list');
if (listContainer) {
- const emptyStateHtml = '暂无历史对话
';
+ const emptyStateHtml = '';
listContainer.innerHTML = emptyStateHtml;
+ if (typeof window.applyTranslations === 'function') window.applyTranslations(listContainer);
}
}
}