fix: Ctrl+S saves section in SECTION-TAB, Ctrl+A selects all items
Ctrl+S in SECTION-TAB (activeTab starts with session_): calls handleSaveSectionTab(curTab). Ctrl+A in MAIN/SECTION-TAB: collects sections, midiItems, clips from activeTracksRef.current into selectedItemIds. Ignores sub-tab contexts (PIANO_ROLL).
This commit is contained in:
@@ -8050,6 +8050,19 @@ const App = () => {
|
||||
showToast('New project created', 'info');
|
||||
return;
|
||||
}
|
||||
if (ctrl && !alt && !e.shiftKey && e.key === 'a') {
|
||||
e.preventDefault();
|
||||
const curTab = activeTabRef.current;
|
||||
if (curTab !== 'main' && !curTab.startsWith('session_')) return;
|
||||
const allIds = new Set();
|
||||
(activeTracksRef.current || []).forEach(t => {
|
||||
(t.sections || []).forEach(s => allIds.add(s.id));
|
||||
(t.midiItems || []).forEach(m => allIds.add(m.id));
|
||||
(t.clips || []).forEach(c => allIds.add(c.id === 'default' ? 'default_' + t.id : c.id));
|
||||
});
|
||||
setSelectedItemIds(allIds);
|
||||
return;
|
||||
}
|
||||
if (ctrl && !alt && e.key === 's') {
|
||||
e.preventDefault();
|
||||
handleExportSFS();
|
||||
@@ -8155,6 +8168,10 @@ const App = () => {
|
||||
}
|
||||
showToast('Đã lưu', 'success');
|
||||
});
|
||||
} else if (curTab.startsWith('session_')) {
|
||||
// Section tab: save section
|
||||
handleSaveSectionTab(curTab);
|
||||
showToast('Đã lưu Section', 'success');
|
||||
} else {
|
||||
// Sub-tab: save current tab
|
||||
const st = subTabsRef.current.find(s => s.id === curTab);
|
||||
|
||||
Reference in New Issue
Block a user