Skip to content

Commit 637ff81

Browse files
committed
feat(image): inline upload-error feedback parity with FontManager
The image upload handler had `try/finally` without `catch`, so failures (non-image MIME, oversize, decode error, GFA exception) propagated as unhandled rejections with no user signal. Add `uploadFailed` state and a small inline hint matching FontManager's pattern.
1 parent 99082ae commit 637ff81

33 files changed

Lines changed: 43 additions & 0 deletions

‎src/locales/ar.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const ar = {
256256
selectImage: 'اختر صورة…',
257257
upload: 'رفع صورة',
258258
uploading: 'جارٍ الرفع…',
259+
uploadError: 'تعذر تحميل الصورة',
259260
preview: 'معاينة',
260261
widthDots: 'العرض (نقاط)',
261262
threshold: 'عتبة أحادية',

‎src/locales/bg.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const bg = {
256256
selectImage: 'Изберете изображение…',
257257
upload: 'Качване на изображение',
258258
uploading: 'Качване…',
259+
uploadError: 'Изображението не може да бъде заредено',
259260
preview: 'Преглед',
260261
widthDots: 'Ширина (точки)',
261262
threshold: 'Моно праг',

‎src/locales/cs.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const cs = {
256256
selectImage: 'Vybrat obrázek…',
257257
upload: 'Nahrát obrázek',
258258
uploading: 'Nahrávání…',
259+
uploadError: 'Obrázek nelze načíst',
259260
preview: 'Náhled',
260261
widthDots: 'Šířka (body)',
261262
threshold: 'Mono práh',

‎src/locales/da.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const da = {
256256
selectImage: 'Vælg billede…',
257257
upload: 'Upload billede',
258258
uploading: 'Uploader…',
259+
uploadError: 'Kunne ikke indlæse billede',
259260
preview: 'Forhåndsvisning',
260261
widthDots: 'Bredde (punkter)',
261262
threshold: 'Mono-tærskel',

‎src/locales/de.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ const de = {
276276
selectImage: 'Bild auswählen…',
277277
upload: 'Bild hochladen',
278278
uploading: 'Hochladen…',
279+
uploadError: 'Bild konnte nicht geladen werden',
279280
preview: 'Vorschau',
280281
widthDots: 'Breite (Punkte)',
281282
threshold: 'Mono-Schwellenwert',

‎src/locales/el.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const el = {
256256
selectImage: 'Επιλογή εικόνας…',
257257
upload: 'Μεταφόρτωση εικόνας',
258258
uploading: 'Μεταφόρτωση…',
259+
uploadError: 'Αδυναμία φόρτωσης εικόνας',
259260
preview: 'Προεπισκόπηση',
260261
widthDots: 'Πλάτος (κουκκίδες)',
261262
threshold: 'Κατώφλι mono',

‎src/locales/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ const en = {
276276
selectImage: 'Select image…',
277277
upload: 'Upload image',
278278
uploading: 'Uploading…',
279+
uploadError: 'Could not load image',
279280
preview: 'Preview',
280281
widthDots: 'Width (dots)',
281282
threshold: 'Mono threshold',

‎src/locales/es.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const es = {
256256
selectImage: 'Seleccionar imagen…',
257257
upload: 'Subir imagen',
258258
uploading: 'Subiendo…',
259+
uploadError: 'No se pudo cargar la imagen',
259260
preview: 'Vista previa',
260261
widthDots: 'Ancho (puntos)',
261262
threshold: 'Umbral mono',

‎src/locales/et.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const et = {
256256
selectImage: 'Vali pilt…',
257257
upload: 'Laadi pilt üles',
258258
uploading: 'Üleslaadimine…',
259+
uploadError: 'Pildi laadimine ebaõnnestus',
259260
preview: 'Eelvaade',
260261
widthDots: 'Laius (punktid)',
261262
threshold: 'Mono lävi',

‎src/locales/fa.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const fa = {
256256
selectImage: 'انتخاب تصویر…',
257257
upload: 'بارگذاری تصویر',
258258
uploading: 'در حال بارگذاری…',
259+
uploadError: 'بارگذاری تصویر ممکن نشد',
259260
preview: 'پیش‌نمایش',
260261
widthDots: 'عرض (نقاط)',
261262
threshold: 'آستانه تک‌رنگ',

0 commit comments

Comments
 (0)