summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/App.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
-rw-r--r--packages/cli/src/ui/App.tsx11
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()}