diff options
| author | christine betts <[email protected]> | 2025-07-25 14:50:34 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-25 14:50:34 +0000 |
| commit | 1d3ad9d0758a94e42fa88d20618d164fe1140f11 (patch) | |
| tree | f79f668858cb32e62a7ff96e3d1993ab341a3b3c /packages/cli/src/ui/components/ContextSummaryDisplay.tsx | |
| parent | 5d4b02ca85e2e6427b68f27a01659a9f0db66d74 (diff) | |
Add drawer for active files in IDE mode (#4682)
Co-authored-by: Shreya <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/components/ContextSummaryDisplay.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/ContextSummaryDisplay.tsx | 22 |
1 files changed, 11 insertions, 11 deletions
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); |
