From 123ad20e9bfc5cf47eca4fe0e073ecef67a639f9 Mon Sep 17 00:00:00 2001 From: Asad Memon Date: Sun, 15 Jun 2025 11:19:05 -0700 Subject: feat: Show model thoughts while loading (#992) --- .../cli/src/ui/components/LoadingIndicator.tsx | 42 +++++++++++++--------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'packages/cli/src/ui/components/LoadingIndicator.tsx') diff --git a/packages/cli/src/ui/components/LoadingIndicator.tsx b/packages/cli/src/ui/components/LoadingIndicator.tsx index 61b74b89..855894e6 100644 --- a/packages/cli/src/ui/components/LoadingIndicator.tsx +++ b/packages/cli/src/ui/components/LoadingIndicator.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { ThoughtSummary } from '@gemini-cli/core'; import React from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; @@ -15,12 +16,14 @@ interface LoadingIndicatorProps { currentLoadingPhrase?: string; elapsedTime: number; rightContent?: React.ReactNode; + thought?: ThoughtSummary | null; } export const LoadingIndicator: React.FC = ({ currentLoadingPhrase, elapsedTime, rightContent, + thought, }) => { const streamingState = useStreamingContext(); @@ -28,25 +31,30 @@ export const LoadingIndicator: React.FC = ({ return null; } + const primaryText = thought?.subject || currentLoadingPhrase; + return ( - - - + + {/* Main loading line */} + + + + + {primaryText && {primaryText}} + + {streamingState === StreamingState.WaitingForConfirmation + ? '' + : ` (esc to cancel, ${elapsedTime}s)`} + + {/* Spacer */} + {rightContent && {rightContent}} - {currentLoadingPhrase && ( - {currentLoadingPhrase} - )} - - {streamingState === StreamingState.WaitingForConfirmation - ? '' - : ` (esc to cancel, ${elapsedTime}s)`} - - {/* Spacer */} - {rightContent && {rightContent}} ); }; -- cgit v1.2.3