Display open IDE file in context section above input box rather than in the footer (#4470)

This commit is contained in:
Shreya Keshive
2025-07-18 18:14:46 -04:00
committed by GitHub
parent 4915050ad4
commit 73745ecd03
4 changed files with 121 additions and 66 deletions

View File

@@ -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()}