fix(ui): polish editor layouts and confirm scene delete

Stretch key action buttons, center empty audio/image pickers, and require confirmation before deleting a scene.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-29 15:35:07 +08:00
parent a2b418b78a
commit c7bf7cf449
8 changed files with 355 additions and 154 deletions
+29 -13
View File
@@ -180,20 +180,36 @@ export function MaterialEditModal({
{previewSrc ? (
<img className={matStyles.previewThumb} src={previewSrc} alt="" />
) : (
<div className={styles.muted}>{t('materials.imageEmpty')}</div>
<div className={matStyles.imageDropEmpty}>
<div className={styles.muted}>{t('materials.imageEmpty')}</div>
<Button
disabled={saving}
onClick={() => {
void (async () => {
const picked = await onPickImage();
if (!picked) return;
setPreviewFromPathAndUrl(picked.filePath, picked.previewDataUrl);
})();
}}
>
{t('materials.chooseImage')}
</Button>
</div>
)}
<Button
disabled={saving}
onClick={() => {
void (async () => {
const picked = await onPickImage();
if (!picked) return;
setPreviewFromPathAndUrl(picked.filePath, picked.previewDataUrl);
})();
}}
>
{t('materials.chooseImage')}
</Button>
{previewSrc ? (
<Button
disabled={saving}
onClick={() => {
void (async () => {
const picked = await onPickImage();
if (!picked) return;
setPreviewFromPathAndUrl(picked.filePath, picked.previewDataUrl);
})();
}}
>
{t('materials.chooseImage')}
</Button>
) : null}
</div>
{!hasImage ? <div className={styles.fieldError}>{t('materials.imageRequired')}</div> : null}
</div>