Skip to content

Commit eca5e68

Browse files
authored
feat(app): disallow duplicate attachments (#39464)
1 parent 5b11635 commit eca5e68

21 files changed

Lines changed: 124 additions & 3 deletions

File tree

packages/app/src/components/prompt-input-v2.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ export function usePromptInputV2Controller(props: PromptInputV2ControllerProps):
368368
title: language.t("prompt.toast.pasteUnsupported.title"),
369369
description: language.t("prompt.toast.pasteUnsupported.description"),
370370
}),
371+
duplicate: () => showToast({ title: language.t("prompt.toast.attachmentDuplicate.title") }),
371372
onError: (error) =>
372373
showToast({
373374
variant: "error",

packages/app/src/i18n/ar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export const dict = {
277277
"prompt.action.send": "إرسال",
278278
"prompt.action.stop": "توقف",
279279
"prompt.toast.pasteUnsupported.title": "مرفق غير مدعوم",
280+
"prompt.toast.attachmentDuplicate.title": "تم تحميل هذا الملف بالفعل",
280281
"prompt.toast.pasteUnsupported.description": "يمكن إرفاق الصور أو ملفات PDF أو الملفات النصية فقط هنا.",
281282
"prompt.toast.modelAgentRequired.title": "حدد وكيلاً ونموذجاً",
282283
"prompt.toast.modelAgentRequired.description": "اختر وكيلاً ونموذجاً قبل إرسال الموجه.",

packages/app/src/i18n/br.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export const dict = {
277277
"prompt.action.send": "Enviar",
278278
"prompt.action.stop": "Parar",
279279
"prompt.toast.pasteUnsupported.title": "Anexo não suportado",
280+
"prompt.toast.attachmentDuplicate.title": "Este arquivo já foi enviado",
280281
"prompt.toast.pasteUnsupported.description": "Apenas imagens, PDFs ou arquivos de texto podem ser anexados aqui.",
281282
"prompt.toast.modelAgentRequired.title": "Selecione um agente e modelo",
282283
"prompt.toast.modelAgentRequired.description": "Escolha um agente e modelo antes de enviar um prompt.",

packages/app/src/i18n/bs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ export const dict = {
298298
"prompt.action.stop": "Zaustavi",
299299

300300
"prompt.toast.pasteUnsupported.title": "Nepodržan prilog",
301+
"prompt.toast.attachmentDuplicate.title": "Ova datoteka je već učitana",
301302
"prompt.toast.pasteUnsupported.description": "Ovdje se mogu priložiti samo slike, PDF-ovi ili tekstualne datoteke.",
302303
"prompt.toast.modelAgentRequired.title": "Odaberi agenta i model",
303304
"prompt.toast.modelAgentRequired.description": "Odaberi agenta i model prije slanja upita.",

packages/app/src/i18n/da.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ export const dict = {
296296
"prompt.action.stop": "Stop",
297297

298298
"prompt.toast.pasteUnsupported.title": "Ikke understøttet vedhæftning",
299+
"prompt.toast.attachmentDuplicate.title": "Denne fil er allerede uploadet",
299300
"prompt.toast.pasteUnsupported.description": "Kun billeder, PDF'er eller tekstfiler kan vedhæftes her.",
300301
"prompt.toast.modelAgentRequired.title": "Vælg en agent og model",
301302
"prompt.toast.modelAgentRequired.description": "Vælg en agent og model før du sender en forespørgsel.",

packages/app/src/i18n/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export const dict = {
282282
"prompt.action.send": "Senden",
283283
"prompt.action.stop": "Stopp",
284284
"prompt.toast.pasteUnsupported.title": "Nicht unterstützter Anhang",
285+
"prompt.toast.attachmentDuplicate.title": "Diese Datei wurde bereits hochgeladen",
285286
"prompt.toast.pasteUnsupported.description": "Hier können nur Bilder, PDFs oder Textdateien angehängt werden.",
286287
"prompt.toast.modelAgentRequired.title": "Wählen Sie einen Agenten und ein Modell",
287288
"prompt.toast.modelAgentRequired.description":

packages/app/src/i18n/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ export const dict = {
301301

302302
"prompt.toast.pasteUnsupported.title": "Unsupported attachment",
303303
"prompt.toast.pasteUnsupported.description": "Only images, PDFs, or text files can be attached here.",
304+
"prompt.toast.attachmentDuplicate.title": "This file has already been uploaded",
304305
"prompt.toast.modelAgentRequired.title": "Select an agent and model",
305306
"prompt.toast.modelAgentRequired.description": "Choose an agent and model before sending a prompt.",
306307
"prompt.toast.worktreeCreateFailed.title": "Failed to create worktree",

packages/app/src/i18n/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ export const dict = {
297297
"prompt.action.stop": "Detener",
298298

299299
"prompt.toast.pasteUnsupported.title": "Adjunto no compatible",
300+
"prompt.toast.attachmentDuplicate.title": "Este archivo ya se ha subido",
300301
"prompt.toast.pasteUnsupported.description": "Solo se pueden adjuntar imágenes, PDFs o archivos de texto aquí.",
301302
"prompt.toast.modelAgentRequired.title": "Selecciona un agente y modelo",
302303
"prompt.toast.modelAgentRequired.description": "Elige un agente y modelo antes de enviar un prompt.",

packages/app/src/i18n/fr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export const dict = {
277277
"prompt.action.send": "Envoyer",
278278
"prompt.action.stop": "Arrêter",
279279
"prompt.toast.pasteUnsupported.title": "Pièce jointe non prise en charge",
280+
"prompt.toast.attachmentDuplicate.title": "Ce fichier a déjà été téléversé",
280281
"prompt.toast.pasteUnsupported.description":
281282
"Seules les images, les PDF ou les fichiers texte peuvent être joints ici.",
282283
"prompt.toast.modelAgentRequired.title": "Sélectionnez un agent et un modèle",

packages/app/src/i18n/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export const dict = {
276276
"prompt.action.send": "送信",
277277
"prompt.action.stop": "停止",
278278
"prompt.toast.pasteUnsupported.title": "サポートされていない添付ファイル",
279+
"prompt.toast.attachmentDuplicate.title": "このファイルはすでにアップロードされています",
279280
"prompt.toast.pasteUnsupported.description": "画像、PDF、またはテキストファイルのみ添付できます。",
280281
"prompt.toast.modelAgentRequired.title": "エージェントとモデルを選択",
281282
"prompt.toast.modelAgentRequired.description": "プロンプトを送信する前にエージェントとモデルを選択してください。",

0 commit comments

Comments
 (0)