diff --git a/packages/cli/src/ui/AppContainer.tsx b/packages/cli/src/ui/AppContainer.tsx index 28aebcd079..939a0945da 100644 --- a/packages/cli/src/ui/AppContainer.tsx +++ b/packages/cli/src/ui/AppContainer.tsx @@ -167,6 +167,12 @@ import { useIsHelpDismissKey } from './utils/shortcutsHelp.js'; import { useSuspend } from './hooks/useSuspend.js'; import { useRunEventNotifications } from './hooks/useRunEventNotifications.js'; import { isNotificationsEnabled } from '../utils/terminalNotifications.js'; +import { + getLastTurnToolCallIds, + isToolExecuting, + isToolAwaitingConfirmation, + getAllToolCalls, +} from './utils/historyUtils.js'; interface AppContainerProps { config: Config; @@ -182,12 +188,6 @@ import { APPROVAL_MODE_REVEAL_DURATION_MS, } from './hooks/useVisibilityToggle.js'; import { useKeyMatchers } from './hooks/useKeyMatchers.js'; -import { - getLastTurnToolCallIds, - isToolExecuting, - isToolAwaitingConfirmation, - getAllToolCalls, -} from './utils/historyUtils.js'; /** * The fraction of the terminal width to allocate to the shell. @@ -1167,6 +1167,11 @@ Logging in with Google... Restarting Gemini CLI to continue. consumePendingHints, ); + const pendingHistoryItems = useMemo( + () => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems], + [pendingSlashCommandHistoryItems, pendingGeminiHistoryItems], + ); + toggleBackgroundShellRef.current = toggleBackgroundShell; isBackgroundShellVisibleRef.current = isBackgroundShellVisible; backgroundShellsRef.current = backgroundShells; @@ -1189,11 +1194,6 @@ Logging in with Google... Restarting Gemini CLI to continue. setIsBackgroundShellListOpenRef.current = setIsBackgroundShellListOpen; - const pendingHistoryItems = useMemo( - () => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems], - [pendingSlashCommandHistoryItems, pendingGeminiHistoryItems], - ); - const lastOutputTimeRef = useRef(0); useEffect(() => { @@ -1815,11 +1815,10 @@ Logging in with Google... Restarting Gemini CLI to continue. toggleLastTurnTools(); // Force layout refresh after a short delay to allow the terminal layout to settle. - // This prevents the "blank screen" issue by ensuring Ink re-measures after - // any async subview updates are complete. + // Minimize "blank screen" issue after any async subview updates are complete. setTimeout(() => { refreshStatic(); - }, 500); + }, 250); return true; } else if ( diff --git a/packages/cli/src/ui/components/MainContent.tsx b/packages/cli/src/ui/components/MainContent.tsx index 98b99d384f..d8656a879c 100644 --- a/packages/cli/src/ui/components/MainContent.tsx +++ b/packages/cli/src/ui/components/MainContent.tsx @@ -88,7 +88,6 @@ export const MainContent = () => { () => augmentedHistory.map( ({ item, isExpandable, isFirstThinking, isFirstAfterThinking }) => ( - // ({ item, isExpandable, isFirstThinking, /* isFirstAfterThinking */ }) => ( 0; - const anyVisibleInPending = remainingTools.some(isToolVisible); - let lastVisibleIsCompact = false; const isCompactModeEnabled = settings.merged.ui?.compactToolOutput === true; for (let i = toolCalls.length - 1; i >= 0; i--) { @@ -653,7 +650,7 @@ export const useGeminiStream = ( if ( toolCalls.length > 0 && !(allTerminal && allPushed) && - (anyVisibleInHistory || anyVisibleInPending) && + toolCalls.some(isToolVisible) && !lastVisibleIsCompact ) { items.push({