diff options
| author | Shreya Keshive <[email protected]> | 2025-07-18 18:14:46 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-18 22:14:46 +0000 |
| commit | 73745ecd0323882fc951e387250fe2efef374e81 (patch) | |
| tree | ab899051fb0d900d34a71c974410b466ff652bb8 /packages/cli/src/ui/App.tsx | |
| parent | 4915050ad47236a6d8349ed87b68cd202f96efbe (diff) | |
Display open IDE file in context section above input box rather than in the footer (#4470)
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
| -rw-r--r-- | packages/cli/src/ui/App.tsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 782e2ff8..39a1f14c 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -58,6 +58,8 @@ import { FlashFallbackEvent, logFlashFallback, AuthType, + type ActiveFile, + ideContext, } from '@google/gemini-cli-core'; import { validateAuthMethod } from '../config/auth.js'; import { useLogger } from './hooks/useLogger.js'; @@ -158,6 +160,14 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = useState<boolean>(false); const [userTier, setUserTier] = useState<UserTierId | undefined>(undefined); + const [activeFile, setActiveFile] = useState<ActiveFile | undefined>(); + + useEffect(() => { + const unsubscribe = ideContext.subscribeToActiveFile(setActiveFile); + // Set the initial value + setActiveFile(ideContext.getActiveFileContext()); + return unsubscribe; + }, []); const openPrivacyNotice = useCallback(() => { setShowPrivacyNotice(true); @@ -883,6 +893,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { </Text> ) : ( <ContextSummaryDisplay + activeFile={activeFile} geminiMdFileCount={geminiMdFileCount} contextFileNames={contextFileNames} mcpServers={config.getMcpServers()} |
