From f58267dd30b495711ebdd7c119bc2ffc8f0eba54 Mon Sep 17 00:00:00 2001 From: VooDisss Date: Mon, 16 Feb 2026 01:23:24 +0200 Subject: [PATCH] fix(ui): always strip @ for SHIFT+ENTER paths regardless of file attachment --- packages/ui/src/lib/prompt-placeholders.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/ui/src/lib/prompt-placeholders.ts b/packages/ui/src/lib/prompt-placeholders.ts index ace86bac..3e07f574 100644 --- a/packages/ui/src/lib/prompt-placeholders.ts +++ b/packages/ui/src/lib/prompt-placeholders.ts @@ -22,18 +22,13 @@ export function resolvePastedPlaceholders(prompt: string, attachments: Attachmen let result = prompt - // For each path attachment, find and replace @path with path in the prompt - // This is more precise than regex and won't affect regular @mentions + // For each path attachment (SHIFT+ENTER), find and replace @path with path in the prompt + // We ALWAYS strip @ for SHIFT+ENTER paths, even if there's also a file attachment for (const path of pathAttachments) { // Try both with and without trailing slash const variants = [path, path + "/"] for (const variant of variants) { - // Skip if this path is also a file attachment (should keep @) - if (fileAttachments.has(variant) || fileAttachments.has(variant.replace(/\/$/, ""))) { - continue - } - // Replace @path with path (exact match) const searchPattern = "@" + variant result = result.split(searchPattern).join(variant)