{
@@ -161,7 +172,8 @@ export const ChatMessage = ({ message }: { message: MessageWithError }) => { //
>
{isThinking ? (
<>
-
+ {/* Only show spinner animation in active tab to save resources */}
+ {isTabActive && }
{t('retrievePanel.chatMessage.thinking')}
>
) : (
@@ -247,11 +259,12 @@ export const ChatMessage = ({ message }: { message: MessageWithError }) => { //
)}
- {(() => {
+ {/* Loading indicator - only show in active tab */}
+ {isTabActive && (() => {
// More comprehensive loading state check
const hasVisibleContent = finalDisplayContent && finalDisplayContent.trim() !== '';
const isLoadingState = !hasVisibleContent && !isThinking && !thinkingTime;
- return isLoadingState &&
;
+ return isLoadingState &&
})()}
)
diff --git a/lightrag_webui/src/features/RetrievalTesting.tsx b/lightrag_webui/src/features/RetrievalTesting.tsx
index 0f3e0869..3fe8ec13 100644
--- a/lightrag_webui/src/features/RetrievalTesting.tsx
+++ b/lightrag_webui/src/features/RetrievalTesting.tsx
@@ -103,6 +103,10 @@ const parseCOTContent = (content: string) => {
export default function RetrievalTesting() {
const { t } = useTranslation()
+ // Get current tab to determine if this tab is active (for performance optimization)
+ const currentTab = useSettingsStore.use.currentTab()
+ const isRetrievalTabActive = currentTab === 'retrieval'
+
const [messages, setMessages] = useState