diff options
| author | Asad Memon <[email protected]> | 2025-06-15 11:19:05 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-15 18:19:05 +0000 |
| commit | 123ad20e9bfc5cf47eca4fe0e073ecef67a639f9 (patch) | |
| tree | 57621474cdb291993fe1c148b1362835c5960b60 /packages/cli/src/ui/components/LoadingIndicator.tsx | |
| parent | b3d89a10758462947546a7d9be43bf617c0787c6 (diff) | |
feat: Show model thoughts while loading (#992)
Diffstat (limited to 'packages/cli/src/ui/components/LoadingIndicator.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/LoadingIndicator.tsx | 42 |
1 files changed, 25 insertions, 17 deletions
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<LoadingIndicatorProps> = ({ currentLoadingPhrase, elapsedTime, rightContent, + thought, }) => { const streamingState = useStreamingContext(); @@ -28,25 +31,30 @@ export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({ return null; } + const primaryText = thought?.subject || currentLoadingPhrase; + return ( - <Box marginTop={1} paddingLeft={0}> - <Box marginRight={1}> - <GeminiRespondingSpinner - nonRespondingDisplay={ - streamingState === StreamingState.WaitingForConfirmation ? '⠏' : '' - } - /> + <Box marginTop={1} paddingLeft={0} flexDirection="column"> + {/* Main loading line */} + <Box> + <Box marginRight={1}> + <GeminiRespondingSpinner + nonRespondingDisplay={ + streamingState === StreamingState.WaitingForConfirmation + ? '⠏' + : '' + } + /> + </Box> + {primaryText && <Text color={Colors.AccentPurple}>{primaryText}</Text>} + <Text color={Colors.Gray}> + {streamingState === StreamingState.WaitingForConfirmation + ? '' + : ` (esc to cancel, ${elapsedTime}s)`} + </Text> + <Box flexGrow={1}>{/* Spacer */}</Box> + {rightContent && <Box>{rightContent}</Box>} </Box> - {currentLoadingPhrase && ( - <Text color={Colors.AccentPurple}>{currentLoadingPhrase}</Text> - )} - <Text color={Colors.Gray}> - {streamingState === StreamingState.WaitingForConfirmation - ? '' - : ` (esc to cancel, ${elapsedTime}s)`} - </Text> - <Box flexGrow={1}>{/* Spacer */}</Box> - {rightContent && <Box>{rightContent}</Box>} </Box> ); }; |
