From 1d3ad9d0758a94e42fa88d20618d164fe1140f11 Mon Sep 17 00:00:00 2001
From: christine betts <chrstn@uw.edu>
Date: Fri, 25 Jul 2025 14:50:34 +0000
Subject: Add drawer for active files in IDE mode (#4682)

Co-authored-by: Shreya <shreyakeshive@google.com>
---
 .../src/ui/components/ContextSummaryDisplay.tsx    | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 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 626a2fa5..b166056a 100644
--- a/packages/cli/src/ui/components/ContextSummaryDisplay.tsx
+++ b/packages/cli/src/ui/components/ContextSummaryDisplay.tsx
@@ -8,7 +8,6 @@ import React from 'react';
 import { Text } from 'ink';
 import { Colors } from '../colors.js';
 import { type OpenFiles, type MCPServerConfig } from '@google/gemini-cli-core';
-import path from 'path';
 
 interface ContextSummaryDisplayProps {
   geminiMdFileCount: number;
@@ -34,16 +33,17 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
     geminiMdFileCount === 0 &&
     mcpServerCount === 0 &&
     blockedMcpServerCount === 0 &&
-    !openFiles?.activeFile
+    (openFiles?.recentOpenFiles?.length ?? 0) === 0
   ) {
     return <Text> </Text>; // Render an empty space to reserve height
   }
 
-  const activeFileText = (() => {
-    if (!openFiles?.activeFile) {
+  const recentFilesText = (() => {
+    const count = openFiles?.recentOpenFiles?.length ?? 0;
+    if (count === 0) {
       return '';
     }
-    return `Open File (${path.basename(openFiles.activeFile)})`;
+    return `${count} recent file${count > 1 ? 's' : ''} (ctrl+e to view)`;
   })();
 
   const geminiMdText = (() => {
@@ -51,8 +51,8 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
       return '';
     }
     const allNamesTheSame = new Set(contextFileNames).size < 2;
-    const name = allNamesTheSame ? contextFileNames[0] : 'Context';
-    return `${geminiMdFileCount} ${name} File${
+    const name = allNamesTheSame ? contextFileNames[0] : 'context';
+    return `${geminiMdFileCount} ${name} file${
       geminiMdFileCount > 1 ? 's' : ''
     }`;
   })();
@@ -65,14 +65,14 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
     const parts = [];
     if (mcpServerCount > 0) {
       parts.push(
-        `${mcpServerCount} MCP Server${mcpServerCount > 1 ? 's' : ''}`,
+        `${mcpServerCount} MCP server${mcpServerCount > 1 ? 's' : ''}`,
       );
     }
 
     if (blockedMcpServerCount > 0) {
       let blockedText = `${blockedMcpServerCount} Blocked`;
       if (mcpServerCount === 0) {
-        blockedText += ` MCP Server${blockedMcpServerCount > 1 ? 's' : ''}`;
+        blockedText += ` MCP server${blockedMcpServerCount > 1 ? 's' : ''}`;
       }
       parts.push(blockedText);
     }
@@ -81,8 +81,8 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
 
   let summaryText = 'Using: ';
   const summaryParts = [];
-  if (activeFileText) {
-    summaryParts.push(activeFileText);
+  if (recentFilesText) {
+    summaryParts.push(recentFilesText);
   }
   if (geminiMdText) {
     summaryParts.push(geminiMdText);
-- 
cgit v1.2.3

