From ce2f7147c4e38bcfe6429e0cf100d80aade1f0a4 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Mon, 20 Apr 2026 22:07:24 +1000 Subject: [PATCH] fix: keep export dropdown open on failure, fix cancel during setup, fix Windows paths, translate i18n - Export dropdown now stays open on GIF/MP4 failure and top-level catch so the exportError UI remains visible (previously dismissed by finally block) - handleCancelExport always resets UI state even before exporter is constructed, so Cancel works during the async setup phase - fromFileUrl() now converts forward slashes to backslashes for Windows drive paths (both primary and fallback parsing paths) - Translated customFonts and color keys in es/ko/nl/zh-CN locales --- .../video-editor/hooks/editorExportWorkflow.ts | 5 +++++ .../video-editor/hooks/useEditorExport.ts | 18 ++++++++---------- .../video-editor/projectPersistencePaths.ts | 6 ++++-- src/i18n/locales/es/editor.json | 2 +- src/i18n/locales/ko/editor.json | 4 ++-- src/i18n/locales/nl/editor.json | 4 ++-- src/i18n/locales/zh-CN/editor.json | 4 ++-- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/components/video-editor/hooks/editorExportWorkflow.ts b/src/components/video-editor/hooks/editorExportWorkflow.ts index 7bac8d4b..5bbe2ab6 100644 --- a/src/components/video-editor/hooks/editorExportWorkflow.ts +++ b/src/components/video-editor/hooks/editorExportWorkflow.ts @@ -254,6 +254,7 @@ export async function runEditorExport({ window.close(); return; } + keepExportDialogOpen = true; } } else { const quality = settings.quality ?? config.exportQuality; @@ -478,6 +479,7 @@ export async function runEditorExport({ window.close(); return; } + keepExportDialogOpen = true; } } @@ -501,6 +503,9 @@ export async function runEditorExport({ } setExportError(errorMessage); toast.error(`Export failed: ${summarizeErrorMessage(errorMessage)}`); + if (!smokeExportConfig.enabled) { + keepExportDialogOpen = true; + } } finally { if (restoreTime !== null) { if (wasPlaying) { diff --git a/src/components/video-editor/hooks/useEditorExport.ts b/src/components/video-editor/hooks/useEditorExport.ts index 06ecf387..a4f4a89b 100644 --- a/src/components/video-editor/hooks/useEditorExport.ts +++ b/src/components/video-editor/hooks/useEditorExport.ts @@ -191,16 +191,14 @@ export function useEditorExport({ }, [getRenderConfig, videoPlaybackRef, handleExport]); const handleCancelExport = useCallback(() => { - if (exporterRef.current) { - exporterRef.current.cancel(); - toast.info("Export canceled"); - clearPendingExportSave(); - setShowExportDropdown(false); - setIsExporting(false); - setExportProgress(null); - setExportError(null); - setExportedFilePath(undefined); - } + exporterRef.current?.cancel(); + toast.info("Export canceled"); + clearPendingExportSave(); + setShowExportDropdown(false); + setIsExporting(false); + setExportProgress(null); + setExportError(null); + setExportedFilePath(undefined); }, [clearPendingExportSave]); const handleExportDropdownClose = useCallback(() => { diff --git a/src/components/video-editor/projectPersistencePaths.ts b/src/components/video-editor/projectPersistencePaths.ts index 716eb370..5ba5fb36 100644 --- a/src/components/video-editor/projectPersistencePaths.ts +++ b/src/components/video-editor/projectPersistencePaths.ts @@ -51,7 +51,7 @@ export function fromFileUrl(fileUrl: string): string { } if (/^\/[A-Za-z]:/.test(pathname)) { - return pathname.slice(1); + return pathname.slice(1).replace(/\//g, "\\"); } return pathname; @@ -63,7 +63,9 @@ export function fromFileUrl(fileUrl: string): string { } catch { // Keep raw best-effort path if percent decoding fails. } - return fallbackPath.replace(/^\/([a-zA-Z]:)/, "$1"); + const nativePath = fallbackPath.replace(/^\/([a-zA-Z]:)/, "$1"); + // Convert forward slashes to backslashes only for Windows drive paths + return /^[a-zA-Z]:/.test(nativePath) ? nativePath.replace(/\//g, "\\") : nativePath; } } diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.json index 60675da0..59f78e54 100644 --- a/src/i18n/locales/es/editor.json +++ b/src/i18n/locales/es/editor.json @@ -43,7 +43,7 @@ "blurStrength": "Fuerza del Desenfoque: {{strength}}", "solidColor": "Color Sólido (Censura)", "borderRadius": "Radio del Borde", - "customFonts": "Custom Fonts", + "customFonts": "Fuentes Personalizadas", "color": "Color" }, diff --git a/src/i18n/locales/ko/editor.json b/src/i18n/locales/ko/editor.json index d7753b30..436f5d32 100644 --- a/src/i18n/locales/ko/editor.json +++ b/src/i18n/locales/ko/editor.json @@ -44,8 +44,8 @@ "blurStrength": "블러 강도: {{strength}}", "solidColor": "단색 (검열)", "borderRadius": "테두리 반경", - "customFonts": "Custom Fonts", - "color": "Color" + "customFonts": "커스텀 글꼴", + "color": "색상" }, "fontStyles": { diff --git a/src/i18n/locales/nl/editor.json b/src/i18n/locales/nl/editor.json index ac5c3593..b2fed059 100644 --- a/src/i18n/locales/nl/editor.json +++ b/src/i18n/locales/nl/editor.json @@ -44,8 +44,8 @@ "blurStrength": "Vervagingssterkte: {{strength}}", "solidColor": "Effen Kleur (Censuur)", "borderRadius": "Hoekradius", - "customFonts": "Custom Fonts", - "color": "Color" + "customFonts": "Aangepaste Lettertypen", + "color": "Kleur" }, "fontStyles": { diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.json index dcc98018..a3e0da18 100644 --- a/src/i18n/locales/zh-CN/editor.json +++ b/src/i18n/locales/zh-CN/editor.json @@ -43,8 +43,8 @@ "blurStrength": "模糊强度: {{strength}}", "solidColor": "纯色 (审查)", "borderRadius": "边框半径", - "customFonts": "Custom Fonts", - "color": "Color" + "customFonts": "自定义字体", + "color": "颜色" }, "fontStyles": {