From 19c854c876fd47ec41a8456fa4d359bb96ab32c9 Mon Sep 17 00:00:00 2001 From: Dragon Date: Fri, 3 Oct 2025 04:11:01 -0700 Subject: [PATCH] Adds support for image pasting from clipboard, and multiple file attachments. --- src/renderer/src/components/footer/footer.tsx | 21 ++++++++- src/renderer/src/hooks/footer/use-footer.ts | 6 +++ .../src/hooks/footer/use-text-input.tsx | 47 +++++++++++++++++-- .../src/hooks/utils/use-media-capture.tsx | 4 +- 4 files changed, 71 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/footer/footer.tsx b/src/renderer/src/components/footer/footer.tsx index 7c058614..0dc75277 100644 --- a/src/renderer/src/components/footer/footer.tsx +++ b/src/renderer/src/components/footer/footer.tsx @@ -35,6 +35,9 @@ interface MessageInputProps { onKeyDown: (e: React.KeyboardEvent) => void onCompositionStart: () => void onCompositionEnd: () => void + onPaste: (e: React.ClipboardEvent) => void + attachmentsCount: number + onClearAttachments: () => void } // Reusable components @@ -81,6 +84,9 @@ const MessageInput = memo(({ onKeyDown, onCompositionStart, onCompositionEnd, + onPaste, + attachmentsCount, + onClearAttachments, }: MessageInputProps) => { const { t } = useTranslation(); @@ -88,21 +94,26 @@ const MessageInput = memo(({ + {attachmentsCount > 0 && (<> + {attachmentsCount} + )}