From 6d67e7c39a6107e53a62082cd9c8429ac0e2a9cf Mon Sep 17 00:00:00 2001 From: Zaki Ali Date: Tue, 25 Mar 2025 11:11:27 -0700 Subject: [PATCH] fix: append the attachment path to the existing text in the input prompt (#1842) --- ui/desktop/src/components/Input.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/desktop/src/components/Input.tsx b/ui/desktop/src/components/Input.tsx index 205fe341..bce25323 100644 --- a/ui/desktop/src/components/Input.tsx +++ b/ui/desktop/src/components/Input.tsx @@ -144,7 +144,11 @@ export default function Input({ const handleFileSelect = async () => { const path = await window.electron.selectFileOrDirectory(); if (path) { - setValue(path); + // Append the path to existing text, with a space if there's existing text + setValue((prev) => { + const currentText = prev.trim(); + return currentText ? `${currentText} ${path}` : path; + }); textAreaRef.current?.focus(); } };