From 4d4eacfc40f87ecc991aaecc12c046d49654425c Mon Sep 17 00:00:00 2001 From: Shreya Keshive Date: Thu, 7 Aug 2025 17:19:31 -0400 Subject: Few IDE integration polishes (#5727) --- .../src/ui/components/IDEContextDetailDisplay.tsx | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'packages/cli/src/ui/components/IDEContextDetailDisplay.tsx') diff --git a/packages/cli/src/ui/components/IDEContextDetailDisplay.tsx b/packages/cli/src/ui/components/IDEContextDetailDisplay.tsx index a1739227..ec3c2dad 100644 --- a/packages/cli/src/ui/components/IDEContextDetailDisplay.tsx +++ b/packages/cli/src/ui/components/IDEContextDetailDisplay.tsx @@ -23,6 +23,12 @@ export function IDEContextDetailDisplay({ return null; } + const basenameCounts = new Map(); + for (const file of openFiles) { + const basename = path.basename(file.path); + basenameCounts.set(basename, (basenameCounts.get(basename) || 0) + 1); + } + return ( 0 && ( Open files: - {openFiles.map((file: File) => ( - - - {path.basename(file.path)} - {file.isActive ? ' (active)' : ''} - - ))} + {openFiles.map((file: File) => { + const basename = path.basename(file.path); + const isDuplicate = (basenameCounts.get(basename) || 0) > 1; + const parentDir = path.basename(path.dirname(file.path)); + const displayName = isDuplicate + ? `${basename} (/${parentDir})` + : basename; + + return ( + + - {displayName} + {file.isActive ? ' (active)' : ''} + + ); + })} )} -- cgit v1.2.3