Akarshan 8601a49ff6
feat: enhance thinking UI, support structured steps, and record total thinking time
- **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.
2025-10-29 20:30:21 +05:30
..
2025-05-25 17:25:03 +07:00
2025-10-09 04:28:08 +07:00
2025-05-20 10:49:57 +07:00
2025-08-11 13:52:20 +07:00
2025-05-15 19:38:59 +07:00
2025-09-30 15:39:45 +07:00
2025-05-15 19:38:59 +07:00
2025-10-28 17:26:27 +07:00
2025-10-08 16:08:40 +07:00
2025-10-09 04:41:18 +07:00
2025-10-08 16:08:40 +07:00