feat(editor): show scene preview immediately and optimize in background

Return control after copying the original asset, then run image optimization
and thumbnail generation in the background with IPC progress updates.
Block duplicate preview uploads and scene creation while requests are in flight.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-03 22:38:51 +08:00
parent 83a326b0b9
commit 10bb7013e6
9 changed files with 514 additions and 209 deletions
@@ -263,6 +263,7 @@ export const EDITOR_MESSAGES: Record<EditorLocale, Record<string, string>> = {
'picker.empty': 'Пока нет проектов.',
'picker.projectMenu': 'Меню проекта',
'picker.openDisabled': 'Открытие проекта — после активации лицензии',
'picker.opening': 'Открытие…',
'picker.defaultName': 'Моя кампания',
'campaign.label': 'АУДИО ИГРЫ',
@@ -278,6 +279,10 @@ export const EDITOR_MESSAGES: Record<EditorLocale, Record<string, string>> = {
'scene.previewHint': 'Файл изображения (PNG, JPG, WebP, GIF и т.д.).',
'scene.previewEmpty': 'Превью не задано',
'scene.previewBusy': 'Загрузка и оптимизация изображения…',
'scene.previewBusySelecting': 'Выберите файл…',
'scene.previewOptimizing': 'Превью уже доступно. Оптимизируем в фоне…',
'scene.previewReady': 'Превью готово',
'scene.previewFailed': 'Превью добавлено, но оптимизация не удалась',
'scene.change': 'Изменить',
'scene.clear': 'Очистить',
'scene.autostart': 'Автостарт',
@@ -586,6 +591,7 @@ export const EDITOR_MESSAGES: Record<EditorLocale, Record<string, string>> = {
'picker.empty': 'No projects yet.',
'picker.projectMenu': 'Project menu',
'picker.openDisabled': 'Open project — after license activation',
'picker.opening': 'Opening…',
'picker.defaultName': 'My campaign',
'campaign.label': 'GAME AUDIO',
@@ -601,6 +607,10 @@ export const EDITOR_MESSAGES: Record<EditorLocale, Record<string, string>> = {
'scene.previewHint': 'Image file (PNG, JPG, WebP, GIF, etc.).',
'scene.previewEmpty': 'No preview',
'scene.previewBusy': 'Loading and optimizing image…',
'scene.previewBusySelecting': 'Choose a file…',
'scene.previewOptimizing': 'Preview is ready. Optimizing in the background…',
'scene.previewReady': 'Preview is ready',
'scene.previewFailed': 'Preview was added, but optimization failed',
'scene.change': 'Change',
'scene.clear': 'Clear',
'scene.autostart': 'Autostart',