summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/ContextSummaryDisplay.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/components/ContextSummaryDisplay.tsx')
-rw-r--r--packages/cli/src/ui/components/ContextSummaryDisplay.tsx16
1 files changed, 10 insertions, 6 deletions
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