From 383b9177848eeefb8c123a7a7ecc0ee391380eea Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Fri, 18 Apr 2025 18:08:43 -0400 Subject: Run `npm run format` - This has the entirety of the changes. Part of https://b.corp.google.com/issues/411720532 --- packages/cli/src/ui/components/Footer.tsx | 12 +++---- packages/cli/src/ui/components/Header.tsx | 38 +++++++++++----------- packages/cli/src/ui/components/HistoryDisplay.tsx | 37 ++++++++++----------- packages/cli/src/ui/components/InputPrompt.tsx | 4 +-- packages/cli/src/ui/components/Tips.tsx | 26 +++++++-------- .../ui/components/messages/ToolGroupMessage.tsx | 34 +++++++++---------- packages/cli/src/ui/hooks/useAppEffects.ts | 2 +- packages/cli/src/ui/hooks/useGeminiStream.ts | 5 ++- 8 files changed, 78 insertions(+), 80 deletions(-) (limited to 'packages/cli/src/ui') diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx index 6b069a2f..f2afc1bd 100644 --- a/packages/cli/src/ui/components/Footer.tsx +++ b/packages/cli/src/ui/components/Footer.tsx @@ -6,12 +6,12 @@ interface FooterProps { } const Footer: React.FC = ({ queryLength }) => ( - - - {queryLength === 0 ? '? for shortcuts' : ''} - - Gemini + + + {queryLength === 0 ? '? for shortcuts' : ''} - ); + Gemini + +); export default Footer; diff --git a/packages/cli/src/ui/components/Header.tsx b/packages/cli/src/ui/components/Header.tsx index d3f0f9d5..f8f7d27e 100644 --- a/packages/cli/src/ui/components/Header.tsx +++ b/packages/cli/src/ui/components/Header.tsx @@ -8,31 +8,31 @@ interface HeaderProps { } const Header: React.FC = ({ cwd }) => ( - <> - {/* Static Header Art */} - - {` + <> + {/* Static Header Art */} + + {` ______ ________ ____ ____ _____ ____ _____ _____ .' ___ ||_ __ ||_ \\ / _||_ _||_ \\|_ _||_ _| / .' \\_| | |_ \\_| | \\/ | | | | \\ | | | | | | ____ | _| _ | |\\ /| | | | | |\\ \\| | | | \\ \`.___] |_| |__/ | _| |_\\/_| |_ _| |_ _| |_\\ |_ _| |_ \`._____.'|________||_____||_____||_____||_____|\\____||_____|`} + + {/* CWD Display */} + + + cwd: {shortenPath(cwd, /*maxLength*/ 70)} - {/* CWD Display */} - - - cwd: {shortenPath(cwd, /*maxLength*/ 70)} - - - - ); + + +); export default Header; diff --git a/packages/cli/src/ui/components/HistoryDisplay.tsx b/packages/cli/src/ui/components/HistoryDisplay.tsx index fe0bf4c1..7565c5bc 100644 --- a/packages/cli/src/ui/components/HistoryDisplay.tsx +++ b/packages/cli/src/ui/components/HistoryDisplay.tsx @@ -17,26 +17,23 @@ interface HistoryDisplayProps { const HistoryDisplay: React.FC = ({ history, onSubmit, -}) => +}) => ( // No grouping logic needed here anymore - ( - - {history.map((item) => ( - - {/* Render standard message types */} - {item.type === 'user' && } - {item.type === 'gemini' && } - {item.type === 'info' && } - {item.type === 'error' && } - - {/* Render the tool group component */} - {item.type === 'tool_group' && ( - - )} - - ))} - - ) -; + + {history.map((item) => ( + + {/* Render standard message types */} + {item.type === 'user' && } + {item.type === 'gemini' && } + {item.type === 'info' && } + {item.type === 'error' && } + {/* Render the tool group component */} + {item.type === 'tool_group' && ( + + )} + + ))} + +); export default HistoryDisplay; diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index 1102e75d..96089eec 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -3,8 +3,6 @@ import { Box, Text } from 'ink'; import TextInput from 'ink-text-input'; import { globalConfig } from '../../config/config.js'; - - interface InputPromptProps { query: string; setQuery: (value: string) => void; @@ -34,6 +32,6 @@ const InputPrompt: React.FC = ({ ); -} +}; export default InputPrompt; diff --git a/packages/cli/src/ui/components/Tips.tsx b/packages/cli/src/ui/components/Tips.tsx index 6be53360..aa8d39d6 100644 --- a/packages/cli/src/ui/components/Tips.tsx +++ b/packages/cli/src/ui/components/Tips.tsx @@ -3,18 +3,18 @@ import { Box, Text } from 'ink'; import { UI_WIDTH } from '../constants.js'; const Tips: React.FC = () => ( - - Tips for getting started: - - 1. /help for more information. - - - 2. /init to create a GEMINI.md for instructions & - context. - - 3. Ask coding questions, edit code or run commands. - 4. Be specific for the best results. - - ); + + Tips for getting started: + + 1. /help for more information. + + + 2. /init to create a GEMINI.md for instructions & + context. + + 3. Ask coding questions, edit code or run commands. + 4. Be specific for the best results. + +); export default Tips; diff --git a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx index 6627faee..6644cd5f 100644 --- a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx @@ -21,23 +21,23 @@ const ToolGroupMessage: React.FC = ({ return ( {toolCalls.map((tool) => ( - - - {tool.status === ToolCallStatus.Confirming && - tool.confirmationDetails && ( - - )} - - ))} + + + {tool.status === ToolCallStatus.Confirming && + tool.confirmationDetails && ( + + )} + + ))} {/* Optional: Add padding below the last item if needed, though ToolMessage already has some vertical space implicitly */} {/* {tools.length > 0 && } */} diff --git a/packages/cli/src/ui/hooks/useAppEffects.ts b/packages/cli/src/ui/hooks/useAppEffects.ts index 16f862b0..7bd7c6d6 100644 --- a/packages/cli/src/ui/hooks/useAppEffects.ts +++ b/packages/cli/src/ui/hooks/useAppEffects.ts @@ -58,4 +58,4 @@ export function useInitializationErrorEffect( ]); } }, [initError, history, setHistory]); // Include setHistory in dependency array -} \ No newline at end of file +} diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index f97f5e27..7fffa3fe 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -3,7 +3,10 @@ import { useInput } from 'ink'; import { GeminiClient } from '../../core/gemini-client.js'; import { type Chat, type PartListUnion } from '@google/genai'; import { HistoryItem } from '../types.js'; -import { processGeminiStream , StreamingState } from '../../core/gemini-stream.js'; +import { + processGeminiStream, + StreamingState, +} from '../../core/gemini-stream.js'; import { globalConfig } from '../../config/config.js'; import { getErrorMessage, isNodeError } from '../../utils/errors.js'; -- cgit v1.2.3