Skip to content

Commit 09c791f

Browse files
fix: show full file path in edit tool view (#1599)
Co-authored-by: reverb256 <reverb256@users.noreply.github.com> Co-authored-by: JonathanLab <jonathanmieloo@gmail.com>
1 parent df71fa9 commit 09c791f

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

apps/code/src/renderer/features/sessions/components/session-update/FileMentionChip.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,33 @@ export const FileMentionChip = memo(function FileMentionChip({
7676

7777
const isClickable = !!taskId;
7878

79+
const relativePath = toRelativePath(filePath, repoPath ?? null);
80+
const directory =
81+
relativePath && relativePath !== filename
82+
? relativePath.replace(`/${filename}`, "")
83+
: null;
84+
7985
return (
8086
<Flex
8187
align="center"
8288
gap="1"
8389
asChild
8490
onClick={isClickable ? handleClick : undefined}
8591
onContextMenu={handleContextMenu}
86-
className={isClickable ? "cursor-pointer hover:underline" : ""}
92+
className={`relative top-[1px] inline-flex min-w-0 max-w-full ${isClickable ? "cursor-pointer hover:underline" : ""}`}
8793
>
8894
<Text size="1">
8995
<FileIcon filename={filename} size={12} />
90-
<span className="font-mono">{filename}</span>
96+
<span className="flex min-w-0 flex-1 items-baseline gap-1 overflow-hidden font-mono text-[13px] leading-none">
97+
<span className="flex-shrink-0 whitespace-nowrap font-semibold">
98+
{filename}
99+
</span>
100+
{directory && (
101+
<span className="min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-gray-9">
102+
{directory}
103+
</span>
104+
)}
105+
</span>
91106
</Text>
92107
</Flex>
93108
);

0 commit comments

Comments
 (0)