revert: section tracks inherit parent instrument, auto-loads SF prog0

Previous fix f2ac70e inherited instrumentId/program/name
from parent MAIN track. This causes SECTION-TAB to auto-load
program 0 of whatever SoundFont is loaded on MAIN, even
though user didn't select any instrument for the section.
Section tracks now keep null instrument + synth_engine
undefined. User can still load instrument manually via
Synth button (routed by updateActiveTracks fix).
This commit is contained in:
2026-07-28 08:27:27 +07:00
parent f2ac70eee0
commit 18e177fa2d
3 changed files with 8 additions and 7 deletions
+4 -3
View File
@@ -8514,9 +8514,10 @@ const App = () => {
markers: [], markers: [],
isArmed: false, isArmed: false,
monitoringEnabled: true, monitoringEnabled: true,
instrumentId: t.instrumentId || null, instrumentId: null,
instrumentProgram: t.instrumentProgram, instrumentProgram: undefined,
instrumentName: t.instrumentName || null instrumentName: null,
synth_engine: undefined
})); }));
setSessionTabs(prev => [...prev, { id: tabId, name: tabName, sectionId: sectionId, tracks: clonedTracks, color: section.color || null }]); setSessionTabs(prev => [...prev, { id: tabId, name: tabName, sectionId: sectionId, tracks: clonedTracks, color: section.color || null }]);
setActiveTab(tabId); setActiveTab(tabId);
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -539,10 +539,10 @@
- **Ghi chú/Test (nếu có):** `npm run build` pass. Ctrl+Click+Drag section/MIDI item → copy đến vị trí mới, item không bị selected. - **Ghi chú/Test (nếu có):** `npm run build` pass. Ctrl+Click+Drag section/MIDI item → copy đến vị trí mới, item không bị selected.
--- ---
### [2026-07-28 08:17] Task: Kế thừa instrument từ MAIN track vào section sub-tracks ### [2026-07-28 08:27] Task: KHÔNG auto-load instrument MAIN vào SECTION-TAB track
- **Tóm tắt thay đổi:** Fix fallback branch `handleEditSectionInTab` — khi section chưa có tracks riêng, clone tracks kế thừa `instrumentId`, `instrumentProgram`, `instrumentName` từ parent MAIN track thay vì null/undefined. Trước đây instrument bị xoá (null/undefined) → section không có instrument nào. - **Tóm tắt thay đổi:** Revert kế thừa instrument từ parent MAIN track. Section tracks giữ `instrumentId: null, instrumentProgram: undefined, instrumentName: null, synth_engine: undefined`. Trước đây kế thừa instrument (f2ac70e) → SECTION-TAB auto-load program 0 của SoundFont từ MAIN. User tự chọn instrument trong SECTION-TAB qua Synth button (đã hỗ trợ qua `updateActiveTracks` routing).
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js` - **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
- **Ghi chú/Test (nếu có):** `npm run build` pass. Load instrument trên MAIN track → mở section tab → MIDI items kế thừa instrument từ parent track. - **Ghi chú/Test (nếu có):** `npm run build` pass. Load instrument MAIN → mở section tab → section tracks KHÔNG có instrument.
--- ---
### [2026-07-28 08:12] Task: Sync instrument load methods từ MAIN vào SECTION-TAB PIANO_ROLL ### [2026-07-28 08:12] Task: Sync instrument load methods từ MAIN vào SECTION-TAB PIANO_ROLL