From 2a1ad1f5d961b9f9593a6016eea7dd398bdeed0b Mon Sep 17 00:00:00 2001
From: Billy Biggs <vektor@gmail.com>
Date: Fri, 13 Jun 2025 09:19:08 -0700
Subject: Update contextFileName to support an optional list of strings (#1001)

---
 packages/cli/src/ui/App.tsx | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 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 2d37c42a..c7ed9a81 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -45,7 +45,7 @@ import process from 'node:process';
 import {
   getErrorMessage,
   type Config,
-  getCurrentGeminiMdFilename,
+  getAllGeminiMdFilenames,
   ApprovalMode,
   isEditorAvailable,
   EditorType,
@@ -373,6 +373,14 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
 
   const branchName = useGitBranchName(config.getTargetDir());
 
+  const contextFileNames = useMemo(() => {
+    const fromSettings = settings.merged.contextFileName;
+    if (fromSettings) {
+      return Array.isArray(fromSettings) ? fromSettings : [fromSettings];
+    }
+    return getAllGeminiMdFilenames();
+  }, [settings.merged.contextFileName]);
+
   if (quittingMessages) {
     return (
       <Box flexDirection="column" marginBottom={1}>
@@ -509,10 +517,7 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
                   ) : (
                     <ContextSummaryDisplay
                       geminiMdFileCount={geminiMdFileCount}
-                      contextFileName={
-                        settings.merged.contextFileName ||
-                        getCurrentGeminiMdFilename()
-                      }
+                      contextFileNames={contextFileNames}
                       mcpServers={config.getMcpServers()}
                       showToolDescriptions={showToolDescriptions}
                     />
-- 
cgit v1.2.3

