From 8303edbb54857d72536e6e7203296d056507621d Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Mon, 2 Mar 2026 20:32:50 -0800 Subject: [PATCH] Code review fixes as a pr (#20612) --- .../DetailedMessagesDisplay.test.tsx | 4 +- .../ui/components/DetailedMessagesDisplay.tsx | 11 +---- .../cli/src/ui/components/Footer.test.tsx | 45 ++++++++++++++++++- packages/cli/src/ui/components/Footer.tsx | 4 +- packages/cli/src/ui/hooks/useGeminiStream.ts | 4 +- .../src/ui/hooks/useLoadingIndicator.test.tsx | 2 +- .../cli/src/ui/hooks/useLoadingIndicator.ts | 4 +- 7 files changed, 55 insertions(+), 19 deletions(-) diff --git a/packages/cli/src/ui/components/DetailedMessagesDisplay.test.tsx b/packages/cli/src/ui/components/DetailedMessagesDisplay.test.tsx index 6e6a4ce48c..65d54e50d6 100644 --- a/packages/cli/src/ui/components/DetailedMessagesDisplay.test.tsx +++ b/packages/cli/src/ui/components/DetailedMessagesDisplay.test.tsx @@ -76,7 +76,7 @@ describe('DetailedMessagesDisplay', () => { unmount(); }); - it('hides the F12 hint in low error verbosity mode', async () => { + it('shows the F12 hint even in low error verbosity mode', async () => { const messages: ConsoleMessageItem[] = [ { type: 'error', content: 'Error message', count: 1 }, ]; @@ -95,7 +95,7 @@ describe('DetailedMessagesDisplay', () => { }, ); await waitUntilReady(); - expect(lastFrame()).not.toContain('(F12 to close)'); + expect(lastFrame()).toContain('(F12 to close)'); unmount(); }); diff --git a/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx b/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx index 097ebe1378..ff88afa888 100644 --- a/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx +++ b/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx @@ -13,8 +13,6 @@ import { ScrollableList, type ScrollableListRef, } from './shared/ScrollableList.js'; -import { useConfig } from '../contexts/ConfigContext.js'; -import { useSettings } from '../contexts/SettingsContext.js'; interface DetailedMessagesDisplayProps { messages: ConsoleMessageItem[]; @@ -29,10 +27,6 @@ export const DetailedMessagesDisplay: React.FC< DetailedMessagesDisplayProps > = ({ messages, maxHeight, width, hasFocus }) => { const scrollableListRef = useRef>(null); - const config = useConfig(); - const settings = useSettings(); - const showHotkeyHint = - settings.merged.ui.errorVerbosity === 'full' || config.getDebugMode(); const borderAndPadding = 3; @@ -71,10 +65,7 @@ export const DetailedMessagesDisplay: React.FC< > - Debug Console{' '} - {showHotkeyHint && ( - (F12 to close) - )} + Debug Console (F12 to close) diff --git a/packages/cli/src/ui/components/Footer.test.tsx b/packages/cli/src/ui/components/Footer.test.tsx index 9c253fec92..01cf46ef30 100644 --- a/packages/cli/src/ui/components/Footer.test.tsx +++ b/packages/cli/src/ui/components/Footer.test.tsx @@ -15,6 +15,19 @@ import { } from '@google/gemini-cli-core'; import type { SessionStatsState } from '../contexts/SessionContext.js'; +let mockIsDevelopment = false; + +vi.mock('../../utils/installationInfo.js', async (importOriginal) => { + const original = + await importOriginal(); + return { + ...original, + get isDevelopment() { + return mockIsDevelopment; + }, + }; +}); + vi.mock('@google/gemini-cli-core', async (importOriginal) => { const original = await importOriginal(); @@ -509,7 +522,15 @@ describe('