fix: restore AI suggestion filter by selection, cache PromptTemplateManager
Cache PromptTemplateManager in ref to prevent new instance per render. Filter: show only Rearrange/favorites when MIDI item selected, all presets otherwise. Root cause of 'suggestion added at top' was stale array reference from new instance every render.
This commit is contained in:
@@ -700,3 +700,9 @@
|
||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
|
||||
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
||||
---
|
||||
|
||||
### [2026-07-29 10:12] Task: Restore AI suggestion filter by selection + fix stale instance
|
||||
- **Tóm tắt thay đổi:** Restore filter: khi chọn MIDI item chỉ hiện Rearrange/favorites, không chọn thì hiện tất cả. Fix gốc: cache PromptTemplateManager qua `aiPromptMgrRef` thay vì `new` mỗi render — tránh thay đổi array reference gây re-render suggestion list.
|
||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
|
||||
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user