fix: remove MIDI tab loop button + Ctrl+click clear range

This commit is contained in:
2026-07-26 11:03:51 +07:00
parent 9438f44052
commit 5b500ebdf3
3 changed files with 13 additions and 8 deletions
+7 -7
View File
@@ -5764,13 +5764,7 @@ const beatSec = 60.0 / (parseInt(bpm) || 120);
}), React.createElement("span", { className: "text-zinc-500" }, "-"), React.createElement("input", { }), React.createElement("span", { className: "text-zinc-500" }, "-"), React.createElement("input", {
type: "number", value: aiBarEnd, onChange: e => setAiBarEnd(parseInt(e.target.value) || 1), type: "number", value: aiBarEnd, onChange: e => setAiBarEnd(parseInt(e.target.value) || 1),
className: "w-8 bg-zinc-900 border border-zinc-700 text-zinc-200 rounded px-1 py-0.5 text-xs text-center" className: "w-8 bg-zinc-900 border border-zinc-700 text-zinc-200 rounded px-1 py-0.5 text-xs text-center"
}), React.createElement("span", { className: "text-zinc-500" }, "bar"), React.createElement("button", { }), React.createElement("span", { className: "text-zinc-500" }, "bar")), React.createElement("div", {
onClick: () => {
setIsLooping(!isLooping);
setSubTabs(prev => prev.map(s => s.id === st.id ? { ...s, isLooping: !(s.isLooping || false) } : s));
},
className: `px-2 py-0.5 rounded text-xs ${isLooping ? 'bg-emerald-700 text-white border border-emerald-500' : 'bg-zinc-800 text-zinc-400'}`
}, React.createElement("i", { "data-lucide": "repeat", className: "w-3 h-3" }))), React.createElement("div", {
className: "flex bg-zinc-800 p-0.5 rounded border border-zinc-700 text-xs" className: "flex bg-zinc-800 p-0.5 rounded border border-zinc-700 text-xs"
}, ['velocity', 'pan'].map(mode => React.createElement("button", { }, ['velocity', 'pan'].map(mode => React.createElement("button", {
key: mode, key: mode,
@@ -5808,6 +5802,12 @@ const beatSec = 60.0 / (parseInt(bpm) || 120);
if (clickTime >= 0) { if (clickTime >= 0) {
setSubTabs(prev => prev.map(s => s.id === st.id ? { ...s, currentTime: clickTime } : s)); setSubTabs(prev => prev.map(s => s.id === st.id ? { ...s, currentTime: clickTime } : s));
} }
if (e.ctrlKey || e.metaKey) {
setLoopStartBeat(null);
setLoopEndBeat(null);
setSubTabs(prev => prev.map(s => s.id === st.id ? { ...s, selectionStart: null, selectionEnd: null } : s));
return;
}
if (e.shiftKey) { if (e.shiftKey) {
const beatSnap = getSnapBeat(clickBeat, snapVal); const beatSnap = getSnapBeat(clickBeat, snapVal);
if (loopStartBeat === null) { if (loopStartBeat === null) {
File diff suppressed because one or more lines are too long
+5
View File
@@ -215,3 +215,8 @@
- **Tóm tắt thay đổi:** Thêm `findCCNoteIndex(beat, mouseY, ccH)` helper — tìm note trong CC lane dựa trên cả X (beat) và Y (vị trí stem top). Khi nhiều note cùng beat (chord), so sánh `mouseY` với stem top của từng note, chọn note có stem gần nhất. Dùng helper này thay thế tất cả `notes.findIndex` và nearest-fallback trong `handleCCMouseDown``handleCCMouseMove`. Fix lỗi không detect được note khi velocity gần nhau hoặc cùng beat. - **Tóm tắt thay đổi:** Thêm `findCCNoteIndex(beat, mouseY, ccH)` helper — tìm note trong CC lane dựa trên cả X (beat) và Y (vị trí stem top). Khi nhiều note cùng beat (chord), so sánh `mouseY` với stem top của từng note, chọn note có stem gần nhất. Dùng helper này thay thế tất cả `notes.findIndex` và nearest-fallback trong `handleCCMouseDown``handleCCMouseMove`. Fix lỗi không detect được note khi velocity gần nhau hoặc cùng beat.
- **Các file ảnh hưởng:** `app/static/js/app.jsx` - **Các file ảnh hưởng:** `app/static/js/app.jsx`
- **Ghi chú/Test (nếu có):** `npm run build` pass. - **Ghi chú/Test (nếu có):** `npm run build` pass.
### [2026-07-26 11:03] Task: Remove MIDI tab loop button + Ctrl+click clear range
- **Tóm tắt thay đổi:** (1) Xóa nút loop (repeat) khỏi MIDI tab toolbar — dùng global transport loop button thay thế. (2) Ctrl/Meta+Click trên ruler (tempo track lane) xóa loop range: set loopStartBeat/loopEndBeat = null, selectionStart/selectionEnd = null.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
- **Ghi chú/Test (nếu có):** `npm run build` pass.