[PR #15535] app/ui: allow pasting images and files from the clipboard in chat #41066

Open
opened 2026-04-23 01:48:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15535
Author: @BarbatosUC
Created: 4/13/2026
Status: 🔄 Open

Base: mainHead: feat/ui-clipboard-support


📝 Commits (1)

  • a960b07 app/ui: allow pasting images and files from the clipboard in chat

📊 Changes

1 file changed (+91 additions, -69 deletions)

View changed files

📝 app/ui/app/src/components/ChatForm.tsx (+91 -69)

📄 Description

app/ui: add clipboard support for chat attachments

Description

This PR enables users to paste images and files directly from the clipboard into the chat interface.

Key Changes

  • Added onPaste handler: Implemented directly in the chat textarea for better control.
  • Improved validation: Integrated with the existing processFiles utility to ensure file integrity.
  • Edge case handling:
    • Prevents duplicated attachments by using e.stopPropagation().
    • Respects model vision capabilities by checking multimodal support before attaching.

Testing Performed

  • Screenshots: Verified pasting single and multiple images from Windows (Capture tool).
  • File Explorer: Verified pasting files directly from the Windows directory.
  • Vision Warning: Confirmed that "no vision" warnings appear for non-multimodal models.
  • Regression: Verified that standard text pasting still works as expected without interference.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15535 **Author:** [@BarbatosUC](https://github.com/BarbatosUC) **Created:** 4/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/ui-clipboard-support` --- ### 📝 Commits (1) - [`a960b07`](https://github.com/ollama/ollama/commit/a960b073a2ce058e592fe904c843ee8077d3b4ce) app/ui: allow pasting images and files from the clipboard in chat ### 📊 Changes **1 file changed** (+91 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/ChatForm.tsx` (+91 -69) </details> ### 📄 Description # app/ui: add clipboard support for chat attachments ## Description This PR enables users to paste images and files directly from the clipboard into the chat interface. ## Key Changes - **Added `onPaste` handler**: Implemented directly in the chat textarea for better control. - **Improved validation**: Integrated with the existing `processFiles` utility to ensure file integrity. - **Edge case handling**: - Prevents duplicated attachments by using `e.stopPropagation()`. - Respects model vision capabilities by checking multimodal support before attaching. ## Testing Performed - [x] **Screenshots**: Verified pasting single and multiple images from Windows (Capture tool). - [x] **File Explorer**: Verified pasting files directly from the Windows directory. - [x] **Vision Warning**: Confirmed that "no vision" warnings appear for non-multimodal models. - [x] **Regression**: Verified that standard text pasting still works as expected without interference. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:48:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#41066