feat(attachments): support local files and video attachments (#6321)

* feat(attachments): support local files and video attachments

Share gateway inspection and send validation for borrowed local paths while preserving binary uploads, original-file ownership, and existing limits.

Related to NAN-284. Native provider video input remains outside this change.

* test: make cross-platform verification fixtures self-contained

* test(webui): align typed fixtures with runtime contracts

* fix(webui): preserve uploaded video playback during history sync

* test(tui): preserve local attachment drafts across resizes

* perf(attachments): preserve upload caches and release video previews

* docs(webui): keep attachment guidance user-focused

* chore: remove redundant dependency comment

* test(providers): make stream idle renewal timing deterministic

* fix(attachments): keep upload byte limits out of local references

Validate common format/count rules separately from upload byte budgets. Keep local inspection and send-time checks metadata-only, and exclude local references from composer and pending-upload totals. Explain upload size rejections with actual size and maximum in all ten locales. Related to NAN-284.

* fix(attachments): retain image references and draft order

* fix(attachments): close local reference UX and authorization gaps

* fix(attachments): preserve focus during asynchronous path confirmation
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-22 18:32:18 +08:00
1 parent 7dfeff9ddf
commit 254f94b068
65 files changed
+1816 -292

No files matched your search

+2 -1
View File
@@ -2307,10 +2307,11 @@
"unsupported_type": "Unsupported file type",
"empty_file": "Empty files cannot be attached",
"too_many_attachments": "Max {{max}} attachments per message",
"too_many_videos": "Max 1 video per message",
"too_many_images": "Max {{max}} images per message",
"magic_mismatch": "File doesn't look like a real image",
"decode_failed": "Couldn't decode this image",
"too_large": "File is too large — try a smaller one",
"too_large": "File is too large to upload ({{size}}; maximum {{max}})",
"total_too_large": "Attachments are too large together — remove some or use smaller files",
"io": "Couldn't read this file"
},
+2 -1
View File
@@ -2087,10 +2087,11 @@
"unsupported_type": "Tipo de archivo no compatible",
"empty_file": "No se pueden adjuntar archivos vacíos",
"too_many_attachments": "Máximo {{max}} adjuntos por mensaje",
"too_many_videos": "Máximo 1 vídeo por mensaje",
"too_many_images": "Máximo {{max}} imágenes por mensaje",
"magic_mismatch": "El archivo no parece una imagen real",
"decode_failed": "No se pudo decodificar esta imagen",
"too_large": "Archivo demasiado grande — prueba uno más pequeño",
"too_large": "El archivo ({{size}}) supera el límite de carga de {{max}}",
"total_too_large": "Los archivos adjuntos son demasiado grandes en conjunto; elimina algunos o usa archivos más pequeños",
"io": "No se pudo leer este archivo"
},
+2 -1
View File
@@ -2086,10 +2086,11 @@
"unsupported_type": "Type de fichier non pris en charge",
"empty_file": "Impossible de joindre des fichiers vides",
"too_many_attachments": "Maximum {{max}} pièces jointes par message",
"too_many_videos": "Une seule vidéo par message",
"too_many_images": "Maximum {{max}} images par message",
"magic_mismatch": "Ce fichier n'est pas une image",
"decode_failed": "Impossible de décoder cette image",
"too_large": "Fichier trop volumineux — essayez-en un plus petit",
"too_large": "Le fichier ({{size}}) dépasse la limite d’envoi de {{max}}",
"total_too_large": "Les pièces jointes sont trop volumineuses ensemble — supprimez-en ou utilisez des fichiers plus petits",
"io": "Impossible de lire ce fichier"
},
+2 -1
View File
@@ -2086,10 +2086,11 @@
"unsupported_type": "Tipe file tidak didukung",
"empty_file": "File kosong tidak dapat dilampirkan",
"too_many_attachments": "Maksimal {{max}} lampiran per pesan",
"too_many_videos": "Maksimal 1 video per pesan",
"too_many_images": "Maksimal {{max}} gambar per pesan",
"magic_mismatch": "File ini tampaknya bukan gambar asli",
"decode_failed": "Tidak dapat mendekode gambar ini",
"too_large": "File terlalu besar — coba yang lebih kecil",
"too_large": "Ukuran file {{size}} melebihi batas unggahan {{max}}",
"total_too_large": "Total lampiran terlalu besar — hapus beberapa atau gunakan file yang lebih kecil",
"io": "Tidak dapat membaca file ini"
},
+2 -1
View File
@@ -2086,10 +2086,11 @@
"unsupported_type": "対応していないファイル形式です",
"empty_file": "空のファイルは添付できません",
"too_many_attachments": "1 メッセージにつき最大 {{max}} 件までです",
"too_many_videos": "1 メッセージにつき動画は 1 件までです",
"too_many_images": "1 メッセージにつき最大 {{max}} 枚です",
"magic_mismatch": "画像ファイルではないようです",
"decode_failed": "この画像をデコードできません",
"too_large": "ファイルが大きすぎます。小さいものを選んでください",
"too_large": "ファイルサイズ {{size}} はアップロード上限 {{max}} を超えています",
"total_too_large": "添付ファイルの合計サイズが大きすぎます。いくつか削除するか、より小さいファイルを使用してください",
"io": "このファイルを読み込めません"
},
+2 -1
View File
@@ -2086,10 +2086,11 @@
"unsupported_type": "지원하지 않는 파일 형식입니다",
"empty_file": "빈 파일은 첨부할 수 없습니다",
"too_many_attachments": "메시지당 최대 {{max}}개까지 가능합니다",
"too_many_videos": "메시지당 동영상은 최대 1개까지 가능합니다",
"too_many_images": "메시지당 최대 {{max}}장까지 가능합니다",
"magic_mismatch": "이미지 파일이 아닌 것 같습니다",
"decode_failed": "이 이미지를 디코딩할 수 없습니다",
"too_large": "파일이 너무 큽니다. 더 작은 파일을 선택해 주세요",
"too_large": "파일 크기 {{size}}가 업로드 한도 {{max}}를 초과합니다",
"total_too_large": "첨부 파일의 전체 크기가 너무 큽니다. 일부를 제거하거나 더 작은 파일을 사용해 주세요",
"io": "이 파일을 읽을 수 없습니다"
},
+2 -1
View File
@@ -2115,10 +2115,11 @@
"unsupported_type": "Tipo de arquivo não compatível",
"empty_file": "Arquivos vazios não podem ser anexados",
"too_many_attachments": "Máx. de {{max}} anexos por mensagem",
"too_many_videos": "Máx. de 1 vídeo por mensagem",
"too_many_images": "Máx. de {{max}} imagens por mensagem",
"magic_mismatch": "O arquivo não parece uma imagem real",
"decode_failed": "Não foi possível decodificar esta imagem",
"too_large": "A imagem é grande demais — tente uma menor",
"too_large": "O arquivo ({{size}}) excede o limite de upload de {{max}}",
"total_too_large": "Os anexos são grandes demais em conjunto — remova alguns ou use arquivos menores",
"io": "Não foi possível ler este arquivo"
},
+2 -1
View File
@@ -2086,10 +2086,11 @@
"unsupported_type": "Loại tệp không được hỗ trợ",
"empty_file": "Không thể đính kèm tệp trống",
"too_many_attachments": "Tối đa {{max}} tệp đính kèm mỗi tin nhắn",
"too_many_videos": "Tối đa 1 video mỗi tin nhắn",
"too_many_images": "Tối đa {{max}} ảnh mỗi tin nhắn",
"magic_mismatch": "Tệp này không phải là một ảnh thực",
"decode_failed": "Không thể giải mã ảnh này",
"too_large": "Tệp quá lớn — hãy thử tệp nhỏ hơn",
"too_large": "Tệp có dung lượng {{size}}, vượt giới hạn tải lên {{max}}",
"total_too_large": "Tổng dung lượng tệp đính kèm quá lớn — hãy xóa bớt hoặc dùng tệp nhỏ hơn",
"io": "Không thể đọc tệp này"
},
+2 -1
View File
@@ -2306,10 +2306,11 @@
"unsupported_type": "不支持的文件类型",
"empty_file": "不能附加空文件",
"too_many_attachments": "每条消息最多 {{max}} 个附件",
"too_many_videos": "每条消息最多 1 个视频",
"too_many_images": "每条消息最多 {{max}} 张图片",
"magic_mismatch": "文件看起来不像真实的图片",
"decode_failed": "无法解码这张图片",
"too_large": "文件太大,请换一个小一点的",
"too_large": "文件为 {{size}},超过上传上限 {{max}}",
"total_too_large": "附件总大小过大,请移除部分文件或使用更小的文件",
"io": "无法读取该文件"
},
+2 -1
View File
@@ -2086,10 +2086,11 @@
"unsupported_type": "不支援的檔案類型",
"empty_file": "無法附加空白檔案",
"too_many_attachments": "每則訊息最多 {{max}} 個附件",
"too_many_videos": "每則訊息最多 1 部影片",
"too_many_images": "每則訊息最多 {{max}} 張圖片",
"magic_mismatch": "檔案內容似乎不是有效的圖片",
"decode_failed": "無法解碼這張圖片",
"too_large": "檔案太大,請改用較小的檔案",
"too_large": "檔案為 {{size}},超過上傳上限 {{max}}",
"total_too_large": "附件總大小過大,請移除部分檔案或改用較小的檔案",
"io": "無法讀取這個檔案"
},