feat: add collapse/expand all tool calls toggle button

Adds a floating button in the chat area that lets users collapse or expand
all tool call details at once. Useful for long conversations with many tool
calls where scrolling through expanded results is tedious.

- New ToolCollapseContext provides global collapse/expand state
- ToolCall components react to global state changes via version tracking
- Toggle button appears only when conversation has tool calls
- Supports EN/FR i18n
This commit is contained in:
Nicolas Varrot
2026-02-12 19:36:53 +00:00
parent cab78db057
commit 2b1ca2d0c8
5 changed files with 84 additions and 7 deletions

View File

@@ -41,6 +41,8 @@ const en = {
'chat.send': 'Send',
'chat.stop': 'Stop',
'chat.scrollToBottom': 'New messages',
'chat.collapseTools': 'Collapse all tools',
'chat.expandTools': 'Expand all tools',
'chat.messages': 'Chat messages',
'chat.thinking': 'Thinking…',
@@ -131,6 +133,8 @@ const fr: Record<keyof typeof en, string> = {
'chat.send': 'Envoyer',
'chat.stop': 'Arrêter',
'chat.scrollToBottom': 'Nouveaux messages',
'chat.collapseTools': 'Replier tous les outils',
'chat.expandTools': 'Déplier tous les outils',
'chat.messages': 'Messages du chat',
'chat.thinking': 'Réflexion…',