fix: section sub-tracks nullify instrument instead of inheriting

handleEditSectionInTab fallback branch explicitly set
instrumentId: null, instrumentProgram: undefined,
instrumentName: null, overriding parent track's values
spread by ...t. Changed to inherit from parent track:
instrumentId: t.instrumentId || null,
instrumentProgram: t.instrumentProgram,
instrumentName: t.instrumentName || null
This commit is contained in:
2026-07-28 08:18:43 +07:00
parent ed51cab765
commit f2ac70eee0
3 changed files with 10 additions and 4 deletions
+3 -3
View File
@@ -8514,9 +8514,9 @@ const App = () => {
markers: [],
isArmed: false,
monitoringEnabled: true,
instrumentId: null,
instrumentProgram: undefined,
instrumentName: null
instrumentId: t.instrumentId || null,
instrumentProgram: t.instrumentProgram,
instrumentName: t.instrumentName || null
}));
setSessionTabs(prev => [...prev, { id: tabId, name: tabName, sectionId: sectionId, tracks: clonedTracks, color: section.color || null }]);
setActiveTab(tabId);
File diff suppressed because one or more lines are too long
+6
View File
@@ -539,6 +539,12 @@
- **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
- **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.
- **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.
---
### [2026-07-28 08:12] Task: Sync instrument load methods từ MAIN vào SECTION-TAB PIANO_ROLL
- **Tóm tắt thay đổi:** Fix `updateActiveTracksRef` — khi `activeTab` là PIANO_ROLL sub-tab có `parent_tab_id` trỏ đến SECTION-TAB, routing instrument update vào `setSessionTabs` thay vì `setTracks` (main). Trước đây đổi instrument trong PIANO_ROLL của SECTION-TAB ghi vào main tracks (vô hiệu). Cùng logic với `activeTracks` useMemo fix trước đó.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`