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:
2026-07-28 07:51:08 +07:00
parent d40ac47d65
commit 2baf034852
3 changed files with 18 additions and 2 deletions
+11 -1
View File
@@ -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: [],