From e2754416516edb8c27e63cee5b249f41c3e0fffc Mon Sep 17 00:00:00 2001 From: Shreya Keshive Date: Mon, 28 Jul 2025 11:03:22 -0400 Subject: Updates schema, UX and prompt for IDE context (#5046) --- packages/cli/src/ui/App.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'packages/cli/src/ui/App.tsx') diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 87a78ac6..aacf45d7 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -60,7 +60,7 @@ import { FlashFallbackEvent, logFlashFallback, AuthType, - type OpenFiles, + type IdeContext, ideContext, } from '@google/gemini-cli-core'; import { validateAuthMethod } from '../config/auth.js'; @@ -169,13 +169,15 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = useState(false); const [userTier, setUserTier] = useState(undefined); - const [openFiles, setOpenFiles] = useState(); + const [ideContextState, setIdeContextState] = useState< + IdeContext | undefined + >(); const [isProcessing, setIsProcessing] = useState(false); useEffect(() => { - const unsubscribe = ideContext.subscribeToOpenFiles(setOpenFiles); + const unsubscribe = ideContext.subscribeToIdeContext(setIdeContextState); // Set the initial value - setOpenFiles(ideContext.getOpenFilesContext()); + setIdeContextState(ideContext.getIdeContext()); return unsubscribe; }, []); @@ -568,7 +570,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { if (Object.keys(mcpServers || {}).length > 0) { handleSlashCommand(newValue ? '/mcp desc' : '/mcp nodesc'); } - } else if (key.ctrl && input === 'e' && ideContext) { + } else if (key.ctrl && input === 'e' && ideContextState) { setShowIDEContextDetail((prev) => !prev); } else if (key.ctrl && (input === 'c' || input === 'C')) { handleExit(ctrlCPressedOnce, setCtrlCPressedOnce, ctrlCTimerRef); @@ -943,7 +945,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { ) : ( { {showIDEContextDetail && ( - + )} {showErrorDetails && ( -- cgit v1.2.3