Remove the separate “Thinking…” placeholder component and embed the empty‑streaming state directly inside the main block. Adjust the click handler and button disabled logic to only allow toggling when content is available, preventing accidental collapse during loading. This change simplifies the component, eliminates duplicate markup, and improves UX by consistently showing the thinking indicator within the block.
The update fixes how total thinking time is calculated during a chat message flow.
Previously the elapsed time from the initial completion was incorrectly added to the
overall thinking time, leading to inflated metrics. The new logic splits the
computation into separate phases (initial completion, tool execution, and
follow‑up completions) and accumulates them into `totalThinkingTime`, ensuring
accurate measurement.
Additionally, translation keys for chat components are now namespaced with
`chat:` to avoid collisions and clearly indicate the context in which they
are used. The diff also removes a stray comment line and keeps metadata
updates consistent across recursive calls.
Add more descriptive loading and finished state labels for the ThinkingBlock component. The update:
- Uses new translation keys (`chat:calling_tool`, `chat:thought_and_tool_call`, etc.) for clearer tool‑call and reasoning messages.
- Handles `tool_call`, `tool_output`, and `reasoning` steps explicitly, providing a fallback when no active step is present.
- Adjusts the final label logic to use the new i18n keys and formats durations consistently.
- Adds missing locale entries for all new keys and a trailing newline to the JSON file.
These changes improve user feedback during chat interactions and make the messages easier to maintain and localize.
Implement support for displaying images returned in the Multi-Content Part (MCP) format within the `tool_output` step of the ReAct thinking block.
This change:
- Safely parses `tool_output` content to detect and extract image data (base64).
- Renders images as clickable thumbnails using data URLs.
- Integrates `ImageModal` to allow users to view the generated images in full size.
This commit significantly refactors how assistant message content containing reasoning steps (<think> blocks) and tool calls is parsed and split into final output text and streamed reasoning text in `ThreadContent.tsx`.
It introduces new logic to correctly handle multiple, open, or closed `<think>` tags, ensuring that:
1. All text outside of `<think>...</think>` tags is correctly extracted as final output text.
2. Content inside all `<think>` tags is aggregated as streamed reasoning text.
3. The message correctly determines if reasoning is actively loading during a stream.
Additionally, this commit:
* **Fixes infinite tool loop prevention:** The global `toolStepCounter` in `completion.ts` is replaced with an explicit `currentStepCount` parameter passed recursively in `postMessageProcessing`. This ensures that the tool step limit is correctly enforced per message chain, preventing potential race conditions and correctly resolving the chain.
* **Fixes large step content rendering:** Limits the content of a single thinking step in `ThinkingBlock.tsx` to 1000 characters to prevent UI slowdowns from rendering extremely large JSON or text outputs.
- Replace raw text parsing with step‑based streaming logic in `ThinkingBlock`.
- Introduced `stepsWithoutDone`, `currentStreamingStepIndex`, and `displayedStepIndex` to drive the streaming UI.
- Added placeholder UI for empty streaming state and hide block when there is no content after streaming finishes.
- Simplified expansion handling and bullet‑point rendering, using `renderStepContent` for both streaming and expanded views.
- Removed unused `extractThinkingContent` import and related code.
- Updated translation keys and duration formatting.
- Consolidate reasoning and tool‑call presentation in `ThreadContent`.
- Introduced `shouldShowThinkingBlock` to render a single `ThinkingBlock` when either reasoning or tool calls are present.
- Adjusted `ThinkingBlock` props (`text`, `steps`, `loading`) and ID generation.
- Commented out the now‑redundant `ToolCallBlock` import and removed its conditional rendering block.
- Cleaned up comments, unused variables, and minor formatting/typo fixes.
- General cleanup:
- Updated comments for clarity.
- Fixed typo in deletion loop comment.
- Minor UI tweaks (bullet styling, border handling).
- **ThinkingBlock**
- Added `ThoughtStep` type and UI handling for step kinds: `thought`, `tool_call`, `tool_output`, and `done`.
- Integrated `Check` icon for completed steps and formatted duration (seconds) display.
- Implemented streaming paragraph extraction, fade‑in/out animation, and improved loading state handling.
- Updated header to show dynamic titles (thinking/thought + duration) and disabled expand/collapse while loading.
- Utilized `cn` utility for conditional class names and added relevant imports.
- **ThreadContent**
- Defined `ToolCall` and `ThoughtStep` types for type safety.
- Constructed `allSteps` via `useMemo`, extracting thought paragraphs, tool calls/outputs, and a final `done` step with total thinking time.
- Passed `steps`, `loading`, and `duration` props to `ThinkingBlock`.
- Introduced `hasReasoning` flag to conditionally render the reasoning block and avoid duplicate tool call rendering.
- Adjusted rendering logic to hide empty reasoning and ensure tool call blocks only appear when no reasoning is present.
- **useChat**
- Refactored `getCurrentThread` for clearer async flow while preserving temporary‑chat behavior.
- Captured `startTime` at message creation and computed `totalThinkingTime` on completion.
- Included `totalThinkingTime` in message metadata when appropriate.
- Minor cleanup: improved error handling for image ingestion and formatting adjustments.
Overall, these changes provide a richer, step‑by‑step thinking UI, better state handling during streaming, and expose total thinking duration for downstream components.
* Refactor translation imports and update text for localization across settings and system monitor routes
- Changed translation import from 'react-i18next' to '@/i18n/react-i18next-compat' in multiple files.
- Updated various text strings to use translation keys for better localization support in:
- Local API Server settings
- MCP Servers settings
- Privacy settings
- Provider settings
- Shortcuts settings
- System Monitor
- Thread details
- Ensured consistent use of translation keys for all user-facing text.
Update web-app/src/routes/settings/appearance.tsx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Update web-app/src/routes/settings/appearance.tsx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Update web-app/src/locales/vn/settings.json
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Update web-app/src/containers/dialogs/DeleteMCPServerConfirm.tsx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Update web-app/src/locales/id/common.json
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Add Chinese (Simplified and Traditional) localization files for various components
- Created `tools.json`, `updater.json`, `assistants.json`, `chat.json`, `common.json`, `hub.json`, `logs.json`, `mcp-servers.json`, `provider.json`, `providers.json`, `settings.json`, `setup.json`, `system-monitor.json`, `tool-approval.json` in both `zh-CN` and `zh-TW` locales.
- Added translations for tool approval, updater notifications, assistant management, chat interface, common UI elements, hub interactions, logging messages, MCP server configurations, provider management, settings options, setup instructions, and system monitoring.
* Refactor localization strings for improved clarity and consistency in English, Indonesian, and Vietnamese settings files
* Fix missing key and reword
* fix pr comment
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>