fix: section tab clears midiItems, breaks ghost+dropdown
handleEditSectionInTab overwrote midiItems: [] when cloning section.tracks, stripping all MIDI data from section context. PianoRollTabEditor uses activeTracks which resolves section tracks -- midiItems must be preserved for dropdown switcher, ghost note extraction, and instrument settings to work.
This commit is contained in:
+11
-1
@@ -8497,7 +8497,17 @@ const App = () => {
|
||||
if (existing) { setActiveTab(existing.id); showToast(`Tab "${section.name}" already open.`, 'info'); return; }
|
||||
const tabId = 'session_' + Date.now();
|
||||
const tabName = section.name || 'Section';
|
||||
const clonedTracks = section.tracks ? JSON.parse(JSON.stringify(section.tracks)) : tracks.filter(t => t.id === trackId).map(t => ({
|
||||
const clonedTracks = section.tracks ? (JSON.parse(JSON.stringify(section.tracks))).map(t => ({
|
||||
...t,
|
||||
clips: [],
|
||||
sections: [],
|
||||
markers: [],
|
||||
isArmed: false,
|
||||
monitoringEnabled: true,
|
||||
instrumentId: t.instrumentId || null,
|
||||
instrumentProgram: t.instrumentProgram,
|
||||
instrumentName: t.instrumentName || null
|
||||
})) : tracks.filter(t => t.id === trackId).map(t => ({
|
||||
...t,
|
||||
clips: [],
|
||||
sections: [],
|
||||
|
||||
Reference in New Issue
Block a user