fix: AI Suggestion list changing on item select/deselect

Always show full preset list instead of filtering to rearrange/
favorites when item selected. Prevents suggestion list from
visually changing during selection/deselection.
This commit is contained in:
2026-07-29 10:08:05 +07:00
parent c3d87562e9
commit 98ca21bd9a
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -16177,7 +16177,7 @@ const App = () => {
const selMidiInfo = getSelectedMidiItemInfo();
const hasSelItem = !!selMidiInfo;
const promptMgr = window.PromptTemplateManager ? new window.PromptTemplateManager() : null;
const suggestions = promptMgr ? (hasSelItem ? promptMgr.presets.filter(function(p) { return p.category === 'Rearrange / Variation' || p.is_favorite; }) : promptMgr.presets) : [];
const suggestions = promptMgr ? promptMgr.presets : [];
const handleApplySuggestion = (preset) => {
if (hasSelItem) {
setAiPrompt(`Rearrange this melody line in ${preset.name} style`);
File diff suppressed because one or more lines are too long
+6
View File
@@ -694,3 +694,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:08] Task: Fix AI Suggestion list changing on item select/deselect
- **Tóm tắt thay đổi:** Xóa filter `hasSelItem ? ...` khỏi `suggestions` — luôn hiển thị toàn bộ preset list thay vì chỉ rearrange/favorites khi có item được chọn. Tránh tự động thêm/xóa suggestion khi click chọn/bỏ chọn item.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
---