FIX: lỗi load dự án và hiển thị mixer panel

This commit is contained in:
2026-07-31 07:51:18 +07:00
parent 652fb98d2c
commit 47e87c8363
2 changed files with 10 additions and 2 deletions
File diff suppressed because one or more lines are too long
+8
View File
@@ -937,3 +937,11 @@
- **Tóm tắt thay đổi:** Thay vì mở modal standalone trong iframe generator, "Lưu thành Preset" giờ postMessage `GENERATOR_PRESET_DATA` lên parent window. React AIPresetModal thêm `message` listener nhận data, auto-populate form (name, category, keywords, bars, bpm, scale, template), set editingPreset='new' và đóng generator modal. Nút "Tạo preset có cấu trúc" trong React form vẫn hoạt động độc lập.
- **Các file ảnh hưởng:** `md/49_AI_PROMPT_GENERATOR.md`, `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
- **Ghi chú/Test (nếu có):** `npm run build` pass. Flow: generator iframe → Lưu thành Preset → form React tự điền → generator modal đóng.
### [2026-07-31 07:37] Task: Fix 3 bugs - panText, cloud project load, auto-restore
- **Tóm tắt thay đổi:**
1. Thêm `const [panText, setPanText] = React.useState('center')` vào MasterStripConsole để fix `Uncaught ReferenceError: panText is not defined`.
2. Fix `restoreLastSessionProject`: xóa bỏ `localStorage.removeItem('sonic_project_id')` trong catch block để không xóa project ID khi API lỗi tạm thời → auto-load trên page reload hoạt động lại.
3. Thêm `.catch()` vào `loadAudioBuffersForTracks` trong `handleOpenProject``restoreLastSessionProject` để tránh unhandled promise rejection gây gián đoạn load project.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
- **Ghi chú/Test (nếu có):** Cần reload page và test Open Project + Mixer Panel sau fix.