From 99a6dc026708d91bb628873a769c615640a2c0ea Mon Sep 17 00:00:00 2001
From: Billy Biggs <bbiggs@google.com>
Date: Sat, 21 Jun 2025 12:15:43 -0700
Subject: Update memory and context summary UI for multiple context filenames
 (#1282)

---
 packages/cli/src/ui/components/ContextSummaryDisplay.tsx | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

(limited to 'packages/cli/src/ui/components/ContextSummaryDisplay.tsx')

diff --git a/packages/cli/src/ui/components/ContextSummaryDisplay.tsx b/packages/cli/src/ui/components/ContextSummaryDisplay.tsx
index b277d0fc..548d1325 100644
--- a/packages/cli/src/ui/components/ContextSummaryDisplay.tsx
+++ b/packages/cli/src/ui/components/ContextSummaryDisplay.tsx
@@ -28,12 +28,16 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
     return <Text> </Text>; // Render an empty space to reserve height
   }
 
-  const geminiMdText =
-    geminiMdFileCount > 0
-      ? `${geminiMdFileCount} ${contextFileNames[0]} file${
-          geminiMdFileCount > 1 ? 's' : ''
-        }`
-      : '';
+  const geminiMdText = (() => {
+    if (geminiMdFileCount === 0) {
+      return '';
+    }
+    const allNamesTheSame = new Set(contextFileNames).size < 2;
+    const name = allNamesTheSame ? contextFileNames[0] : 'context';
+    return `${geminiMdFileCount} ${name} file${
+      geminiMdFileCount > 1 ? 's' : ''
+    }`;
+  })();
 
   const mcpText =
     mcpServerCount > 0
-- 
cgit v1.2.3

