From 9683f90f7e373eab75a30a14af626b30ad51ba48 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 20 Jan 2026 17:55:34 +0000 Subject: [PATCH] fix(ui): insert full paths for @file mentions --- packages/ui/src/components/prompt-input.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/prompt-input.tsx b/packages/ui/src/components/prompt-input.tsx index 331f064e..ab4bb636 100644 --- a/packages/ui/src/components/prompt-input.tsx +++ b/packages/ui/src/components/prompt-input.tsx @@ -844,7 +844,10 @@ export default function PromptInput(props: PromptInputProps) { const currentPrompt = prompt() const pos = atPosition() const cursorPos = textareaRef?.selectionStart || 0 - const folderMention = relativePath === "." || relativePath === "" ? "/" : displayPath + const folderMention = + relativePath === "." || relativePath === "" + ? "/" + : relativePath.replace(/\/+$/, "") + "/" if (pos !== null) { const before = currentPrompt.substring(0, pos + 1) @@ -888,7 +891,7 @@ export default function PromptInput(props: PromptInputProps) { if (pos !== null) { const before = currentPrompt.substring(0, pos) const after = currentPrompt.substring(cursorPos) - const attachmentText = `@${filename}` + const attachmentText = `@${normalizedPath}` const newPrompt = before + attachmentText + " " + after setPrompt(newPrompt)