From 50929940cc165d6e98dbf0c075d3a6358c65fa66 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 2 Jul 2026 18:35:35 +0800 Subject: [PATCH 1/2] fix: hide project memory refresh notice --- src/hooks/useTKMindChat.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hooks/useTKMindChat.ts b/src/hooks/useTKMindChat.ts index f324328..d7f57d1 100644 --- a/src/hooks/useTKMindChat.ts +++ b/src/hooks/useTKMindChat.ts @@ -377,12 +377,8 @@ export function useTKMindChat( setMemoryLoading(true); try { const result = await bootstrapProjectMemory(sessionId, appConfig.memoryQuery, force); - if (force) { - setNotice( - result.summary - ? `项目记忆已刷新(${result.source})` - : '未找到可用的项目记忆,当前会话仍可正常使用', - ); + if (force && !result.summary) { + setNotice('未找到可用的项目记忆,当前会话仍可正常使用'); } return result; } catch (err) { From 913533246756c557e7e962afc8fbfd8f49f46139 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 2 Jul 2026 18:39:59 +0800 Subject: [PATCH 2/2] fix: hide fully loaded history notice --- src/components/ChatPanel.tsx | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/components/ChatPanel.tsx b/src/components/ChatPanel.tsx index f2ce29b..dfbf98a 100644 --- a/src/components/ChatPanel.tsx +++ b/src/components/ChatPanel.tsx @@ -129,7 +129,6 @@ export function ChatPanel({ const [pendingImages, setPendingImages] = useState([]); const [uploadingImage, setUploadingImage] = useState(false); const [imageError, setImageError] = useState(null); - const [showHistoryFullyLoadedNotice, setShowHistoryFullyLoadedNotice] = useState(false); const [voiceStopSignal, setVoiceStopSignal] = useState(0); const [randomPrompt] = useState( () => CHAT_PLACEHOLDER_PROMPTS[Math.floor(Math.random() * CHAT_PLACEHOLDER_PROMPTS.length)], @@ -197,22 +196,8 @@ export function ChatPanel({ initializedSessionRef.current = null; pendingOlderLoadRef.current = null; nearBottomRef.current = true; - setShowHistoryFullyLoadedNotice(false); }, [session?.id]); - useEffect(() => { - const isHomeWelcome = variant !== 'compact' && messages.length === 0; - if (isHomeWelcome || historyTotal <= 0 || historyHasMore || historyLoadingMore) { - setShowHistoryFullyLoadedNotice(false); - return; - } - setShowHistoryFullyLoadedNotice(true); - const timer = window.setTimeout(() => { - setShowHistoryFullyLoadedNotice(false); - }, 5000); - return () => window.clearTimeout(timer); - }, [historyHasMore, historyLoadingMore, historyTotal, messages.length, variant]); - useLayoutEffect(() => { const container = mainRef.current; if (!container) return; @@ -555,13 +540,11 @@ export function ChatPanel({ className={compact ? 'space-chat-panel-body' : `main${showHomeWelcome ? ' main-home' : ''}`} onScroll={handleMainScroll} > - {!showHomeWelcome && (historyLoadingMore || historyHasMore || showHistoryFullyLoadedNotice) && ( + {!showHomeWelcome && (historyLoadingMore || historyHasMore) && (
{historyLoadingMore ? `正在加载更早消息… 已加载 ${messages.length}${historyTotal > 0 ? ` / ${historyTotal}` : ''}` - : historyHasMore - ? `向上滚动加载更早消息${historyTotal > 0 ? ` · 已加载 ${messages.length} / ${historyTotal}` : ''}` - : `历史消息已全部加载${historyTotal > 0 ? ` · ${messages.length} / ${historyTotal}` : ''}`} + : `向上滚动加载更早消息${historyTotal > 0 ? ` · 已加载 ${messages.length} / ${historyTotal}` : ''}`}
)}