diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx index f06a9658225f..7525a3274f9b 100644 --- a/apps/web/src/components/chat/ChatComposer.tsx +++ b/apps/web/src/components/chat/ChatComposer.tsx @@ -227,6 +227,7 @@ import { toastManager } from "../ui/toast"; import { BotIcon, CircleAlertIcon, + PaperclipIcon, PencilRulerIcon, type LucideIcon, LockIcon, @@ -1030,6 +1031,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) * next draft. */ const pendingImageCompressionsRef = useRef>(new Map()); + const imageFileInputRef = useRef(null); // ------------------------------------------------------------------ // Derived: composer send state @@ -3301,6 +3303,40 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) )} >
+ { + const files = Array.from(event.currentTarget.files ?? []); + // Clear the input so choosing the same image again still + // emits a change event after it has been removed. + event.currentTarget.value = ""; + if (files.length === 0) return; + void addComposerImages(files); + focusComposer(); + }} + /> + 0 + } + onClick={() => imageFileInputRef.current?.click()} + > + + Attach + + {noProviderAvailable ? (