feat(app): add drag-and-drop file upload and file picker to composer (#1474)

- Desktop web: drag-and-drop non-image files onto the chat pane to upload
- Desktop web: file picker option in the composer attachment sheet
- Uploaded files are sent to the LLM as filename references in a tmp directory
- New useFilePicker hook for cross-platform file picking
- Extended useFileDropZone to support generic file drops
- Added UploadedFileAttachment type to protocol and composer attachment system
- Fixed adaptive modal sheet closing on backdrop press in selection mode
This commit is contained in:
Mohamed Boudra
2026-06-12 21:56:51 +08:00
committed by GitHub
parent 9c43e0222a
commit 736b2da1a2
18 changed files with 563 additions and 16 deletions
+5
View File
@@ -99,12 +99,15 @@ export const ar: TranslationResources = {
},
attachments: {
addImage: "أضف صورة",
addFile: "Upload file",
addIssueOrPr: "أضف مشكلة أو PR",
dropImagesHere: "إسقاط الصور هنا",
dropFilesHere: "Drop files here",
editQueuedMessage: "تحرير الرسالة في قائمة الانتظار",
sendQueuedMessageNow: "إرسال رسالة في قائمة الانتظار الآن",
openImage: "فتح مرفق الصورة",
removeImage: "إزالة مرفق الصورة",
removeFile: "Remove file attachment",
openGithub: "افتح{{kind}}#{{number}}",
removeGithub: "إزالة{{kind}}#{{number}}",
browserElement: "العنصر ·{{tag}}",
@@ -119,6 +122,8 @@ export const ar: TranslationResources = {
noHostSelected: "لم يتم تحديد مضيف",
initialPromptRequired: "مطلوب موجه الأولي",
alreadyLoading: "جارٍ التحميل بالفعل",
uploadFailed: "Failed to upload file",
fileTooLarge: "{{fileName}} is too large (max {{size}})",
},
clientCommands: {
archiveAgent: "أرشفة الوكيل الحالي",
+5
View File
@@ -97,12 +97,15 @@ export const en = {
},
attachments: {
addImage: "Add image",
addFile: "Upload file",
addIssueOrPr: "Add issue or PR",
dropImagesHere: "Drop images here",
dropFilesHere: "Drop files here",
editQueuedMessage: "Edit queued message",
sendQueuedMessageNow: "Send queued message now",
openImage: "Open image attachment",
removeImage: "Remove image attachment",
removeFile: "Remove file attachment",
openGithub: "Open {{kind}} #{{number}}",
removeGithub: "Remove {{kind}} #{{number}}",
browserElement: "Element · {{tag}}",
@@ -117,6 +120,8 @@ export const en = {
noHostSelected: "No host selected",
initialPromptRequired: "Initial prompt is required",
alreadyLoading: "Already loading",
uploadFailed: "Failed to upload file",
fileTooLarge: "{{fileName}} is too large (max {{size}})",
},
clientCommands: {
archiveAgent: "Archive the current agent",
+5
View File
@@ -99,12 +99,15 @@ export const es: TranslationResources = {
},
attachments: {
addImage: "Agregar imagen",
addFile: "Upload file",
addIssueOrPr: "Agregar problema oPR",
dropImagesHere: "Suelta imágenes aquí",
dropFilesHere: "Drop files here",
editQueuedMessage: "Editar mensaje en cola",
sendQueuedMessageNow: "Enviar mensaje en cola ahora",
openImage: "Abrir imagen adjunta",
removeImage: "Quitar imagen adjunta",
removeFile: "Remove file attachment",
openGithub: "Abrir{{kind}}#{{number}}",
removeGithub: "Quitar{{kind}}#{{number}}",
browserElement: "Elemento ·{{tag}}",
@@ -119,6 +122,8 @@ export const es: TranslationResources = {
noHostSelected: "Ningún anfitrión seleccionado",
initialPromptRequired: "Se requiere aviso inicial",
alreadyLoading: "Ya cargando",
uploadFailed: "Failed to upload file",
fileTooLarge: "{{fileName}} is too large (max {{size}})",
},
clientCommands: {
archiveAgent: "Archivar el agente actual",
+5
View File
@@ -100,12 +100,15 @@ export const fr: TranslationResources = {
},
attachments: {
addImage: "Ajouter une image",
addFile: "Upload file",
addIssueOrPr: "Ajouter un problème ouPR",
dropImagesHere: "Déposez des images ici",
dropFilesHere: "Drop files here",
editQueuedMessage: "Modifier le message en file d'attente",
sendQueuedMessageNow: "Envoyer le message en file d'attente maintenant",
openImage: "Ouvrir la pièce jointe de l'image",
removeImage: "Supprimer l'image jointe",
removeFile: "Remove file attachment",
openGithub: "Ouvrir{{kind}}#{{number}}",
removeGithub: "Supprimer{{kind}}#{{number}}",
browserElement: "Élément ·{{tag}}",
@@ -120,6 +123,8 @@ export const fr: TranslationResources = {
noHostSelected: "Aucun hôte sélectionné",
initialPromptRequired: "Une invite initiale est requise",
alreadyLoading: "Déjà en cours de chargement",
uploadFailed: "Failed to upload file",
fileTooLarge: "{{fileName}} is too large (max {{size}})",
},
clientCommands: {
archiveAgent: "Archiver l'agent actuel",
+5
View File
@@ -99,12 +99,15 @@ export const ru: TranslationResources = {
},
attachments: {
addImage: "Добавить изображение",
addFile: "Upload file",
addIssueOrPr: "Добавить проблему или PR",
dropImagesHere: "Скиньте изображения сюда",
dropFilesHere: "Drop files here",
editQueuedMessage: "Изменить сообщение в очереди",
sendQueuedMessageNow: "Отправить сообщение в очереди сейчас",
openImage: "Открыть прикрепленное изображение",
removeImage: "Удалить прикрепленное изображение",
removeFile: "Remove file attachment",
openGithub: "Открыть{{kind}}#{{number}}",
removeGithub: "Удалить{{kind}}#{{number}}",
browserElement: "Элемент ·{{tag}}",
@@ -119,6 +122,8 @@ export const ru: TranslationResources = {
noHostSelected: "Хост не выбран",
initialPromptRequired: "Требуется начальное приглашение",
alreadyLoading: "Уже загружается",
uploadFailed: "Failed to upload file",
fileTooLarge: "{{fileName}} is too large (max {{size}})",
},
clientCommands: {
archiveAgent: "Архивировать текущего агента",
+5
View File
@@ -99,12 +99,15 @@ export const zhCN: TranslationResources = {
},
attachments: {
addImage: "添加图片",
addFile: "Upload file",
addIssueOrPr: "添加 issue 或 PR",
dropImagesHere: "将图片拖放到这里",
dropFilesHere: "Drop files here",
editQueuedMessage: "编辑排队消息",
sendQueuedMessageNow: "立即发送排队消息",
openImage: "打开图片附件",
removeImage: "移除图片附件",
removeFile: "Remove file attachment",
openGithub: "打开 {{kind}} #{{number}}",
removeGithub: "移除 {{kind}} #{{number}}",
browserElement: "元素 · {{tag}}",
@@ -119,6 +122,8 @@ export const zhCN: TranslationResources = {
noHostSelected: "未选择 Host",
initialPromptRequired: "初始 prompt 必填",
alreadyLoading: "正在加载",
uploadFailed: "Failed to upload file",
fileTooLarge: "{{fileName}} is too large (max {{size}})",
},
clientCommands: {
archiveAgent: "归档当前 Agent",