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.
This commit is contained in:
2026-07-31 07:06:29 +07:00
parent 0fdb8318f0
commit 468a1f11a4
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -10341,7 +10341,7 @@ const App = () => {
window.lucide.createIcons(); window.lucide.createIcons();
} }
}, 50); }, 50);
}, [activeTool, activeTab, contextMenu]); }, [activeTool, activeTab, contextMenu, activeTracks]);
const timelineWrapperRef = useRef(null); const timelineWrapperRef = useRef(null);
const [timelineWrapperNode, setTimelineWrapperNode] = useState(null); const [timelineWrapperNode, setTimelineWrapperNode] = useState(null);
const handleTimelineWrapperRef = useCallback(node => { const handleTimelineWrapperRef = useCallback(node => {
+6
View File
@@ -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 ### [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. - **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` - **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`