revert: playhead fixes cause cannot play on MAIN/SECTION-TAB
Revert two changes from 5d31563:
1. Explicit requestAnimationFrame in handlePlayPause (redundant,
useEffect already handles RAF start after setIsPlaying)
2. setCurrentTime(0) in handleEditSectionInTab (resets global
currentTime, interferes with MAIN session position)
This commit is contained in:
@@ -8525,7 +8525,6 @@ const App = () => {
|
||||
}));
|
||||
setSessionTabs(prev => [...prev, { id: tabId, name: tabName, sectionId: sectionId, tracks: clonedTracks, color: section.color || null }]);
|
||||
setActiveTab(tabId);
|
||||
setCurrentTime(0);
|
||||
};
|
||||
|
||||
// ── Sub Tab: apply effects & merge back (LOOP_EDITOR_2.md §1.2) ──
|
||||
@@ -10615,7 +10614,6 @@ const App = () => {
|
||||
startAudioTimeRef.current = context.currentTime;
|
||||
startTrackPlayback(currentTime);
|
||||
setIsPlaying(true);
|
||||
animationFrameIdRef.current = requestAnimationFrame(updatePlayhead);
|
||||
}
|
||||
};
|
||||
handlePlayPauseRef.current = handlePlayPause;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -539,10 +539,10 @@
|
||||
- **Ghi chú/Test (nếu có):** `npm run build` pass. Ctrl+Click+Drag section/MIDI item → copy đến vị trí mới, item không bị selected.
|
||||
---
|
||||
|
||||
### [2026-07-28 09:17] Task: Playhead SECTION-TAB di chuyển dù không có items
|
||||
- **Tóm tắt thay đổi:** Thêm `requestAnimationFrame(updatePlayhead)` sau `setIsPlaying(true)` trong `handlePlayPause` để đảm bảo RAF luôn chạy. Thêm `setCurrentTime(0)` trong `handleEditSectionInTab` để reset playhead về 0 khi mở section tab. Trước đây playhead không di chuyển vì effect useEffect dependency chưa kịp fire hoặc `currentTime` ở vị trí ngoài section timeline.
|
||||
### [2026-07-28 09:21] Task: Revert fix playhead — gây lỗi không play được
|
||||
- **Tóm tắt thay đổi:** Revert 2 changes từ 5d31563: (1) xoá `requestAnimationFrame(updatePlayhead)` thừa trong `handlePlayPause` (effect đã xử lý). (2) xoá `setCurrentTime(0)` trong `handleEditSectionInTab` (gây reset currentTime global). Giữ nguyên các fix instrument isolation + program default.
|
||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
|
||||
- **Ghi chú/Test (nếu có):** `npm run build` pass. Mở SECTION-TAB → Play → playhead di chuyển từ 0 đến maxDuration.
|
||||
- **Ghi chú/Test (nếu có):** `npm run build` pass. Cần kiểm tra Play trên MAIN và SECTION-TAB.
|
||||
---
|
||||
|
||||
### [2026-07-28 09:40] Task: Cả main + section MIDI playback không default program 0
|
||||
|
||||
Reference in New Issue
Block a user