FIX: Đã fix preview Media Explorer (v202608062345)
This commit is contained in:
@@ -11513,7 +11513,7 @@ const MEDIA_LIBRARY_SAMPLES = [
|
||||
{ name: "MIDI_Loop_06.mid", events: 88, lengthQn: 16, time: "0:08.000", tpqn: 480, bpm: 130, kind: "midi" }
|
||||
];
|
||||
|
||||
const MediaExplorerPanel = ({ height, clipboardRef }) => {
|
||||
const MediaExplorerPanel = ({ height, clipboardRef, active }) => {
|
||||
const [userFiles, setUserFiles] = React.useState([]);
|
||||
const [folder, setFolder] = React.useState('library');
|
||||
const [selected, setSelected] = React.useState(null);
|
||||
@@ -12651,6 +12651,12 @@ const MediaExplorerPanel = ({ height, clipboardRef }) => {
|
||||
setIsPaused(false);
|
||||
}, []);
|
||||
|
||||
// F6 close / panel bị ẩn (display:none — KHÔNG unmount) → tắt preview âm
|
||||
// thanh (trước đây preview tiếp tục phát sau khi đóng Media Explorer).
|
||||
React.useEffect(function() {
|
||||
if (active === false) stopMediaPlayback();
|
||||
}, [active, stopMediaPlayback]);
|
||||
|
||||
const playSelected = async (f, token) => {
|
||||
if (!f) return;
|
||||
stopMediaPlayback();
|
||||
@@ -27496,7 +27502,8 @@ STRICT CONSTRAINTS:
|
||||
className: "flex-1 min-h-0 overflow-hidden bg-[#262626]"
|
||||
}, /*#__PURE__*/React.createElement(MediaExplorerPanel, {
|
||||
height: mediaExplorerPanelHeight,
|
||||
clipboardRef: clipboardRef
|
||||
clipboardRef: clipboardRef,
|
||||
active: showMediaExplorer
|
||||
}))));
|
||||
})(), /*#__PURE__*/React.createElement("div", {
|
||||
className: "h-6 bg-[#141414] border-t border-zinc-900 px-4 flex items-center justify-between text-xs text-zinc-500 select-none shrink-0"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -24,7 +24,7 @@
|
||||
<script src="/static/js/services/midiExtractor.js?v=202607281052"></script>
|
||||
<script src="/static/js/services/promptTemplateManager.js?v=202607281039"></script>
|
||||
<script src="/static/js/services/undoRedoEngine.js?v=202607290941"></script>
|
||||
<script src="/static/js/app.precompiled.js?v=202608062330" defer></script>
|
||||
<script src="/static/js/app.precompiled.js?v=202608062345" defer></script>
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=202607271016">
|
||||
<style>
|
||||
:root {
|
||||
|
||||
@@ -2265,3 +2265,10 @@
|
||||
- **FIX (app.jsx):** merge session tabs CHỈ match với `sectionInnerTracks` (inner tracks của section items) — không match track main top-level.
|
||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/templates/index.html` (?v=202608062330), `wiki.md`. Rebuild precompiled.
|
||||
- **Ghi chú/Test:** `npm run build` → deploy → reload → nhấp đôi section item → SECTION-TAB đầy đủ (midi + audioclip đúng vị trí) + play cả 2.
|
||||
|
||||
### [2026-08-06 23:45] Task: Media Explorer (F6) — close panel phải tắt preview âm thanh
|
||||
- **Báo cáo user:** đóng Media Explorer panel → preview âm thanh vẫn phát.
|
||||
- **Nguyên nhân:** panel KHÔNG unmount khi đóng (ẩn bằng `display:none` 27465) — cleanup unmount không chạy → preview source + SonicSF notes tiếp tục.
|
||||
- **FIX (app.jsx):** truyền `active={showMediaExplorer}` vào MediaExplorerPanel + effect `if (active === false) stopMediaPlayback()` — đóng F6 → dừng source + loop + SonicSF.stopAll.
|
||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/templates/index.html` (?v=202608062345 — sửa typo `</script></script>` kép), `wiki.md`. Rebuild precompiled.
|
||||
- **Ghi chú/Test:** `npm run build` → hard refresh → F6 → preview 1 file → F6 close → âm dừng ngay.
|
||||
|
||||
Reference in New Issue
Block a user