From 5be89befeff9c4d4f3ab9f508f030bc153fdd06b Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Fri, 25 Apr 2025 17:11:08 -0700 Subject: feat: Fix flickering in iTerm + scrolling + performance issues. - Refactors history display using Ink's component to prevent flickering and improve performance by rendering completed items statically. - Introduces ConsolePatcher component to capture and display console.log, console.warn, and console.error output within the Ink UI, addressing native handling issues. - Introduce a new content splitting mechanism to work better for static items. Basically when content gets too long we will now split content into multiple blocks for Gemini messages to ensure that we can statically cache larger pieces of history. Fixes: - https://b.corp.google.com/issues/411450097 - https://b.corp.google.com/issues/412716309 --- .../cli/src/ui/components/messages/ToolGroupMessage.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/ui/components/messages/ToolGroupMessage.tsx') diff --git a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx index 0675411f..2d4982c2 100644 --- a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx @@ -13,12 +13,14 @@ import { ToolConfirmationMessage } from './ToolConfirmationMessage.js'; import { Colors } from '../../colors.js'; interface ToolGroupMessageProps { + groupId: number; toolCalls: IndividualToolCallDisplay[]; onSubmit: (value: PartListUnion) => void; } // Main component renders the border and maps the tools using ToolMessage export const ToolGroupMessage: React.FC = ({ + groupId, toolCalls, onSubmit, }) => { @@ -29,13 +31,23 @@ export const ToolGroupMessage: React.FC = ({ return ( {toolCalls.map((tool) => ( - + = ({ onSubmit={onSubmit} > )} - + ))} {/* Optional: Add padding below the last item if needed, though ToolMessage already has some vertical space implicitly */} -- cgit v1.2.3