mirror of
https://github.com/mudler/LocalAI.git
synced 2026-06-21 23:29:04 -04:00
The chat input only accepted attachments via the file picker, so users who copied an image from a webpage or a screen region had to first save it to a file before attaching it (#10361). Add an onPaste handler on the input textarea that pulls image items out of the clipboard and routes them through the same staging path as the file picker. The per-file processing in handleFileChange is extracted into a shared processFiles helper so both entry points stay in sync. Clipboard images, which arrive unnamed or as a generic "image.png", are given unique typed names so multiple pastes don't collide, and the default paste is suppressed only when an image is actually attached so normal text paste is unaffected. Closes #10361 Signed-off-by: Anai-Guo <antai12232931@outlook.com>