feat: all same-track MIDI items selectable to focus in piano roll left column

This commit is contained in:
2026-07-31 10:06:42 +07:00
parent d81afba93d
commit f1b00eb060
2 changed files with 15 additions and 1 deletions
+14
View File
@@ -7646,6 +7646,20 @@ const beatSec = 60.0 / (parseInt(bpm) || 120);
className: "text-[14px] font-sans truncate px-1",
title: track ? track.name : m._trackName
}, track ? track.name : m._trackName)));
if (m._trackId === st.trackId && track && track.midiItems && track.midiItems.length > 0) {
var itemBtns = [];
track.midiItems.forEach(function(im, ii) {
var isItemFocused = focusItemId === im.id;
var isItemActive = im.id === st.target_id;
itemBtns.push(React.createElement("button", {
key: im.id,
onClick: function() { setFocusItemId(im.id); },
title: (im.name || ('MIDI ' + (ii + 1))) + (isItemActive ? ' (đang mở)' : ''),
className: "flex items-center justify-center h-[16px] border rounded-md cursor-pointer outline-none mx-1 my-[1px] text-[9px] font-sans px-1 truncate " + (isItemFocused ? 'bg-yellow-400 text-black font-bold' : (isItemActive ? 'bg-yellow-900/70 text-yellow-300 border-yellow-700' : 'bg-zinc-800 text-zinc-400 border-zinc-700 hover:bg-zinc-700 hover:text-zinc-200'))
}, React.createElement("span", { className: "truncate" }, im.name || ('MIDI ' + (ii + 1)))));
});
els.push(React.createElement("div", { key: 'midi_items_' + m._trackId, className: "flex flex-col gap-0 mb-1" }, itemBtns));
}
});
return els;
}() : null)), React.createElement("div", {
File diff suppressed because one or more lines are too long