feat(translate): multi-file queue with dedicated runner tests + context polish
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled

Batch upload: dropzone and inputs accept multiple files (cap 10/run,
validated + deduped); 2+ files switch the submit to a queue screen —
sequential jobs with per-file progress, failure messages through the
humanizer, per-file download/review links, staggered download-all,
real server-side stop (cancel API) plus between-files abort. The
one-file flow is untouched: files.length === 1 takes the exact
existing path.

Runner: standalone runTranslationJob (submit + poll + abort + cancel)
with injectable poll interval; 5 dedicated vitest cases covering
completed-with-progress, backend failure, submit HTTP error, mid-flight
abort with server cancel, and network-failure cutoff.

Context page close review: /dashboard/context is a clean redirect to
glossaries (no duplicate); the fake 300ms save delay removed (instant
zustand persist); suggestion chips now resolve their prompt bodies
through i18n (EN+FR — no more French prompts for English users); the
translate config column shows a 'Context guidelines active' chip that
links to the editor when a Pro LLM prompt is set.

Dead code: legacy file-uploader.tsx (+webllm.ts, its only consumer)
and the unused PRESETS/applyPreset/clearContext store block removed
(-14KB of glossary strings).

Verified: build exit 0, vitest 14/14 (9 prior + 5 runner), eslint 62
errors (vs 64 at HEAD), 0 missing i18n keys.
This commit is contained in:
2026-08-30 23:05:37 +02:00
parent 67365918ae
commit a96b3c099a
16 changed files with 647 additions and 779 deletions

View File

@@ -29,5 +29,6 @@
"fileUploader.reconstructing": "Reconstruction du document…",
"fileUploader.translatingLocally": "Traduction locale avec WebLLM…",
"fileUploader.error.invalidFormat": "Format non supporté. Formats acceptés : .xlsx, .docx, .pptx, .pdf",
"fileUploader.error.tooLarge": "Fichier trop volumineux (max 50 Mo)"
"fileUploader.error.tooLarge": "Fichier trop volumineux (max 50 Mo)",
"fileUploader.error.tooMany": "File limitée à 10 documents par exécution."
}

View File

@@ -226,5 +226,11 @@
"glossaries.suggestion.numbers": "Chiffres",
"glossaries.suggestion.placeholders": "Placeholders",
"glossaries.suggestion.technical": "Termes techniques",
"glossaries.suggestion.concise": "Style concis"
"glossaries.suggestion.concise": "Style concis",
"glossaries.suggestion.formal.value": "Utilise toujours un ton formel et professionnel dans tes traductions.",
"glossaries.suggestion.proprietary.value": "Ne traduis pas les noms propres, marques et noms de personnes.",
"glossaries.suggestion.numbers.value": "Garde tous les chiffres, pourcentages et montants tels quels sans les modifier.",
"glossaries.suggestion.placeholders.value": "Ne traduis pas les variables entre accolades comme {nom}, {date}, {montant}.",
"glossaries.suggestion.technical.value": "Conserve les termes techniques en langue originale et ne les traduis pas.",
"glossaries.suggestion.concise.value": "Préfère des formulations courtes et directes. Évite les périphrases."
}

View File

@@ -101,5 +101,12 @@
"translate.cancelledTitle": "Traduction annulée",
"translate.cancelledDesc": "Le job a été arrêté et le document réservé a été libéré.",
"translate.cancelFailedTitle": "Annulation impossible",
"translate.cancelFailedDesc": "Le job est peut-être déjà terminé. L'affichage se mettra à jour sous peu."
"translate.cancelFailedDesc": "Le job est peut-être déjà terminé. L'affichage se mettra à jour sous peu.",
"translate.contextActive": "Consignes de contexte actives",
"translate.startBatch": "Traduire {count} documents",
"translate.batch.runningTitle": "Traduction de vos documents",
"translate.batch.doneTitle": "{done}/{total} traduits",
"translate.batch.stop": "Arrêter la file",
"translate.batch.downloadAll": "Tout télécharger",
"translate.batch.newSession": "Nouvelle session"
}