diff --git a/web-app/src/containers/ThinkingBlock.tsx b/web-app/src/containers/ThinkingBlock.tsx index 4f1e8bdeb..aa5aaff27 100644 --- a/web-app/src/containers/ThinkingBlock.tsx +++ b/web-app/src/containers/ThinkingBlock.tsx @@ -114,7 +114,7 @@ const ThinkingBlock = ({
- {t('thinking')}... + {t('thinking')}
@@ -253,26 +253,36 @@ const ThinkingBlock = ({ const timeInSeconds = formatDuration(duration ?? 0) if (loading) { - // Check if the active step is a tool call - if (activeStep?.type === 'tool_call' || hasToolCalls) { - return 'Calling tool...' - } else { - return t('thinking') + // Logic for streaming (loading) state: + if (activeStep) { + if ( + activeStep.type === 'tool_call' || + activeStep.type === 'tool_output' + ) { + return `${t('calling_tool')}` // Use a specific translation key for tool + } else if (activeStep.type === 'reasoning') { + return `${t('chat:thinking')}` // Use the generic thinking key + } } + + // Fallback if loading but no activeStep (isStreamingEmpty case, though handled before this memo) + return `${t('chat:thinking')}` } + // Logic for finalized (not loading) state: // Build label based on what steps occurred let label = '' if (hasReasoning && hasToolCalls) { - label = `${t('thought')}` + // Use a more descriptive label when both were involved + label = t('chat:thought_and_tool_call') } else if (hasToolCalls) { - label = 'Tool Called' + label = t('chat:tool_called') } else { - label = t('thought') + label = t('chat:thought') } if (timeInSeconds > 0) { - return `${label} ${t('for')} ${timeInSeconds} ${t('seconds')}` + return `${label} ${t('chat:for')} ${timeInSeconds} ${t('chat:seconds')}` } return label }, [loading, duration, t, activeStep, steps]) diff --git a/web-app/src/locales/en/chat.json b/web-app/src/locales/en/chat.json index 5ca734fcc..05c053e71 100644 --- a/web-app/src/locales/en/chat.json +++ b/web-app/src/locales/en/chat.json @@ -8,5 +8,12 @@ }, "sendMessage": "Send Message", "newConversation": "New Conversation", - "clearHistory": "Clear History" -} \ No newline at end of file + "clearHistory": "Clear History", + "thought_and_tool_call": "Thought and called tools", + "tool_called": "Called tools", + "calling_tool": "Calling a tool", + "thinking": "Thinking", + "for": "for", + "seconds": "seconds" +} +