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

@@ -6,6 +6,7 @@ import { Sidebar } from './components/Sidebar';
import { LoginScreen } from './components/LoginScreen';
import { ConnectionBanner } from './components/ConnectionBanner';
import { KeyboardShortcuts } from './components/KeyboardShortcuts';
import { ToolCollapseProvider } from './contexts/ToolCollapseContext';
const Chat = lazy(() => import('./components/Chat').then(m => ({ default: m.Chat })));
@@ -85,6 +86,7 @@ export default function App() {
}
return (
<ToolCollapseProvider>
<div className="h-dvh flex overflow-x-hidden bg-[#1e1e24] text-zinc-300 bg-[radial-gradient(ellipse_at_top,rgba(255,255,255,0.02),transparent_50%),radial_gradient(ellipse_at_bottom_right,rgba(99,102,241,0.04),transparent_50%)]" role="application" aria-label="PinchChat">
<Sidebar
sessions={sessions}
@@ -103,5 +105,6 @@ export default function App() {
</div>
<KeyboardShortcuts open={shortcutsOpen} onClose={() => setShortcutsOpen(false)} />
</div>
</ToolCollapseProvider>
);
}