diff options
| author | Shreya Keshive <[email protected]> | 2025-07-28 11:03:22 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-28 15:03:22 +0000 |
| commit | e2754416516edb8c27e63cee5b249f41c3e0fffc (patch) | |
| tree | e00ee188509ce7f0b4f353cf6e08d0422490fe72 /packages/cli/src/ui/App.tsx | |
| parent | f2e006179d27af34c35b58b1df3032e351e61eaf (diff) | |
Updates schema, UX and prompt for IDE context (#5046)
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
| -rw-r--r-- | packages/cli/src/ui/App.tsx | 16 |
1 files changed, 9 insertions, 7 deletions
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<boolean>(false); const [userTier, setUserTier] = useState<UserTierId | undefined>(undefined); - const [openFiles, setOpenFiles] = useState<OpenFiles | undefined>(); + const [ideContextState, setIdeContextState] = useState< + IdeContext | undefined + >(); const [isProcessing, setIsProcessing] = useState<boolean>(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) => { </Text> ) : ( <ContextSummaryDisplay - openFiles={openFiles} + ideContext={ideContextState} geminiMdFileCount={geminiMdFileCount} contextFileNames={contextFileNames} mcpServers={config.getMcpServers()} @@ -963,7 +965,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { </Box> </Box> {showIDEContextDetail && ( - <IDEContextDetailDisplay openFiles={openFiles} /> + <IDEContextDetailDisplay ideContext={ideContextState} /> )} {showErrorDetails && ( <OverflowProvider> |
