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:
2026-07-28 09:59:13 +07:00
parent fa7ffe88bf
commit 62a41d4502
3 changed files with 26 additions and 2 deletions
+17
View File
@@ -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);