New tools rendering (#2005)
* Optimize message update handling and rendering
Refactors ChatMessage.svelte to interleave tool and stream updates for more accurate message rendering, consolidates consecutive stream tokens, and updates ToolUpdate.svelte styles for improved spacing. Also optimizes update handling in both the client and server to merge consecutive stream updates, reducing unnecessary array growth and improving performance.
* Improve message updates reactivity and storage efficiency
In the Svelte page, message update merging now creates new objects and arrays to ensure UI reactivity when streaming tokens are merged. On the server, ephemeral stream tokens and keep-alive updates are filtered out before persisting messages to the database, reducing payload size and improving rehydration performance.
* Improve chat message block handling and update persistence
Refactors ChatMessage.svelte to better handle interleaved tool and stream updates, ensuring correct text chunking and fallback behavior. Updates the conversation server logic to persist lightweight stream update markers (with token length only) instead of full tokens, preserving update order without duplicating content and improving rehydration performance.
* Improve type safety and token handling in chat messages
Adds explicit 'as const' type annotations for message block types in ChatMessage.svelte to improve type safety. Fixes token merging in conversation page to handle undefined tokens safely. Updates server logic to preserve existing token length if already present, preventing recomputation and ensuring correct ordering.
* Update ChatMessage.svelte
* Refactor chat block UI and improve tool/result handling
Introduces BlockWrapper.svelte for consistent block layout and connectors in chat UI. Refactors ToolUpdate and OpenReasoningResults to use BlockWrapper, improving expand/collapse behavior and visual feedback for loading, errors, and results. Updates message streaming logic to support compressed tokens with length markers, and cleans up related code in ChatMessage and server logic for more reliable rendering and update merging.
* Refine chat block styling and tool update UI
Improves visual spacing and block linking in chat components, updates icon and ring color logic for tool updates, and refines expandable content UI. Removes unused imports and adjusts styles for better consistency and clarity.
* Update tool status icon and loading color
Replaces the hammer icon with a check icon when a tool update is successful in ToolUpdate.svelte. Adjusts the loading path color opacity in BlockWrapper.svelte for improved visual feedback.
* Update error color classes for consistency
Adjusted Tailwind CSS classes for error backgrounds and borders to use more consistent red shades and opacity in both light and dark modes. This improves visual clarity and maintains a uniform appearance for error states.
* Update +page.svelte
* Update +page.svelte
* Refactor chat components for improved reasoning UI
Replaces global <think> block regex usage with a non-global version to avoid lastIndex side effects. Updates OpenReasoningResults to auto-expand on initial loading and improves collapsed preview by stripping markdown. Removes unused navigation props and UI from ToolUpdate for cleaner code.
* Update OpenReasoningResults.svelte
* Refine chat UI sizing and color styles
Adjusted icon and spacing sizes in BlockWrapper.svelte for improved alignment. Updated ToolUpdate.svelte to use more consistent gray text colors. Increased heading font sizes for .prose-sm in main.css from 55% to 75% of original for better readability.
* Update BlockWrapper.svelte