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:
@@ -8514,9 +8514,9 @@ const App = () => {
|
|||||||
markers: [],
|
markers: [],
|
||||||
isArmed: false,
|
isArmed: false,
|
||||||
monitoringEnabled: true,
|
monitoringEnabled: true,
|
||||||
instrumentId: null,
|
instrumentId: t.instrumentId || null,
|
||||||
instrumentProgram: undefined,
|
instrumentProgram: t.instrumentProgram,
|
||||||
instrumentName: null
|
instrumentName: t.instrumentName || null
|
||||||
}));
|
}));
|
||||||
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
@@ -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.
|
- **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
|
### [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 đó.
|
- **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`
|
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
|
||||||
|
|||||||
Reference in New Issue
Block a user