From 468a1f11a405d30b17b253b2e8bcb5ee3eb1511d Mon Sep 17 00:00:00 2001 From: 3dtours Date: Fri, 31 Jul 2026 07:06:29 +0700 Subject: [PATCH] fix: Lucide icon refresh on new track creation Add activeTracks to useEffect deps for lucide.createIcons() so icons render when user/AI creates tracks via any path. --- app/static/js/app.jsx | 2 +- wiki.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/static/js/app.jsx b/app/static/js/app.jsx index de64a26..cb7351e 100644 --- a/app/static/js/app.jsx +++ b/app/static/js/app.jsx @@ -10341,7 +10341,7 @@ const App = () => { window.lucide.createIcons(); } }, 50); - }, [activeTool, activeTab, contextMenu]); + }, [activeTool, activeTab, contextMenu, activeTracks]); const timelineWrapperRef = useRef(null); const [timelineWrapperNode, setTimelineWrapperNode] = useState(null); const handleTimelineWrapperRef = useCallback(node => { diff --git a/wiki.md b/wiki.md index 8aa1998..21484dd 100644 --- a/wiki.md +++ b/wiki.md @@ -1,3 +1,9 @@ +### [2026-07-31 07:03] Task: Fix Lucide icons not rendering on new tracks (TCP + SECTION-TAB) +- **Tóm tắt thay đổi:** `useEffect` gọi `lucide.createIcons()` thiếu `activeTracks` trong dependency array → khi track được tạo (user/AI/MIDI import/clone section), DOM nodes mới có `data-lucide` nhưng không được chuyển thành SVG → icon ẩn hoặc hiển thị sai. Fix: thêm `activeTracks` vào deps để auto-refresh icons sau mỗi lần track list thay đổi. +- **Các file ảnh hưởng:** `app/static/js/app.jsx` +- **Ghi chú/Test (nếu có):** Không cần build. Fix áp dụng cho tất cả đường dẫn tạo track: addNewTrack, insertTrackBelow, AI cut/composition/rearrange, MIDI import, section clone. +--- + ### [2026-07-28 07:56] Task: Fix PIANO_ROLL activeTracks + instrument auto-assign trong SECTION-TAB - **Tóm tắt thay đổi:** Fix `activeTracks` useMemo: khi `activeTab` là PIANO_ROLL sub-tab từ SECTION-TAB (`parent_tab_id` bắt đầu `session_`), trả về tracks của section tab thay vì main tracks. Trước đây `activeTracks` luôn trả về main tracks khi activeTab !== session_xxx → dropdown MIDI item rỗng, track name không hiển thị, instrument lookup sai. Fix: check `subTabs` cho PIANO_ROLL type để resolve đúng parent session tracks. - **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`